mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
Sourced wnframework-modules from Google Code as erpnext
This commit is contained in:
330
event_updates/Module Def/Event Updates/Event Updates.txt
Normal file
330
event_updates/Module Def/Event Updates/Event Updates.txt
Normal file
@@ -0,0 +1,330 @@
|
||||
[
|
||||
{
|
||||
'_last_update': None,
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'disabled': 'No',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def',
|
||||
'doctype_list': None,
|
||||
'file_list': None,
|
||||
'idx': None,
|
||||
'is_hidden': 'No',
|
||||
'last_updated_date': '2010-11-29 12:02:02',
|
||||
'modified': '2010-09-25 15:53:18',
|
||||
'modified_by': 'Administrator',
|
||||
'module_desc': '<p>This module contains</p>\n<ul>\n<li>Feeds</li>\n<li>To Do List</li>\n<li>Events</li>\n</ul>',
|
||||
'module_icon': 'star_full.png',
|
||||
'module_label': 'Home',
|
||||
'module_name': 'Event Updates',
|
||||
'module_page': 'Event Updates',
|
||||
'module_seq': 0,
|
||||
'name': 'Event Updates',
|
||||
'owner': 'Administrator',
|
||||
'parent': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'trash_reason': None,
|
||||
'widget_code': None
|
||||
},
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'description': None,
|
||||
'display_name': 'Comment Widget Record',
|
||||
'doc_name': 'Comment Widget Record',
|
||||
'doc_type': 'Forms',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'fields': None,
|
||||
'hide': None,
|
||||
'icon': None,
|
||||
'idx': None,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDI00108',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'items',
|
||||
'parenttype': 'Module Def'
|
||||
},
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'description': None,
|
||||
'display_name': 'Feed',
|
||||
'doc_name': 'Feed',
|
||||
'doc_type': 'Forms',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'fields': None,
|
||||
'hide': None,
|
||||
'icon': None,
|
||||
'idx': None,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDI00109',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'items',
|
||||
'parenttype': 'Module Def'
|
||||
},
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'description': None,
|
||||
'display_name': 'Home',
|
||||
'doc_name': 'Home',
|
||||
'doc_type': 'Pages',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'fields': None,
|
||||
'hide': None,
|
||||
'icon': None,
|
||||
'idx': None,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDI00111',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'items',
|
||||
'parenttype': 'Module Def'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 1,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00014',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Administrator'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 2,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00015',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Accounts User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 3,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00016',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Accounts Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 4,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00017',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'HR User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 5,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00018',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'HR Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 6,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00019',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Material User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 7,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00020',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Material Master Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 8,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00021',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Material Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 9,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00022',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Purchase User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 10,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00023',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Purchase Master Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 11,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00024',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Purchase Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 12,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00025',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Production User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 13,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00026',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Production Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 14,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00027',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'System Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 15,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00028',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Sales User'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 16,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00029',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Sales Master Manager'
|
||||
},
|
||||
{
|
||||
'creation': '2010-11-30 22:40:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Role',
|
||||
'idx': 17,
|
||||
'modified': '2010-11-30 22:40:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'MDR00030',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Event Updates',
|
||||
'parentfield': 'roles',
|
||||
'parenttype': 'Module Def',
|
||||
'role': 'Sales Manager'
|
||||
}
|
||||
]
|
||||
52
event_updates/__init__.py
Normal file
52
event_updates/__init__.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import webnotes
|
||||
|
||||
feed_dict = {
|
||||
# Project
|
||||
'Ticket': ['[%(status)s] %(subject)s', '#000080'],
|
||||
|
||||
# Sales
|
||||
'Lead': ['%(lead_name)s', '#000080'],
|
||||
'Quotation': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'],
|
||||
'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'],
|
||||
|
||||
# Purchase
|
||||
'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'],
|
||||
'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'],
|
||||
|
||||
# Stock
|
||||
'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'],
|
||||
|
||||
# Accounts
|
||||
'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'],
|
||||
'Payable Voucher': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'],
|
||||
'Receivable Voucher':['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'],
|
||||
|
||||
# HR
|
||||
'Expense Voucher': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'],
|
||||
'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'],
|
||||
'Leave Transaction':['%(leave_type)s for %(employee)s', '#4169E1'],
|
||||
|
||||
# Support
|
||||
'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'],
|
||||
'Maintenance Visit':['To %(customer_name)s', '#4169E1'],
|
||||
'Support Ticket': ['[%(status)s] %(subject)s', '#000080']
|
||||
}
|
||||
|
||||
def make_feed(doc, subject, color):
|
||||
"makes a new Feed record"
|
||||
from webnotes.model.doc import Document
|
||||
webnotes.conn.sql("delete from tabFeed where doc_type=%s and doc_name=%s", (doc.doctype, doc.name))
|
||||
f = Document('Feed')
|
||||
f.doc_type = doc.doctype
|
||||
f.doc_name = doc.name
|
||||
f.subject = subject
|
||||
f.color = color
|
||||
f.save(1)
|
||||
|
||||
def update_feed(doc):
|
||||
"adds a new feed"
|
||||
subject, color = feed_dict.get(doc.doctype, [None, None])
|
||||
if subject:
|
||||
subject = subject % doc.fields
|
||||
make_feed(doc, subject, color)
|
||||
|
||||
0
event_updates/doctype/__init__.py
Normal file
0
event_updates/doctype/__init__.py
Normal file
0
event_updates/doctype/feed/__init__.py
Normal file
0
event_updates/doctype/feed/__init__.py
Normal file
22
event_updates/doctype/feed/feed.py
Normal file
22
event_updates/doctype/feed/feed.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
196
event_updates/doctype/feed/feed.txt
Normal file
196
event_updates/doctype/feed/feed.txt
Normal file
@@ -0,0 +1,196 @@
|
||||
[
|
||||
{
|
||||
'_last_update': None,
|
||||
'allow_attach': None,
|
||||
'allow_copy': None,
|
||||
'allow_email': None,
|
||||
'allow_print': None,
|
||||
'allow_rename': None,
|
||||
'allow_trash': None,
|
||||
'autoname': '_FEED.#####',
|
||||
'change_log': None,
|
||||
'client_script': None,
|
||||
'client_script_core': None,
|
||||
'client_string': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2011-05-09 11:04:25',
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocType',
|
||||
'document_type': None,
|
||||
'dt_template': None,
|
||||
'hide_heading': None,
|
||||
'hide_toolbar': None,
|
||||
'idx': None,
|
||||
'in_create': None,
|
||||
'in_dialog': None,
|
||||
'is_transaction_doc': None,
|
||||
'issingle': None,
|
||||
'istable': None,
|
||||
'max_attachments': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-04-05 09:16:57',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'Feed',
|
||||
'name_case': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': None,
|
||||
'parent_node': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'print_outline': None,
|
||||
'read_only': None,
|
||||
'read_only_onload': None,
|
||||
'search_fields': None,
|
||||
'section_style': 'Simple',
|
||||
'server_code': None,
|
||||
'server_code_compiled': None,
|
||||
'server_code_core': None,
|
||||
'server_code_error': None,
|
||||
'show_in_menu': 0,
|
||||
'smallicon': None,
|
||||
'use_template': None,
|
||||
'version': 1
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-05-09 11:04:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'doc_type',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 1,
|
||||
'in_filter': None,
|
||||
'label': 'Doc Type',
|
||||
'modified': '2011-05-09 11:04:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': '000000400',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Feed',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-05-09 11:04:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'doc_name',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 2,
|
||||
'in_filter': None,
|
||||
'label': 'Doc Name',
|
||||
'modified': '2011-05-09 11:04:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': '000000401',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Feed',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-05-09 11:04:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'subject',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 3,
|
||||
'in_filter': None,
|
||||
'label': 'Subject',
|
||||
'modified': '2011-05-09 11:04:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': '000000402',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Feed',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-05-09 11:04:25',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'color',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 4,
|
||||
'in_filter': None,
|
||||
'label': 'Color',
|
||||
'modified': '2011-05-09 11:04:25',
|
||||
'modified_by': 'Administrator',
|
||||
'name': '000000403',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Feed',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
}
|
||||
]
|
||||
0
event_updates/doctype/home_control/__init__.py
Normal file
0
event_updates/doctype/home_control/__init__.py
Normal file
0
event_updates/doctype/home_control/home_control.js
Normal file
0
event_updates/doctype/home_control/home_control.js
Normal file
387
event_updates/doctype/home_control/home_control.py
Normal file
387
event_updates/doctype/home_control/home_control.py
Normal file
@@ -0,0 +1,387 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes import session, msgprint, errprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
try: import json
|
||||
except: import simplejson as json
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------
|
||||
# ------------------------------------- Home page module details -----------------------------------------
|
||||
|
||||
def delete_cache(self):
|
||||
sql("delete from __DocTypeCache")
|
||||
com = sql("select abbr, name from tabCompany")
|
||||
for d in com:
|
||||
sql("update `tabCompany` set receivables_group = '%s' where (receivables_group = '%s' or receivables_group = '' or receivables_group is null) and name = '%s'" % ('Accounts Receivable - '+cstr(d[0]), 'Accounts Receivables - '+cstr(d[0]), d[1]))
|
||||
sql("update `tabCompany` set payables_group = '%s' where (payables_group = '%s' or payables_group = '' or payables_group is null) and name = '%s'" % ('Accounts Payable - '+cstr(d[0]), 'Accounts Payables - '+cstr(d[0]), d[1]))
|
||||
|
||||
def get_modules(self):
|
||||
rl = webnotes.user.get_roles()
|
||||
ml = sql("select distinct t1.name, t1.module_icon, t1.module_label, t1.module_desc, t1.module_page from `tabModule Def` t1, `tabModule Def Role` t2 where t2.role in ('%s') and t1.disabled !='Yes' and ifnull(t1.is_hidden, 'No') != 'Yes' and t1.name = t2.parent order by t1.module_seq asc" % "','".join(rl), as_dict=1)
|
||||
return ml
|
||||
|
||||
def get_login_url(self):
|
||||
return session['data'].get('login_from', '')
|
||||
|
||||
def get_module_details(self,m):
|
||||
ret = {}
|
||||
ret['il'] = sql('select doc_type, doc_name, display_name, icon, description, fields, click_function, idx from `tabModule Def Item` where parent=%s and ifnull(`hide`,0)=0 order by idx asc', m, as_dict=1)
|
||||
ret['wl'] = sql('select widget_code from `tabModule Def` where name =%s', m)[0][0] or ''
|
||||
ret['custom_reports'] = sql('''
|
||||
SELECT DISTINCT t1.criteria_name AS `display_name`, t1.description, t1.doc_type AS `doc_name`, 'Custom Reports' AS `doc_type`
|
||||
FROM `tabSearch Criteria` t1, `tabDocPerm` t2
|
||||
WHERE t1.module = "%s"
|
||||
AND IFNULL(t1.disabled,0) = 0
|
||||
AND (t1.doc_type=t2.parent OR t1.parent_doc_type = t2.parent)
|
||||
AND t2.permlevel = 0
|
||||
AND t2.read=1
|
||||
AND t2.role IN ("%s")
|
||||
AND ifnull(standard,"No")="No"''' % (m, '", "'.join(webnotes.user.get_roles())), as_dict=1)
|
||||
return ret
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
# ----------------------------------------------- Home page updates ----------------------------------------------
|
||||
|
||||
def get_events_list(self):
|
||||
import webnotes, webnotes.utils
|
||||
from webnotes.widgets.event import get_cal_events
|
||||
|
||||
dl = get_cal_events(nowdate(), add_days(nowdate(), 7))
|
||||
el = []
|
||||
for d in dl:
|
||||
#el.append([d.name, d.event_date, d.event_hour, d.event_name, d.description or '', d.ref_type or '', d.ref_name or '', d.owner])
|
||||
dict = {
|
||||
'name': d.name,
|
||||
'event_date': d.event_date,
|
||||
'event_hour': d.event_hour,
|
||||
'event_name': d.event_name,
|
||||
'description': d.description,
|
||||
'notes': d.notes,
|
||||
'event_type': d.event_type,
|
||||
'ref_type': d.ref_type,
|
||||
'ref_name': d.ref_name,
|
||||
'owner' : d.owner
|
||||
}
|
||||
|
||||
el.append(dict)
|
||||
return el
|
||||
|
||||
|
||||
def get_activity_list(self):
|
||||
out = {}
|
||||
import webnotes
|
||||
rt = webnotes.user.can_read
|
||||
|
||||
dt_list = [d[0] for d in sql("select distinct t2.name from tabDocField t1, tabDocType t2 where t1.fieldname='status' and t1.docstatus=0 and (t2.istable is null or t2.istable = 0) and t1.parent = t2.name")]
|
||||
if not dt_list:
|
||||
return out
|
||||
|
||||
# get list of activity dt
|
||||
for dt in dt_list:
|
||||
if dt in rt:
|
||||
out[dt] = {}
|
||||
# get status list
|
||||
sl = sql("select distinct status from `tab%s`" % dt)
|
||||
|
||||
for s in sl:
|
||||
if s[0]:
|
||||
# get count
|
||||
cnt = sql("select count(*) from `tab%s` where status = '%s' and modified > '%s'" % (dt, s[0], add_days(nowdate(), -7)))[0][0]
|
||||
out[dt][s[0]] = cint(cnt)
|
||||
return out
|
||||
|
||||
def send_feedback(self, args):
|
||||
args = json.loads(args)
|
||||
|
||||
fb_sender = sql("select concat_ws(' ',first_name, last_name), email from tabProfile where name=%s", session['user'])
|
||||
fb_subject = 'Feedback : ' + args['subject']
|
||||
|
||||
|
||||
fb_msg = '''
|
||||
<div style="font-size:14px; padding:8px; border:1px solid #DDF">
|
||||
<div style="margin-bottom:16px">%s wrote,</div>
|
||||
<div>%s</div>
|
||||
</div>
|
||||
''' % (fb_sender[0][0], args['feedback'])
|
||||
|
||||
sendmail('info@webnotestech.com', fb_sender[0][1], msg = fb_msg, subject=args['subject'],parts=[], cc=[], attach=[])
|
||||
|
||||
def get_dt_help(self,dt):
|
||||
return sql("select description from tabDocType where name=%s",dt)[0][0] or ''
|
||||
|
||||
# ----------------------------------------------------------------------------------------
|
||||
def welcome_done(self):
|
||||
if cint(get_defaults().get('welcome_done')):
|
||||
return 'Yes'
|
||||
else:
|
||||
return 'No'
|
||||
|
||||
def set_welcome_done(self):
|
||||
set_default('welcome_done', '1')
|
||||
|
||||
# Check Complete Registration
|
||||
# ----------------------
|
||||
def registration_complete(self):
|
||||
if cint(get_defaults().get('registration_complete')):
|
||||
return 'Yes'
|
||||
else:
|
||||
return 'No'
|
||||
|
||||
# get dashboard counts
|
||||
# --------------------
|
||||
def get_wip_counts(self):
|
||||
#dtl = ['Lead', 'Enquiries', 'Sales Order', 'Invoices', 'Indent', 'Purchase Order', 'Bills', 'Tasks', 'Delivery Note', 'Maintenance']
|
||||
can_read_dt = ['Lead', 'Enquiry', 'Sales Order', 'Receivable Voucher', 'Indent', 'Purchase Order', 'Payable Voucher', 'Delivery Note', 'Task', 'Serial No']
|
||||
dt = {}
|
||||
for d in can_read_dt:
|
||||
args = {}
|
||||
|
||||
# if Lead
|
||||
if d=='Lead':
|
||||
args = {'To follow up':sql("select count(name) from tabLead where status!='Converted' and status!='Lead Lost' and status!='Not Interested'")}
|
||||
|
||||
# if Enquiry
|
||||
elif d=='Enquiry':
|
||||
args['Quotations to be sent'] = sql("select count(distinct(t2.name)) from `tabQuotation`t1, `tabEnquiry`t2 where t1.enq_no!=t2.name and t2.docstatus=1")
|
||||
args['To follow up'] = sql("select count(distinct(t2.name)) from `tabQuotation`t1, `tabEnquiry`t2 where t1.enq_no=t2.name and t2.docstatus=1 and t1.docstatus=1")
|
||||
|
||||
# if Sales Order
|
||||
elif d=='Sales Order':
|
||||
args['To be delivered'] = sql("select count(name) from `tabSales Order` where ifnull(per_delivered,0)<100 and delivery_date>now() and docstatus=1")
|
||||
args['To be billed'] = sql("select count(name) from `tabSales Order` where ifnull(per_billed,0)<100 and docstatus=1")
|
||||
args['Overdue'] = sql("select count(name) from `tabSales Order` where ifnull(per_delivered,0)<100 and delivery_date<now() and docstatus=1")
|
||||
args['To be submitted'] = sql("select count(name) from `tabSales Order` where docstatus=0 and status='Draft'") #Draft
|
||||
|
||||
# if Receivable Voucher
|
||||
elif d=='Receivable Voucher':
|
||||
args['To receive payment'] = sql("select count(name) from `tabReceivable Voucher` where docstatus=1 and due_date>now() and outstanding_amount!=0")
|
||||
args['Overdue'] = sql("select count(name) from `tabReceivable Voucher` where docstatus=1 and due_date<now() and outstanding_amount!=0")
|
||||
args['To be submitted'] = sql("select count(name) from `tabReceivable Voucher` where docstatus=0") #Draft
|
||||
|
||||
# if Indent
|
||||
elif d=='Indent':
|
||||
args['Purchase Order to be made'] = sql("select count(name) from `tabIndent` where ifnull(per_ordered,0)<100 and docstatus=1")
|
||||
args['To be submitted'] = sql("select count(name) from `tabIndent` where status='Draft'") #Draft
|
||||
|
||||
# if Purchase Order
|
||||
elif d=='Purchase Order':
|
||||
args['To receive items'] = sql("select count(name) from `tabPurchase Order` where ifnull(per_received,0)<100 and docstatus=1")
|
||||
args['To be billed'] = sql("select count(name) from `tabPurchase Order` where ifnull(per_billed,0)<100 and docstatus=1")
|
||||
args['To be submitted'] = sql("select count(name) from `tabPurchase Order` where status='Draft'") #Draft
|
||||
|
||||
# if Payable Voucher
|
||||
elif d=='Payable Voucher':
|
||||
args['To be paid'] = sql("select count(name) from `tabPayable Voucher` where docstatus=1 and outstanding_amount!=0")
|
||||
args['To be submitted'] = sql("select count(name) from `tabPayable Voucher` where docstatus=0") #Draft
|
||||
|
||||
# if Delivery Note
|
||||
elif d=='Delivery Note':
|
||||
args['To be submitted'] = sql("select count(name) from `tabDelivery Note` where status='Draft' and docstatus=0")
|
||||
args['To be billed'] = sql("select count(name) from `tabDelivery Note` where docstatus=1 and docstatus=1 and ifnull(per_billed,0)<100")
|
||||
|
||||
# if Tasks
|
||||
elif d=='Task':
|
||||
args = {'Open': sql("select count(name) from `tabTicket` where status='Open'")}
|
||||
|
||||
# if Serial No
|
||||
elif d=='Serial No':
|
||||
args['AMC expiring this month'] = sql("select count(name) from `tabSerial No` where docstatus!=2 and maintenance_status = 'Under AMC' and status!='Scrapped' and status!='Not in Use' and month(now()) = month(amc_expiry_date) and year(now()) = year(amc_expiry_date)")
|
||||
args['Warranty expiring this month'] = sql("select count(name) from `tabSerial No` where docstatus!=2 and maintenance_status = 'Under Warranty' and status!='Scrapped' and status!='Not in Use' and month(now()) = month(ifnull(warranty_expiry_date,0)) and year(now())=year(ifnull(warranty_expiry_date,0))")
|
||||
|
||||
for a in args:
|
||||
args[a] = args[a] and args[a][0][0] or 0
|
||||
|
||||
dt[d] = args
|
||||
return dt
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_todo_count(self):
|
||||
count = sql("select count(distinct name) from `tabToDo Item` where owner=%s", session['user'])
|
||||
count = count and count[0][0] or 0
|
||||
return count
|
||||
|
||||
def get_todo_list(self):
|
||||
return convert_to_lists(sql("select name, description, date, priority,checked from `tabToDo Item` where owner=%s order by field(priority,'High','Medium','Low') asc, date asc", session['user']))
|
||||
|
||||
def add_todo_item(self,args):
|
||||
args = json.loads(args)
|
||||
|
||||
d = Document('ToDo Item', args.get('name') or None)
|
||||
d.description = args['description']
|
||||
d.date = args['date']
|
||||
d.priority = args['priority']
|
||||
d.checked = args.get('checked', 0)
|
||||
d.owner = session['user']
|
||||
d.save(not args.get('name') and 1 or 0)
|
||||
|
||||
return d.name
|
||||
|
||||
def remove_todo_item(self,nm):
|
||||
sql("delete from `tabToDo Item` where name = %s",nm)
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_status_details(self, arg=''):
|
||||
# no of users online
|
||||
count = sql("select count(distinct user) from tabSessions t2 where user not in ('Guest','Administrator') and TIMESTAMPDIFF(HOUR,t2.lastupdate,NOW()) <= 1")
|
||||
|
||||
# unread messages
|
||||
unread = sql("select count(t1.name) from `tabMail` t1, `tabMail Participant Details` t2 where t2.participant_name = '%s' and t2.parent = t1.name and (t2.read_status = 'No' or t2.read_status is NULL) and (t2.delete_status = 'No' or t2.delete_status is NULL) and t1.last_updated_by != t2.participant_name" % arg)
|
||||
|
||||
# system messages
|
||||
msg_id = webnotes.conn.get_global('system_message_id')
|
||||
msg = ''
|
||||
|
||||
if msg_id and msg_id != webnotes.conn.get_global('system_message_id', session['user']):
|
||||
msg = webnotes.conn.get_global('system_message')
|
||||
|
||||
return {'user_count': count and cint(count[0][0]) or 0, 'unread': unread and cint(unread[0][0]) or 0, 'system_message':msg}
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def dismiss_message(self, arg=''):
|
||||
msg_id = webnotes.conn.get_global('system_message_id')
|
||||
webnotes.conn.set_global('system_message_id', msg_id, session['user'])
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_todo_reminder(self):
|
||||
return convert_to_lists(sql("select name, description, date, priority,checked from `tabToDo Item` where owner=%s and date=%s and checked=1 order by priority, date", (session['user'], nowdate())))
|
||||
|
||||
# get user details
|
||||
def get_users(self):
|
||||
ret = {}
|
||||
ret['usr'] = convert_to_lists(sql("select distinct name, concat_ws(' ', first_name, last_name), ifnull(messanger_status,'Available') from tabProfile where name=%s", session['user']))
|
||||
ret['on'] = convert_to_lists(sql("select distinct t1.name, concat_ws(' ', t1.first_name, t1.last_name), ifnull(t1.messanger_status,'Available') from tabProfile t1, tabSessions t2 where t1.name = t2.user and t1.name not in('Guest',%s) and TIMESTAMPDIFF(HOUR,t2.lastupdate,NOW()) <= 1", session['user']))
|
||||
ret['off'] = convert_to_lists(sql("select distinct t1.name, concat_ws(' ', t1.first_name, t1.last_name), ifnull(t1.messanger_status,'Offline') from tabProfile t1, tabSessions t2 where t1.name != t2.user and t1.name not in('Guest',%s) and t1.name not in(select distinct t1.name from tabProfile t1, tabSessions t2 where t1.name = t2.user and t1.name not in('Guest',%s) and (t1.messanger_status !='Invisible' or t1.messanger_status is null) and TIMESTAMPDIFF(HOUR,t2.lastupdate,NOW()) <= 1)", (session['user'], session['user'])))
|
||||
|
||||
return ret
|
||||
|
||||
# Delete event
|
||||
def delete_event(self,id):
|
||||
sql("delete from tabEvent where name=%s", id)
|
||||
|
||||
# edit event
|
||||
def edit_event(self,arg):
|
||||
arg = json.loads(arg)
|
||||
d = Document('Event', arg.get('name') or None)
|
||||
for k in arg:
|
||||
d.fields[k] = str(arg[k])
|
||||
d.save(not arg.get('name') and 1 or 0)
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
# module settings
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
def get_module_order(self):
|
||||
show_list = ['Event Updates','My Company','Setup','Accounts','CRM','SRM','Maintenance','Material Management','Payroll','Projects','Analysis','Production']
|
||||
ml = filter(lambda x: x[0] in show_list, \
|
||||
sql("select name, module_label, module_seq, is_hidden from `tabModule Def` where docstatus<2 order by module_seq asc, module_label asc"))
|
||||
return convert_to_lists(ml)
|
||||
|
||||
def set_module_order(self,arg):
|
||||
arg = eval(arg)
|
||||
for k in arg:
|
||||
sql("update `tabModule Def` set module_seq = %s, is_hidden = %s where name = %s", (cint(arg[k]['module_seq']) + 1, arg[k]['is_hidden'], k))
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_bd_list(self):
|
||||
bl = convert_to_lists(sql("select name,concat_ws(' ',first_name,last_name),birth_date from tabProfile where (birth_date is not null and birth_date != '') and (enabled is not null and enabled !='')"))
|
||||
|
||||
nd = nowdate().split('-')
|
||||
d = cint(nd[2])
|
||||
m = cint(nd[1])
|
||||
|
||||
tb = []
|
||||
for b in bl:
|
||||
if b[2] and b[2].find('-') != -1:
|
||||
if cint(b[2].split('-')[2]) == d and cint(b[2].split('-')[1]) == m:
|
||||
tb.append(b)
|
||||
|
||||
return tb
|
||||
|
||||
# obtain account id for webforms
|
||||
def get_acc_id(self):
|
||||
acc_id = sql("select value from `tabSingles` where field='account_id' and doctype='Control Panel'")
|
||||
acc_id = acc_id and acc_id[0][0] or ''
|
||||
if acc_id:
|
||||
return cstr(acc_id)
|
||||
else:
|
||||
msgprint("Account Id not specified")
|
||||
raise Exception
|
||||
|
||||
#update serial no status
|
||||
def update_serial_status(self, lst, status):
|
||||
lst11=[]
|
||||
for y1 in lst:
|
||||
sql("update `tabSerial No` set maintenance_status = %s where name=%s", (status,y1))
|
||||
lst11.append(y1)
|
||||
msgprint("Status updated as '"+status+"' for "+cstr(lst11))
|
||||
|
||||
# chk to set serial no status as 'Out of warranty'
|
||||
def set_for_out_of_warranty(self):
|
||||
chk_for_out_of_wrnty = sql("select name from `tabSerial No` where ifnull(warranty_expiry_date, '2200-12-12') < CURDATE() and ifnull(warranty_expiry_date, '0000-00-00') != '0000-00-00' and ifnull(amc_expiry_date, '0000-00-00') ='0000-00-00' and ifnull(maintenance_status, '') != 'Out of Warranty'")
|
||||
if chk_for_out_of_wrnty:
|
||||
lst1 = [x1[0] for x1 in chk_for_out_of_wrnty]
|
||||
self.update_serial_status(lst1, 'Out Of Warranty')
|
||||
|
||||
# chk to set serial no status as 'Out of amc'
|
||||
def set_for_out_of_amc(self):
|
||||
chk_for_out_of_amc = sql("select name from `tabSerial No` where ifnull(warranty_expiry_date, '0000-00-00')< CURDATE() and ifnull(amc_expiry_date, '2200-12-12') < CURDATE() and ifnull(amc_expiry_date, '0000-00-00') !='0000-00-00' and ifnull(maintenance_status, '') !='Out of AMC'")
|
||||
if chk_for_out_of_amc:
|
||||
lst2 = [x2[0] for x2 in chk_for_out_of_amc]
|
||||
self.update_serial_status(lst2, 'Out Of AMC')
|
||||
|
||||
# chk to set serial no status as 'under amc'
|
||||
def set_for_under_amc(self):
|
||||
chk_for_under_amc = sql("select name from `tabSerial No` where ifnull(warranty_expiry_date, '0000-00-00')< CURDATE() and ifnull(amc_expiry_date, '2200-12-12') >= CURDATE() and ifnull(amc_expiry_date, '0000-00-00') !='0000-00-00' and ifnull(maintenance_status, '') !='Under AMC'")
|
||||
if chk_for_under_amc:
|
||||
lst3 = [x3[0] for x3 in chk_for_under_amc]
|
||||
self.update_serial_status(lst3, 'Under AMC')
|
||||
|
||||
# chk to set serial no status as 'under warranty'
|
||||
def set_for_under_warranty(self):
|
||||
chk_for_under_wrnty = sql("select name from `tabSerial No` where ifnull(warranty_expiry_date, '2200-12-12') >= CURDATE() and ifnull(warranty_expiry_date, '0000-00-00') != '0000-00-00' and ifnull(amc_expiry_date, '0000-00-00') ='0000-00-00' and ifnull(maintenance_status, '') != 'Under Warranty'")
|
||||
if chk_for_under_wrnty:
|
||||
lst4 = [x4[0] for x4 in chk_for_under_wrnty]
|
||||
self.update_serial_status(lst4, 'Under Warranty')
|
||||
|
||||
# check maintenance status for all serial nos only for 1st login each day
|
||||
def set_serial_no_status(self):
|
||||
|
||||
chk_serial_no_update_date = webnotes.conn.get_global('maintenance_status_update_date')
|
||||
|
||||
# check status only for 1st login each day.... if maintenance date already updated means it is checked
|
||||
if getdate(chk_serial_no_update_date) != nowdate():
|
||||
# chk to set serial no status as 'Out of warranty'
|
||||
self.set_for_out_of_warranty()
|
||||
|
||||
# chk to set serial no status as 'Out of amc'
|
||||
self.set_for_out_of_amc()
|
||||
|
||||
# chk to set serial no status as 'under amc'
|
||||
self.set_for_under_amc()
|
||||
|
||||
# chk to set serial no status as 'under warranty'
|
||||
self.set_for_under_warranty()
|
||||
|
||||
#set maintenance_status_update_date
|
||||
webnotes.conn.set_global('maintenance_status_update_date', nowdate())
|
||||
|
||||
# get user fullname
|
||||
def get_user_fullname(self,usr):
|
||||
return sql("select concat_ws(' ',first_name, last_name) from tabProfile where name=%s", usr)[0][0] or ''
|
||||
1
event_updates/doctype/home_control/home_control.txt
Normal file
1
event_updates/doctype/home_control/home_control.txt
Normal file
@@ -0,0 +1 @@
|
||||
[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2009-07-09 16:32:49', 'search_fields': None, 'module': 'Event Updates', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': 1, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': 0, 'max_attachments': None, 'version': 4, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': None, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': '', 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Home Control', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-11-21 16:46:44', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}]
|
||||
0
event_updates/doctype/widget_control/__init__.py
Normal file
0
event_updates/doctype/widget_control/__init__.py
Normal file
45
event_updates/doctype/widget_control/widget_control.py
Normal file
45
event_updates/doctype/widget_control/widget_control.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import nowdate
|
||||
from webnotes.model.doc import Document
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import session, form, msgprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
try: import json
|
||||
except: import simplejson as json
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def add_comment(self,args):
|
||||
import time
|
||||
args = eval(args)
|
||||
if(args['comment']):
|
||||
cmt = Document('Comment Widget Record')
|
||||
for arg in args:
|
||||
cmt.fields[arg] = args[arg]
|
||||
cmt.comment_date = nowdate()
|
||||
cmt.comment_time = time.strftime('%H:%M')
|
||||
cmt.save(1)
|
||||
|
||||
try:
|
||||
get_obj('Feed Control').upate_comment_in_feed(args['comment_doctype'], args['comment_docname'])
|
||||
except:
|
||||
pass
|
||||
|
||||
else:
|
||||
raise Exception
|
||||
|
||||
def remove_comment(self, args):
|
||||
args = json.loads(args)
|
||||
sql("delete from `tabComment Widget Record` where name=%s",args['id'])
|
||||
|
||||
try:
|
||||
get_obj('Feed Control').upate_comment_in_feed(args['dt'], args['dn'])
|
||||
except: pass
|
||||
1
event_updates/doctype/widget_control/widget_control.txt
Normal file
1
event_updates/doctype/widget_control/widget_control.txt
Normal file
@@ -0,0 +1 @@
|
||||
[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2009-11-12 13:06:24', 'search_fields': None, 'module': 'Event Updates', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': 1, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': 0, 'max_attachments': None, 'version': 27, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': 0, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': None, 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Widget Control', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-09-20 14:06:57', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}]
|
||||
0
event_updates/page/__init__.py
Normal file
0
event_updates/page/__init__.py
Normal file
0
event_updates/page/event_updates/__init__.py
Normal file
0
event_updates/page/event_updates/__init__.py
Normal file
111
event_updates/page/event_updates/event_updates.comp.js
Normal file
111
event_updates/page/event_updates/event_updates.comp.js
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
pscript['onload_Event Updates']=function(){if(user=='Guest'){loadpage('Login Page');return;}
|
||||
pscript.home_make_body();pscript.home_make_status();pscript.home_pre_process();pscript.home_make_widgets();}
|
||||
pscript.home_make_body=function(){var wrapper=page_body.pages['Event Updates'];wrapper.main_tab=make_table(wrapper,1,2,'100%',['70%','30%']);$y(wrapper.main_tab,{tableLayout:'fixed'});wrapper.body=$a($td(wrapper.main_tab,0,0),'div','layout_wrapper');wrapper.head=$a(wrapper.body,'div');wrapper.banner_area=$a(wrapper.head,'div');wrapper.toolbar_area=$a(wrapper.head,'div');wrapper.system_message_area=$a(wrapper.body,'div','',{marginBottom:'16px',padding:'8px',backgroundColor:'#FFD',border:'1px dashed #AA6',display:'none'})}
|
||||
pscript.home_pre_process=function(wrapper){var wrapper=page_body.pages['Event Updates'];var cp=locals['Control Panel']['Control Panel'];if(cp.client_name){var banner=$a(wrapper.banner_area,'div','',{paddingBottom:'4px'})
|
||||
banner.innerHTML=cp.client_name;}
|
||||
if(in_list(user_roles,'System Manager')){pscript.complete_registration();}}
|
||||
pscript.home_make_widgets=function(){var wrapper=page_body.pages['Event Updates'];var cell=$td(wrapper.main_tab,0,1);sidebar=new wn.widgets.PageSidebar(cell,{sections:[{title:'Calendar',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){new HomeCalendar(new HomeWidget(wrapper,'Calendar','Event'),wrapper);}},{title:'To Do',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){new HomeToDo(new HomeWidget(wrapper,'To Do','Item'));}},{title:'Online Users',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){pscript.online_users_obj=new OnlineUsers(wrapper);}}]})
|
||||
sidebar.refresh()
|
||||
new FeedList(wrapper.body);}
|
||||
OnlineUsers=function(wrapper){var me=this;this.wrapper=wrapper;this.my_company_link=function(){$a($a(wrapper,'div','',{marginBottom:'7px'}),'span','link_type',{color:'#777','color:hover':'#FFF',fontSize:'11px'},'See all users',function(){loadpage('My Company');});}
|
||||
this.render=function(online_users){me.my_company_link();if(online_users.length){var max=online_users.length;max=(max>10?10:max)
|
||||
for(var i=0;i<max;i++){new OneOnlineUser(me.wrapper,online_users[i]);}}else{$a(wrapper,'div','',{'color':'#888'},'No user online!')}}}
|
||||
OneOnlineUser=function(wrapper,det){var name=cstr(det[1])+' '+cstr(det[2]);if(det[1]==user)name='You'
|
||||
var div=$a(wrapper,'div','',{padding:'3px 0px'});$a(div,'div','',{width:'7px',height:'7px',cssFloat:'left',margin:'5px',backgroundColor:'green'});$a(div,'div','',{marginLeft:'3px'},name);}
|
||||
HomeWidget=function(parent,heading,item){var me=this;this.item=item;this.wrapper=$a(parent,'div');this.body=$a(this.wrapper,'div','',{paddingBottom:'16px'});this.footer=$a(this.wrapper,'div');this.add_btn=$btn(this.footer,'+ Add '+item,function(){me.add()});this.refresh_btn=$ln(this.footer,'Refresh',function(){me.refresh();},{fontSize:'11px',marginLeft:'7px',color:'#888'});}
|
||||
HomeWidget.prototype.refresh=function(){var me=this;$di(this.working_img);var callback=function(r,rt){$dh(me.working_img);me.body.innerHTML='';if(me.decorator.setup_body)me.decorator.setup_body();for(var i=0;i<r.message.length;i++){new HomeWidgetItem(me,r.message[i]);}
|
||||
if(!r.message.length){$a(me.body,'div','',{color:'#777'},me.no_items_message);}}
|
||||
$c_obj('Home Control',this.get_list_method,'',callback);}
|
||||
HomeWidget.prototype.make_dialog=function(){var me=this;if(!this.dialog){this.dialog=new wn.widgets.Dialog();this.dialog.make({width:480,title:'New '+this.item,fields:this.dialog_fields});this.dialog.fields_dict.save.input.onclick=function(){this.set_working();me.decorator.save(this);}}}
|
||||
HomeWidget.prototype.add=function(){this.make_dialog();this.decorator.clear_dialog();this.dialog.show();}
|
||||
HomeWidgetItem=function(widget,det){var me=this;this.det=det;this.widget=widget;this.widget=widget;this.det=det;if(widget.decorator.get_item_parent)parent=widget.decorator.get_item_parent(det);else parent=widget.body;if(!parent)return;this.wrapper=$a(parent,'div');this.tab=make_table(this.wrapper,1,3,'100%',['90%','5%','5%'],{paddingRight:'4px'});this.edit_btn=$a($td(this.tab,0,1),'div','wn-icon '+'ic-doc_edit',{cursor:'pointer'});this.edit_btn.onclick=function(){me.edit();}
|
||||
this.del_btn=$a($td(this.tab,0,2),'div','wn-icon '+'ic-trash',{cursor:'pointer'});this.del_btn.onclick=function(){me.delete_item();}
|
||||
widget.decorator.render_item(this,det);}
|
||||
HomeWidgetItem.prototype.edit=function(){this.widget.make_dialog();this.widget.decorator.set_dialog_values(this.det);this.widget.dialog.show();}
|
||||
HomeWidgetItem.prototype.delete_item=function(){var me=this;this.wrapper.innerHTML='<span style="color:#888">Deleting...</span>';var callback=function(r,rt){$(me.wrapper).slideUp();}
|
||||
$c_obj('Home Control',this.widget.delete_method,this.widget.get_item_id(this.det),callback);}
|
||||
HomeCalendar=function(widget,wrapper){$ln(widget.footer,'Full Calendar',function(){loadpage('_calendar');},{marginLeft:'7px',fontSize:'11px',color:'#888'})
|
||||
this.widget=widget;this.widget.get_list_method='get_events_list'
|
||||
this.widget.delete_method='delete_event';this.widget.no_items_message='You have no events in the next 7 days';this.widget.get_item_id=function(det){return det.name;}
|
||||
this.widget.decorator=this;var hl=[];for(var i=0;i<24;i++){hl.push(((i+8)%24)+':00');}
|
||||
this.widget.dialog_fields=[{fieldtype:'Date',fieldname:'event_date',label:'Event Date',reqd:1},{fieldtype:'Time',fieldname:'event_hour',label:'Event Time',reqd:1},{fieldtype:'Text',fieldname:'description',label:'Description',reqd:1},{fieldtype:'Button',fieldname:'save',label:'Save'}];this.widget.refresh();}
|
||||
HomeCalendar.prototype.setup_body=function(){var w=this.widget;w.date_blocks={};for(var i=0;i<7;i++){var dt=dateutil.obj_to_str(dateutil.add_days(new Date(),i));var div=$a(w.body,'div','',{padding:'4px 0px',borderBottom:'1px solid #AAA',display:'none'});div.head=$a(div,'div','',{fontWeight:'bold',paddingBottom:'4px'});div.head.innerHTML=(i==0?'Today':(i==1?'Tomorrow':dateutil.str_to_user(dt)))
|
||||
w.date_blocks[dt]=div;}}
|
||||
HomeCalendar.prototype.get_item_parent=function(det){var d=this.widget.date_blocks[det.event_date];$ds(d);return d;}
|
||||
HomeCalendar.prototype.render_item=function(item,det){var tab=make_table($td(item.tab,0,0),1,2,'100%',['48px',null],{padding:'2px',lineHeight:'1.5em'});$y(tab,{tableLayout:'fixed'});$td(tab,0,0).innerHTML='<span style="color:#888">'+det.event_hour+':</span> ';$a($td(tab,0,1),'span','social',{},replace_newlines(det.description));if(det.ref_type&&det.ref_name&&det.ref_name!='None'){var span=$a($a($td(tab,0,1),'div'),'span','link_type');span.innerHTML=det.ref_name;span.dt=det.ref_type;span.onclick=function(){loaddoc(this.dt,this.innerHTML);}}}
|
||||
HomeCalendar.prototype.clear_dialog=function(){this.set_dialog_values({event_date:get_today(),event_hour:'8:00',description:''});}
|
||||
HomeCalendar.prototype.set_dialog_values=function(det){var d=this.widget.dialog;d.set_values(det);d.det=det;}
|
||||
HomeCalendar.prototype.save=function(btn){var d=this.widget.dialog;var me=this;var det=d.get_values();if(!det){btn.done_working();return;}
|
||||
det.name=d.det.name;det.owner=user;if(!det.event_type)
|
||||
det.event_type='Private';var callback=function(r,rt){btn.done_working();me.widget.dialog.hide();me.widget.refresh();}
|
||||
$c_obj('Home Control','edit_event',JSON.stringify(det),callback);}
|
||||
HomeToDo=function(widget){this.widget=widget;this.widget.get_list_method='get_todo_list';this.widget.delete_method='remove_todo_item';this.widget.no_items_message='Nothing to do?';this.widget.get_item_id=function(det){return det[0];}
|
||||
this.widget.decorator=this;this.widget.dialog_fields=[{fieldtype:'Date',fieldname:'date',label:'Event Date',reqd:1},{fieldtype:'Text',fieldname:'description',label:'Description',reqd:1},{fieldtype:'Check',fieldname:'checked',label:'Completed'},{fieldtype:'Select',fieldname:'priority',label:'Priority',reqd:1,'options':['Medium','High','Low'].join('\n')},{fieldtype:'Button',fieldname:'save',label:'Save'}];this.widget.refresh();}
|
||||
HomeToDo.prototype.render_item=function(item,det){var tab=make_table($td(item.tab,0,0),1,2,'100%',['48px',null],{padding:'2px'});$y(tab,{tableLayout:'fixed'});var span=$a($td(tab,0,0),'span','',{padding:'2px',color:'#FFF',fontSize:'10px',backgroundColor:(det[3]=='Low'?'#888':(det[3]=='High'?'#EDA857':'#687FD3'))});$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');span.innerHTML=det[3];var span=$a($td(tab,0,1),'span','social',{lineHeight:'1.5em'},replace_newlines(det[1]));if(det[4])$y(span,{textDecoration:'line-through'});if(!det[4]&&dateutil.str_to_obj(det[2])<new Date()){$y(span,{color:'RED'});$a($td(tab,0,1),'div','',{fontSize:'10px',color:'#666'},dateutil.str_to_user(det[2])+' (Overdue)');}else{$a($td(tab,0,1),'div','',{fontSize:'10px',color:'#666'},dateutil.str_to_user(det[2]));}}
|
||||
HomeToDo.prototype.clear_dialog=function(){this.set_dialog_values(['','',get_today(),'Medium',0]);}
|
||||
HomeToDo.prototype.set_dialog_values=function(det){var d=this.widget.dialog;d.set_values({date:det[2],priority:det[3],description:det[1],checked:det[4]});d.det=det;}
|
||||
HomeToDo.prototype.save=function(btn){var d=this.widget.dialog;var me=this;var det=d.get_values()
|
||||
if(!det){btn.done_working();return;}
|
||||
det.name=d.det?d.det[0]:'';var callback=function(r,rt){btn.done_working();me.widget.dialog.hide();me.widget.refresh();}
|
||||
$c_obj('Home Control','add_todo_item',JSON.stringify(det),callback);}
|
||||
FeedList=function(parent){this.auto_feed_off=cint(sys_defaults.auto_feed_off);this.wrapper=$a(parent,'div');this.make_head();this.make_list();this.list.run();}
|
||||
FeedList.prototype.make_head=function(){var me=this;this.head=$a(this.wrapper,'div','',{marginBottom:'8px'});$a(this.head,'h1','',{display:'inline'},'Home');$a(this.head,'span','link_type',{marginLeft:'7px'},'[?]',function(){msgprint('<b>What appears here?</b> This is where you get updates of everything you are allowed to access and generates an update')})
|
||||
$a(this.head,'span','link_type',{cursor:'pointer',marginLeft:'7px',fontSize:'11px'},'refresh',function(){me.run();});}
|
||||
FeedList.prototype.run=function(){this.prev_date=null;this.list.run();}
|
||||
FeedList.prototype.make_list=function(){this.list_area=$a(this.wrapper,'div')
|
||||
this.no_result=$a(this.wrapper,'div','help_box',{display:'none'},'Nothing to show yet. Your feed will be updated as you start your activities')
|
||||
var l=new Listing('Feed List',1);var me=this;l.colwidths=['100%'];l.page_len=20;l.opts.cell_style={padding:'0px'};l.opts.hide_rec_label=1;l.get_query=function(){this.query=repl('select \
|
||||
distinct t1.name, t1.doc_type, t1.doc_name, t1.subject, t1.modified_by, \
|
||||
concat(ifnull(t2.first_name,""), " ", ifnull(t2.last_name,"")), t1.modified, t1.color \
|
||||
from tabFeed t1, tabProfile t2, tabUserRole t3, tabDocPerm t4 \
|
||||
where t1.doc_type = t4.parent \
|
||||
and t2.name = t1.owner \
|
||||
and t3.parent = "%(user)s" \
|
||||
and t4.role = t3.role \
|
||||
and ifnull(t4.`read`,0) = 1 \
|
||||
order by t1.modified desc',{user:user})
|
||||
this.query_max=''}
|
||||
l.show_cell=function(cell,ri,ci,d){me.render_feed(cell,ri,ci,d);}
|
||||
l.onrun=function(){$(me.wrapper).fadeIn();if(me.after_run)me.after_run();}
|
||||
l.make(this.list_area);$dh(l.btn_area);this.list=l;}
|
||||
FeedList.prototype.after_run=function(){this.list.has_data()?$dh(this.no_result):$ds(this.no_result)}
|
||||
FeedList.prototype.render_feed=function(cell,ri,ci,d){new FeedItem(cell,d[ri],this);}
|
||||
FeedItem=function(cell,det,feedlist){var me=this;this.det=det;this.feedlist=feedlist;this.wrapper=$a(cell,'div','',{paddingBottom:'4px'});this.head=$a(this.wrapper,'div');this.tab=make_table(this.wrapper,1,2,'100%',[(100/7)+'%',(600/7)+'%']);$y(this.tab,{tableLayout:'fixed'})
|
||||
$y($td(this.tab,0,0),{textAlign:'right',paddingRight:'4px'});this.text_area=$a($td(this.tab,0,1),'div');this.render_references(this.text_area,det);this.render_tag(det);this.add_day_sep(det);}
|
||||
FeedItem.prototype.add_day_sep=function(det){var me=this;var prev_date=det[6].split(' ')[0];var make_div=function(){var div=$a(me.head,'div','',{borderBottom:'1px solid #888',margin:'8px 0px',padding:'2px 0px',color:'#888',fontSize:'11px'});div.innerHTML=comment_when(det[6],1);if(prev_date==get_today()){div.innerHTML='';span=$a(div,'span','',{padding:'2px',color:'#000',fontWeight:'bold'});span.innerHTML='Today';}}
|
||||
if(this.feedlist.prev_date&&this.feedlist.prev_date!=prev_date){make_div();}
|
||||
if(!this.feedlist.prev_date){make_div();}
|
||||
this.feedlist.prev_date=prev_date;}
|
||||
FeedItem.prototype.render_tag=function(det){tag=$a($td(this.tab,0,0),'div','',{color:'#FFF',padding:'3px',textAlign:'right',fontSize:'11px',whiteSpace:'nowrap',overflow:'hidden',cursor:'pointer'});$br(tag,'3px');$y(tag,{backgroundColor:(det[7]?det[7]:'#273')});tag.innerHTML=get_doctype_label(det[1]);tag.dt=det[1]
|
||||
tag.onclick=function(){loaddocbrowser(this.dt);}}
|
||||
FeedItem.prototype.render_references=function(div,det){div.tab=make_table(div,1,2,'100%',[null,'15%'])
|
||||
var dt=det[1];var dn=det[2]
|
||||
var allow=in_list(profile.can_read,dt);var span=$a($td(div.tab,0,0),'span',(allow?'link_type':''),null,det[2]);span.dt=dt;span.dn=dn;if(allow)span.onclick=function(){loaddoc(this.dt,this.dn);}
|
||||
if(det[3]){$a($td(div.tab,0,0),'span','',{marginLeft:'7px',color:'#444'},det[3]);}
|
||||
$y($td(div.tab,0,1),{fontSize:'11px'}).innerHTML=(strip(det[5])?det[5]:det[4]);}
|
||||
HomeStatusBar=function(){var me=this;var parent=page_body.pages['Event Updates'];this.wrapper=$a($td(parent.main_tab,0,1),'div','home-status',{},'Loading...');$br(this.wrapper,'3px');this.render=function(r){this.wrapper.innerHTML='';this.span=$a(this.wrapper,'span','home-status-link')
|
||||
this.span.onclick=function(){loadpage('My Company')}
|
||||
if(r.unread_messages){this.span.innerHTML='<span class="home-status-unread">'+r.unread_messages+'</span> unread message'+(cint(r.unread_messages)>1?'s':'');}else{this.span.innerHTML='No unread messages.';}}}
|
||||
pscript.home_make_status=function(){var home_status_bar=new HomeStatusBar()
|
||||
var wrapper=page_body.pages['Event Updates'];$c_page('event_updates','event_updates','get_status_details',user,function(r,rt){home_status_bar.render(r.message);if(r.message.system_message)
|
||||
pscript.show_system_message(wrapper,r.message.system_message);if(pscript.is_erpnext_saas&&cint(r.message.is_trial)&&in_list(user_roles,'System Manager')){pscript.trial_box=$a(div,'div','help_box',{margin:'2px 8px 2px 0px'},"Your Free Trial expires in "+
|
||||
r.message.days_to_expiry+" days. When you are satisfied, please <span class='link_type' onclick='pscript.convert_to_paid()'>please click here</span> to convert to a paid account."+"<br>To get help, view <a href='http://erpnext.blogspot.com/2011/02/getting-started-with-your-erpnext.html' target='_blank'>Getting Started with Your System</a> (opens in a new page)");}
|
||||
pscript.online_users_obj.render(r.message.online_users);pscript.online_users=r.message.online_users;});}
|
||||
pscript.convert_to_paid=function(){var callback=function(r,rt){if(r.exc){msgprint(r.exc);return;}
|
||||
$(pscript.trial_box).slideUp();}
|
||||
$c_page('event_updates','event_updates','convert_to_paid','',callback)}
|
||||
pscript.show_system_message=function(wrapper,msg){$ds(wrapper.system_message_area);var txt=$a(wrapper.system_message_area,'div','',{lineHeight:'1.6em'});txt.innerHTML=msg;var span=$ln($a(wrapper.system_message_area,'div'),'Dismiss',function(me){me.set_working();$c_obj('Home Control','dismiss_message','',function(r,rt){me.done_working();$(wrapper.system_message_area).slideUp();});},{fontSize:'11px'})}
|
||||
pscript.complete_registration=function()
|
||||
{var reg_callback=function(r,rt){if(r.message=='No'){var d=new Dialog(400,200,"Please Complete Your Registration");if(user!='Administrator'){d.no_cancel();$dh(page_body.wntoolbar.wrapper);}
|
||||
$($a(d.body,'div','',{margin:'8px',color:'#888'})).html('<b>Company Name : </b>'+locals['Control Panel']['Control Panel'].company_name);d.make_body([['Data','Company Abbreviation'],['Select','Fiscal Year Start Date'],['Select','Default Currency'],['Button','Save'],]);pscript.make_dialog_field(d);d.widgets['Save'].onclick=function()
|
||||
{d.widgets['Save'].set_working();flag=pscript.validate_fields(d);if(flag)
|
||||
{var args=[locals['Control Panel']['Control Panel'].company_name,d.widgets['Company Abbreviation'].value,d.widgets['Fiscal Year Start Date'].value,d.widgets['Default Currency'].value];$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r,rt){sys_defaults=r.message;d.hide();$ds(page_body.wntoolbar.wrapper);});}}
|
||||
d.show();}}
|
||||
$c_obj('Home Control','registration_complete','',reg_callback);}
|
||||
pscript.make_dialog_field=function(d)
|
||||
{fisc_format=d.widgets['Fiscal Year Start Date'];add_sel_options(fisc_format,['','1st Jan','1st Apr','1st Jul','1st Oct']);currency_list=['','AED','AFN','ALL','AMD','ANG','AOA','ARS','AUD','AZN','BAM','BBD','BDT','BGN','BHD','BIF','BMD','BND','BOB','BRL','BSD','BTN','BYR','BZD','CAD','CDF','CFA','CFP','CHF','CLP','CNY','COP','CRC','CUC','CZK','DJF','DKK','DOP','DZD','EEK','EGP','ERN','ETB','EUR','EURO','FJD','FKP','FMG','GBP','GEL','GHS','GIP','GMD','GNF','GQE','GTQ','GYD','HKD','HNL','HRK','HTG','HUF','IDR','ILS','INR','IQD','IRR','ISK','JMD','JOD','JPY','KES','KGS','KHR','KMF','KPW','KRW','KWD','KYD','KZT','LAK','LBP','LKR','LRD','LSL','LTL','LVL','LYD','MAD','MDL','MGA','MKD','MMK','MNT','MOP','MRO','MUR','MVR','MWK','MXN','MYR','MZM','NAD','NGN','NIO','NOK','NPR','NRs','NZD','OMR','PAB','PEN','PGK','PHP','PKR','PLN','PYG','QAR','RMB','RON','RSD','RUB','RWF','SAR','SCR','SDG','SDR','SEK','SGD','SHP','SOS','SRD','STD','SYP','SZL','THB','TJS','TMT','TND','TRY','TTD','TWD','TZS','UAE','UAH','UGX','USD','USh','UYU','UZS','VEB','VND','VUV','WST','XAF','XCD','XDR','XOF','XPF','YEN','YER','YTL','ZAR','ZMK','ZWR'];currency=d.widgets['Default Currency'];add_sel_options(currency,currency_list);}
|
||||
pscript.validate_fields=function(d)
|
||||
{var lst=['Company Abbreviation','Fiscal Year Start Date','Default Currency'];var msg='Please enter the following fields';var flag=1;for(var i=0;i<lst.length;i++)
|
||||
{if(!d.widgets[lst[i]].value){flag=0;msg=msg+NEWLINE+lst[i];}}
|
||||
if(!flag)alert(msg);return flag;}
|
||||
17
event_updates/page/event_updates/event_updates.css
Normal file
17
event_updates/page/event_updates/event_updates.css
Normal file
@@ -0,0 +1,17 @@
|
||||
div.home-status {
|
||||
margin: 7px;
|
||||
padding: 5px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
span.home-status-link {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.home-status-unread {
|
||||
padding: 2px 3px;
|
||||
font-size: 11px;
|
||||
color: #FFF;
|
||||
background-color: RED;
|
||||
}
|
||||
1
event_updates/page/event_updates/event_updates.html
Normal file
1
event_updates/page/event_updates/event_updates.html
Normal file
@@ -0,0 +1 @@
|
||||
<div id="updates_div"></div>
|
||||
748
event_updates/page/event_updates/event_updates.js
Normal file
748
event_updates/page/event_updates/event_updates.js
Normal file
@@ -0,0 +1,748 @@
|
||||
pscript['onload_Event Updates'] = function() {
|
||||
if(user=='Guest') {
|
||||
loadpage('Login Page');
|
||||
return;
|
||||
}
|
||||
|
||||
pscript.home_make_body();
|
||||
pscript.home_make_status();
|
||||
pscript.home_pre_process();
|
||||
pscript.home_make_widgets();
|
||||
}
|
||||
|
||||
// ==================================
|
||||
|
||||
pscript.home_make_body = function() {
|
||||
var wrapper = page_body.pages['Event Updates'];
|
||||
|
||||
// body
|
||||
wrapper.main_tab = make_table(wrapper,1,2,'100%',['70%','30%']);
|
||||
$y(wrapper.main_tab, {tableLayout:'fixed'});
|
||||
|
||||
wrapper.body = $a($td(wrapper.main_tab, 0, 0), 'div', 'layout_wrapper');
|
||||
|
||||
wrapper.head = $a(wrapper.body, 'div');
|
||||
|
||||
wrapper.banner_area = $a(wrapper.head, 'div');
|
||||
wrapper.toolbar_area = $a(wrapper.head, 'div');
|
||||
|
||||
|
||||
wrapper.system_message_area = $a(wrapper.body, 'div', '',
|
||||
{marginBottom:'16px', padding:'8px', backgroundColor:'#FFD', border:'1px dashed #AA6', display:'none'})
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ==================================
|
||||
|
||||
pscript.home_pre_process = function(wrapper) {
|
||||
var wrapper = page_body.pages['Event Updates'];
|
||||
var cp = locals['Control Panel']['Control Panel'];
|
||||
|
||||
// banner
|
||||
if(cp.client_name) {
|
||||
var banner = $a(wrapper.banner_area, 'div', '', {paddingBottom:'4px'})
|
||||
banner.innerHTML = cp.client_name;
|
||||
}
|
||||
|
||||
// complete registration
|
||||
if(in_list(user_roles,'System Manager')) { pscript.complete_registration(); }
|
||||
}
|
||||
|
||||
// Widgets
|
||||
// ==================================
|
||||
|
||||
pscript.home_make_widgets = function() {
|
||||
var wrapper = page_body.pages['Event Updates'];
|
||||
var cell = $td(wrapper.main_tab, 0, 1);
|
||||
|
||||
// sidebar
|
||||
sidebar = new wn.widgets.PageSidebar(cell, {
|
||||
sections:[
|
||||
{
|
||||
title: 'Calendar',
|
||||
display: function() { return !has_common(user_roles, ['Guest','Customer','Vendor'])},
|
||||
render: function(wrapper) {
|
||||
new HomeCalendar(new HomeWidget(wrapper, 'Calendar', 'Event'), wrapper);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: 'To Do',
|
||||
display: function() { return !has_common(user_roles, ['Guest','Customer','Vendor'])},
|
||||
render: function(wrapper) {
|
||||
new HomeToDo(new HomeWidget(wrapper, 'To Do', 'Item'));
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: 'Online Users',
|
||||
display: function() { return !has_common(user_roles, ['Guest','Customer','Vendor'])},
|
||||
render: function(wrapper) {
|
||||
pscript.online_users_obj = new OnlineUsers(wrapper);
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
sidebar.refresh()
|
||||
|
||||
/*$y(cell,{padding:'0px 8px'});
|
||||
|
||||
new HomeCalendar(new HomeWidget(cell, 'Calendar', 'Event'));
|
||||
|
||||
|
||||
new HomeToDo(new HomeWidget(cell, 'To Do', 'Item'));*/
|
||||
|
||||
new FeedList(wrapper.body);
|
||||
}
|
||||
|
||||
OnlineUsers = function(wrapper) {
|
||||
var me = this;
|
||||
this.wrapper = wrapper;
|
||||
|
||||
this.my_company_link = function() {
|
||||
$a($a(wrapper, 'div', '', {marginBottom:'7px'}), 'span', 'link_type',
|
||||
{color:'#777', 'color:hover':'#FFF', fontSize:'11px'},
|
||||
'See all users', function() {loadpage('My Company'); });
|
||||
}
|
||||
|
||||
this.render = function(online_users) {
|
||||
me.my_company_link();
|
||||
|
||||
if(online_users.length) {
|
||||
var max = online_users.length; max = (max > 10 ? 10 : max)
|
||||
for(var i=0; i<max; i++) {
|
||||
new OneOnlineUser(me.wrapper, online_users[i]);
|
||||
}
|
||||
} else {
|
||||
$a(wrapper, 'div', '', {'color':'#888'}, 'No user online!')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OneOnlineUser = function(wrapper, det) {
|
||||
var name = cstr(det[1]) + ' ' + cstr(det[2]);
|
||||
if(det[1]==user) name = 'You'
|
||||
var div = $a(wrapper, 'div', '', {padding:'3px 0px'});
|
||||
$a(div, 'div', '', {width:'7px', height:'7px', cssFloat:'left', margin:'5px', backgroundColor:'green'});
|
||||
$a(div, 'div', '', {marginLeft:'3px'}, name);
|
||||
}
|
||||
|
||||
HomeWidget = function(parent, heading, item) {
|
||||
var me = this; this.item = item;
|
||||
|
||||
this.wrapper = $a(parent, 'div');
|
||||
|
||||
|
||||
// body
|
||||
this.body = $a(this.wrapper,'div','',{paddingBottom:'16px'});
|
||||
this.footer = $a(this.wrapper,'div');
|
||||
|
||||
// add button
|
||||
this.add_btn = $btn(this.footer,'+ Add ' + item,function(){me.add()});
|
||||
|
||||
// refresh
|
||||
this.refresh_btn = $ln(this.footer,'Refresh',function() { me.refresh(); },{fontSize:'11px',marginLeft:'7px',color:'#888'});
|
||||
}
|
||||
|
||||
HomeWidget.prototype.refresh = function() {
|
||||
var me = this;
|
||||
$di(this.working_img);
|
||||
|
||||
var callback = function(r,rt) {
|
||||
$dh(me.working_img);
|
||||
me.body.innerHTML = '';
|
||||
|
||||
// prepare (for calendar?)
|
||||
if(me.decorator.setup_body) me.decorator.setup_body();
|
||||
|
||||
for(var i=0;i<r.message.length;i++) {
|
||||
new HomeWidgetItem(me, r.message[i]);
|
||||
}
|
||||
if(!r.message.length) {
|
||||
$a(me.body,'div','',{color:'#777'}, me.no_items_message);
|
||||
}
|
||||
}
|
||||
$c_obj('Home Control',this.get_list_method,'',callback);
|
||||
}
|
||||
|
||||
HomeWidget.prototype.make_dialog = function() {
|
||||
var me = this;
|
||||
if(!this.dialog) {
|
||||
this.dialog = new wn.widgets.Dialog();
|
||||
this.dialog.make({
|
||||
width: 480,
|
||||
title: 'New ' + this.item,
|
||||
fields:this.dialog_fields
|
||||
});
|
||||
|
||||
this.dialog.fields_dict.save.input.onclick = function() {
|
||||
this.set_working();
|
||||
me.decorator.save(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HomeWidget.prototype.add = function() {
|
||||
this.make_dialog();
|
||||
this.decorator.clear_dialog();
|
||||
this.dialog.show();
|
||||
}
|
||||
|
||||
// Item
|
||||
// --------
|
||||
|
||||
HomeWidgetItem = function(widget, det) {
|
||||
var me = this; this.det = det; this.widget = widget;
|
||||
this.widget = widget; this.det = det;
|
||||
|
||||
// parent
|
||||
if(widget.decorator.get_item_parent) parent = widget.decorator.get_item_parent(det);
|
||||
else parent = widget.body;
|
||||
|
||||
if(!parent) return;
|
||||
|
||||
// wrapper
|
||||
this.wrapper = $a(parent, 'div');
|
||||
this.tab = make_table(this.wrapper, 1, 3, '100%', ['90%', '5%', '5%'],{paddingRight:'4px'});
|
||||
|
||||
// buttons
|
||||
this.edit_btn = $a($td(this.tab,0,1),'div','wn-icon ' + 'ic-doc_edit', {cursor:'pointer'});
|
||||
this.edit_btn.onclick = function() { me.edit(); }
|
||||
|
||||
this.del_btn = $a($td(this.tab,0,2),'div','wn-icon ' + 'ic-trash', {cursor:'pointer'});
|
||||
this.del_btn.onclick = function() { me.delete_item(); }
|
||||
|
||||
widget.decorator.render_item(this, det);
|
||||
}
|
||||
|
||||
HomeWidgetItem.prototype.edit = function() {
|
||||
this.widget.make_dialog();
|
||||
this.widget.decorator.set_dialog_values(this.det);
|
||||
this.widget.dialog.show();
|
||||
}
|
||||
|
||||
HomeWidgetItem.prototype.delete_item = function() {
|
||||
var me = this;
|
||||
this.wrapper.innerHTML = '<span style="color:#888">Deleting...</span>';
|
||||
var callback = function(r,rt) {
|
||||
$(me.wrapper).slideUp();
|
||||
}
|
||||
$c_obj('Home Control',this.widget.delete_method, this.widget.get_item_id(this.det) ,callback);
|
||||
|
||||
}
|
||||
|
||||
// Calendar
|
||||
// ===========================
|
||||
|
||||
HomeCalendar = function(widget, wrapper) {
|
||||
// calendar link
|
||||
$ln(widget.footer,'Full Calendar',function() { loadpage('_calendar'); },{marginLeft:'7px', fontSize:'11px', color:'#888'})
|
||||
|
||||
this.widget = widget;
|
||||
|
||||
// methods
|
||||
this.widget.get_list_method = 'get_events_list'
|
||||
this.widget.delete_method = 'delete_event';
|
||||
this.widget.no_items_message = 'You have no events in the next 7 days';
|
||||
this.widget.get_item_id = function(det) { return det.name; }
|
||||
|
||||
this.widget.decorator = this;
|
||||
|
||||
var hl = [];
|
||||
for(var i=0; i<24; i++) {
|
||||
hl.push(((i+8) % 24) + ':00');
|
||||
}
|
||||
|
||||
this.widget.dialog_fields = [
|
||||
{fieldtype:'Date', fieldname:'event_date', label:'Event Date', reqd:1},
|
||||
{fieldtype:'Time', fieldname:'event_hour', label:'Event Time', reqd:1},
|
||||
{fieldtype:'Text', fieldname:'description', label:'Description', reqd:1},
|
||||
{fieldtype:'Button', fieldname:'save', label:'Save'}
|
||||
];
|
||||
|
||||
this.widget.refresh();
|
||||
}
|
||||
|
||||
// create calendar grid
|
||||
// --------------------
|
||||
HomeCalendar.prototype.setup_body = function() {
|
||||
var w = this.widget;
|
||||
w.date_blocks = {};
|
||||
for(var i=0; i<7; i++) {
|
||||
var dt = dateutil.obj_to_str(dateutil.add_days(new Date(),i));
|
||||
var div = $a(w.body, 'div', '', {padding:'4px 0px', borderBottom:'1px solid #AAA',display:'none'});
|
||||
div.head = $a(div, 'div', '', {fontWeight:'bold', paddingBottom:'4px'});
|
||||
div.head.innerHTML = (i==0 ? 'Today' : (i==1 ? 'Tomorrow' : dateutil.str_to_user(dt)))
|
||||
w.date_blocks[dt] = div;
|
||||
}
|
||||
}
|
||||
|
||||
HomeCalendar.prototype.get_item_parent = function(det) {
|
||||
var d = this.widget.date_blocks[det.event_date]; $ds(d);
|
||||
return d;
|
||||
}
|
||||
|
||||
HomeCalendar.prototype.render_item = function(item, det) {
|
||||
var tab = make_table($td(item.tab, 0, 0), 1, 2, '100%', ['48px', null], {padding:'2px', lineHeight:'1.5em'});
|
||||
$y(tab, {tableLayout:'fixed'});
|
||||
|
||||
$td(tab, 0, 0).innerHTML = '<span style="color:#888">' + det.event_hour + ':</span> ';
|
||||
$a($td(tab, 0, 1), 'span', 'social', {}, replace_newlines(det.description));
|
||||
|
||||
if(det.ref_type && det.ref_name && det.ref_name != 'None') {
|
||||
var span=$a($a($td(tab, 0, 1),'div'),'span','link_type');
|
||||
span.innerHTML = det.ref_name; span.dt = det.ref_type;
|
||||
span.onclick = function() { loaddoc(this.dt, this.innerHTML); }
|
||||
}
|
||||
}
|
||||
|
||||
HomeCalendar.prototype.clear_dialog = function() {
|
||||
this.set_dialog_values({event_date:get_today(), event_hour:'8:00', description:''});
|
||||
}
|
||||
|
||||
HomeCalendar.prototype.set_dialog_values = function(det) {
|
||||
var d = this.widget.dialog;
|
||||
d.set_values(det);
|
||||
d.det = det;
|
||||
}
|
||||
|
||||
HomeCalendar.prototype.save = function(btn) {
|
||||
var d = this.widget.dialog;
|
||||
var me = this;
|
||||
var det = d.get_values();
|
||||
|
||||
if(!det) {
|
||||
btn.done_working();
|
||||
return;
|
||||
}
|
||||
|
||||
det.name = d.det.name;
|
||||
det.owner = user;
|
||||
if(!det.event_type)
|
||||
det.event_type = 'Private';
|
||||
|
||||
var callback = function(r,rt) {
|
||||
btn.done_working();
|
||||
me.widget.dialog.hide();
|
||||
me.widget.refresh();
|
||||
}
|
||||
$c_obj('Home Control','edit_event',JSON.stringify(det),callback);
|
||||
}
|
||||
|
||||
// Todo
|
||||
// ===========================
|
||||
|
||||
HomeToDo = function(widget) {
|
||||
this.widget = widget;
|
||||
|
||||
// methods
|
||||
this.widget.get_list_method = 'get_todo_list';
|
||||
this.widget.delete_method = 'remove_todo_item';
|
||||
this.widget.no_items_message = 'Nothing to do?';
|
||||
this.widget.get_item_id = function(det) { return det[0]; }
|
||||
|
||||
this.widget.decorator = this;
|
||||
|
||||
this.widget.dialog_fields = [
|
||||
{fieldtype:'Date', fieldname:'date', label:'Event Date', reqd:1},
|
||||
{fieldtype:'Text', fieldname:'description', label:'Description', reqd:1},
|
||||
{fieldtype:'Check', fieldname:'checked', label:'Completed'},
|
||||
{fieldtype:'Select', fieldname:'priority', label:'Priority', reqd:1, 'options':['Medium','High','Low'].join('\n')},
|
||||
{fieldtype:'Button', fieldname:'save', label:'Save'}
|
||||
];
|
||||
|
||||
this.widget.refresh();
|
||||
}
|
||||
|
||||
HomeToDo.prototype.render_item = function(item, det) {
|
||||
|
||||
// priority tag
|
||||
var tab = make_table($td(item.tab, 0, 0), 1, 2, '100%', ['48px', null], {padding:'2px'});
|
||||
$y(tab, {tableLayout:'fixed'});
|
||||
|
||||
var span = $a($td(tab, 0, 0), 'span', '', {padding:'2px',color:'#FFF',fontSize:'10px'
|
||||
,backgroundColor:(det[3]=='Low' ? '#888' : (det[3]=='High' ? '#EDA857' : '#687FD3'))});
|
||||
|
||||
$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');
|
||||
span.innerHTML = det[3];
|
||||
|
||||
// text
|
||||
var span = $a($td(tab, 0, 1), 'span', 'social', {lineHeight:'1.5em'}, replace_newlines(det[1]));
|
||||
if(det[4]) $y(span,{textDecoration:'line-through'});
|
||||
|
||||
// if expired & open, then in red
|
||||
if(!det[4] && dateutil.str_to_obj(det[2]) < new Date()) {
|
||||
$y(span,{color:'RED'});
|
||||
$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]) + ' (Overdue)');
|
||||
} else {
|
||||
$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]));
|
||||
}
|
||||
}
|
||||
|
||||
HomeToDo.prototype.clear_dialog = function() {
|
||||
this.set_dialog_values(['','',get_today(),'Medium',0]);
|
||||
}
|
||||
|
||||
HomeToDo.prototype.set_dialog_values = function(det) {
|
||||
var d = this.widget.dialog;
|
||||
d.set_values({
|
||||
date: det[2],
|
||||
priority: det[3],
|
||||
description: det[1],
|
||||
checked: det[4]
|
||||
});
|
||||
d.det = det;
|
||||
}
|
||||
|
||||
HomeToDo.prototype.save = function(btn) {
|
||||
var d = this.widget.dialog;
|
||||
var me = this;
|
||||
|
||||
var det = d.get_values()
|
||||
if(!det) {
|
||||
btn.done_working();
|
||||
return;
|
||||
}
|
||||
|
||||
det.name = d.det ? d.det[0] : '';
|
||||
|
||||
var callback = function(r,rt) {
|
||||
btn.done_working();
|
||||
me.widget.dialog.hide();
|
||||
me.widget.refresh();
|
||||
}
|
||||
$c_obj('Home Control','add_todo_item',JSON.stringify(det),callback);
|
||||
}
|
||||
|
||||
// Feed
|
||||
// ==================================
|
||||
|
||||
|
||||
FeedList = function(parent) {
|
||||
// settings
|
||||
this.auto_feed_off = cint(sys_defaults.auto_feed_off);
|
||||
|
||||
this.wrapper = $a(parent, 'div');
|
||||
this.make_head();
|
||||
this.make_list();
|
||||
this.list.run();
|
||||
}
|
||||
|
||||
FeedList.prototype.make_head = function() {
|
||||
var me = this;
|
||||
this.head = $a(this.wrapper, 'div', '', {marginBottom:'8px'});
|
||||
|
||||
// head
|
||||
|
||||
$a(this.head,'h1','', {display:'inline'}, 'Home');
|
||||
$a(this.head,'span','link_type', {marginLeft:'7px'}, '[?]', function() {
|
||||
msgprint('<b>What appears here?</b> This is where you get updates of everything you are allowed to access and generates an update')
|
||||
})
|
||||
|
||||
// refresh
|
||||
$a(this.head,'span','link_type',
|
||||
{cursor:'pointer', marginLeft:'7px', fontSize:'11px'}, 'refresh',
|
||||
function() { me.run(); }
|
||||
);
|
||||
}
|
||||
|
||||
FeedList.prototype.run = function() {
|
||||
this.prev_date = null;
|
||||
this.list.run();
|
||||
}
|
||||
|
||||
FeedList.prototype.make_list = function() {
|
||||
this.list_area = $a(this.wrapper,'div')
|
||||
this.no_result = $a(this.wrapper, 'div','help_box',{display:'none'},'Nothing to show yet. Your feed will be updated as you start your activities')
|
||||
|
||||
var l = new Listing('Feed List',1);
|
||||
var me = this;
|
||||
|
||||
// style
|
||||
l.colwidths = ['100%']; l.page_len = 20;
|
||||
l.opts.cell_style = {padding:'0px'};
|
||||
l.opts.hide_rec_label = 1;
|
||||
|
||||
// build query
|
||||
l.get_query = function(){
|
||||
this.query = repl('select \
|
||||
distinct t1.name, t1.doc_type, t1.doc_name, t1.subject, t1.modified_by, \
|
||||
concat(ifnull(t2.first_name,""), " ", ifnull(t2.last_name,"")), t1.modified, t1.color \
|
||||
from tabFeed t1, tabProfile t2, tabUserRole t3, tabDocPerm t4 \
|
||||
where t1.doc_type = t4.parent \
|
||||
and t2.name = t1.owner \
|
||||
and t3.parent = "%(user)s" \
|
||||
and t4.role = t3.role \
|
||||
and ifnull(t4.`read`,0) = 1 \
|
||||
order by t1.modified desc', {user:user})
|
||||
this.query_max = ''
|
||||
}
|
||||
|
||||
// render list ui
|
||||
l.show_cell = function(cell,ri,ci,d){ me.render_feed(cell,ri,ci,d); }
|
||||
|
||||
// onrun
|
||||
l.onrun = function(){ $(me.wrapper).fadeIn(); if(me.after_run) me.after_run(); }
|
||||
|
||||
// make
|
||||
l.make(this.list_area);
|
||||
$dh(l.btn_area);
|
||||
|
||||
this.list = l;
|
||||
}
|
||||
|
||||
FeedList.prototype.after_run = function() {
|
||||
this.list.has_data() ? $dh(this.no_result) : $ds(this.no_result)
|
||||
}
|
||||
|
||||
FeedList.prototype.render_feed = function(cell,ri,ci,d) {
|
||||
new FeedItem(cell, d[ri], this);
|
||||
}
|
||||
|
||||
// Item
|
||||
// -------------------------------
|
||||
|
||||
FeedItem = function(cell, det, feedlist) {
|
||||
var me = this;
|
||||
|
||||
this.det = det; this.feedlist = feedlist;
|
||||
this.wrapper = $a(cell,'div','',{paddingBottom:'4px'});
|
||||
this.head = $a(this.wrapper,'div');
|
||||
|
||||
this.tab = make_table(this.wrapper, 1, 2, '100%', [(100/7)+'%', (600/7)+'%']);
|
||||
$y(this.tab,{tableLayout:'fixed'})
|
||||
|
||||
// image
|
||||
$y($td(this.tab,0,0),{textAlign:'right',paddingRight:'4px'});
|
||||
|
||||
// text
|
||||
this.text_area = $a($td(this.tab,0,1), 'div');
|
||||
this.render_references(this.text_area, det);
|
||||
|
||||
this.render_tag(det);
|
||||
|
||||
// add day separator
|
||||
this.add_day_sep(det);
|
||||
}
|
||||
|
||||
// Day separator
|
||||
// -------------------------------------------------
|
||||
|
||||
FeedItem.prototype.add_day_sep = function(det) {
|
||||
var me = this;
|
||||
var prev_date = det[6].split(' ')[0];
|
||||
|
||||
var make_div = function() {
|
||||
var div = $a(me.head, 'div', '',
|
||||
{borderBottom:'1px solid #888', margin:'8px 0px', padding:'2px 0px', color:'#888', fontSize:'11px'});
|
||||
div.innerHTML = comment_when(det[6], 1);
|
||||
|
||||
// today?
|
||||
if(prev_date==get_today()) {
|
||||
div.innerHTML = '';
|
||||
span = $a(div, 'span', '', {padding:'2px', color:'#000', fontWeight:'bold'});
|
||||
span.innerHTML = 'Today';
|
||||
}
|
||||
}
|
||||
|
||||
if(this.feedlist.prev_date && this.feedlist.prev_date != prev_date) { make_div(); }
|
||||
if(!this.feedlist.prev_date) { make_div(); }
|
||||
this.feedlist.prev_date = prev_date;
|
||||
}
|
||||
|
||||
// Tag
|
||||
// -------------------------------------------------
|
||||
|
||||
FeedItem.prototype.render_tag = function(det) {
|
||||
tag = $a($td(this.tab,0,0), 'div', '',
|
||||
{color:'#FFF', padding:'3px', textAlign:'right', fontSize:'11px', whiteSpace:'nowrap', overflow:'hidden', cursor:'pointer'});
|
||||
$br(tag,'3px');
|
||||
$y(tag, {backgroundColor:(det[7] ? det[7] : '#273')});
|
||||
tag.innerHTML = get_doctype_label(det[1]);
|
||||
tag.dt = det[1]
|
||||
tag.onclick = function() { loaddocbrowser(this.dt); }
|
||||
}
|
||||
|
||||
FeedItem.prototype.render_references = function(div, det) {
|
||||
// name
|
||||
div.tab = make_table(div, 1, 2, '100%', [null, '15%'])
|
||||
//div.innerHTML = '<b>' + (strip(det[11]) ? det[11] : det[2]) + ' (' + cint(det[12]) + '): </b> has ' + det[7] + ' ';
|
||||
|
||||
var dt = det[1]; var dn = det[2]
|
||||
|
||||
// link
|
||||
var allow = in_list(profile.can_read, dt);
|
||||
var span = $a($td(div.tab,0,0), 'span', (allow ? 'link_type': ''), null, det[2]);
|
||||
span.dt = dt; span.dn = dn;
|
||||
if(allow) span.onclick = function() { loaddoc(this.dt, this.dn); }
|
||||
|
||||
// subject
|
||||
if(det[3]) {
|
||||
$a($td(div.tab,0,0), 'span', '', {marginLeft:'7px', color:'#444'}, det[3]);
|
||||
}
|
||||
|
||||
// by
|
||||
$y($td(div.tab,0,1), {fontSize:'11px'}).innerHTML = (strip(det[5]) ? det[5] : det[4]);
|
||||
}
|
||||
|
||||
HomeStatusBar = function() {
|
||||
var me = this;
|
||||
var parent = page_body.pages['Event Updates'];
|
||||
this.wrapper = $a($td(parent.main_tab, 0, 1), 'div', 'home-status', {}, 'Loading...');
|
||||
$br(this.wrapper, '3px');
|
||||
|
||||
this.render = function(r) {
|
||||
this.wrapper.innerHTML = '';
|
||||
this.span = $a(this.wrapper, 'span', 'home-status-link')
|
||||
this.span.onclick = function() { loadpage('My Company') }
|
||||
|
||||
if(r.unread_messages) {
|
||||
this.span.innerHTML = '<span class="home-status-unread">' + r.unread_messages + '</span> unread message' + (cint(r.unread_messages) > 1 ? 's' : '');
|
||||
} else {
|
||||
this.span.innerHTML = 'No unread messages.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pscript.home_make_status = function() {
|
||||
var home_status_bar = new HomeStatusBar()
|
||||
var wrapper = page_body.pages['Event Updates'];
|
||||
|
||||
// get values
|
||||
$c_page('event_updates', 'event_updates', 'get_status_details', user,
|
||||
function(r,rt) {
|
||||
|
||||
home_status_bar.render(r.message);
|
||||
|
||||
// system_messages
|
||||
if(r.message.system_message)
|
||||
pscript.show_system_message(wrapper, r.message.system_message);
|
||||
|
||||
// trial
|
||||
if(pscript.is_erpnext_saas && cint(r.message.is_trial) && in_list(user_roles, 'System Manager')) {
|
||||
pscript.trial_box = $a(div, 'div', 'help_box', {margin:'2px 8px 2px 0px'}, "Your Free Trial expires in " +
|
||||
r.message.days_to_expiry + " days. When you are satisfied, please <span class='link_type' onclick='pscript.convert_to_paid()'>please click here</span> to convert to a paid account." +
|
||||
"<br>To get help, view <a href='http://erpnext.blogspot.com/2011/02/getting-started-with-your-erpnext.html' target='_blank'>Getting Started with Your System</a> (opens in a new page)");
|
||||
}
|
||||
|
||||
// render online users
|
||||
pscript.online_users_obj.render(r.message.online_users);
|
||||
pscript.online_users = r.message.online_users;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// show system message
|
||||
// -------------------
|
||||
pscript.convert_to_paid = function() {
|
||||
var callback = function(r,rt) {
|
||||
if(r.exc) { msgprint(r.exc); return; }
|
||||
$(pscript.trial_box).slideUp();
|
||||
}
|
||||
$c_page('event_updates','event_updates','convert_to_paid','',callback)
|
||||
}
|
||||
|
||||
// show system message
|
||||
// -------------------
|
||||
pscript.show_system_message = function(wrapper, msg) {
|
||||
$ds(wrapper.system_message_area);
|
||||
var txt = $a(wrapper.system_message_area, 'div', '', {lineHeight:'1.6em'});
|
||||
txt.innerHTML = msg;
|
||||
|
||||
var span = $ln($a(wrapper.system_message_area, 'div'), 'Dismiss',
|
||||
function(me) {
|
||||
me.set_working();
|
||||
$c_obj('Home Control', 'dismiss_message', '', function(r,rt) {
|
||||
me.done_working();
|
||||
$(wrapper.system_message_area).slideUp();
|
||||
});
|
||||
}, {fontSize:'11px'}
|
||||
)
|
||||
}
|
||||
|
||||
// complete my company registration
|
||||
// --------------------------------
|
||||
pscript.complete_registration = function()
|
||||
{
|
||||
var reg_callback = function(r, rt){
|
||||
if(r.message == 'No'){
|
||||
var d = new Dialog(400, 200, "Please Complete Your Registration");
|
||||
if(user != 'Administrator'){
|
||||
d.no_cancel(); // Hide close image
|
||||
$dh(page_body.wntoolbar.wrapper);
|
||||
}
|
||||
$($a(d.body,'div','', {margin:'8px', color:'#888'})).html('<b>Company Name : </b>'+locals['Control Panel']['Control Panel'].company_name);
|
||||
|
||||
d.make_body(
|
||||
[
|
||||
['Data','Company Abbreviation'],
|
||||
['Select','Fiscal Year Start Date'],
|
||||
['Select','Default Currency'],
|
||||
['Button','Save'],
|
||||
]);
|
||||
|
||||
//d.widgets['Save'].disabled = true; // disable Save button
|
||||
pscript.make_dialog_field(d);
|
||||
|
||||
// submit details
|
||||
d.widgets['Save'].onclick = function()
|
||||
{
|
||||
d.widgets['Save'].set_working();
|
||||
|
||||
flag = pscript.validate_fields(d);
|
||||
if(flag)
|
||||
{
|
||||
var args = [
|
||||
locals['Control Panel']['Control Panel'].company_name,
|
||||
d.widgets['Company Abbreviation'].value,
|
||||
d.widgets['Fiscal Year Start Date'].value,
|
||||
d.widgets['Default Currency'].value
|
||||
];
|
||||
|
||||
$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
|
||||
sys_defaults = r.message;
|
||||
d.hide();
|
||||
$ds(page_body.wntoolbar.wrapper);
|
||||
});
|
||||
}
|
||||
}
|
||||
d.show();
|
||||
}
|
||||
}
|
||||
$c_obj('Home Control','registration_complete','',reg_callback);
|
||||
}
|
||||
|
||||
// make dialog fields
|
||||
// ------------------
|
||||
pscript.make_dialog_field = function(d)
|
||||
{
|
||||
// fiscal year format
|
||||
fisc_format = d.widgets['Fiscal Year Start Date'];
|
||||
add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
|
||||
|
||||
// default currency
|
||||
currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
|
||||
currency = d.widgets['Default Currency'];
|
||||
add_sel_options(currency, currency_list);
|
||||
}
|
||||
|
||||
|
||||
// validate fields
|
||||
// ---------------
|
||||
pscript.validate_fields = function(d)
|
||||
{
|
||||
var lst = ['Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
|
||||
var msg = 'Please enter the following fields';
|
||||
var flag = 1;
|
||||
for(var i=0; i<lst.length; i++)
|
||||
{
|
||||
if(!d.widgets[lst[i]].value){
|
||||
flag = 0;
|
||||
msg = msg + NEWLINE + lst[i];
|
||||
}
|
||||
}
|
||||
|
||||
if(!flag) alert(msg);
|
||||
return flag;
|
||||
}
|
||||
56
event_updates/page/event_updates/event_updates.py
Normal file
56
event_updates/page/event_updates/event_updates.py
Normal file
@@ -0,0 +1,56 @@
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
def get_online_users():
|
||||
# get users
|
||||
return webnotes.conn.sql("""SELECT DISTINCT t1.user, t2.first_name, t2.last_name
|
||||
from tabSessions t1, tabProfile t2
|
||||
where t1.user = t2.name
|
||||
and t1.user not in ('Guest','Administrator')
|
||||
and TIMESTAMPDIFF(HOUR,t1.lastupdate,NOW()) <= 1""", as_list=1) or []
|
||||
|
||||
#
|
||||
# get unread messages
|
||||
#
|
||||
def get_unread_messages():
|
||||
"returns unread (docstatus-0 messages for a user)"
|
||||
return cint(webnotes.conn.sql("""SELECT COUNT(*) FROM `tabComment Widget Record`
|
||||
WHERE comment_doctype='My Company'
|
||||
AND comment_docname = %s
|
||||
AND ifnull(docstatus,0)=0
|
||||
""", webnotes.user.name)[0][0])
|
||||
|
||||
#
|
||||
# Get toolbar items
|
||||
#
|
||||
def get_status_details(arg=None):
|
||||
from webnotes.utils import cint, date_diff, nowdate
|
||||
|
||||
online = get_online_users()
|
||||
|
||||
# system messages
|
||||
msg_id = webnotes.conn.get_global('system_message_id')
|
||||
msg = ''
|
||||
|
||||
if msg_id and msg_id != webnotes.conn.get_global('system_message_id', webnotes.session['user']):
|
||||
msg = webnotes.conn.get_global('system_message')
|
||||
|
||||
return {
|
||||
'user_count': len(online) or 0,
|
||||
'unread_messages': get_unread_messages(),
|
||||
'online_users': online or [],
|
||||
'system_message':msg,
|
||||
'is_trial': webnotes.conn.get_global('is_trial'),
|
||||
'days_to_expiry': (webnotes.conn.get_global('days_to_expiry') or '0')
|
||||
}
|
||||
|
||||
#
|
||||
# Convert to a paid account
|
||||
#
|
||||
def convert_to_paid():
|
||||
from server_tools.server_tools.gateway_utils import convert_to_paid_gateway
|
||||
r = convert_to_paid_gateway()
|
||||
if r['exc']:
|
||||
webnotes.msgprint(r['exc'])
|
||||
raise Exception, r['exc']
|
||||
webnotes.msgprint('Thank you for choosing to convert to a Paid Account!')
|
||||
1
event_updates/page/event_updates/event_updates.txt
Normal file
1
event_updates/page/event_updates/event_updates.txt
Normal file
@@ -0,0 +1 @@
|
||||
[{'creation': '2010-07-13 12:51:53', 'module': 'Event Updates', 'doctype': 'Page', 'owner': 'Administrator', 'style': None, 'modified_by': 'Administrator', 'script': None, 'show_in_menu': None, 'content': None, 'page_name': 'Event Updates', 'menu_index': None, 'docstatus': 0, 'parent': None, 'standard': 'Yes', 'icon': None, 'name': 'Event Updates', 'idx': None, 'static_content': None, 'modified': '2010-11-27 14:59:10', 'parenttype': None, 'parent_node': None, 'parentfield': None}]
|
||||
@@ -0,0 +1 @@
|
||||
Event Updates
|
||||
0
event_updates/page/profile_settings/__init__.py
Normal file
0
event_updates/page/profile_settings/__init__.py
Normal file
19
event_updates/page/profile_settings/profile_settings.comp.js
Normal file
19
event_updates/page/profile_settings/profile_settings.comp.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
pscript['onload_profile-settings']=function(){var wrapper=page_body.pages['profile-settings'];pscript.myprofile=new MyProfile(wrapper)}
|
||||
MyProfile=function(wrapper){this.wrapper=wrapper;var me=this;this.make=function(){this.head=new PageHeader(this.wrapper,'My Profile Settings');this.head.add_button('Change Password',this.change_password)
|
||||
this.tab=make_table($a(this.wrapper,'div','',{marginTop:'19px'}),1,2,'90%',['50%','50%'],{padding:'11px'})
|
||||
this.img=$a($td(this.tab,0,0),'img');set_user_img(this.img,user);$btn($a($td(this.tab,0,0),'div','',{marginTop:'11px'}),'Change Image',this.change_image)
|
||||
this.make_form();this.load_details();}
|
||||
this.load_details=function(){$c_page('event_updates','profile_settings','get_user_details','',function(r,rt){me.form.set_values(r.message);})}
|
||||
this.make_form=function(){var div=$a($td(this.tab,0,1),'div');this.form=new wn.widgets.FieldGroup()
|
||||
this.form.make_fields(div,[{fieldname:'first_name',fieldtype:'Data',label:'First Name',reqd:1},{fieldname:'last_name',fieldtype:'Data',label:'Last Name',reqd:1},{fieldname:'bio',fieldtype:'Text',label:'Bio'},{fieldname:'update',fieldtype:'Button',label:'Update'}]);this.form.fields_dict.update.input.onclick=function(){var v=me.form.get_values();if(v){this.set_working();var btn=this;$c_page('event_updates','profile_settings','set_user_details',v,function(r,rt){btn.done_working();})}}}
|
||||
this.change_password=function(){var d=new wn.widgets.Dialog({title:'Change Password',width:400,fields:[{fieldname:'old_password',fieldtype:'Password',label:'Old Password',reqd:1},{fieldname:'new_password',fieldtype:'Password',label:'New Password',reqd:1},{fieldname:'new_password1',fieldtype:'Password',label:'Re-type New Password',reqd:1},{fieldname:'change',fieldtype:'Button',label:'Change'}]})
|
||||
d.make();d.fields_dict.change.input.onclick=function(){var v=d.get_values();if(v){if(v.new_password!=v.new_password1){msgprint('Passwords must match');return;}
|
||||
this.set_working();$c_page('event_updates','profile_settings','change_password',v,function(r,rt){if(!r.message&&r.exc){msgprint(r.exc);return;}
|
||||
d.hide();})}}
|
||||
d.show();}
|
||||
this.change_image=function(){if(!me.change_dialog){var d=new Dialog(400,200,'Set Your Profile Image');d.make_body([['HTML','wrapper']]);var w=d.widgets['wrapper'];me.uploader=new Uploader(w,{thumbnail:'80px',server_obj:'Company Control',method:'update_profile_image'},pscript.user_image_upload)
|
||||
me.change_dialog=d;}
|
||||
me.change_dialog.show();}
|
||||
this.make();}
|
||||
pscript.user_image_upload=function(fid){msgprint('File Uploaded');if(fid){pscript.myprofile.change_dialog.hide();set_user_img(pscript.myprofile.img,user,null,fid);}}
|
||||
114
event_updates/page/profile_settings/profile_settings.js
Normal file
114
event_updates/page/profile_settings/profile_settings.js
Normal file
@@ -0,0 +1,114 @@
|
||||
pscript['onload_profile-settings'] = function() {
|
||||
var wrapper = page_body.pages['profile-settings'];
|
||||
pscript.myprofile = new MyProfile(wrapper)
|
||||
}
|
||||
|
||||
MyProfile = function(wrapper) {
|
||||
this.wrapper = wrapper;
|
||||
var me = this;
|
||||
|
||||
this.make = function() {
|
||||
this.head = new PageHeader(this.wrapper, 'My Profile Settings');
|
||||
this.head.add_button('Change Password', this.change_password)
|
||||
this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}),
|
||||
1, 2, '90%', ['50%', '50%'], {padding:'11px'})
|
||||
this.img = $a($td(this.tab, 0, 0), 'img');
|
||||
set_user_img(this.img, user);
|
||||
|
||||
$btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image)
|
||||
|
||||
this.make_form();
|
||||
this.load_details();
|
||||
}
|
||||
|
||||
this.load_details = function() {
|
||||
$c_page('event_updates','profile_settings','get_user_details','',function(r, rt) {
|
||||
me.form.set_values(r.message);
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
// form
|
||||
//
|
||||
this.make_form = function() {
|
||||
var div = $a($td(this.tab, 0, 1), 'div');
|
||||
this.form = new wn.widgets.FieldGroup()
|
||||
this.form.make_fields(div, [
|
||||
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
|
||||
{fieldname:'last_name', fieldtype:'Data',label:'Last Name',reqd:1},
|
||||
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
|
||||
{fieldname:'update', fieldtype:'Button',label:'Update'}
|
||||
]);
|
||||
|
||||
this.form.fields_dict.update.input.onclick = function() {
|
||||
var v = me.form.get_values();
|
||||
if(v) {
|
||||
this.set_working();
|
||||
var btn = this;
|
||||
$c_page('event_updates','profile_settings','set_user_details',v,function(r, rt) {
|
||||
btn.done_working();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// change password
|
||||
//
|
||||
this.change_password = function() {
|
||||
var d = new wn.widgets.Dialog({
|
||||
title:'Change Password',
|
||||
width: 400,
|
||||
fields: [
|
||||
{fieldname:'old_password', fieldtype:'Password', label:'Old Password', reqd:1 },
|
||||
{fieldname:'new_password', fieldtype:'Password', label:'New Password', reqd:1 },
|
||||
{fieldname:'new_password1', fieldtype:'Password', label:'Re-type New Password', reqd:1 },
|
||||
{fieldname:'change', fieldtype:'Button', label:'Change'}
|
||||
]
|
||||
})
|
||||
d.make();
|
||||
d.fields_dict.change.input.onclick = function() {
|
||||
var v = d.get_values();
|
||||
if(v) {
|
||||
if(v.new_password != v.new_password1) {
|
||||
msgprint('Passwords must match'); return;
|
||||
}
|
||||
this.set_working();
|
||||
$c_page('event_updates','profile_settings','change_password',v,function(r,rt) {
|
||||
if(!r.message && r.exc) { msgprint(r.exc); return; }
|
||||
d.hide();
|
||||
})
|
||||
}
|
||||
}
|
||||
d.show();
|
||||
}
|
||||
|
||||
//
|
||||
// change image
|
||||
//
|
||||
|
||||
this.change_image = function() {
|
||||
if(!me.change_dialog) {
|
||||
|
||||
var d = new Dialog(400,200,'Set Your Profile Image');
|
||||
d.make_body([
|
||||
['HTML','wrapper']
|
||||
]);
|
||||
|
||||
var w = d.widgets['wrapper'];
|
||||
me.uploader = new Uploader(w, {thumbnail:'80px', server_obj:'Company Control', method:'update_profile_image'}, pscript.user_image_upload)
|
||||
me.change_dialog = d;
|
||||
}
|
||||
me.change_dialog.show();
|
||||
}
|
||||
this.make();
|
||||
}
|
||||
|
||||
pscript.user_image_upload = function(fid) {
|
||||
msgprint('File Uploaded');
|
||||
|
||||
if(fid) {
|
||||
pscript.myprofile.change_dialog.hide();
|
||||
set_user_img(pscript.myprofile.img, user, null, fid);
|
||||
}
|
||||
}
|
||||
34
event_updates/page/profile_settings/profile_settings.py
Normal file
34
event_updates/page/profile_settings/profile_settings.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import load_json, cint, nowdate
|
||||
|
||||
#
|
||||
# change profile (remote)
|
||||
#
|
||||
def change_password(arg):
|
||||
arg = load_json(arg)
|
||||
|
||||
if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
|
||||
import server_tools.server_tools.gateway_utils
|
||||
webnotes.msgprint(server_tools.server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
|
||||
else:
|
||||
if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
|
||||
webnotes.msgprint('Old password is not correct', raise_exception=1)
|
||||
|
||||
from webnotes.utils import nowdate
|
||||
webnotes.conn.sql("update tabProfile set password=password(%s), password_last_updated=%s where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
|
||||
webnotes.msgprint('Password Updated');
|
||||
|
||||
def get_user_details(arg=None):
|
||||
"Returns user first name, last name and bio"
|
||||
|
||||
return webnotes.conn.sql("select first_name, last_name, bio from tabProfile where name=%s", webnotes.user.name, as_dict=1)[0]
|
||||
|
||||
def set_user_details(arg=None):
|
||||
"updates user details given in argument"
|
||||
from webnotes.model.doc import Document
|
||||
|
||||
p = Document('Profile', webnotes.user.name)
|
||||
p.fields.update(load_json(arg))
|
||||
p.save()
|
||||
webnotes.msgprint('Updated')
|
||||
26
event_updates/page/profile_settings/profile_settings.txt
Normal file
26
event_updates/page/profile_settings/profile_settings.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
'content': None,
|
||||
'creation': '2011-05-09 11:04:27',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Page',
|
||||
'icon': None,
|
||||
'idx': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-04-13 12:08:59',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'Profile Settings',
|
||||
'owner': 'Administrator',
|
||||
'page_name': 'Profile Settings',
|
||||
'parent': None,
|
||||
'parent_node': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'script': None,
|
||||
'show_in_menu': None,
|
||||
'standard': 'Yes',
|
||||
'static_content': None,
|
||||
'style': None
|
||||
}
|
||||
]
|
||||
0
event_updates/search_criteria/__init__.py
Normal file
0
event_updates/search_criteria/__init__.py
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '`tabPayable Voucher`.outstanding_amount!=0\n`tabPayable Voucher`.docstatus=1',
|
||||
'add_tab': None,
|
||||
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Voucher Date,Payable Voucher\x01Due Date,Payable Voucher\x01Credit To,Payable Voucher\x01Bill Date,Payable Voucher\x01Outstanding Amount',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Bills-To be paid',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Payable Voucher',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Payable Voucher\x01Submitted':1,'Payable Voucher\x01Is Opening':'','Payable Voucher\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:26:48',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'bills-to_be_paid',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabPayable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Voucher Date,Payable Voucher\x01Due Date,Payable Voucher\x01Credit To,Payable Voucher\x01Bill No,Payable Voucher\x01Bill Date,Payable Voucher\x01Outstanding Amount',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Bills-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Payable Voucher',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Payable Voucher\x01Saved':1,'Payable Voucher\x01Is Opening':'','Payable Voucher\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-03 12:24:43',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'bills-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabPayable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': 'ifnull(`tabDelivery Note`.per_billed, 0) < 100',
|
||||
'add_tab': None,
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Owner,Delivery Note\x01Customer Name,Delivery Note\x01% Billed,Delivery Note\x01Company',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Delivery Note-To be billed',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Delivery Note',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Delivery Note\x01Submitted':1,'Delivery Note\x01Status':'Submitted','Delivery Note\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:24:34',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'delivery_note-to_be_billed',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabDelivery Note`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Owner,Delivery Note\x01Customer Name,Delivery Note\x01Posting Date,Delivery Note\x01Company',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Delivery Note-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Delivery Note',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Delivery Note\x01Saved':1,'Delivery Note\x01Status':'Draft','Delivery Note\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:17:58',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'delivery_note-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabDelivery Note`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '`tabQuotation`.enq_no!=`tabEnquiry`.name\n',
|
||||
'add_tab': 'tabQuotation',
|
||||
'columns': 'Enquiry\x01ID,Enquiry\x01Owner',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Enquiry-Quotations to be sent',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Enquiry',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': '{}',
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-07-16 13:29:58',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'enquiry-quotations_to_be_sent',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabEnquiry`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,5 @@
|
||||
report.customize_filters = function() {
|
||||
|
||||
this.filter_fields_dict['Enquiry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Enquiry'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': '',
|
||||
'add_cond': "`tabEnquiry`.name=`tabQuotation`.enq_no\n`tabEnquiry`.docstatus=1\n`tabQuotation`.status='Submitted'",
|
||||
'add_tab': None,
|
||||
'columns': 'Enquiry\x01ID,Enquiry\x01Owner,Enquiry\x01Company,Enquiry\x01Fiscal Year',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Enquiry-To follow up',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Enquiry',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Enquiry\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 12:08:00',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'enquiry-to_follow_up',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabEnquiry`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabIndent`.status='Submitted'\nifnull(`tabIndent`.per_ordered,0)<100",
|
||||
'add_tab': '',
|
||||
'columns': 'Indent\x01ID,Indent\x01Indent Date,Indent\x01Requested By,Indent\x01Owner,Indent\x01% Ordered',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Indent-Purchase Order to be made',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Indent',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Indent\x01Submitted':1,'Indent\x01Status':'Submitted','Indent\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:37:18',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'indent-purchase_order_to_be_made',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabIndent`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabIndent`.status='Draft'",
|
||||
'add_tab': None,
|
||||
'columns': 'Indent\x01ID,Indent\x01Owner,Indent\x01Indent Date,Indent\x01Remarks',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Indent-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Indent',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Indent\x01Saved':1,'Indent\x01Status':'Draft','Indent\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:38:49',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'indent-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabIndent`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '`tabReceivable Voucher`.due_date<now()\n`tabReceivable Voucher`.outstanding_amount!=0\n`tabReceivable Voucher`.docstatus=1',
|
||||
'add_tab': None,
|
||||
'columns': 'Receivable Voucher\x01ID,Receivable Voucher\x01Debit To,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Due Date,Receivable Voucher\x01Outstanding Amount',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Invoices-Overdue',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Saved':1,'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-04-30 17:08:52',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'invoices-overdue',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabReceivable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '',
|
||||
'add_tab': None,
|
||||
'columns': 'Receivable Voucher\x01ID,Receivable Voucher\x01Debit To,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Due Date',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Invoices-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Saved':1,'Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-03 10:18:56',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'invoices-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabReceivable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '`tabReceivable Voucher`.due_date>now() \n`tabReceivable Voucher`.outstanding_amount!=0\n`tabReceivable Voucher`.docstatus=1',
|
||||
'add_tab': None,
|
||||
'columns': 'Receivable Voucher\x01ID,Receivable Voucher\x01Owner,Receivable Voucher\x01Debit To,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Due Date,Receivable Voucher\x01Outstanding Amount',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Invoices-To receive payment',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-04-30 16:54:26',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'invoices-to_receive_payment',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabReceivable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,5 @@
|
||||
report.customize_filters = function() {
|
||||
this.filter_fields_dict['Lead'+FILTER_SEP +'Status'].df.filter_hide = 1;
|
||||
this.filter_fields_dict['Lead'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabLead`.status!='Converted' \n`tabLead`.status!='Lead Lost' \n`tabLead`.status!='Not Interested'",
|
||||
'add_tab': None,
|
||||
'columns': 'Lead\x01ID,Lead\x01Status,Lead\x01Lead Name,Lead\x01Lead Date,Lead\x01Lead Owner,Lead\x01Next Contact Date',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Lead-To follow up',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Lead',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Lead\x01Status':'','Lead\x01Source':'','Lead\x01Expected Month':'','Lead\x01Industry':'','Lead\x01Market Segment':'','Lead\x01Rating':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 12:01:19',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'lead-to_follow_up',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabLead`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "ifnull(`tabPurchase Order`.per_billed,0)<100\n`tabPurchase Order`.status='Submitted'",
|
||||
'add_tab': None,
|
||||
'columns': 'Purchase Order\x01ID,Purchase Order\x01Supplier,Purchase Order\x01PO Date,Purchase Order\x01Company,Purchase Order\x01Grand Total',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Purchase Order-To be billed',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Purchase Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Purchase Order\x01Submitted':1,'Purchase Order\x01Status':'Submitted','Purchase Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:31:42',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'purchase_order-to_be_billed',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabPurchase Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Purchase Order\x01ID,Purchase Order\x01Supplier,Purchase Order\x01PO Date,Purchase Order\x01Company,Purchase Order\x01Grand Total',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Purchase Order-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Purchase Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Purchase Order\x01Saved':1,'Purchase Order\x01Submitted':0,'Purchase Order\x01Status':'Draft','Purchase Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-03 11:19:23',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'purchase_order-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabPurchase Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "ifnull(`tabPurchase Order`.per_received,0)<100\n`tabPurchase Order`.status='Submitted'",
|
||||
'add_tab': None,
|
||||
'columns': 'Purchase Order\x01ID,Purchase Order\x01Supplier,Purchase Order\x01PO Date,Purchase Order\x01Company,Purchase Order\x01% Received,Purchase Order\x01Grand Total',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Purchase Order-To receive items',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Purchase Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Purchase Order\x01Submitted':1,'Purchase Order\x01Status':'Submitted','Purchase Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:34:22',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'purchase_order-to_receive_items',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabPurchase Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Customer'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'ID'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Quotation No'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Sales Partner'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'From Sales Order Date'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'To Sales Order Date'].df.filter_hide = 0;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': '`tabSales Order`.delivery_date<now()\nifnull(`tabSales Order`.per_delivered,0)<100',
|
||||
'add_tab': None,
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Customer,Sales Order\x01Sales Order Date,Sales Order\x01Expected Delivery Date,Sales Order\x01Quotation No,Sales Order\x01Company,Sales Order\x01% Delivered',
|
||||
'creation': '2010-08-26 11:52:27',
|
||||
'criteria_name': 'Sales Order-Overdue',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Sales Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Submitted':1,'Sales Order\x01Status':'Submitted','Sales Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-26 11:52:09',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'sales_order-overdue',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSales Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "ifnull(`tabSales Order`.per_billed,0)<100\n`tabSales Order`.status='Submitted'",
|
||||
'add_tab': None,
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Status,Sales Order\x01Quotation No,Sales Order\x01Sales Order Date,Sales Order\x01Expected Delivery Date,Sales Order\x01% Billed,Sales Order\x01Customer',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Sales Order-To be billed',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Sales Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Submitted':1,'Sales Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:45:37',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'sales_order-to_be_billed',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSales Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "ifnull(`tabSales Order`.per_delivered,0)<100\n`tabSales Order`.status = 'Submitted'\n`tabSales Order`. delivery_date > now()",
|
||||
'add_tab': None,
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Owner,Sales Order\x01Status,Sales Order\x01Customer,Sales Order\x01Sales Order Date,Sales Order\x01Expected Delivery Date,Sales Order\x01Quotation No',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Sales Order-To be delivered',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Sales Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Saved':1,'Sales Order\x01Submitted':1,'Sales Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:53:29',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'sales_order-to_be_delivered',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 100,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': '',
|
||||
'sort_by': '`tabSales Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabSales Order`.status='Draft'",
|
||||
'add_tab': None,
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Customer,Sales Order\x01Sales Order Date,Sales Order\x01Quotation No',
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'criteria_name': 'Sales Order-To be submitted',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Sales Order',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Saved':1,'Sales Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-05-13 17:47:45',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'sales_order-to_be_submitted',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 100,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSales Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': '',
|
||||
'add_cond': '`tab Serial No`.month(amc_expiry_date)=month(now()) \n`tab Serial No`.year(amc_expiry_date)=year(now())',
|
||||
'add_tab': None,
|
||||
'columns': 'Serial No\x01ID,Serial No\x01Status,Serial No\x01AMC Expiry Date,Serial No\x01Customer Name',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Serial No-AMC expiring this month',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Serial No',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Serial No\x01Saved':1,'Serial No\x01Submitted':1,'Serial No\x01Status':'','Serial No\x01Warranty Status':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-07-29 15:01:33',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'serial_no-amc_expiring_this_month',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSerial No`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': '',
|
||||
'add_cond': "`tab Serial No`.docstatus!=2\n`tab Serial No`.maintenance_status='Under Warranty'\n`tab Serial No`.status!='Scrapped'\n`tab Serial No`.status!='Not in Use'\n`tab Serial No`.month(ifnull(warranty_expiry_date,0)) = month(now()) \n`tab Serial No`.yearmonth(ifnull(warranty_expiry_date,0)) = year(now())",
|
||||
'add_tab': None,
|
||||
'columns': 'Serial No\x01ID,Serial No\x01Status,Serial No\x01Warranty Expiry Date,Serial No\x01Customer Name',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Serial No-Warranty expiring this month',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Serial No',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Serial No\x01Saved':1,'Serial No\x01Submitted':1,'Serial No\x01Status':'Issued','Serial No\x01Maintenance Status':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-07-23 09:57:51',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'serial_no-warranty_expiring_this_month',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSerial No`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
0
event_updates/search_criteria/task_open/__init__.py
Normal file
0
event_updates/search_criteria/task_open/__init__.py
Normal file
37
event_updates/search_criteria/task_open/task_open.txt
Normal file
37
event_updates/search_criteria/task_open/task_open.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabTicket`.status='Open'",
|
||||
'add_tab': None,
|
||||
'columns': 'Ticket\x01ID,Ticket\x01Subject,Ticket\x01Priority,Ticket\x01Raised By,Ticket\x01Allocated To',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'Task-Open',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Ticket',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Ticket\x01Priority':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-07-16 13:03:49',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Event Updates',
|
||||
'name': 'task-open',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': '',
|
||||
'server_script': None,
|
||||
'sort_by': '`tabTicket`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user