Fixed merge conflict

This commit is contained in:
Nabin Hait 2016-12-23 17:35:38 +05:30
commit f2bc961e1b
484 changed files with 55881 additions and 36421 deletions

View file

@ -41,16 +41,26 @@ class _dict(dict):
def _(msg, lang=None):
"""Returns translated string in current lang, if exists."""
from frappe.translate import get_full_dict
from frappe.utils import cstr
if not lang:
lang = local.lang
# msg should always be unicode
msg = cstr(msg).strip()
msg = as_unicode(msg).strip()
return get_full_dict(local.lang).get(msg) or msg
def as_unicode(text, encoding='utf-8'):
'''Convert to unicode if required'''
if isinstance(text, unicode):
return text
elif text==None:
return ''
elif isinstance(text, basestring):
return unicode(text, encoding)
else:
return unicode(text)
def get_lang_dict(fortype, name=None):
"""Returns the translated language dict for the given type and name.
@ -225,11 +235,11 @@ def errprint(msg):
"""Log error. This is sent back as `exc` in response.
:param msg: Message."""
from utils import cstr
msg = as_unicode(msg)
if not request or (not "cmd" in local.form_dict):
print cstr(msg)
print msg.encode('utf-8')
error_log.append(cstr(msg))
error_log.append(msg)
def log(msg):
"""Add to `debug_log`.
@ -239,8 +249,7 @@ def log(msg):
if conf.get("logging") or False:
print repr(msg)
from utils import cstr
debug_log.append(cstr(msg))
debug_log.append(as_unicode(msg))
def msgprint(msg, title=None, raise_exception=0, as_table=False, indicator=None, alert=False):
"""Print a message to the user (via HTTP response).
@ -355,12 +364,12 @@ def get_request_header(key, default=None):
:param default: Default value."""
return request.headers.get(key, default)
def sendmail(recipients=(), sender="", subject="No Subject", message="No Message",
def sendmail(recipients=[], sender="", subject="No Subject", message="No Message",
as_markdown=False, delayed=True, reference_doctype=None, reference_name=None,
unsubscribe_method=None, unsubscribe_params=None, unsubscribe_message=None,
attachments=None, content=None, doctype=None, name=None, reply_to=None,
cc=(), show_as_cc=(), message_id=None, in_reply_to=None, send_after=None, expose_recipients=False,
send_priority=1, communication=None, retry=1):
cc=[], message_id=None, in_reply_to=None, send_after=None, expose_recipients=None,
send_priority=1, communication=None, retry=1, now=None):
"""Send email using user's default **Email Account** or global default **Email Account**.
@ -383,25 +392,23 @@ def sendmail(recipients=(), sender="", subject="No Subject", message="No Message
:param expose_recipients: Display all recipients in the footer message - "This email was sent to"
:param communication: Communication link to be set in Email Queue record
"""
message = content or message
if delayed:
import frappe.email.queue
frappe.email.queue.send(recipients=recipients, sender=sender,
subject=subject, message=content or message,
reference_doctype = doctype or reference_doctype, reference_name = name or reference_name,
unsubscribe_method=unsubscribe_method, unsubscribe_params=unsubscribe_params, unsubscribe_message=unsubscribe_message,
attachments=attachments, reply_to=reply_to, cc=cc, show_as_cc=show_as_cc, message_id=message_id, in_reply_to=in_reply_to,
send_after=send_after, expose_recipients=expose_recipients, send_priority=send_priority, communication=communication)
else:
import frappe.email
if as_markdown:
frappe.email.sendmail_md(recipients, sender=sender,
subject=subject, msg=content or message, attachments=attachments, reply_to=reply_to,
cc=cc, message_id=message_id, in_reply_to=in_reply_to, retry=retry)
else:
frappe.email.sendmail(recipients, sender=sender,
subject=subject, msg=content or message, attachments=attachments, reply_to=reply_to,
cc=cc, message_id=message_id, in_reply_to=in_reply_to, retry=retry)
if as_markdown:
from markdown2 import markdown
message = markdown(message)
if not delayed:
now = True
import email.queue
email.queue.send(recipients=recipients, sender=sender,
subject=subject, message=message,
reference_doctype = doctype or reference_doctype, reference_name = name or reference_name,
unsubscribe_method=unsubscribe_method, unsubscribe_params=unsubscribe_params, unsubscribe_message=unsubscribe_message,
attachments=attachments, reply_to=reply_to, cc=cc, message_id=message_id, in_reply_to=in_reply_to,
send_after=send_after, expose_recipients=expose_recipients, send_priority=send_priority,
communication=communication, now=now)
whitelisted = []
guest_methods = []
@ -847,13 +854,12 @@ def get_file_json(path):
def read_file(path, raise_not_found=False):
"""Open a file and return its content as Unicode."""
from frappe.utils import cstr
if isinstance(path, unicode):
path = path.encode("utf-8")
if os.path.exists(path):
with open(path, "r") as f:
return cstr(f.read())
return as_unicode(f.read())
elif raise_not_found:
raise IOError("{} Not Found".format(path))
else:

View file

@ -129,6 +129,7 @@ def handle():
return build_response("json")
def validate_oauth():
from frappe.oauth import get_url_delimiter
form_dict = frappe.local.form_dict
authorization_header = frappe.get_request_header("Authorization").split(" ") if frappe.get_request_header("Authorization") else None
if authorization_header and authorization_header[0].lower() == "bearer":
@ -142,7 +143,7 @@ def validate_oauth():
body = r.get_data()
headers = r.headers
required_scopes = frappe.db.get_value("OAuth Bearer Token", token, "scopes").split(";")
required_scopes = frappe.db.get_value("OAuth Bearer Token", token, "scopes").split(get_url_delimiter())
valid, oauthlib_request = get_oauth_server().verify_request(uri, http_method, body, headers, required_scopes)

View file

@ -9,7 +9,6 @@ import frappe
import os
import time
import redis
from functools import wraps
from frappe.utils import get_site_path
from frappe import conf
@ -93,7 +92,9 @@ def publish_realtime(event=None, message=None, room=None,
room = get_site_room()
if after_commit:
frappe.local.realtime_log.append([event, message, room])
params = [event, message, room]
if not params in frappe.local.realtime_log:
frappe.local.realtime_log.append(params)
else:
emit_via_redis(event, message, room)

View file

@ -0,0 +1,18 @@
- Filters Dashboard
- Dashboard with pre-defined filters in List/Report View
- Tag Category
- Show/Group tags based on category
- Updated Font Awesome version to 4.x.x
- Checkboxes in grid
- Delete selected rows
- Map selected rows from one document to another.
- Show Totals button in report
- OpenID Connect for Frappe
- Threading based on message id in Email Queue
- New control object daterangepicker for filtering
- Orientation selection in PDF
- Expand/Collapse All buttons in tree view reports
- Add attachment from email and copy attachments to Communication Record
- Bulk Upload from zip file
- Tree view decoration
- Custom menu for report view

View file

@ -8,14 +8,33 @@ import frappe.model
import frappe.utils
import json, os
'''
Handle RESTful requests that are mapped to the `/api/resource` route.
Requests via FrappeClient are also handled here.
'''
@frappe.whitelist()
def get_list(doctype, fields=None, filters=None, order_by=None,
limit_start=None, limit_page_length=20):
'''Returns a list of records by filters, fields, ordering and limit
:param doctype: DocType of the data to be queried
:param fields: fields to be returned. Default is `name`
:param filters: filter list by this dict
:param order_by: Order by this fieldname
:param limit_start: Start at this index
:param limit_page_length: Number of records to be returned (default 20)'''
return frappe.get_list(doctype, fields=fields, filters=filters, order_by=order_by,
limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=False)
@frappe.whitelist()
def get(doctype, name=None, filters=None):
'''Returns a document by name or filters
:param doctype: DocType of the document to be returned
:param name: return document of this `name`
:param filters: If name is not set, filter by these values and return the first match'''
if filters and not name:
name = frappe.db.get_value(doctype, json.loads(filters))
if not name:
@ -29,6 +48,12 @@ def get(doctype, name=None, filters=None):
@frappe.whitelist()
def get_value(doctype, fieldname, filters=None, as_dict=True, debug=False):
'''Returns a value form a document
:param doctype: DocType to be queried
:param fieldname: Field to be returned (default `name`)
:param filters: dict or string for identifying the record'''
if not frappe.has_permission(doctype):
frappe.throw(_("Not permitted"), frappe.PermissionError)
@ -83,6 +108,9 @@ def set_value(doctype, name, fieldname, value=None):
@frappe.whitelist()
def insert(doc=None):
'''Insert a document
:param doc: JSON or dict object to be inserted'''
if isinstance(doc, basestring):
doc = json.loads(doc)
@ -98,6 +126,9 @@ def insert(doc=None):
@frappe.whitelist()
def insert_many(docs=None):
'''Insert multiple documents
:param docs: JSON or list of dict objects to be inserted in one request'''
if isinstance(docs, basestring):
docs = json.loads(docs)
@ -121,6 +152,9 @@ def insert_many(docs=None):
@frappe.whitelist()
def save(doc):
'''Update (save) an existing document
:param doc: JSON or dict object with the properties of the document to be updated'''
if isinstance(doc, basestring):
doc = json.loads(doc)
@ -129,11 +163,19 @@ def save(doc):
@frappe.whitelist()
def rename_doc(doctype, old_name, new_name, merge=False):
'''Rename document
:param doctype: DocType of the document to be renamed
:param old_name: Current `name` of the document to be renamed
:param new_name: New `name` to be set'''
new_name = frappe.rename_doc(doctype, old_name, new_name, merge=merge)
return new_name
@frappe.whitelist()
def submit(doc):
'''Submit a document
:param doc: JSON or dict object to be submitted remotely'''
if isinstance(doc, basestring):
doc = json.loads(doc)
@ -144,6 +186,10 @@ def submit(doc):
@frappe.whitelist()
def cancel(doctype, name):
'''Cancel a document
:param doctype: DocType of the document to be cancelled
:param name: name of the document to be cancelled'''
wrapper = frappe.get_doc(doctype, name)
wrapper.cancel()
@ -151,6 +197,10 @@ def cancel(doctype, name):
@frappe.whitelist()
def delete(doctype, name):
'''Delete a remote document
:param doctype: DocType of the document to be deleted
:param name: name of the document to be deleted'''
frappe.delete_doc(doctype, name)
@frappe.whitelist()
@ -161,6 +211,9 @@ def set_default(key, value, parent=None):
@frappe.whitelist()
def make_width_property_setter(doc):
'''Set width Property Setter
:param doc: Property Setter document with `width` property'''
if isinstance(doc, basestring):
doc = json.loads(doc)
if doc["doctype"]=="Property Setter" and doc["property"]=="width":
@ -168,6 +221,9 @@ def make_width_property_setter(doc):
@frappe.whitelist()
def bulk_update(docs):
'''Bulk update documents
:param docs: JSON list of documents to be updated remotely. Each document must have `docname` property'''
docs = json.loads(docs)
failed_docs = []
for doc in docs:
@ -187,17 +243,32 @@ def bulk_update(docs):
@frappe.whitelist()
def has_permission(doctype, docname, perm_type="read"):
'''Returns a JSON with data whether the document has the requested permission
:param doctype: DocType of the document to be checked
:param docname: `name` of the document to be checked
:param perm_type: one of `read`, `write`, `create`, `submit`, `cancel`, `report`. Default is `read`'''
# perm_type can be one of read, write, create, submit, cancel, report
return {"has_permission": frappe.has_permission(doctype, perm_type.lower(), docname)}
@frappe.whitelist()
def get_password(doctype, name, fieldname):
'''Return a password type property. Only applicable for System Managers
:param doctype: DocType of the document that holds the password
:param name: `name` of the document that holds the password
:param fieldname: `fieldname` of the password property
'''
frappe.only_for("System Manager")
return frappe.get_doc(doctype, name).get_password(fieldname)
@frappe.whitelist()
def get_js(items):
'''Load JS code files. Will also append translations
and extend `frappe._messages`
:param items: JSON list of paths of the js files to be loaded.'''
items = json.loads(items)
out = []
for src in items:

View file

@ -27,7 +27,7 @@ def trigger_scheduler_event(context, event):
try:
frappe.init(site=site)
frappe.connect()
frappe.utils.scheduler.trigger(site, event, now=context.force)
frappe.utils.scheduler.trigger(site, event, now=True)
finally:
frappe.destroy()

View file

@ -1,3 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
docs_version = "7.x.x"
source_link = "https://github.com/frappe/frappe"
docs_base_url = "https://frappe.github.io/frappe"
@ -22,10 +27,13 @@ ERP for managing small and medium sized businesses.
[Get started with the Tutorial](https://frappe.github.io/frappe/user/)
"""
docs_version = "7.x.x"
google_analytics_id = 'UA-8911157-23'
def get_context(context):
context.brand_html = ('<img class="brand-logo" src="'+context.docs_base_url
+'/assets/img/frappe-bird-white.png"> Frappé Framework</img>')
context.top_bar_items = [
{"label": "Developer Tutorials", "url": context.docs_base_url + "/user", "right": 1},
{"label": "API Documentation", "url": context.docs_base_url + "/current", "right": 1}
{"label": "Tutorials", "url": context.docs_base_url + "/user", "right": 1},
{"label": "API", "url": context.docs_base_url + "/current", "right": 1},
{"label": "Forum", "url": 'https://discuss.erpnext.com', "right": 1}
]

View file

@ -6,7 +6,7 @@ def get_data():
data = [
{
"label": _("Users"),
"icon": "icon-group",
"icon": "fa fa-group",
"items": [
{
"type": "doctype",
@ -22,41 +22,41 @@ def get_data():
},
{
"label": _("Permissions"),
"icon": "icon-lock",
"icon": "fa fa-lock",
"items": [
{
"type": "page",
"name": "permission-manager",
"label": _("Role Permissions Manager"),
"icon": "icon-lock",
"icon": "fa fa-lock",
"description": _("Set Permissions on Document Types and Roles")
},
{
"type": "page",
"name": "user-permissions",
"label": _("User Permissions Manager"),
"icon": "icon-shield",
"icon": "fa fa-shield",
"description": _("Set Permissions per User")
},
{
"type": "page",
"name": "modules_setup",
"label": _("Show / Hide Modules"),
"icon": "icon-upload",
"icon": "fa fa-upload",
"description": _("Show or hide modules globally.")
},
{
"type": "report",
"is_query_report": True,
"doctype": "User",
"icon": "icon-eye-open",
"icon": "fa fa-eye-open",
"name": "Permitted Documents For User",
"description": _("Check which Documents are readable by a User")
},
{
"type": "report",
"doctype": "DocShare",
"icon": "icon-share",
"icon": "fa fa-share",
"name": "Document Share Report",
"description": _("Report of all document shares")
}
@ -64,7 +64,7 @@ def get_data():
},
{
"label": _("Settings"),
"icon": "icon-wrench",
"icon": "fa fa-wrench",
"items": [
{
"type": "doctype",
@ -87,13 +87,13 @@ def get_data():
},
{
"label": _("Data"),
"icon": "icon-th",
"icon": "fa fa-th",
"items": [
{
"type": "page",
"name": "data-import-tool",
"label": _("Import / Export Data"),
"icon": "icon-upload",
"icon": "fa fa-upload",
"description": _("Import / Export Data from .csv files.")
},
{
@ -121,13 +121,13 @@ def get_data():
"name": "backups",
"label": _("Download Backups"),
"description": _("List of backups available for download"),
"icon": "icon-download"
"icon": "fa fa-download"
},
]
},
{
"label": _("Email"),
"icon": "icon-envelope",
"icon": "fa fa-envelope",
"items": [
{
"type": "doctype",
@ -153,7 +153,7 @@ def get_data():
},
{
"label": _("Printing"),
"icon": "icon-print",
"icon": "fa fa-print",
"items": [
{
"type": "page",
@ -175,7 +175,7 @@ def get_data():
},
{
"label": _("Workflow"),
"icon": "icon-random",
"icon": "fa fa-random",
"items": [
{
"type": "doctype",
@ -196,14 +196,14 @@ def get_data():
},
{
"label": _("Integrations"),
"icon": "icon-star",
"icon": "fa fa-star",
"items": [
{
"type": "page",
"name": "applications",
"label": _("Application Installer"),
"description": _("Install Applications."),
"icon": "icon-download"
"icon": "fa fa-download"
},
{
"type": "doctype",
@ -229,7 +229,7 @@ def get_data():
},
{
"label": _("Customize"),
"icon": "icon-glass",
"icon": "fa fa-glass",
"items": [
{
"type": "doctype",
@ -257,10 +257,16 @@ def get_data():
"type": "doctype",
"name": "DocType",
"description": _("Add custom forms.")
},
{
"type": "doctype",
"label": _("Custom Tags"),
"name": "Tag Category",
"description": _("Add your own Tag Categories")
}
]
},
]
add_setup_section(data, "frappe", "website", _("Website"), "icon-globe")
add_setup_section(data, "frappe", "website", _("Website"), "fa fa-globe")
return data

View file

@ -5,7 +5,7 @@ def get_data():
return [
{
"label": _("Web Site"),
"icon": "icon-star",
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
@ -46,7 +46,7 @@ def get_data():
},
{
"label": _("Setup"),
"icon": "icon-cog",
"icon": "fa fa-cog",
"items": [
{
"type": "doctype",
@ -84,5 +84,19 @@ def get_data():
"label": _("Portal Settings"),
}
]
}
},
{
"label": _("Knowledge Base"),
"items": [
{
"type": "doctype",
"name": "Help Category",
},
{
"type": "doctype",
"name": "Help Article",
},
]
},
]

File diff suppressed because it is too large Load diff

View file

@ -229,6 +229,7 @@ def on_doctype_update():
frappe.db.add_index("Communication", ["status", "communication_type"])
frappe.db.add_index("Communication", ["creation"])
frappe.db.add_index("Communication", ["modified"])
frappe.db.add_index("Communication", ["message_id(200)"])
def has_permission(doc, ptype, user):
if ptype=="read":

View file

@ -10,6 +10,7 @@ from frappe.utils import (get_url, get_formatted_email, cint,
from frappe.utils.file_manager import get_file
from frappe.email.queue import check_email_limit
from frappe.utils.scheduler import log
from frappe.email.email_body import get_message_id
import frappe.email.smtp
import MySQLdb
import time
@ -57,11 +58,22 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received =
"communication_medium": communication_medium,
"sent_or_received": sent_or_received,
"reference_doctype": doctype,
"reference_name": name
"reference_name": name,
"message_id":get_message_id().strip(" <>")
})
comm.insert(ignore_permissions=True)
if not doctype:
# if no reference given, then send it against the communication
comm.db_set(dict(reference_doctype='Communication', reference_name=comm.name))
if isinstance(attachments, basestring):
attachments = json.loads(attachments)
# if not committed, delayed task doesn't find the communication
if attachments:
add_attachments(comm.name, attachments)
frappe.db.commit()
if cint(send_email):
@ -120,10 +132,15 @@ def _notify(doc, print_html=None, print_format=None, attachments=None,
prepare_to_notify(doc, print_html, print_format, attachments)
if doc.outgoing_email_account.send_unsubscribe_message:
unsubscribe_message = _("Leave this conversation")
else:
unsubscribe_message = ""
frappe.sendmail(
recipients=(recipients or []) + (cc or []),
show_as_cc=(cc or []),
expose_recipients=True,
recipients=(recipients or []),
cc=(cc or []),
expose_recipients="header",
sender=doc.sender,
reply_to=doc.incoming_email_account,
subject=doc.subject,
@ -131,8 +148,8 @@ def _notify(doc, print_html=None, print_format=None, attachments=None,
reference_doctype=doc.reference_doctype,
reference_name=doc.reference_name,
attachments=doc.attachments,
message_id=doc.name,
unsubscribe_message=_("Leave this conversation"),
message_id=doc.message_id,
unsubscribe_message=unsubscribe_message,
delayed=True,
communication=doc.name
)
@ -252,7 +269,7 @@ def set_incoming_outgoing_accounts(doc):
if not doc.outgoing_email_account:
doc.outgoing_email_account = frappe.db.get_value("Email Account",
{"default_outgoing": 1, "enable_outgoing": 1},
["email_id", "always_use_account_email_id_as_sender", "name"], as_dict=True) or frappe._dict()
["email_id", "always_use_account_email_id_as_sender", "name", "send_unsubscribe_message"], as_dict=True) or frappe._dict()
def get_recipients(doc, fetched_from_email_account=False):
"""Build a list of email addresses for To"""
@ -312,6 +329,20 @@ def get_cc(doc, recipients=None, fetched_from_email_account=False):
return cc
def add_attachments(name, attachments):
'''Add attachments to the given Communiction'''
from frappe.utils.file_manager import save_url
# loop through attachments
for a in attachments:
attach = frappe.db.get_value("File", {"name":a},
["file_name", "file_url", "is_private"], as_dict=1)
# save attachments to new doc
save_url(attach.file_url, attach.file_name, "Communication", name,
"Home/Attachments", attach.is_private)
def filter_email_list(doc, email_list, exclude, is_cc=False):
# temp variables
filtered = []
@ -383,6 +414,8 @@ def sendmail(communication_name, print_html=None, print_format=None, attachments
for i in xrange(3):
try:
communication = frappe.get_doc("Communication", communication_name)
if communication.sent_or_received == "Received":
communication.message_id = None
communication._notify(print_html=print_html, print_format=print_format, attachments=attachments,
recipients=recipients, cc=cc)

View file

@ -23,6 +23,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -48,6 +49,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Label",
"length": 0,
"no_copy": 0,
@ -78,6 +80,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Type",
"length": 0,
"no_copy": 0,
@ -106,6 +109,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Name",
"length": 0,
"no_copy": 0,
@ -133,6 +137,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Mandatory",
"length": 0,
"no_copy": 0,
@ -164,6 +169,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Precision",
"length": 0,
"no_copy": 0,
@ -191,6 +197,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Length",
"length": 0,
"no_copy": 0,
@ -217,6 +224,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Index",
"length": 0,
"no_copy": 0,
@ -246,6 +254,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In List View",
"length": 0,
"no_copy": 0,
@ -261,6 +270,33 @@
"unique": 0,
"width": "70px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_standard_filter",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Standard Filter",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -273,6 +309,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Bold",
"length": 0,
"no_copy": 0,
@ -300,6 +337,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible",
"length": 255,
"no_copy": 0,
@ -327,6 +365,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible Depends On",
"length": 0,
"no_copy": 0,
@ -353,6 +392,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -378,6 +418,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Options",
"length": 0,
"no_copy": 0,
@ -405,6 +446,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default",
"length": 0,
"no_copy": 0,
@ -432,6 +474,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
@ -457,6 +500,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Display Depends On",
"length": 255,
"no_copy": 0,
@ -484,6 +528,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hidden",
"length": 0,
"no_copy": 0,
@ -513,6 +558,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Read Only",
"length": 0,
"no_copy": 0,
@ -540,6 +586,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Unique",
"length": 0,
"no_copy": 0,
@ -567,6 +614,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Set Only Once",
"length": 0,
"no_copy": 0,
@ -592,6 +640,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -617,6 +666,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Perm Level",
"length": 0,
"no_copy": 0,
@ -647,6 +697,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ignore User Permissions",
"length": 0,
"no_copy": 0,
@ -672,6 +723,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow on Submit",
"length": 0,
"no_copy": 0,
@ -701,6 +753,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Hide",
"length": 0,
"no_copy": 0,
@ -757,6 +810,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ignore XSS Filter",
"length": 0,
"no_copy": 0,
@ -783,6 +837,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Display",
"length": 0,
"no_copy": 0,
@ -808,6 +863,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Filter",
"length": 0,
"no_copy": 0,
@ -837,6 +893,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "No Copy",
"length": 0,
"no_copy": 0,
@ -866,6 +923,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide",
"length": 0,
"no_copy": 0,
@ -896,6 +954,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide If No Value",
"length": 0,
"no_copy": 0,
@ -922,6 +981,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Width",
"length": 0,
"no_copy": 0,
@ -947,6 +1007,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Width",
"length": 0,
"no_copy": 0,
@ -978,6 +1039,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Columns",
"length": 0,
"no_copy": 0,
@ -1004,6 +1066,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -1028,6 +1091,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@ -1057,6 +1121,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"oldfieldname": "oldfieldname",
@ -1083,6 +1148,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"oldfieldname": "oldfieldtype",
@ -1118,5 +1184,5 @@
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}
"track_seen": 0
}

View file

@ -1,6 +1,6 @@
<div class="row" style="max-height: 30px;">
<div class="col-xs-12">
<div class="text-ellipsis">
<div class="ellipsis">
{{%= list.get_avatar_and_id(doc) %}}
<!-- sample text -->
@ -13,7 +13,7 @@
<span style="margin-right: 8px;"
title="{{%= __("Title") %}}" class="filterable"
data-filter="check,=,Yes">
<i class="icon-icon text-muted"></i>
<i class="fa fa-icon text-muted"></i>
</span>
{{% }} %}}

View file

@ -25,6 +25,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -33,6 +34,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -51,6 +53,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Module",
"length": 0,
"no_copy": 0,
@ -61,6 +64,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -80,6 +84,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Is Child Table",
"length": 0,
"no_copy": 0,
@ -89,6 +94,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -109,6 +115,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Editable Grid",
"length": 0,
"no_copy": 0,
@ -117,6 +124,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -136,6 +144,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Is Single",
"length": 0,
"no_copy": 0,
@ -145,6 +154,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -163,12 +173,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -180,6 +192,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "document_type",
"fieldtype": "Select",
"hidden": 0,
@ -187,7 +200,8 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Document Type",
"in_standard_filter": 0,
"label": "Show in Module Section",
"length": 0,
"no_copy": 0,
"oldfieldname": "document_type",
@ -197,35 +211,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "InnoDB",
"depends_on": "eval:!doc.issingle",
"fieldname": "engine",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Database Engine",
"length": 0,
"no_copy": 0,
"options": "InnoDB\nMyISAM",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -244,6 +230,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Icon",
"length": 0,
"no_copy": 0,
@ -251,6 +238,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -269,6 +257,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Custom?",
"length": 0,
"no_copy": 0,
@ -276,6 +265,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -294,6 +284,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Beta",
"length": 0,
"no_copy": 0,
@ -302,6 +293,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -322,6 +314,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Image View",
"length": 0,
"no_copy": 0,
@ -330,6 +323,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -348,6 +342,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Plugin",
"length": 0,
"no_copy": 0,
@ -355,6 +350,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -373,6 +369,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Fields",
"length": 0,
"no_copy": 0,
@ -381,6 +378,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -399,6 +397,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Fields",
"length": 0,
"no_copy": 0,
@ -409,6 +408,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -427,6 +427,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Naming",
"length": 0,
"no_copy": 0,
@ -434,6 +435,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -453,6 +455,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto Name",
"length": 0,
"no_copy": 0,
@ -462,6 +465,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -480,6 +484,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Name Case",
"length": 0,
"no_copy": 0,
@ -490,6 +495,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -508,6 +514,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@ -517,6 +524,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -536,12 +544,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -562,6 +572,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title Field",
"length": 0,
"no_copy": 0,
@ -569,6 +580,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -588,6 +600,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Search Fields",
"length": 0,
"no_copy": 0,
@ -597,6 +610,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -616,6 +630,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Image Field",
"length": 0,
"no_copy": 0,
@ -624,6 +639,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -645,6 +661,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sort Field",
"length": 0,
"no_copy": 0,
@ -652,6 +669,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -672,6 +690,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sort Order",
"length": 0,
"no_copy": 0,
@ -680,6 +699,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -700,6 +720,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Timeline Field",
"length": 0,
"no_copy": 0,
@ -708,6 +729,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -727,6 +749,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permission Rules",
"length": 0,
"no_copy": 0,
@ -734,6 +757,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -753,6 +777,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
@ -763,6 +788,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -782,12 +808,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -806,6 +834,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permissions Settings",
"length": 0,
"no_copy": 0,
@ -813,6 +842,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -831,6 +861,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User Cannot Create",
"length": 0,
"no_copy": 0,
@ -840,6 +871,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -858,6 +890,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User Cannot Search",
"length": 0,
"no_copy": 0,
@ -867,6 +900,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -885,6 +919,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Submittable",
"length": 0,
"no_copy": 0,
@ -892,6 +927,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -911,6 +947,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow Import",
"length": 0,
"no_copy": 0,
@ -918,6 +955,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -936,6 +974,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow Rename",
"length": 0,
"no_copy": 0,
@ -945,6 +984,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -963,6 +1003,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Dialog",
"length": 0,
"no_copy": 0,
@ -972,6 +1013,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -990,6 +1032,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show Print First",
"length": 0,
"no_copy": 0,
@ -999,6 +1042,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1017,6 +1061,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Max Attachments",
"length": 0,
"no_copy": 0,
@ -1026,6 +1071,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1044,6 +1090,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Other Settings",
"length": 0,
"no_copy": 0,
@ -1051,6 +1098,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1069,6 +1117,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hide Heading",
"length": 0,
"no_copy": 0,
@ -1078,6 +1127,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1096,6 +1146,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hide Toolbar",
"length": 0,
"no_copy": 0,
@ -1105,6 +1156,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1123,6 +1175,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hide Copy",
"length": 0,
"no_copy": 0,
@ -1132,6 +1185,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1150,6 +1204,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Track Seen",
"length": 0,
"no_copy": 0,
@ -1158,6 +1213,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1177,6 +1233,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Quick Entry",
"length": 0,
"no_copy": 0,
@ -1185,6 +1242,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1203,6 +1261,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Print Format",
"length": 0,
"no_copy": 0,
@ -1210,6 +1269,66 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "advanced",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Advanced",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "InnoDB",
"depends_on": "eval:!doc.issingle",
"fieldname": "engine",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Database Engine",
"length": 0,
"no_copy": 0,
"options": "InnoDB\nMyISAM",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -1219,7 +1338,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-bolt",
"icon": "fa fa-bolt",
"idx": 6,
"image_view": 0,
"in_create": 0,
@ -1228,7 +1347,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-10-13 01:13:58.133080",
"modified": "2016-11-08 01:17:33.593456",
"modified_by": "Administrator",
"module": "Core",
"name": "DocType",

View file

@ -9,7 +9,7 @@ import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields
from frappe.model import no_value_fields, default_fields
from frappe.model.document import Document
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.desk.notifications import delete_notification_count_for
@ -59,15 +59,47 @@ class DocType(Document):
self.make_amendable()
self.validate_website()
self.update_fields_to_fetch()
def check_developer_mode(self):
"""Throw exception if not developer mode or via patch"""
if frappe.flags.in_patch:
if frappe.flags.in_patch or frappe.flags.in_test:
return
if not frappe.conf.get("developer_mode") and not self.custom:
frappe.throw(_("Not in Developer Mode! Set in site_config.json or make 'Custom' DocType."))
def update_fields_to_fetch(self):
'''Update values for newly set fetch values'''
try:
old_meta = frappe.get_meta(frappe.get_doc('DocType', self.name), cached=False)
old_fields_to_fetch = [df.fieldname for df in old_meta.get_fields_to_fetch()]
except frappe.DoesNotExistError:
old_fields_to_fetch = []
new_meta = frappe.get_meta(self, cached=False)
if set(old_fields_to_fetch) != set([df.fieldname for df in new_meta.get_fields_to_fetch()]):
for df in new_meta.get_fields_to_fetch():
if df.fieldname not in old_fields_to_fetch:
link_fieldname, source_fieldname = df.options.split('.', 1)
link_df = new_meta.get_field(link_fieldname)
frappe.db.sql('''update
`tab{link_doctype}` source,
`tab{doctype}` target
set
target.`{fieldname}` = source.`{source_fieldname}`
where
target.`{link_fieldname}` = source.name
and ifnull(target.`{fieldname}`, '')="" '''.format(
link_doctype = link_df.options,
source_fieldname = source_fieldname,
doctype = self.name,
fieldname = df.fieldname,
link_fieldname = link_fieldname
))
def validate_document_type(self):
if self.document_type=="Transaction":
self.document_type = "Document"
@ -387,7 +419,6 @@ def validate_fields(meta):
if not meta.search_fields:
return
fieldname_list = [d.fieldname for d in fields]
for fieldname in (meta.search_fields or "").split(","):
fieldname = fieldname.strip()
if fieldname not in fieldname_list:
@ -398,8 +429,6 @@ def validate_fields(meta):
if not meta.get("title_field"):
return
fieldname_list = [d.fieldname for d in fields]
if meta.title_field not in fieldname_list:
frappe.throw(_("Title field must be a valid fieldname"), InvalidFieldNameError)
@ -437,8 +466,6 @@ def validate_fields(meta):
if not meta.timeline_field:
return
fieldname_list = [d.fieldname for d in fields]
if meta.timeline_field not in fieldname_list:
frappe.throw(_("Timeline field must be a valid fieldname"), InvalidFieldNameError)
@ -446,7 +473,22 @@ def validate_fields(meta):
if df.fieldtype not in ("Link", "Dynamic Link"):
frappe.throw(_("Timeline field must be a Link or Dynamic Link"), InvalidFieldNameError)
def check_sort_field(meta):
'''Validate that sort_field(s) is a valid field'''
if meta.sort_field:
sort_fields = [meta.sort_field]
if ',' in meta.sort_field:
sort_fields = [d.split()[0] for d in meta.sort_field.split(',')]
for fieldname in sort_fields:
if not fieldname in fieldname_list + list(default_fields):
frappe.throw(_("Sort field {0} must be a valid fieldname").format(fieldname),
InvalidFieldNameError)
fields = meta.get("fields")
fieldname_list = [d.fieldname for d in fields]
not_allowed_in_list_view = list(copy.copy(no_value_fields))
if meta.istable:
not_allowed_in_list_view.remove('Button')
@ -470,6 +512,7 @@ def validate_fields(meta):
check_search_fields(meta)
check_title_field(meta)
check_timeline_field(meta)
check_sort_field(meta)
def validate_permissions_for_doctype(doctype, for_remove=False):
"""Validates if permissions are set correctly."""

View file

@ -93,7 +93,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-warning-sign",
"icon": "fa fa-warning-sign",
"idx": 1,
"image_view": 0,
"in_create": 0,

View file

@ -19,3 +19,9 @@ def set_old_logs_as_seen():
# clear old logs
frappe.db.sql("""delete from `tabError Log` where datediff(curdate(), creation) > 30""")
@frappe.whitelist()
def clear_error_logs():
'''Flush all Error Logs'''
frappe.only_for('System Manager')
frappe.db.sql('''delete from `tabError Log`''')

View file

@ -8,4 +8,14 @@ frappe.listview_settings['Error Log'] = {
}
},
order_by: "seen asc, modified desc",
onload: function(listview) {
listview.page.add_menu_item(__("Clear Error Logs"), function() {
frappe.call({
method:'frappe.core.doctype.error_log.error_log.clear_error_logs',
callback: function() {
listview.refresh();
}
});
});
}
};

View file

@ -62,7 +62,7 @@
</div>
<div class="col-lg-1">
<span class="btn btn-xs btn-default" data-toggle="collapse" data-target="#frame-{{ frameid }}-locals">
<i class="icon-list-ul"> {{ __("Locals") }}</i>
<i class="fa fa-list-ul"> {{ __("Locals") }}</i>
</span>
</div>
</div>

View file

@ -6,7 +6,7 @@ frappe.ui.form.on("File", "refresh", function(frm) {
file_url = file_url.replace(/#/g, '%23');
}
window.open(file_url);
}, "icon-download");
}, "fa fa-download");
}
var wrapper = frm.get_field("preview_html").$wrapper;
@ -22,4 +22,18 @@ frappe.ui.form.on("File", "refresh", function(frm) {
} else {
wrapper.empty();
}
if(frm.doc.file_name.split('.').splice(-1)[0]==='zip') {
frm.add_custom_button(__('Unzip'), function() {
frappe.call({
method: "frappe.core.doctype.file.file.unzip_file",
args: {
name: frm.doc.name,
},
callback: function() {
frappe.set_route('List', 'File');
}
});
});
}
});

View file

@ -22,6 +22,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "File Name",
"length": 0,
"no_copy": 0,
@ -31,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -50,6 +52,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Private",
"length": 0,
"no_copy": 0,
@ -58,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -76,6 +80,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preview",
"length": 0,
"no_copy": 0,
@ -84,6 +89,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -102,6 +108,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preview HTML",
"length": 0,
"no_copy": 0,
@ -110,6 +117,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -128,6 +136,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -135,6 +144,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -154,6 +164,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Home Folder",
"length": 0,
"no_copy": 0,
@ -162,6 +173,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -180,6 +192,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Attachments Folder",
"length": 0,
"no_copy": 0,
@ -188,6 +201,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -206,6 +220,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "File Size",
"length": 0,
"no_copy": 0,
@ -213,6 +228,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -231,6 +247,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -238,6 +255,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -257,6 +275,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "File URL",
"length": 0,
"no_copy": 0,
@ -264,6 +283,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -282,6 +302,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Thumbnail URL",
"length": 0,
"no_copy": 0,
@ -290,6 +311,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -308,6 +330,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Folder",
"length": 0,
"no_copy": 0,
@ -317,6 +340,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -335,6 +359,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Folder",
"length": 0,
"no_copy": 0,
@ -343,6 +368,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -362,6 +388,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -369,6 +396,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -387,6 +415,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Attached To DocType",
"length": 0,
"no_copy": 0,
@ -395,6 +424,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@ -413,6 +443,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -420,6 +451,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -438,6 +470,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Attached To Name",
"length": 0,
"no_copy": 0,
@ -445,6 +478,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@ -463,6 +497,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content Hash",
"length": 0,
"no_copy": 0,
@ -470,6 +505,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@ -488,6 +524,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "lft",
"length": 0,
"no_copy": 0,
@ -496,6 +533,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -514,6 +552,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "rgt",
"length": 0,
"no_copy": 0,
@ -522,6 +561,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -540,6 +580,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "old_parent",
"length": 0,
"no_copy": 0,
@ -548,6 +589,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -557,7 +599,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file",
"icon": "fa fa-file",
"idx": 1,
"image_view": 0,
"in_create": 0,
@ -567,7 +609,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-09-21 12:23:34.017457",
"modified": "2016-11-07 05:52:55.387721",
"modified_by": "Administrator",
"module": "Core",
"name": "File",
@ -583,6 +625,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -603,6 +646,7 @@
"export": 1,
"if_owner": 1,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View file

@ -23,6 +23,7 @@ from frappe import _
from frappe.utils.nestedset import NestedSet
from frappe.utils import strip, get_files_path
from PIL import Image, ImageOps
import zipfile
class FolderNotEmpty(frappe.ValidationError): pass
@ -238,6 +239,35 @@ class File(NestedSet):
self.flags.on_rollback = True
self.on_trash()
def unzip(self):
'''Unzip current file and replace it by its children'''
if not ".zip" in self.file_name:
frappe.msgprint(_("Not a zip file"))
return
zip_path = frappe.get_site_path(self.file_url.strip('/'))
base_url = os.path.dirname(self.file_url)
with zipfile.ZipFile(zip_path) as zf:
zf.extractall(os.path.dirname(zip_path))
for info in zf.infolist():
if not info.filename.startswith('__MACOSX'):
file_url = file_url = base_url + '/' + info.filename
file_name = frappe.db.get_value('File', dict(file_url=file_url))
if file_name:
file_doc = frappe.get_doc('File', file_name)
else:
file_doc = frappe.new_doc("File")
file_doc.file_name = info.filename
file_doc.file_size = info.file_size
file_doc.folder = self.folder
file_doc.is_private = self.is_private
file_doc.file_url = file_url
file_doc.attached_to_doctype = self.attached_to_doctype
file_doc.attached_to_name = self.attached_to_name
file_doc.save()
frappe.delete_doc('File', self.name)
def on_doctype_update():
frappe.db.add_index("File", ["attached_to_doctype", "attached_to_name"])
@ -368,3 +398,9 @@ def check_file_permission(file_url):
return True
raise frappe.PermissionError
@frappe.whitelist()
def unzip_file(name):
'''Unzip the given file and make file records for each of the extracted files'''
file_obj = frappe.get_doc('File', name)
file_obj.unzip()

View file

@ -20,17 +20,17 @@ frappe.listview_settings['File'] = {
var icon = ""
if(data.is_folder) {
icon += '<i class="icon-folder-close-alt icon-fixed-width"></i> ';
icon += '<i class="fa fa-folder-close-alt fa-fw"></i> ';
} else if(frappe.utils.is_image_file(data.file_name)) {
icon += '<i class="icon-picture icon-fixed-width"></i> ';
icon += '<i class="fa fa-picture fa-fw"></i> ';
} else {
icon += '<i class="icon-file-alt icon-fixed-width"></i> '
icon += '<i class="fa fa-file-alt fa-fw"></i> '
}
data._title = icon + (data.file_name ? data.file_name : data.file_url)
if (data.is_private) {
data._title += ' <i class="icon-lock icon-fixed-width text-warning"></i>'
data._title += ' <i class="fa fa-lock fa-fw text-warning"></i>'
}
},
onload: function(doclist) {
@ -81,7 +81,32 @@ frappe.listview_settings['File'] = {
doclist.page.add_menu_item(__("Edit Folder"), function() {
frappe.set_route("Form", "File", doclist.current_folder);
});
},
doclist.page.add_menu_item(__("Import .zip"), function() {
// make upload dialog
dialog = frappe.ui.get_upload_dialog({
args: {
folder: doclist.current_folder,
from_form: 1
},
callback: function(attachment, r) {
frappe.call({
method: "frappe.core.doctype.file.file.unzip_file",
args: {
name: r.message["name"],
},
callback: function(r) {
if(!r.exc) {
//doclist.refresh();
} else {
frappe.msgprint(__("Error in uploading files." + r.exc));
}
}
});
},
});
});
},
setup_dragdrop: function(doclist) {
$(doclist.$page).on('dragenter dragover', false)
.on('drop', function (e) {
@ -123,7 +148,7 @@ frappe.listview_settings['File'] = {
"new_parent": doclist.current_folder,
"old_parent": doclist.old_parent
},
callback:function(r){
callback:function(r) {
doclist.paste = false;
frappe.msgprint(__(r.message));
doclist.selected_files = [];
@ -143,7 +168,6 @@ frappe.listview_settings['File'] = {
}
},
refresh: function(doclist) {
// set folder before querying
var name_filter = doclist.filter_list.get_filter("file_name");
var folder_filter = doclist.filter_list.get_filter("folder");

View file

@ -112,7 +112,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-globe",
"icon": "fa fa-globe",
"idx": 0,
"image_view": 0,
"in_create": 0,

View file

@ -38,4 +38,4 @@ def update_language_names():
data = json.loads(f.read())
for l in data:
frappe.db.set_value('Language', l['code'], 'language_name', l['name'])
frappe.db.set_value('Language', l['code'], 'language_name', l['name'])

View file

@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "module_name",
"fieldtype": "Data",
"hidden": 0,
@ -21,6 +23,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Module Name",
"length": 0,
"no_copy": 0,
@ -30,6 +33,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -40,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "app_name",
"fieldtype": "Data",
"hidden": 0,
@ -47,6 +52,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "App Name",
"length": 0,
"no_copy": 0,
@ -54,6 +60,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -63,7 +70,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-sitemap",
"icon": "fa fa-sitemap",
"idx": 1,
"image_view": 0,
"in_create": 0,
@ -72,7 +79,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 05:24:25.789580",
"modified": "2016-11-07 05:54:42.688231",
"modified_by": "Administrator",
"module": "Core",
"name": "Module Def",
@ -88,6 +95,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -108,6 +116,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,

View file

@ -3,28 +3,36 @@
"allow_import": 0,
"allow_rename": 1,
"autoname": "field:page_name",
"beta": 0,
"creation": "2012-12-20 17:16:49",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "page_html",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Page HTML",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -35,12 +43,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "page_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Page Name",
"length": 0,
"no_copy": 0,
@ -48,7 +59,9 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -59,18 +72,23 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -81,18 +99,23 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "icon",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "icon",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -103,17 +126,22 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -124,12 +152,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "module",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Module",
"length": 0,
"no_copy": 0,
@ -138,7 +169,9 @@
"options": "Module Def",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -149,12 +182,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "standard",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Standard",
"length": 0,
"no_copy": 0,
@ -163,7 +199,9 @@
"options": "\nYes\nNo",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -174,17 +212,22 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break0",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -195,12 +238,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "roles",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Roles",
"length": 0,
"no_copy": 0,
@ -209,7 +255,9 @@
"options": "Page Role",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -219,15 +267,16 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file",
"icon": "fa fa-file",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.370746",
"modified": "2016-11-07 05:55:29.162083",
"modified_by": "Administrator",
"module": "Core",
"name": "Page",
@ -243,6 +292,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -263,6 +313,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -274,6 +325,8 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"track_seen": 0
}

View file

@ -39,7 +39,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-cog",
"icon": "fa fa-cog",
"idx": 1,
"image_view": 0,
"in_create": 0,

View file

@ -31,7 +31,7 @@ cur_frm.cscript.refresh = function(doc) {
frappe.set_route("query-report", doc.name);
break;
}
}, "icon-table");
}, "fa fa-table");
if (doc.is_standard === "Yes") {
cur_frm.add_custom_button(doc.disabled ? __("Enable Report") : __("Disable Report"), function() {
@ -45,7 +45,7 @@ cur_frm.cscript.refresh = function(doc) {
}).always(function() {
cur_frm.reload_doc();
});
}, doc.disabled ? "icon-ok" : "icon-off");
}, doc.disabled ? "fa fa-check" : "fa fa-off");
}
cur_frm.cscript.report_type(doc);

View file

@ -3,16 +3,20 @@
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:report_name",
"beta": 0,
"creation": "2013-03-09 15:45:57",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "System",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "report_name",
"fieldtype": "Data",
"hidden": 0,
@ -20,6 +24,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Name",
"length": 0,
"no_copy": 0,
@ -27,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -37,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ref_doctype",
"fieldtype": "Link",
"hidden": 0,
@ -44,6 +51,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Ref DocType",
"length": 0,
"no_copy": 0,
@ -52,6 +60,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -62,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_standard",
"fieldtype": "Select",
"hidden": 0,
@ -69,6 +79,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Is Standard",
"length": 0,
"no_copy": 0,
@ -77,6 +88,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -87,6 +99,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "module",
"fieldtype": "Link",
"hidden": 0,
@ -94,6 +107,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Module",
"length": 0,
"no_copy": 0,
@ -102,6 +116,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -112,6 +127,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "add_total_row",
"fieldtype": "Check",
"hidden": 0,
@ -119,6 +135,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Add Total Row",
"length": 0,
"no_copy": 0,
@ -126,6 +143,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -136,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@ -143,12 +162,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -159,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "report_type",
"fieldtype": "Select",
"hidden": 0,
@ -166,6 +188,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Type",
"length": 0,
"no_copy": 0,
@ -174,6 +197,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -184,6 +208,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
@ -191,6 +216,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
@ -198,6 +224,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -208,6 +235,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"depends_on": "eval:[\"Query Report\", \"Script Report\"].indexOf(doc.report_type)!==-1",
"fieldname": "apply_user_permissions",
@ -217,6 +245,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Apply User Permissions",
"length": 0,
"no_copy": 0,
@ -224,6 +253,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -234,6 +264,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@ -241,12 +272,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -257,6 +290,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.report_type==\"Query Report\"",
"fieldname": "query",
"fieldtype": "Code",
@ -265,6 +299,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Query",
"length": 0,
"no_copy": 0,
@ -272,6 +307,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -282,6 +318,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"description": "JavaScript Format: frappe.query_reports['REPORTNAME'] = {}",
"fieldname": "javascript",
@ -291,6 +328,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Javascript",
"length": 0,
"no_copy": 0,
@ -298,6 +336,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -308,6 +347,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.report_type==\"Report Builder\"",
"fieldname": "json",
"fieldtype": "Code",
@ -316,6 +356,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "JSON",
"length": 0,
"no_copy": 0,
@ -323,6 +364,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -332,15 +374,16 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-table",
"icon": "fa fa-table",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-02-22 09:14:41.050580",
"modified": "2016-11-07 05:31:31.290828",
"modified_by": "Administrator",
"module": "Core",
"name": "Report",
@ -356,6 +399,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -376,6 +420,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -396,6 +441,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -416,6 +462,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -427,8 +474,10 @@
"write": 0
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"track_seen": 0
}

View file

@ -94,7 +94,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-bookmark",
"icon": "fa fa-bookmark",
"idx": 1,
"image_view": 0,
"in_create": 0,

View file

@ -691,7 +691,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-cog",
"icon": "fa fa-cog",
"idx": 0,
"image_view": 0,
"in_create": 0,

View file

@ -26,6 +26,9 @@ class SystemSettings(Document):
if self.language:
set_default_language(self.language)
frappe.cache().delete_value('system_settings')
frappe.cache().delete_value('time_zone')
@frappe.whitelist()
def load():
if not "System Manager" in frappe.get_roles():

View file

@ -0,0 +1,58 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "",
"creation": "2016-05-25 09:43:44.767581",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "tag_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Tags",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-05-31 08:29:01.773065",
"modified_by": "Administrator",
"module": "Core",
"name": "Tag",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View file

@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Tag(Document):
def validate(self):
self.tag_name = self.tag_name.title()

View file

@ -0,0 +1,9 @@
// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on('Tag', {
tag_name:function(frm){
for (var i = 0 ;i<frm.doc.tags.length;i++){
frm.doc.tags[i].tag_name = toTitle(frm.doc.tags[i].tag_name)
}
}
});

View file

@ -0,0 +1,131 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "field:category_name",
"creation": "2016-05-25 09:49:07.125394",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "category_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Category Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "tags",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Tags",
"length": 0,
"no_copy": 0,
"options": "Tag",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "tagdocs",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Doctypes",
"length": 0,
"no_copy": 0,
"options": "Tag Doc Category",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-05-30 15:02:54.357007",
"modified_by": "Administrator",
"module": "Core",
"name": "Tag Category",
"name_case": "Title Case",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 0,
"export": 1,
"if_owner": 0,
"import": 1,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "System Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 1
}
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View file

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class TagCategory(Document):
pass

View file

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Tag Categories')
class TestTagCategories(unittest.TestCase):
pass

View file

@ -0,0 +1,58 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2016-05-25 13:09:20.996154",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "tagdoc",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Doctype to Assign Tags",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-05-30 15:04:45.454688",
"modified_by": "Administrator",
"module": "Core",
"name": "Tag Doc Category",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View file

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class TagDocCategory(Document):
pass

View file

@ -24,7 +24,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"in_standard_filter": 1,
"label": "Language",
"length": 0,
"no_copy": 0,
@ -37,7 +37,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@ -220,7 +220,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-02 16:33:36.047300",
"modified": "2016-12-15 14:55:16.957936",
"modified_by": "Administrator",
"module": "Core",
"name": "Translation",

View file

@ -289,7 +289,7 @@ frappe.RoleEditor = Class.extend({
for(key in perm) {
if(key!='parent' && key!='permlevel') {
if(perm[key]) {
perm[key] = '<i class="icon-ok"></i>';
perm[key] = '<i class="fa fa-check"></i>';
} else {
perm[key] = '';
}

File diff suppressed because it is too large Load diff

View file

@ -67,6 +67,9 @@ class User(Document):
if self.language == "Loading...":
self.language = None
if (self.name not in ["Administrator", "Guest"]) and (not self.frappe_userid):
self.frappe_userid = frappe.generate_hash(length=39)
def on_update(self):
# clear new password
self.validate_user_limit()
@ -324,22 +327,22 @@ class User(Document):
and reference_doctype='User'
and (reference_name=%s or owner=%s)""", (self.name, self.name))
def before_rename(self, olddn, newdn, merge=False):
frappe.clear_cache(user=olddn)
self.validate_rename(olddn, newdn)
def before_rename(self, old_name, new_name, merge=False):
frappe.clear_cache(user=old_name)
self.validate_rename(old_name, new_name)
def validate_rename(self, olddn, newdn):
def validate_rename(self, old_name, new_name):
# do not allow renaming administrator and guest
if olddn in STANDARD_USERS:
if old_name in STANDARD_USERS:
throw(_("User {0} cannot be renamed").format(self.name))
self.validate_email_type(newdn)
self.validate_email_type(new_name)
def validate_email_type(self, email):
from frappe.utils import validate_email_add
validate_email_add(email.strip(), True)
def after_rename(self, olddn, newdn, merge=False):
def after_rename(self, old_name, new_name, merge=False):
tables = frappe.db.sql("show tables")
for tab in tables:
desc = frappe.db.sql("desc `%s`" % tab[0], as_dict=1)
@ -351,12 +354,12 @@ class User(Document):
frappe.db.sql("""\
update `%s` set `%s`=%s
where `%s`=%s""" % \
(tab[0], field, '%s', field, '%s'), (newdn, olddn))
(tab[0], field, '%s', field, '%s'), (new_name, old_name))
# set email
frappe.db.sql("""\
update `tabUser` set email=%s
where name=%s""", (newdn, newdn))
where name=%s""", (new_name, new_name))
def append_roles(self, *roles):
"""Add roles to user"""
@ -627,24 +630,31 @@ def reset_password(user):
def user_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.desk.reportview import get_match_cond
user_type_condition = "and user_type = 'System User'"
if filters and filters.get('ignore_user_type'):
user_type_condition = ''
txt = "%{}%".format(txt)
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
from `tabUser`
where enabled=1
and user_type = 'System User'
{user_type_condition}
and docstatus < 2
and name not in ({standard_users})
and ({key} like %s
or concat_ws(' ', first_name, middle_name, last_name) like %s)
and ({key} like %(txt)s
or concat_ws(' ', first_name, middle_name, last_name) like %(txt)s)
{mcond}
order by
case when name like %s then 0 else 1 end,
case when concat_ws(' ', first_name, middle_name, last_name) like %s
case when name like %(txt)s then 0 else 1 end,
case when concat_ws(' ', first_name, middle_name, last_name) like %(txt)s
then 0 else 1 end,
name asc
limit %s, %s""".format(standard_users=", ".join(["%s"]*len(STANDARD_USERS)),
limit %(start)s, %(page_len)s""".format(
user_type_condition = user_type_condition,
standard_users=", ".join(["'{0}'".format(frappe.db.escape(u)) for u in STANDARD_USERS]),
key=searchfield, mcond=get_match_cond(doctype)),
tuple(list(STANDARD_USERS) + [txt, txt, txt, txt, start, page_len]))
dict(start=start, page_len=page_len, txt=txt))
def get_total_users():
"""Returns total no. of system users"""
@ -657,7 +667,7 @@ def get_system_users(exclude_users=None, limit=None):
exclude_users = []
elif not isinstance(exclude_users, (list, tuple)):
exclude_users = [exclude_users]
limit_cond = ''
if limit:
limit_cond = 'limit {0}'.format(limit)

View file

@ -2,7 +2,7 @@
// MIT License. See license.txt
frappe.listview_settings['User'] = {
add_fields: ["enabled", "user_type"],
add_fields: ["enabled", "user_type", "user_image"],
filters: [["enabled","=","Yes"]],
prepare_data: function(data) {
data["user_for_avatar"] = data["name"];

View file

@ -10,11 +10,13 @@
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ref_doctype",
"fieldtype": "Link",
"hidden": 0,
@ -22,6 +24,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Ref DocType",
"length": 0,
"no_copy": 0,
@ -30,6 +33,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -40,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "docname",
"fieldtype": "Data",
"hidden": 0,
@ -47,6 +52,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Docname",
"length": 0,
"no_copy": 0,
@ -54,6 +60,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -64,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "doclist_json",
"fieldtype": "Code",
"hidden": 0,
@ -71,6 +79,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Doclist JSON",
"length": 0,
"no_copy": 0,
@ -78,6 +87,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -87,7 +97,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-copy",
"icon": "fa fa-copy",
"idx": 1,
"image_view": 0,
"in_create": 0,
@ -96,7 +106,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 05:24:24.954110",
"modified": "2016-11-07 05:28:22.062452",
"modified_by": "Administrator",
"module": "Core",
"name": "Version",
@ -112,6 +122,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,

View file

@ -45,11 +45,11 @@ frappe.DataImportTool = Class.extend({
var parent_doctype = frappe.get_doc('DocType', me.doctype);
parent_doctype["reqd"] = true;
var doctype_list = [parent_doctype];
frappe.meta.get_table_fields(me.doctype).forEach(function(df) {
var d = frappe.get_doc('DocType', df.options);
d["reqd"]=df.reqd;
doctype_list.push(d);
doctype_list.push(d);
});
$(frappe.render_template("data_import_tool_columns", {doctype_list: doctype_list}))
.appendTo(me.select_columns.empty());
@ -70,16 +70,18 @@ frappe.DataImportTool = Class.extend({
me.select_columns.find('.select-column-check[data-reqd="1"]').prop('checked', true);
});
var get_template_url = '/api/method/frappe.core.page.data_import_tool.exporter.get_template';
this.page.main.find(".btn-download-template").on('click', function() {
window.open(me.get_export_url(false));
open_url_post(get_template_url, me.get_export_params(false));
});
this.page.main.find(".btn-download-data").on('click', function() {
window.open(me.get_export_url(true));
open_url_post(get_template_url, me.get_export_params(true));
});
},
get_export_url: function(with_data) {
get_export_params: function(with_data) {
var doctype = this.select.val();
var columns = {};
@ -92,11 +94,13 @@ frappe.DataImportTool = Class.extend({
columns[_doctype].push(_fieldname);
});
return "/api/method/frappe.core.page.data_import_tool.exporter.get_template?"
+ "doctype=" + doctype
+ "&parent_doctype=" + doctype
+ "&select_columns=" + JSON.stringify(columns)
+ "&with_data="+ (with_data ? 'Yes' : 'No')+"&all_doctypes=Yes";
return {
doctype: doctype,
parent_doctype: doctype,
select_columns: JSON.stringify(columns),
with_data: with_data ? 'Yes' : 'No',
all_doctypes: 'Yes'
}
},
make_upload: function() {
var me = this;

View file

@ -3,7 +3,7 @@
"creation": "2012-06-14 15:07:25",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-upload",
"icon": "fa fa-upload",
"idx": 1,
"modified": "2016-05-11 03:37:53.385693",
"modified_by": "Administrator",

View file

@ -40,11 +40,9 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
column_start_end = {}
if all_doctypes:
doctype_parentfield = {}
child_doctypes = []
for df in frappe.get_meta(doctype).get_table_fields():
child_doctypes.append(df.options)
doctype_parentfield[df.options] = df.fieldname
child_doctypes.append(dict(doctype=df.options, parentfield=df.fieldname))
def get_data_keys_definition():
return get_data_keys()
@ -71,7 +69,7 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
w.writerow([_('"Parent" signifies the parent table in which this row must be added')])
w.writerow([_('If you are updating, please select "Overwrite" else existing rows will not be deleted.')])
def build_field_columns(dt):
def build_field_columns(dt, parentfield=None):
meta = frappe.get_meta(dt)
# build list of valid docfields
@ -83,10 +81,12 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
tablecolumns.sort(lambda a, b: int(a.idx - b.idx))
_column_start_end = frappe._dict(start=0)
if dt==doctype:
column_start_end[dt] = frappe._dict({"start": 0})
_column_start_end = frappe._dict(start=0)
else:
column_start_end[dt] = frappe._dict({"start": len(columns)})
_column_start_end = frappe._dict(start=len(columns))
append_field_column(frappe._dict({
"fieldname": "name",
@ -106,16 +106,18 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
append_field_column(docfield, False)
# if there is one column, add a blank column (?)
if len(columns)-column_start_end[dt].start == 1:
if len(columns)-_column_start_end.start == 1:
append_empty_field_column()
# append DocType name
tablerow[column_start_end[dt].start + 1] = dt
tablerow[_column_start_end.start + 1] = dt
if dt!=doctype:
tablerow[column_start_end[dt].start + 2] = doctype_parentfield[dt]
if parentfield:
tablerow[_column_start_end.start + 2] = parentfield
column_start_end[dt].end = len(columns) + 1
_column_start_end.end = len(columns) + 1
column_start_end[(dt, parentfield)] = _column_start_end
def append_field_column(docfield, for_mandatory):
if not docfield:
@ -176,7 +178,7 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
w.writerow([get_data_keys_definition().data_separator])
def add_data():
def add_data_row(row_group, dt, doc, rowidx):
def add_data_row(row_group, dt, parentfield, doc, rowidx):
d = doc.copy()
meta = frappe.get_meta(dt)
if all_doctypes:
@ -185,8 +187,11 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
if len(row_group) < rowidx + 1:
row_group.append([""] * (len(columns) + 1))
row = row_group[rowidx]
if column_start_end.get(dt):
for i, c in enumerate(columns[column_start_end[dt].start:column_start_end[dt].end]):
_column_start_end = column_start_end.get((dt, parentfield))
if _column_start_end:
for i, c in enumerate(columns[_column_start_end.start:_column_start_end.end]):
df = meta.get_field(c)
fieldtype = df.fieldtype if df else "Data"
value = d.get(c, "")
@ -196,7 +201,7 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
elif fieldtype == "Datetime":
value = format_datetime(value)
row[column_start_end[dt].start + i + 1] = value
row[_column_start_end.start + i + 1] = value
if with_data=='Yes':
frappe.permissions.can_export(parent_doctype, raise_exception=True)
@ -236,14 +241,15 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
# add main table
row_group = []
add_data_row(row_group, doctype, doc, 0)
add_data_row(row_group, doctype, None, doc, 0)
if all_doctypes:
# add child tables
for child_doctype in child_doctypes:
for ci, child in enumerate(frappe.db.sql("""select * from `tab%s`
where parent=%s order by idx""" % (child_doctype, "%s"), doc.name, as_dict=1)):
add_data_row(row_group, child_doctype, child, ci)
for c in child_doctypes:
for ci, child in enumerate(frappe.db.sql("""select * from `tab{0}`
where parent=%s and parentfield=%s order by idx""".format(c['doctype']),
(doc.name, c['parentfield']), as_dict=1)):
add_data_row(row_group, c['doctype'], c['parentfield'], child, ci)
for row in row_group:
w.writerow(row)
@ -262,15 +268,14 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
inforow = [_('Info:'), '']
columns = [key]
build_field_columns(doctype)
if all_doctypes:
for d in child_doctypes:
append_empty_field_column()
if (select_columns and select_columns.get(d, None)) or not select_columns:
if (select_columns and select_columns.get(d['doctype'], None)) or not select_columns:
# if atleast one column is selected for this doctype
build_field_columns(d)
build_field_columns(d['doctype'], d['parentfield'])
add_field_headings()
add_data()

View file

@ -19,13 +19,13 @@ from frappe.core.page.data_import_tool.data_import_tool import get_data_keys
def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False, no_email=True, overwrite=None,
ignore_links=False, pre_process=None, via_console=False):
"""upload data"""
frappe.flags.in_import = True
# extra input params
params = json.loads(frappe.form_dict.get("params") or '{}')
if params.get("submit_after_import"):
submit_after_import = True
if params.get("ignore_encoding_errors"):
@ -86,30 +86,26 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
dt = None
for i, d in enumerate(doctype_row[1:]):
if d not in ("~", "-"):
if d: # value in doctype_row
if doctype_row[i]==dt:
# prev column is doctype (in case of parentfield)
doctype_parentfield[dt] = doctype_row[i+1]
else:
dt = d
doctypes.append(d)
column_idx_to_fieldname[dt] = {}
column_idx_to_fieldtype[dt] = {}
if d and doctype_row[i] in (None, '' ,'~', '-', 'DocType:'):
dt, parentfield = d, doctype_row[i+2] or None
doctypes.append((dt, parentfield))
column_idx_to_fieldname[(dt, parentfield)] = {}
column_idx_to_fieldtype[(dt, parentfield)] = {}
if dt:
column_idx_to_fieldname[dt][i+1] = rows[row_idx + 2][i+1]
column_idx_to_fieldtype[dt][i+1] = rows[row_idx + 4][i+1]
column_idx_to_fieldname[(dt, parentfield)][i+1] = rows[row_idx + 2][i+1]
column_idx_to_fieldtype[(dt, parentfield)][i+1] = rows[row_idx + 4][i+1]
def get_doc(start_idx):
if doctypes:
doc = {}
for idx in xrange(start_idx, len(rows)):
if (not doc) or main_doc_empty(rows[idx]):
for dt in doctypes:
for dt, parentfield in doctypes:
d = {}
for column_idx in column_idx_to_fieldname[dt]:
for column_idx in column_idx_to_fieldname[(dt, parentfield)]:
try:
fieldname = column_idx_to_fieldname[dt][column_idx]
fieldtype = column_idx_to_fieldtype[dt][column_idx]
fieldname = column_idx_to_fieldname[(dt, parentfield)][column_idx]
fieldtype = column_idx_to_fieldtype[(dt, parentfield)][column_idx]
d[fieldname] = rows[idx][column_idx]
if fieldtype in ("Int", "Check"):
@ -143,7 +139,7 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
if not overwrite:
d['parent'] = doc["name"]
d['parenttype'] = doctype
d['parentfield'] = doctype_parentfield[dt]
d['parentfield'] = parentfield
doc.setdefault(d['parentfield'], []).append(d)
else:
break
@ -175,7 +171,6 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
doctype = get_header_row(get_data_keys_definition().main_table)[1]
columns = filter_empty_columns(get_header_row(get_data_keys_definition().columns)[1:])
doctypes = []
doctype_parentfield = {}
column_idx_to_fieldname = {}
column_idx_to_fieldtype = {}

View file

@ -2,7 +2,7 @@
"creation": "2013-02-14 17:37:37.000000",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-th",
"icon": "fa fa-th",
"idx": 1,
"modified": "2013-07-11 14:41:56.000000",
"modified_by": "Administrator",

View file

@ -1,7 +1,7 @@
<div class="case-wrapper"
data-name="{{ module_name }}" data-link="{{ link }}" title="{{ _label }}">
{{ app_icon }}
<div class="case-label text-ellipsis">
<div class="case-label ellipsis">
<div class="circle module-count-{{ _id }}" data-doctype="{{ _doctype }}" style="display: none;">
<span class="circle-text"></span>
</div>

View file

@ -3,7 +3,7 @@
<div>
<div class="checkbox">
<label>
<input type="checkbox" data-module="{{ icon.module_name }}"
<input type="checkbox" data-module="{{ icon.module_name }}" class="module-select"
{% if not (icon.hidden if user else icon.blocked) %}checked{% endif %}>
{{ _(icon.label or icon.module_name) }}
</label>

View file

@ -19,6 +19,14 @@
{% endfor %}
</select>
</div>
<div class="col-sm-3">
<div class="checkbox" style="margin-top: 5px;">
<label>
<input type="checkbox" class="check-all">
{{ _("Select All") }}
</label>
</div>
</div>
</div>
<div class="block-warning hidden">
<div class="alert alert-warning small" style="margin: 0px; margin-top: 15px;">{{ _("Global Settings: Users will only be able to choose checked icons") }}</div>

View file

@ -37,7 +37,7 @@ frappe.pages['modules_setup'].on_page_load = function(wrapper) {
// save action
page.set_primary_action('Save', function() {
var hidden_list = [];
page.wrapper.find('input[type="checkbox"]').each(function() {
page.wrapper.find('input.module-select').each(function() {
if(!$(this).is(":checked")) {
hidden_list.push($(this).attr('data-module'));
}
@ -64,6 +64,11 @@ frappe.pages['modules_setup'].on_page_load = function(wrapper) {
frappe.set_route('applications');
});
}
// setup select all
$('.check-all').on('click', function() {
$(wrapper).find('input.module-select').prop('checked', $(this).prop('checked'));
});
}
frappe.pages['modules_setup'].on_page_show = function(wrapper) {

View file

@ -3,7 +3,7 @@
"creation": "2012-10-04 18:45:29",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-cog",
"icon": "fa fa-cog",
"idx": 1,
"modified": "2016-02-26 00:21:05.501007",
"modified_by": "Administrator",

View file

@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe.desk.doctype.desktop_icon.desktop_icon import set_hidden_list, get_desktop_icons
from frappe.utils.user import UserPermissions
from frappe import _
@frappe.whitelist()
def update(hidden_list, user=None):
@ -13,7 +14,7 @@ def update(hidden_list, user=None):
frappe.only_for('System Manager')
set_hidden_list(hidden_list, user)
frappe.msgprint(frappe._('Updated'))
frappe.msgprint(frappe._('Updated'), indicator='green', title=_('Success'), alert=True)
def get_context(context):
context.icons = get_user_icons(frappe.session.user)

View file

@ -2,7 +2,7 @@ frappe.pages['permission-manager'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
parent: wrapper,
title: __('Role Permissions Manager'),
icon: "icon-lock",
icon: "fa fa-lock",
single_column: true
});
@ -305,7 +305,7 @@ frappe.PermissionEngine = Class.extend({
},
add_delete_button: function(row, d) {
var me = this;
$("<button class='btn btn-default btn-sm'><i class='icon-remove'></i></button>")
$("<button class='btn btn-default btn-sm'><i class='fa fa-remove'></i></button>")
.appendTo($("<td>").appendTo(row))
.attr("data-name", d.name)
.attr("data-doctype", d.parent)
@ -362,7 +362,7 @@ frappe.PermissionEngine = Class.extend({
},
show_add_rule: function() {
var me = this;
$("<button class='btn btn-default btn-primary btn-sm'><i class='icon-plus'></i> "
$("<button class='btn btn-default btn-primary btn-sm'><i class='fa fa-plus'></i> "
+__("Add A New Rule")+"</button>")
.appendTo($("<p class='permission-toolbar'>").appendTo(this.body))
.click(function() {
@ -491,7 +491,7 @@ frappe.PermissionEngine = Class.extend({
make_reset_button: function() {
var me = this;
$('<button class="btn btn-default btn-sm" style="margin-left: 10px;">\
<i class="icon-refresh"></i> ' + __("Restore Original Permissions") + '</button>')
<i class="fa fa-refresh"></i> ' + __("Restore Original Permissions") + '</button>')
.appendTo(this.body.find(".permission-toolbar"))
.on("click", function() {
me.get_standard_permissions(function(data) {

View file

@ -2,7 +2,7 @@
"creation": "2013-01-01 11:00:01.000000",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-lock",
"icon": "fa fa-lock",
"idx": 1,
"modified": "2013-07-11 14:43:43.000000",
"modified_by": "Administrator",

View file

@ -2,7 +2,7 @@ frappe.pages['user-permissions'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
parent: wrapper,
title: __("User Permissions Manager"),
icon: "icon-shield",
icon: "fa fa-shield",
single_column: true
});
@ -87,14 +87,14 @@ frappe.UserPermissions = Class.extend({
fieldname: "download",
label: __("Download"),
fieldtype: "Button",
icon: "icon-download"
icon: "fa fa-download"
});
me.upload = me.wrapper.page.add_field({
fieldname: "upload",
label: __("Upload"),
fieldtype: "Button",
icon: "icon-upload"
icon: "fa fa-upload"
});
}
@ -269,7 +269,7 @@ frappe.UserPermissions = Class.extend({
},
add_delete_button: function(row, d) {
var me = this;
$("<button class='btn btn-sm btn-default'><i class='icon-remove'></i></button>")
$("<button class='btn btn-sm btn-default'><i class='fa fa-remove'></i></button>")
.appendTo($("<td>").appendTo(row))
.attr("data-name", d.name)
.attr("data-user", d.parent)

View file

@ -3,7 +3,7 @@
"creation": "2013-01-01 18:50:55",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-user",
"icon": "fa fa-user",
"idx": 1,
"modified": "2014-05-28 16:53:43.103533",
"modified_by": "Administrator",

View file

@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "dt",
"fieldtype": "Link",
"hidden": 0,
@ -21,6 +23,7 @@
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Document",
"length": 0,
"no_copy": 0,
@ -31,6 +34,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -41,6 +45,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "label",
"fieldtype": "Data",
"hidden": 0,
@ -48,6 +53,7 @@
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Label",
"length": 0,
"no_copy": 1,
@ -57,6 +63,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -67,6 +74,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "label_help",
"fieldtype": "HTML",
"hidden": 0,
@ -74,6 +82,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Label Help",
"length": 0,
"no_copy": 0,
@ -82,6 +91,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -92,6 +102,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fieldname",
"fieldtype": "Data",
"hidden": 0,
@ -99,6 +110,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Fieldname",
"length": 0,
"no_copy": 1,
@ -108,6 +120,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -118,6 +131,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"description": "Select the label after which you want to insert new field.",
"fieldname": "insert_after",
@ -127,6 +141,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Insert After",
"length": 0,
"no_copy": 1,
@ -136,6 +151,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -146,6 +162,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_6",
"fieldtype": "Column Break",
"hidden": 0,
@ -153,6 +170,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -160,6 +178,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -170,6 +189,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"default": "Data",
"fieldname": "fieldtype",
"fieldtype": "Select",
@ -178,6 +198,7 @@
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Field Type",
"length": 0,
"no_copy": 0,
@ -188,6 +209,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -198,6 +220,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:in_list([\"Float\", \"Currency\", \"Percent\"], doc.fieldtype)",
"description": "Set non-standard precision for a Float or Currency field",
"fieldname": "precision",
@ -207,6 +230,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Precision",
"length": 0,
"no_copy": 0,
@ -216,6 +240,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -226,6 +251,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "options",
"fieldtype": "Text",
"hidden": 0,
@ -233,6 +259,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Options",
"length": 0,
"no_copy": 0,
@ -242,6 +269,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -252,6 +280,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "options_help",
"fieldtype": "HTML",
"hidden": 0,
@ -259,6 +288,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Options Help",
"length": 0,
"no_copy": 0,
@ -267,6 +297,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -277,6 +308,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_11",
"fieldtype": "Section Break",
"hidden": 0,
@ -284,6 +316,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -291,6 +324,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -301,6 +335,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.fieldtype==\"Section Break\"",
"fieldname": "collapsible",
"fieldtype": "Check",
@ -309,6 +344,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible",
"length": 0,
"no_copy": 0,
@ -317,6 +353,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -327,6 +364,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.fieldtype==\"Section Break\"",
"fieldname": "collapsible_depends_on",
"fieldtype": "Code",
@ -335,6 +373,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible Depends On",
"length": 0,
"no_copy": 0,
@ -343,6 +382,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -353,6 +393,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "default",
"fieldtype": "Text",
"hidden": 0,
@ -360,6 +401,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Value",
"length": 0,
"no_copy": 0,
@ -369,6 +411,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -379,6 +422,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "depends_on",
"fieldtype": "Code",
"hidden": 0,
@ -386,6 +430,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Depends On",
"length": 255,
"no_copy": 0,
@ -393,6 +438,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -403,6 +449,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text",
"hidden": 0,
@ -410,6 +457,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Field Description",
"length": 0,
"no_copy": 0,
@ -420,6 +468,7 @@
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -431,6 +480,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "permlevel",
"fieldtype": "Int",
@ -439,6 +489,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permission Level",
"length": 0,
"no_copy": 0,
@ -448,6 +499,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -458,6 +510,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "width",
"fieldtype": "Data",
"hidden": 0,
@ -465,6 +518,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Width",
"length": 0,
"no_copy": 0,
@ -474,6 +528,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -484,6 +539,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "properties",
"fieldtype": "Column Break",
"hidden": 0,
@ -491,6 +547,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -500,6 +557,7 @@
"print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -511,6 +569,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reqd",
"fieldtype": "Check",
"hidden": 0,
@ -518,6 +577,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Is Mandatory Field",
"length": 0,
"no_copy": 0,
@ -527,6 +587,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -537,6 +598,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "unique",
"fieldtype": "Check",
"hidden": 0,
@ -544,6 +606,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Unique",
"length": 0,
"no_copy": 0,
@ -552,6 +615,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -562,6 +626,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "read_only",
"fieldtype": "Check",
"hidden": 0,
@ -569,6 +634,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Read Only",
"length": 0,
"no_copy": 0,
@ -576,6 +642,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -586,6 +653,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.fieldtype===\"Link\"",
"fieldname": "ignore_user_permissions",
"fieldtype": "Check",
@ -594,6 +662,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ignore User Permissions",
"length": 0,
"no_copy": 0,
@ -601,6 +670,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -611,6 +681,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "hidden",
"fieldtype": "Check",
"hidden": 0,
@ -618,6 +689,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hidden",
"length": 0,
"no_copy": 0,
@ -625,6 +697,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -635,6 +708,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "print_hide",
"fieldtype": "Check",
"hidden": 0,
@ -642,6 +716,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide",
"length": 0,
"no_copy": 0,
@ -651,6 +726,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -661,6 +737,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:[\"Int\", \"Float\", \"Currency\", \"Percent\"].indexOf(doc.fieldtype)!==-1",
"fieldname": "print_hide_if_no_value",
"fieldtype": "Check",
@ -669,6 +746,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide If No Value",
"length": 0,
"no_copy": 0,
@ -677,6 +755,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -687,6 +766,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "print_width",
"fieldtype": "Data",
"hidden": 1,
@ -694,6 +774,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Width",
"length": 0,
"no_copy": 1,
@ -701,6 +782,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -711,6 +793,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "no_copy",
"fieldtype": "Check",
"hidden": 0,
@ -718,6 +801,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "No Copy",
"length": 0,
"no_copy": 0,
@ -727,6 +811,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -737,6 +822,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "allow_on_submit",
"fieldtype": "Check",
"hidden": 0,
@ -744,6 +830,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow on Submit",
"length": 0,
"no_copy": 0,
@ -753,6 +840,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -763,6 +851,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_filter",
"fieldtype": "Check",
"hidden": 0,
@ -770,6 +859,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Report Filter",
"length": 0,
"no_copy": 0,
@ -779,6 +869,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -789,6 +880,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_list_view",
"fieldtype": "Check",
"hidden": 0,
@ -796,6 +888,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In List View",
"length": 0,
"no_copy": 0,
@ -803,6 +896,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -813,6 +907,35 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_filter_dash",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Standard Filter",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "report_hide",
"fieldtype": "Check",
"hidden": 0,
@ -820,6 +943,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Hide",
"length": 0,
"no_copy": 0,
@ -829,6 +953,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -839,6 +964,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "search_index",
"fieldtype": "Check",
"hidden": 1,
@ -846,6 +972,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Index",
"length": 0,
"no_copy": 1,
@ -853,6 +980,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -863,6 +991,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Don't HTML Encode HTML tags like &lt;script&gt; or just characters like &lt; or &gt;, as they could be intentionally used in this field",
"fieldname": "ignore_xss_filter",
"fieldtype": "Check",
@ -871,6 +1000,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ignore XSS Filter",
"length": 0,
"no_copy": 0,
@ -879,6 +1009,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -888,15 +1019,16 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-glass",
"icon": "fa fa-glass",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-05-14 09:22:58.789603",
"modified": "2016-11-07 05:23:16.370928",
"modified_by": "Administrator",
"module": "Custom",
"name": "Custom Field",
@ -912,6 +1044,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -932,6 +1065,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View file

@ -11,6 +11,7 @@
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
@ -24,6 +25,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "DocType",
"length": 0,
"no_copy": 0,
@ -34,6 +36,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -53,6 +56,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Script Type",
"length": 0,
"no_copy": 0,
@ -63,6 +67,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -81,6 +86,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Script",
"length": 0,
"no_copy": 0,
@ -91,6 +97,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -109,6 +116,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sample",
"length": 0,
"no_copy": 0,
@ -117,6 +125,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -126,7 +135,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-glass",
"icon": "fa fa-glass",
"idx": 1,
"image_view": 0,
"in_create": 0,
@ -135,7 +144,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-09-24 05:47:53.900418",
"modified": "2016-11-07 05:24:05.590423",
"modified_by": "Administrator",
"module": "Custom",
"name": "Custom Script",
@ -151,6 +160,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -171,6 +181,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View file

@ -70,11 +70,11 @@ frappe.ui.form.on("Customize Form", {
frm.add_custom_button(__('Refresh Form'), function() {
frm.script_manager.trigger("doc_type");
}, "icon-refresh", "btn-default");
}, "fa fa-refresh", "btn-default");
frm.add_custom_button(__('Reset to defaults'), function() {
frappe.customize_form.confirm(__('Remove all customizations?'), frm);
}, "icon-eraser", "btn-default");
}, "fa fa-eraser", "btn-default");
if(frappe.boot.developer_mode) {
frm.add_custom_button(__('Export Customizations'), function() {

View file

@ -536,7 +536,7 @@
],
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "icon-glass",
"icon": "fa fa-glass",
"idx": 1,
"image_view": 0,
"in_create": 0,

View file

@ -43,6 +43,7 @@ docfield_properties = {
'ignore_user_permissions': 'Check',
'in_filter': 'Check',
'in_list_view': 'Check',
'in_standard_filter': 'Check',
'hidden': 'Check',
'collapsible': 'Check',
'collapsible_depends_on': 'Data',

View file

@ -23,6 +23,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Label and Type",
"length": 0,
"no_copy": 0,
@ -50,6 +51,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Label",
"length": 0,
"no_copy": 0,
@ -79,6 +81,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Type",
"length": 0,
"no_copy": 0,
@ -108,6 +111,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Name",
"length": 0,
"no_copy": 0,
@ -136,6 +140,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Mandatory",
"length": 0,
"no_copy": 0,
@ -166,6 +171,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Unique",
"length": 0,
"no_copy": 0,
@ -193,6 +199,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In List View",
"length": 0,
"no_copy": 0,
@ -207,6 +214,33 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_standard_filter",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Standard Filter",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -219,6 +253,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -247,6 +282,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Precision",
"length": 0,
"no_copy": 0,
@ -276,6 +312,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Length",
"length": 0,
"no_copy": 0,
@ -304,6 +341,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Options",
"length": 0,
"no_copy": 0,
@ -332,6 +370,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
@ -360,6 +399,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Depends On",
"length": 0,
"no_copy": 0,
@ -389,6 +429,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Perm Level",
"length": 0,
"no_copy": 0,
@ -417,6 +458,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hidden",
"length": 0,
"no_copy": 0,
@ -447,6 +489,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Read Only",
"length": 0,
"no_copy": 0,
@ -475,6 +518,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible",
"length": 0,
"no_copy": 0,
@ -503,6 +547,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collapsible Depends On",
"length": 0,
"no_copy": 0,
@ -530,6 +575,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -556,6 +602,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ignore User Permissions",
"length": 0,
"no_copy": 0,
@ -582,6 +629,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow on Submit",
"length": 0,
"no_copy": 0,
@ -610,6 +658,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Hide",
"length": 0,
"no_copy": 0,
@ -665,6 +714,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Display",
"length": 0,
"no_copy": 0,
@ -692,6 +742,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default",
"length": 0,
"no_copy": 0,
@ -720,6 +771,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "In Filter",
"length": 0,
"no_copy": 0,
@ -750,6 +802,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -776,6 +829,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@ -806,6 +860,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide",
"length": 0,
"no_copy": 0,
@ -835,6 +890,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Hide If No Value",
"length": 0,
"no_copy": 0,
@ -863,6 +919,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Width",
"length": 0,
"no_copy": 0,
@ -893,6 +950,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Columns",
"length": 0,
"no_copy": 0,
@ -919,6 +977,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Width",
"length": 0,
"no_copy": 0,
@ -949,6 +1008,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Custom Field",
"length": 0,
"no_copy": 0,

View file

@ -2,29 +2,38 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2013-01-10 16:34:04",
"custom": 0,
"description": "Property Setter overrides a standard DocType or Field property",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "help",
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Help",
"length": 0,
"no_copy": 0,
"options": "<div class=\"alert\">Please don't update it as it can mess up your form. Use the Customize Form View and Custom Fields to set properties!</div>",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -35,17 +44,22 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sb0",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -56,20 +70,25 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.__islocal",
"fieldname": "doctype_or_field",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "DocType or Field",
"length": 0,
"no_copy": 0,
"options": "\nDocField\nDocType",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -80,19 +99,24 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "New value to be set",
"fieldname": "value",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Set Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -103,17 +127,22 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -124,19 +153,24 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "doc_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -147,20 +181,25 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.doctype_or_field=='DocField'",
"description": "ID (name) of the entity whose property is to be set",
"fieldname": "field_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Field Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@ -171,18 +210,23 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "property",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Property",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -193,18 +237,23 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "property_type",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Property Type",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -215,18 +264,23 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "default_value",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -236,15 +290,16 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-glass",
"icon": "fa fa-glass",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:52.878049",
"modified": "2016-12-15 14:55:45.761422",
"modified_by": "Administrator",
"module": "Custom",
"name": "Property Setter",
@ -260,6 +315,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -280,6 +336,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -291,7 +348,10 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "doc_type,property"
"search_fields": "doc_type,property",
"sort_order": "DESC",
"track_seen": 0
}

View file

@ -47,6 +47,7 @@ CREATE TABLE `tabDocField` (
`description` text,
`in_filter` int(1) NOT NULL DEFAULT 0,
`in_list_view` int(1) NOT NULL DEFAULT 0,
`in_standard_filter` int(1) NOT NULL DEFAULT 0,
`read_only` int(1) NOT NULL DEFAULT 0,
`precision` varchar(255) DEFAULT NULL,
`length` int(11) NOT NULL DEFAULT 0,

View file

@ -1,7 +1,7 @@
{
"app_url": "https://github.com/frappe/knowledge_base",
"app_name": "knowledge_base",
"app_icon": "icon-question-sign",
"app_icon": "fa fa-question-sign",
"app_color": "#4cd964",
"app_description": "Publish help articles by category on the portal",
"app_publisher": "Frappe",

View file

@ -1,7 +1,7 @@
{
"app_url": "https://github.com/frappe/poll",
"app_name": "poll",
"app_icon": "icon-ok-sign",
"app_icon": "fa fa-ok-sign",
"app_color": "#4cd964",
"app_description": "Online poll for the website",
"app_publisher": "Frappe",

View file

@ -382,7 +382,7 @@ class Database:
return self.get_value(doctype, filters, "*", as_dict=as_dict, cache=cache)
def get_value(self, doctype, filters=None, fieldname="name", ignore=None, as_dict=False,
debug=False, cache=False):
debug=False, order_by=None, cache=False):
"""Returns a document property or list of properties.
:param doctype: DocType name.
@ -391,6 +391,7 @@ class Database:
:param ignore: Don't raise exception if table, column is missing.
:param as_dict: Return values as dict.
:param debug: Print query in error log.
:param order_by: Column to order by
Example:
@ -407,7 +408,7 @@ class Database:
frappe.db.get_value("System Settings", None, "date_format")
"""
ret = self.get_values(doctype, filters, fieldname, ignore, as_dict, debug, cache=cache)
ret = self.get_values(doctype, filters, fieldname, ignore, as_dict, debug, order_by, cache=cache)
return ((len(ret[0]) > 1 or as_dict) and ret[0] or ret[0][0]) if ret else None
@ -421,6 +422,7 @@ class Database:
:param ignore: Don't raise exception if table, column is missing.
:param as_dict: Return values as dict.
:param debug: Print query in error log.
:param order_by: Column to order by
Example:
@ -509,7 +511,16 @@ class Database:
return r and [[i[1] for i in r]] or []
def get_singles_dict(self, doctype):
"""Get Single DocType as dict."""
"""Get Single DocType as dict.
:param doctype: DocType of the single object whose value is requested
Example:
# Get coulmn and value of the single doctype Accounts Settings
account_settings = frappe.db.get_singles_dict("Accounts Settings")
"""
return frappe._dict(self.sql("""select field, value from
tabSingles where doctype=%s""", doctype))
@ -520,7 +531,17 @@ class Database:
return frappe.get_list(*args, **kwargs)
def get_single_value(self, doctype, fieldname, cache=False):
"""Get property of Single DocType. Cache locally by default"""
"""Get property of Single DocType. Cache locally by default
:param doctype: DocType of the single object whose value is requested
:param fieldname: `fieldname` of the property whose value is requested
Example:
# Get the default value of the company from the Global Defaults doctype.
company = frappe.db.get_single_value('Global Defaults', 'default_company')
"""
value = self.value_cache.setdefault(doctype, {}).get(fieldname)
if value:
return value
@ -586,7 +607,7 @@ class Database:
:param dt: DocType name.
:param dn: Document name.
:param field: Property / field name.
:param field: Property / field name or dictionary of values to be updated
:param value: Value to be updated.
:param modified: Use this as the `modified` timestamp.
:param modified_by: Set this user as `modified_by`.
@ -598,28 +619,40 @@ class Database:
if not modified_by:
modified_by = frappe.session.user
to_update = {}
if update_modified:
to_update = {"modified": modified, "modified_by": modified_by}
if isinstance(field, dict):
to_update.update(field)
else:
to_update.update({field: val})
if dn and dt!=dn:
# with table
conditions, values = self.build_conditions(dn)
values.update({"val": val, "modified": modified, "modified_by": modified_by})
values.update(to_update)
if update_modified:
self.sql("""update `tab{0}` set `{1}`=%(val)s, modified=%(modified)s, modified_by=%(modified_by)s where
{2}""".format(dt, field, conditions), values, debug=debug)
else:
self.sql("""update `tab{0}` set `{1}`=%(val)s where
{2}""".format(dt, field, conditions), values, debug=debug)
set_values = []
for key in to_update:
set_values.append('`{0}`=%({0})s'.format(key))
self.sql("""update `tab{0}`
set {1} where {2}""".format(dt, ', '.join(set_values), conditions),
values, debug=debug)
else:
self.sql("delete from tabSingles where field=%s and doctype=%s", (field, dt))
self.sql("insert into tabSingles(doctype, field, value) values (%s, %s, %s)",
(dt, field, val), debug=debug)
if update_modified and (field not in ("modified", "modified_by")):
self.set_value(dt, dn, "modified", modified)
self.set_value(dt, dn, "modified_by", modified_by)
# for singles
keys = to_update.keys()
self.sql('''
delete from tabSingles
where field in ({0}) and
doctype=%s'''.format(', '.join(['%s']*len(keys))),
keys + [dt], debug=debug)
for key, value in to_update.iteritems():
self.sql('''insert into tabSingles(doctype, field, value) values (%s, %s, %s)''',
(dt, key, value), debug=debug)
if dt in self.value_cache:
del self.value_cache[dt]
@ -679,8 +712,7 @@ class Database:
return frappe.defaults.get_defaults(parent)
def begin(self):
pass
#self.sql("start transaction")
self.sql("start transaction")
def commit(self):
"""Commit current transaction. Calls SQL `COMMIT`."""

View file

@ -2,16 +2,20 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2016-02-22 03:47:45.387068",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "module_name",
"fieldtype": "Data",
"hidden": 0,
@ -19,6 +23,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Module Name",
"length": 0,
"no_copy": 0,
@ -27,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -37,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "label",
"fieldtype": "Data",
"hidden": 0,
@ -44,6 +51,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Label",
"length": 0,
"no_copy": 0,
@ -52,6 +60,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -62,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "standard",
"fieldtype": "Check",
"hidden": 0,
@ -69,6 +79,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Standard",
"length": 0,
"no_copy": 0,
@ -77,6 +88,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -87,6 +99,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "custom",
"fieldtype": "Check",
"hidden": 0,
@ -94,6 +107,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Custom",
"length": 0,
"no_copy": 0,
@ -102,6 +116,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -112,6 +127,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@ -119,6 +135,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -126,6 +143,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -136,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "app",
"fieldtype": "Data",
"hidden": 0,
@ -143,6 +162,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "App",
"length": 0,
"no_copy": 0,
@ -151,6 +171,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -161,6 +182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "hidden",
"fieldtype": "Check",
"hidden": 0,
@ -168,6 +190,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hidden",
"length": 0,
"no_copy": 0,
@ -176,6 +199,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -186,6 +210,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "blocked",
"fieldtype": "Check",
"hidden": 0,
@ -193,6 +218,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Blocked",
"length": 0,
"no_copy": 0,
@ -201,6 +227,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -211,6 +238,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "force_show",
"fieldtype": "Check",
"hidden": 0,
@ -218,6 +246,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Force Show",
"length": 0,
"no_copy": 0,
@ -226,6 +255,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -236,6 +266,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
@ -243,6 +274,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -250,6 +282,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -260,6 +293,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "type",
"fieldtype": "Select",
"hidden": 0,
@ -267,6 +301,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Type",
"length": 0,
"no_copy": 0,
@ -276,6 +311,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -286,6 +322,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "_doctype",
"fieldtype": "Link",
"hidden": 0,
@ -293,6 +330,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "_doctype",
"length": 0,
"no_copy": 0,
@ -302,6 +340,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -312,6 +351,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "link",
"fieldtype": "Small Text",
"hidden": 0,
@ -319,6 +359,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Link",
"length": 0,
"no_copy": 0,
@ -327,6 +368,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -337,6 +379,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_10",
"fieldtype": "Column Break",
"hidden": 0,
@ -344,6 +387,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -351,6 +395,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -361,6 +406,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "color",
"fieldtype": "Data",
"hidden": 0,
@ -368,6 +414,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Color",
"length": 0,
"no_copy": 0,
@ -376,6 +423,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -386,6 +434,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "icon",
"fieldtype": "Data",
"hidden": 0,
@ -393,6 +442,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Icon",
"length": 0,
"no_copy": 0,
@ -401,6 +451,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -411,6 +462,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reverse",
"fieldtype": "Check",
"hidden": 0,
@ -418,6 +470,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reverse Icon Color",
"length": 0,
"no_copy": 0,
@ -426,6 +479,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -436,6 +490,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "idx",
"fieldtype": "Int",
"hidden": 0,
@ -443,6 +498,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Idx",
"length": 0,
"no_copy": 0,
@ -451,6 +507,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -461,13 +518,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-04-01 09:50:56.611440",
"modified": "2016-11-07 05:31:01.259347",
"modified_by": "Administrator",
"module": "Desk",
"name": "Desktop Icon",
@ -484,6 +542,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -495,9 +554,11 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 1,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "module_name"
"title_field": "module_name",
"track_seen": 0
}

View file

@ -3,16 +3,20 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "EV.#####",
"beta": 0,
"creation": "2013-06-10 13:17:47",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "details",
"fieldtype": "Section Break",
"hidden": 0,
@ -20,6 +24,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -28,6 +33,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -38,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "subject",
"fieldtype": "Data",
"hidden": 0,
@ -45,6 +52,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Subject",
"length": 0,
"no_copy": 0,
@ -52,6 +60,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -62,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "event_type",
"fieldtype": "Select",
"hidden": 0,
@ -69,6 +79,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Event Type",
"length": 0,
"no_copy": 0,
@ -79,6 +90,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@ -89,6 +101,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"fieldname": "send_reminder",
"fieldtype": "Check",
@ -97,6 +110,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send an email reminder in the morning",
"length": 0,
"no_copy": 0,
@ -104,6 +118,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -114,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@ -121,12 +137,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -137,6 +155,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "starts_on",
"fieldtype": "Datetime",
"hidden": 0,
@ -144,6 +163,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Starts on",
"length": 0,
"no_copy": 0,
@ -151,6 +171,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -161,6 +182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ends_on",
"fieldtype": "Datetime",
"hidden": 0,
@ -168,6 +190,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ends on",
"length": 0,
"no_copy": 0,
@ -175,6 +198,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -185,6 +209,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "all_day",
"fieldtype": "Check",
"hidden": 0,
@ -192,6 +217,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "All Day",
"length": 0,
"no_copy": 0,
@ -199,6 +225,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -209,6 +236,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_8",
"fieldtype": "Section Break",
"hidden": 0,
@ -216,12 +244,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -232,6 +262,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "repeat_this_event",
"fieldtype": "Check",
"hidden": 0,
@ -239,6 +270,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Repeat this Event",
"length": 0,
"no_copy": 0,
@ -246,6 +278,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -256,6 +289,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "repeat_this_event",
"fieldname": "section_break_11",
"fieldtype": "Section Break",
@ -264,12 +298,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -280,6 +316,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "repeat_this_event",
"fieldname": "repeat_on",
"fieldtype": "Select",
@ -288,6 +325,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Repeat On",
"length": 0,
"no_copy": 0,
@ -296,6 +334,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -306,6 +345,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "repeat_this_event",
"description": "Leave blank to repeat always",
"fieldname": "repeat_till",
@ -315,6 +355,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Repeat Till",
"length": 0,
"no_copy": 0,
@ -322,6 +363,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -332,6 +374,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_11",
"fieldtype": "Column Break",
"hidden": 0,
@ -339,12 +382,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -355,6 +400,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "monday",
"fieldtype": "Check",
@ -363,6 +409,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Monday",
"length": 0,
"no_copy": 0,
@ -370,6 +417,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -380,6 +428,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "tuesday",
"fieldtype": "Check",
@ -388,6 +437,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Tuesday",
"length": 0,
"no_copy": 0,
@ -395,6 +445,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -405,6 +456,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "wednesday",
"fieldtype": "Check",
@ -413,6 +465,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Wednesday",
"length": 0,
"no_copy": 0,
@ -420,6 +473,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -430,6 +484,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "thursday",
"fieldtype": "Check",
@ -438,6 +493,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Thursday",
"length": 0,
"no_copy": 0,
@ -445,6 +501,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -455,6 +512,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "friday",
"fieldtype": "Check",
@ -463,6 +521,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Friday",
"length": 0,
"no_copy": 0,
@ -470,6 +529,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -480,6 +540,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "saturday",
"fieldtype": "Check",
@ -488,6 +549,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Saturday",
"length": 0,
"no_copy": 0,
@ -495,6 +557,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -505,6 +568,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.repeat_this_event && doc.repeat_on===\"Every Day\"",
"fieldname": "sunday",
"fieldtype": "Check",
@ -513,6 +577,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sunday",
"length": 0,
"no_copy": 0,
@ -520,6 +585,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -530,6 +596,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@ -537,12 +604,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -553,6 +622,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
@ -560,6 +630,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@ -570,6 +641,7 @@
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -581,6 +653,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "participants",
"fieldtype": "Section Break",
"hidden": 0,
@ -588,6 +661,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Participants",
"length": 0,
"no_copy": 0,
@ -596,6 +670,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -606,6 +681,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "groups",
"fieldtype": "Column Break",
"hidden": 0,
@ -613,6 +689,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Groups",
"length": 0,
"no_copy": 0,
@ -622,6 +699,7 @@
"print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -633,6 +711,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "roles",
"fieldtype": "Table",
"hidden": 0,
@ -640,6 +719,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Roles",
"length": 0,
"no_copy": 0,
@ -650,6 +730,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -660,6 +741,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ref_type",
"fieldtype": "Link",
"hidden": 0,
@ -667,6 +749,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ref Type",
"length": 0,
"no_copy": 0,
@ -677,6 +760,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -687,6 +771,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ref_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@ -694,6 +779,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Ref Name",
"length": 0,
"no_copy": 0,
@ -704,6 +790,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -713,15 +800,16 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-calendar",
"icon": "fa fa-calendar",
"idx": 1,
"image_view": 0,
"in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-03-25 06:09:03.205236",
"modified": "2016-11-07 05:31:17.333435",
"modified_by": "Administrator",
"module": "Desk",
"name": "Event",
@ -737,6 +825,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -757,6 +846,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -768,6 +858,7 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 1,
"read_only_onload": 0,
"sort_order": "DESC",

View file

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import (getdate, cint, add_months, date_diff, add_days,
nowdate, get_datetime_str, cstr, get_datetime)
nowdate, get_datetime_str, cstr, get_datetime, now_datetime)
from frappe.model.document import Document
from frappe.utils.user import get_enabled_system_users
@ -13,6 +13,9 @@ weekdays = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday",
class Event(Document):
def validate(self):
if not self.starts_on:
self.starts_on = now_datetime()
if self.starts_on and self.ends_on and get_datetime(self.starts_on) > get_datetime(self.ends_on):
frappe.msgprint(frappe._("Event end must be after start"), raise_exception=True)

View file

@ -198,7 +198,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
"icon": "fa fa-file-text",
"idx": 1,
"image_view": 0,
"in_create": 0,

View file

@ -9,4 +9,30 @@ import unittest
# test_records = frappe.get_test_records('ToDo')
class TestToDo(unittest.TestCase):
pass
def test_fetch(self):
todo = frappe.get_doc(dict(doctype='ToDo', description='test todo',
assigned_by='Administrator')).insert()
self.assertEquals(todo.assigned_by_full_name,
frappe.db.get_value('User', todo.assigned_by, 'full_name'))
def test_fetch_setup(self):
frappe.db.sql('delete from tabToDo')
todo_meta = frappe.get_doc('DocType', 'ToDo')
todo_meta.get('fields', dict(fieldname='assigned_by_full_name'))[0].options = ''
todo_meta.save()
frappe.clear_cache(doctype='ToDo')
todo = frappe.get_doc(dict(doctype='ToDo', description='test todo',
assigned_by='Administrator')).insert()
self.assertFalse(todo.assigned_by_full_name)
todo_meta = frappe.get_doc('DocType', 'ToDo')
todo_meta.get('fields', dict(fieldname='assigned_by_full_name'))[0].options = 'assigned_by.full_name'
todo_meta.save()
todo.reload()
self.assertEquals(todo.assigned_by_full_name,
frappe.db.get_value('User', todo.assigned_by, 'full_name'))

View file

@ -25,7 +25,7 @@ frappe.ui.form.on("ToDo", {
// back to list
frappe.set_route("List", "ToDo");
});
}, "icon-ok", "btn-success");
}, "fa fa-check", "btn-success");
} else {
frm.add_custom_button(__("Re-open"), function() {
frm.set_value("status", "Open");

View file

@ -9,11 +9,14 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description_and_status",
"fieldtype": "Section Break",
"hidden": 0,
@ -21,6 +24,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -28,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -38,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Open",
"fieldname": "status",
"fieldtype": "Select",
@ -46,6 +52,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
"length": 0,
"no_copy": 0,
@ -54,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -64,6 +72,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Medium",
"fieldname": "priority",
"fieldtype": "Select",
@ -72,6 +81,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Priority",
"length": 0,
"no_copy": 0,
@ -82,6 +92,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -92,6 +103,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
@ -99,12 +111,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -115,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "date",
"fieldtype": "Date",
"hidden": 0,
@ -122,6 +137,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Due Date",
"length": 0,
"no_copy": 0,
@ -131,6 +147,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -141,6 +158,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "owner",
"fieldtype": "Link",
"hidden": 0,
@ -148,6 +166,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Allocated To",
"length": 0,
"no_copy": 0,
@ -156,6 +175,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -166,6 +186,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description_section",
"fieldtype": "Section Break",
"hidden": 0,
@ -173,6 +194,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
@ -181,6 +203,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -191,6 +214,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
@ -198,6 +222,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@ -208,6 +233,7 @@
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -219,6 +245,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@ -226,6 +253,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reference",
"length": 0,
"no_copy": 0,
@ -233,6 +261,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -243,6 +272,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_type",
"fieldtype": "Link",
"hidden": 0,
@ -250,6 +280,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reference Type",
"length": 0,
"no_copy": 0,
@ -260,6 +291,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -270,6 +302,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@ -277,6 +310,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
@ -287,6 +321,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -297,6 +332,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_10",
"fieldtype": "Column Break",
"hidden": 0,
@ -304,12 +340,14 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -320,6 +358,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "role",
"fieldtype": "Link",
"hidden": 0,
@ -327,6 +366,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Role",
"length": 0,
"no_copy": 0,
@ -337,6 +377,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -347,6 +388,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "assigned_by",
"fieldtype": "Link",
"hidden": 0,
@ -354,6 +396,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Assigned By",
"length": 0,
"no_copy": 0,
@ -362,6 +405,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -372,6 +416,36 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "assigned_by_full_name",
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Assigned By Full Name",
"length": 0,
"no_copy": 0,
"options": "assigned_by.full_name",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sender",
"fieldtype": "Data",
"hidden": 1,
@ -379,6 +453,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sender",
"length": 0,
"no_copy": 0,
@ -387,6 +462,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -396,7 +472,7 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-check",
"icon": "fa fa-check",
"idx": 2,
"image_view": 0,
"in_create": 0,
@ -405,7 +481,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-15 13:11:14.435351",
"modified": "2016-12-15 14:56:07.115129",
"modified_by": "Administrator",
"module": "Desk",
"name": "ToDo",
@ -421,6 +497,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -441,6 +518,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View file

@ -1,53 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.desk.form.linked_with import get_linked_docs, get_linked_doctypes
@frappe.whitelist()
def get_document_completion_status(doctypes, frm_doctype, frm_docname):
if isinstance(doctypes, basestring):
doctypes = json.loads(doctypes)
doc = frappe.get_doc(frm_doctype, frm_docname)
linkinfo = get_linked_doctypes(frm_doctype)
flow_completion = {}
if hasattr(doc, "prev_link_mapper"):
for doctype in doc.prev_link_mapper:
fieldname = doc.prev_link_mapper[doctype]["fieldname"]
lookup_doctype = doc.prev_link_mapper[doctype]["doctype"]
limit = doc.prev_link_mapper[doctype].get("limit") or 1
condition = make_condition(doc.prev_link_mapper[doctype].get("filters"))
if condition:
condition = "where {condition}".format(condition=condition)
else:
condition = ""
result = frappe.db.sql_list("select {fieldname} from `tab{doctype}` \
{condition} limit {limit}".format(fieldname=fieldname, doctype=lookup_doctype,
condition=condition, limit=limit))
if result:
flow_completion[doctype] = True
for doctype in doctypes:
if doctype not in flow_completion:
links = get_linked_docs(frm_doctype, frm_docname, linkinfo, for_doctype=doctype)
if links:
flow_completion[doctype] = True
return flow_completion
def make_condition(filters=None):
condition = []
if filters and isinstance(filters, list):
for cond in filters:
condition.append("`tab{0}`.{1} {2} '{3}'".format(*cond))
return " and ".join(condition)

View file

@ -10,21 +10,10 @@ import frappe.desk.form.load
@frappe.whitelist()
def get_linked_docs(doctype, name, linkinfo=None, for_doctype=None):
key = "linked_with:{doctype}:{name}".format(doctype=doctype, name=name)
if isinstance(linkinfo, basestring):
# additional fields are added in linkinfo
linkinfo = json.loads(linkinfo)
if for_doctype:
key = "{key}:{for_doctype}".format(key=key, for_doctype=for_doctype)
results = frappe.cache().get_value(key, user=True)
if results:
return results
meta = frappe.desk.form.meta.get_meta(doctype)
results = {}
if not linkinfo:
@ -58,7 +47,7 @@ def get_linked_docs(doctype, name, linkinfo=None, for_doctype=None):
fields = ["`tab{dt}`.`{fn}`".format(dt=dt, fn=sf.strip()) for sf in fields if sf
and "`tab" not in sf]
try:
if link.get("filters"):
ret = frappe.get_list(doctype=dt, fields=fields, filters=link.get("filters"))
@ -76,9 +65,9 @@ def get_linked_docs(doctype, name, linkinfo=None, for_doctype=None):
# dynamic link
if link.get("doctype_fieldname"):
filters.append([link.get('child_doctype'), link.get("doctype_fieldname"), "=", doctype])
ret = frappe.get_list(doctype=dt, fields=fields, filters=filters)
else:
if link.get("fieldname"):
filters = [[dt, link.get("fieldname"), '=', name]]
@ -98,8 +87,7 @@ def get_linked_docs(doctype, name, linkinfo=None, for_doctype=None):
if ret:
results[dt] = ret
frappe.cache().set_value(key, results, user=True)
return results
@frappe.whitelist()

View file

@ -152,12 +152,16 @@ def get_communication_data(doctype, name, start=0, limit=20, after=None, fields=
conditions = '''communication_type in ("Communication", "Comment")
and (
(reference_doctype=%(doctype)s and reference_name=%(name)s)
or (timeline_doctype=%(doctype)s
and timeline_name=%(name)s
and communication_type="Comment"
and comment_type in ("Created", "Updated", "Submitted", "Cancelled", "Deleted"))
)
and (comment_type is null or comment_type != 'Update')'''
or (
(timeline_doctype=%(doctype)s and timeline_name=%(name)s)
and (
communication_type="Communication"
or (
communication_type="Comment"
and comment_type in ("Created", "Updated", "Submitted", "Cancelled", "Deleted")
)))
)'''
if after:
# find after a particular date
@ -174,7 +178,7 @@ def get_communication_data(doctype, name, start=0, limit=20, after=None, fields=
return communications
def get_assignments(dt, dn):
cl = frappe.db.sql("""select owner, description from `tabToDo`
cl = frappe.db.sql("""select name, owner, description from `tabToDo`
where reference_type=%(doctype)s and reference_name=%(name)s and status="Open"
order by modified desc limit 5""", {
"doctype": dt,

View file

@ -34,7 +34,7 @@ def get_data(module):
else:
add_custom_doctypes(data, doctype_info)
add_section(data, _("Custom Reports"), "icon-list-alt",
add_section(data, _("Custom Reports"), "fa fa-list-alt",
get_report_list(module))
data = combine_common_sections(data)
@ -64,13 +64,13 @@ def build_standard_config(module, doctype_info):
data = []
add_section(data, _("Documents"), "icon-star",
add_section(data, _("Documents"), "fa fa-star",
[d for d in doctype_info if d.document_type in ("Document", "Transaction")])
add_section(data, _("Setup"), "icon-cog",
add_section(data, _("Setup"), "fa fa-cog",
[d for d in doctype_info if d.document_type in ("Master", "Setup", "")])
add_section(data, _("Standard Reports"), "icon-list",
add_section(data, _("Standard Reports"), "fa fa-list",
get_report_list(module, is_standard="Yes"))
return data
@ -87,10 +87,10 @@ def add_section(data, label, icon, items):
def add_custom_doctypes(data, doctype_info):
"""Adds Custom DocTypes to modules setup via `config/desktop.py`."""
add_section(data, _("Documents"), "icon-star",
add_section(data, _("Documents"), "fa fa-star",
[d for d in doctype_info if (d.custom and d.document_type in ("Document", "Transaction"))])
add_section(data, _("Setup"), "icon-cog",
add_section(data, _("Setup"), "fa fa-cog",
[d for d in doctype_info if (d.custom and d.document_type in ("Setup", "Master", ""))])
def get_doctype_info(module):

View file

@ -69,7 +69,7 @@ frappe.pages['activity'].on_page_load = function(wrapper) {
if(frappe.boot.user.can_get_report.indexOf("Feed")!=-1) {
this.page.add_menu_item(__('Build Report'), function() {
frappe.set_route('Report', "Feed");
}, 'icon-th')
}, 'fa fa-th')
}
this.page.add_menu_item(__('Show Likes'), function() {
@ -120,7 +120,7 @@ frappe.activity.Feed = Class.extend({
data.by = frappe.user.full_name(data.owner);
data.avatar = frappe.avatar(data.owner);
data.icon = "icon-flag";
data.icon = "fa fa-flag";
// color for comment
data.add_class = {

View file

@ -2,7 +2,7 @@
"creation": "2013-04-09 11:45:31.000000",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-play",
"icon": "fa fa-play",
"idx": 1,
"modified": "2013-07-11 14:40:20.000001",
"modified_by": "Administrator",

View file

@ -180,7 +180,7 @@ frappe.applications.Installer = Class.extend({
frappe.ui.make_app_page({
parent: this.parent,
title: __('App Installer'),
icon: "icon-download",
icon: "fa fa-download",
single_column: true
});

View file

@ -3,7 +3,7 @@
"creation": "2013-12-23 11:01:52",
"docstatus": 0,
"doctype": "Page",
"icon": "icon-magic",
"icon": "fa fa-magic",
"idx": 1,
"modified": "2015-11-18 06:20:09.586810",
"modified_by": "Administrator",

View file

@ -1,7 +1,7 @@
<ul class="nav nav-pills nav-stacked">
{% for (var i=0, l= data.length; i < l; i++) { var contact = data[i]; %}
<li data-user="{%= contact.name %}" class="h6 module-sidebar-item">
<a class="messages-sidebar-link text-ellipsis">
<a class="messages-sidebar-link ellipsis">
<span class="indicator {% if(contact.has_session > 0) { %} green {% } else { %} grey {% } %}">
<span class="avatar avatar-small hidden-sm hidden-md hidden-lg" title="{%= frappe.user.full_name(contact.name) %} ">
<img class="media-object" src="{%= frappe.user.image(contact.name) %}">

View file

@ -3,4 +3,5 @@
if(item.type==="module" && !item.blocked) { %}
{{ frappe.render_template("modules_sidebar_item", {"item": item}) }}
{% }; } %}
</ul>
<li class="divider"></li>
</ul>

View file

@ -1,7 +1,7 @@
<li class="strong module-sidebar-item">
<a class="module-link" data-name="{{ item.module_name }}"
href="#modules/{{ item.module_name }}">
<i class="icon icon-chevron-right pull-right"
<i class="fa fa-chevron-right pull-right"
style="display: none;"></i>
<span>{{ item._label }}</span></a>
</li>

View file

@ -33,7 +33,7 @@
margin: -20px auto 20px;
}
.setup-wizard-slide .icon-fixed-width {
.setup-wizard-slide .fa-fw {
vertical-align: middle;
}

View file

@ -257,6 +257,7 @@ frappe.wiz.WizardSlide = Class.extend({
if(this.onload) {
this.onload(this);
}
this.focus_first_input();
},
set_init_values: function() {
@ -288,29 +289,62 @@ frappe.wiz.WizardSlide = Class.extend({
// prev
if(this.id > 0) {
this.$prev = this.$body.find('.prev-btn').removeClass("hide")
this.$prev = this.$body.find('.prev-btn')
.removeClass("hide")
.attr('tabIndex', 0)
.click(function() {
frappe.set_route(me.wiz.page_name, me.id-1 + "");
me.prev();
})
.css({"margin-right": "10px"});
}
// next or complete
if(this.id+1 < this.wiz.slides.length) {
this.$next = this.$body.find('.next-btn').removeClass("hide")
.click(function() {
if(me.set_values()) {
frappe.set_route(me.wiz.page_name, me.id+1 + "");
}
});
this.$next = this.$body.find('.next-btn')
.removeClass("hide")
.attr('tabIndex', 0)
.click(this.next_or_complete.bind(this));
} else {
this.$complete = this.$body.find('.complete-btn').removeClass("hide")
.click(function() {
if(me.set_values()) {
me.wiz.on_complete(me.wiz);
}
});
this.$complete = this.$body.find('.complete-btn')
.removeClass("hide")
.attr('tabIndex', 0)
.click(this.next_or_complete.bind(this));
}
//setup mousefree navigation
this.$body.on('keypress', function(e) {
if(e.which === 13) {
$target = $(e.target);
if($target.hasClass('prev-btn')) {
me.prev();
} else if($target.hasClass('btn-attach')) {
//do nothing
} else {
me.next_or_complete();
e.preventDefault();
}
}
});
},
next_or_complete: function() {
if(this.set_values()) {
if(this.id+1 < this.wiz.slides.length) {
this.next();
} else {
this.wiz.on_complete(this.wiz);
}
}
},
focus_first_input: function() {
setTimeout(function() {
this.$body.find('.form-control').first().focus();
}.bind(this), 0);
},
next: function() {
frappe.set_route(this.wiz.page_name, this.id+1 + "");
},
prev: function() {
frappe.set_route(this.wiz.page_name, this.id-1 + "");
},
get_input: function(fn) {
return this.form.get_input(fn);
@ -332,7 +366,7 @@ function load_frappe_slides() {
name: "welcome",
domains: ["all"],
title: __("Welcome"),
icon: "icon-world",
icon: "fa fa-world",
help: __("Let's prepare the system for first use."),
fields: [
@ -401,7 +435,7 @@ function load_frappe_slides() {
frappe.wiz.region = {
domains: ["all"],
title: __("Region"),
icon: "icon-flag",
icon: "fa fa-flag",
help: __("Select your Country, Time Zone and Currency"),
fields: [
{ fieldname: "country", label: __("Country"), reqd:1,
@ -512,7 +546,7 @@ function load_frappe_slides() {
frappe.wiz.user = {
domains: ["all"],
title: __("The First User: You"),
icon: "icon-user",
icon: "fa fa-user",
fields: [
{"fieldname": "first_name", "label": __("First Name"), "fieldtype": "Data",
reqd:1},

View file

@ -1,7 +1,7 @@
<div class="container setup-wizard-slide {%= css_class %}" data-slide-name="{%= name %}">
<div class="text-center setup-wizard-progress text-extra-muted">
{% for (var i=0; i < slides_count; i++) { %}
<i class="icon-fixed-width {% if (i+1==step) { %} icon-circle {% } else { %} icon-circle-blank {% } %}"></i>
<i class="fa-fw {% if (i+1==step) { %} fa fa-circle {% } else { %} fa fa-circle-o {% } %}"></i>
{% } %}
</div>
<p class="text-center lead">{%= title %}</p>

View file

@ -13,6 +13,7 @@ from frappe import _
def get():
args = get_form_params()
args.save_list_settings = True
data = compress(execute(**args), args = args)
return data
@ -33,6 +34,7 @@ def get_form_params():
if isinstance(data.get("docstatus"), basestring):
data["docstatus"] = json.loads(data["docstatus"])
# queries must always be server side
data.query = None
@ -60,7 +62,6 @@ def compress(data, args = {}):
"values": values
}
@frappe.whitelist()
def save_report():
"""save report"""
@ -86,13 +87,22 @@ def export_query():
form_params["limit_page_length"] = None
form_params["as_list"] = True
doctype = form_params.doctype
add_totals_row = None
del form_params["doctype"]
if 'add_totals_row' in form_params and form_params['add_totals_row']=='1':
add_totals_row = 1
del form_params["add_totals_row"]
frappe.permissions.can_export(doctype, raise_exception=True)
db_query = DatabaseQuery(doctype)
ret = db_query.execute(**form_params)
if add_totals_row:
ret = append_totals_row(ret)
data = [['Sr'] + get_labels(db_query.fields, doctype)]
for i, row in enumerate(ret):
data.append([i+1] + list(row))
@ -112,6 +122,21 @@ def export_query():
frappe.response['type'] = 'csv'
frappe.response['doctype'] = doctype
def append_totals_row(data):
if not data:
return data
data = list(data)
totals = []
totals.extend([""]*len(data[0]))
for row in data:
for i in xrange(len(row)):
if isinstance(row[i], (float, int)):
totals[i] = (totals[i] or 0) + row[i]
data.append(totals)
return data
def get_labels(fields, doctype):
"""get column labels based on column names"""
labels = []
@ -144,25 +169,77 @@ def delete_items():
frappe.delete_doc(doctype, d)
@frappe.whitelist()
def get_stats(stats, doctype):
def get_sidebar_stats(stats, doctype, filters=[]):
cat_tags = frappe.db.sql("""select tag.parent as category, tag.tag_name as tag
from `tabTag Doc Category` as docCat
INNER JOIN tabTag as tag on tag.parent = docCat.parent
where docCat.tagdoc=%s
ORDER BY tag.parent asc,tag.idx""",doctype,as_dict=1)
return {"defined_cat":cat_tags, "stats":get_stats(stats, doctype, filters)}
@frappe.whitelist()
def get_stats(stats, doctype, filters=[]):
"""get tag info"""
import json
tags = json.loads(stats)
if filters:
filters = json.loads(filters)
stats = {}
columns = frappe.db.get_table_columns(doctype)
for tag in tags:
if not tag in columns: continue
tagcount = execute(doctype, fields=[tag, "count(*)"],
filters=["ifnull(`%s`,'')!=''" % tag], group_by=tag, as_list=True)
tagcount = frappe.get_all(doctype, fields=[tag, "count(*)"],
#filters=["ifnull(`%s`,'')!=''" % tag], group_by=tag, as_list=True)
filters = filters + ["ifnull(`%s`,'')!=''" % tag], group_by = tag, as_list = True)
if tag=='_user_tags':
stats[tag] = scrub_user_tags(tagcount)
stats[tag].append(["No Tags", frappe.get_all(doctype,
fields=[tag, "count(*)"],
filters=filters +["({0} = ',' or {0} is null)".format(tag)], as_list=True)[0][1]])
else:
stats[tag] = tagcount
return stats
@frappe.whitelist()
def get_filter_dashboard_data(stats, doctype, filters=[]):
"""get tags info"""
import json
tags = json.loads(stats)
if filters:
filters = json.loads(filters)
stats = {}
columns = frappe.db.get_table_columns(doctype)
for tag in tags:
if not tag["name"] in columns: continue
tagcount = []
if tag["type"] not in ['Date', 'Datetime']:
tagcount = frappe.get_all(doctype,
fields=[tag["name"], "count(*)"],
filters = filters + ["ifnull(`%s`,'')!=''" % tag["name"]],
group_by = tag["name"],
as_list = True)
if tag["type"] not in ['Check','Select','Date','Datetime','Int',
'Float','Currency','Percent'] and tag['name'] not in ['docstatus']:
stats[tag["name"]] = list(tagcount)
if stats[tag["name"]]:
data =["No Data", frappe.get_all(doctype,
fields=[tag["name"], "count(*)"],
filters=filters + ["({0} = '' or {0} is null)".format(tag["name"])],
as_list=True)[0][1]]
if data and data[1]!=0:
stats[tag["name"]].append(data)
else:
stats[tag["name"]] = tagcount
return stats
def scrub_user_tags(tagcount):
"""rebuild tag list for tags"""
rdict = {}

View file

@ -2,6 +2,7 @@
# MIT License. See license.txt
from __future__ import unicode_literals
import json
"""
Server side functions for tagging.
@ -48,18 +49,17 @@ def remove_tag(tag, dt, dn):
@frappe.whitelist()
def get_tags(doctype, txt):
tags = []
def get_tags(doctype, txt, cat_tags):
tags = json.loads(cat_tags)
try:
for _user_tags in frappe.db.sql_list("""select `_user_tags`
for _user_tags in frappe.db.sql_list("""select DISTINCT `_user_tags`
from `tab{0}`
where _user_tags like '%{1}%'
limit 1""".format(frappe.db.escape(doctype), frappe.db.escape(txt))):
tags.extend(_user_tags.split(","))
limit 50""".format(frappe.db.escape(doctype), frappe.db.escape(txt))):
tags.extend(_user_tags[1:].split(","))
except Exception, e:
if e.args[0]!=1054: raise
return sorted(filter(lambda t: t and txt in t, list(set(tags))))
return sorted(filter(lambda t: t and txt.lower() in t.lower(), list(set(tags))))
class DocTags:
"""Tags for a particular doctype"""

Some files were not shown because too many files have changed in this diff Show more