diff --git a/frappe/core/doctype/system_settings/system_settings.json b/frappe/core/doctype/system_settings/system_settings.json index 999e5802c8..49c3a06edf 100644 --- a/frappe/core/doctype/system_settings/system_settings.json +++ b/frappe/core/doctype/system_settings/system_settings.json @@ -71,6 +71,15 @@ "options": "", "permlevel": 0 }, + { + "default": "720:00", + "description": "In Hours", + "fieldname": "session_expiry_mobile", + "fieldtype": "Data", + "label": "Session Expiry Mobile", + "permlevel": 0, + "precision": "" + }, { "description": "Run scheduled jobs only if checked", "fieldname": "enable_scheduler", @@ -91,7 +100,7 @@ ], "icon": "icon-cog", "issingle": 1, - "modified": "2015-05-03 10:35:04.415621", + "modified": "2015-05-18 05:11:38.759688", "modified_by": "Administrator", "module": "Core", "name": "System Settings", diff --git a/frappe/core/doctype/system_settings/system_settings.py b/frappe/core/doctype/system_settings/system_settings.py index b49ee6d553..0e26b8edd5 100644 --- a/frappe/core/doctype/system_settings/system_settings.py +++ b/frappe/core/doctype/system_settings/system_settings.py @@ -11,10 +11,11 @@ from frappe.utils.momentjs import get_all_timezones class SystemSettings(Document): def validate(self): - if self.session_expiry: - parts = self.session_expiry.split(":") - if len(parts)!=2 or not (cint(parts[0]) or cint(parts[1])): - frappe.throw(_("Session Expiry must be in format {0}").format("hh:mm")) + for key in ("session_expiry", "session_expiry_mobile"): + if self.get(key): + parts = self.get(key).split(":") + if len(parts)!=2 or not (cint(parts[0]) or cint(parts[1])): + frappe.throw(_("Session Expiry must be in format {0}").format("hh:mm")) def on_update(self): for df in self.meta.get("fields"): diff --git a/frappe/data/Framework.sql b/frappe/data/Framework.sql index 92d90a3da7..724a303756 100644 --- a/frappe/data/Framework.sql +++ b/frappe/data/Framework.sql @@ -175,6 +175,7 @@ CREATE TABLE `tabSessions` ( `sessiondata` longtext, `ipaddress` varchar(16) DEFAULT NULL, `lastupdate` datetime(6) DEFAULT NULL, + `device` datetime(6) DEFAULT "desktop", `status` varchar(20) DEFAULT NULL, KEY `sid` (`sid`) ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/frappe/patches.txt b/frappe/patches.txt index 500939f9ab..cca44b24d9 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -78,3 +78,4 @@ frappe.patches.v5_0.move_scheduler_last_event_to_system_settings execute:frappe.db.sql("update tabUser set new_password='' where ifnull(new_password, '')!=''") frappe.patches.v5_0.fix_text_editor_file_urls execute:frappe.db.sql("update `tabComment` set comment_type='Comment' where comment_doctype='Blog Post' and ifnull(comment_type, '')=''") +frappe.patches.v5_0.modify_session diff --git a/frappe/patches/v5_0/modify_session.py b/frappe/patches/v5_0/modify_session.py new file mode 100644 index 0000000000..122982da07 --- /dev/null +++ b/frappe/patches/v5_0/modify_session.py @@ -0,0 +1,4 @@ +import frappe + +def execute(): + frappe.db.sql("alter table tabSessions add column `device` varchar(255) default 'desktop'") diff --git a/frappe/public/js/frappe/form/footer/attachments.js b/frappe/public/js/frappe/form/footer/attachments.js index 198fba1e4a..5672588dae 100644 --- a/frappe/public/js/frappe/form/footer/attachments.js +++ b/frappe/public/js/frappe/form/footer/attachments.js @@ -69,7 +69,7 @@ frappe.ui.form.Attachments = Class.extend({ %(file_name)s\ ', { file_name: file_name, - file_url: file_url + file_url: frappe.urllib.get_full_url(file_url) })) .insertAfter(this.attachments_label.addClass("has-attachments")); diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 3fb3e3c759..52065badc7 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -222,6 +222,7 @@ frappe.views.CommunicationComposer = Class.extend({ +__("Add Attachments")+"").appendTo(attach.empty()); $.each(files, function(i, f) { if (!f.file_name) return; + f.file_url = frappe.urllib.get_full_url(f.file_url); $(repl('
' + '