mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Merge pull request #5 from saurabh6790/membership_payments
[fix] rename jobs page to erpnext-job to avoid conflict with erpnext's job application
This commit is contained in:
@@ -290,7 +290,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-03-06 16:04:54.620681",
|
"modified": "2017-03-22 15:30:54.620681",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Foundation",
|
"module": "ERPNext Foundation",
|
||||||
"name": "Portal Job",
|
"name": "Portal Job",
|
||||||
@@ -321,7 +321,7 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"route": "/jobs",
|
"route": "/erpnext-jobs",
|
||||||
"show_name_in_global_search": 0,
|
"show_name_in_global_search": 0,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
|||||||
@@ -10,16 +10,16 @@ import foundation
|
|||||||
class PortalJob(WebsiteGenerator):
|
class PortalJob(WebsiteGenerator):
|
||||||
def get_context(self, context):
|
def get_context(self, context):
|
||||||
context.parents = [dict(label='View All Jobs',
|
context.parents = [dict(label='View All Jobs',
|
||||||
route='jobs')]
|
route='erpnext-jobs')]
|
||||||
context.is_member = foundation.is_member()
|
context.is_member = foundation.is_member()
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not self.route:
|
if not self.route:
|
||||||
self.route = 'jobs/' + self.scrub(self.title)
|
self.route = 'erpnext-jobs/' + self.scrub(self.title)
|
||||||
|
|
||||||
def get_list_context(context):
|
def get_list_context(context):
|
||||||
context.allow_guest = True
|
context.allow_guest = True
|
||||||
context.title = 'ERPNext Jobs'
|
context.title = 'ERPNext Jobs'
|
||||||
context.no_breadcrumbs = True
|
context.no_breadcrumbs = True
|
||||||
context.order_by = 'creation desc'
|
context.order_by = 'creation desc'
|
||||||
context.introduction = '<div>Jobs for ERPNext Service Providers</div><br><button class="button green-btn">Post A Job</button>'
|
context.introduction = '<div>Jobs for ERPNext Service Providers</div><br><a class="green-btn" href="/my-jobs?new=1">Post A Job</a>'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
"route": "my-jobs",
|
"route": "my-jobs",
|
||||||
"show_sidebar": 1,
|
"show_sidebar": 1,
|
||||||
"sidebar_items": [],
|
"sidebar_items": [],
|
||||||
"success_url": "/jobs",
|
"success_url": "/erpnext-jobs",
|
||||||
"title": "Jobs",
|
"title": "Jobs",
|
||||||
"web_form_fields": [
|
"web_form_fields": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ website_context = {
|
|||||||
]},
|
]},
|
||||||
{"label": "Community", "child_items": [
|
{"label": "Community", "child_items": [
|
||||||
{"label": "Service Providers", "url": "/service-providers"},
|
{"label": "Service Providers", "url": "/service-providers"},
|
||||||
{"label": "Jobs", "url": "/jobs"},
|
{"label": "Jobs", "url": "/erpnext-jobs"},
|
||||||
{"label": "Apps", "url": "/apps"},
|
{"label": "Apps", "url": "/apps"},
|
||||||
{"label": "Events", "url": "/events"}
|
{"label": "Events", "url": "/events"}
|
||||||
]},
|
]},
|
||||||
@@ -69,7 +69,6 @@ website_context = {
|
|||||||
"hide_login": 1,
|
"hide_login": 1,
|
||||||
"favicon": "/assets/frappe_theme/img/favicon.ico"
|
"favicon": "/assets/frappe_theme/img/favicon.ico"
|
||||||
}
|
}
|
||||||
|
|
||||||
# website user home page (by Role)
|
# website user home page (by Role)
|
||||||
# role_home_page = {
|
# role_home_page = {
|
||||||
# "Role": "home_page"
|
# "Role": "home_page"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ def migrate():
|
|||||||
|
|
||||||
users = source.sql('select * from tabUser', as_dict=1)
|
users = source.sql('select * from tabUser', as_dict=1)
|
||||||
for u in users:
|
for u in users:
|
||||||
if validate_email_add(u.email.strip()):
|
if validate_email_add(u.email.strip()) and not frappe.db.exists("User", u.email):
|
||||||
frappe.get_doc(dict(
|
frappe.get_doc(dict(
|
||||||
doctype='User',
|
doctype='User',
|
||||||
name=u.name,
|
name=u.name,
|
||||||
@@ -18,16 +18,19 @@ def migrate():
|
|||||||
last_name=u.last_name,
|
last_name=u.last_name,
|
||||||
email=u.email
|
email=u.email
|
||||||
)).insert(ignore_if_duplicate=True)
|
)).insert(ignore_if_duplicate=True)
|
||||||
print u.name
|
|
||||||
|
|
||||||
print "sync auth"
|
auth_details = source.sql('select * from __Auth where name = %s', u.email, as_dict=1)
|
||||||
auth = source.sql('select * from __Auth where name != "Administrator"', as_dict=1)
|
|
||||||
for user in auth:
|
if auth_details:
|
||||||
frappe.db.sql("""insert into __Auth
|
auth = auth_details[0]
|
||||||
(doctype, name, fieldname, password, salt, encrypted)
|
|
||||||
values (%s, %s, %s, %s, %s, %s)""",
|
if not frappe.db.sql("select doctype from __Auth where name = %s", auth.name):
|
||||||
(user.doctype, user.name, user.fieldname, user.password, user.salt, user.encrypted), debug=1)
|
frappe.db.sql("""insert into __Auth
|
||||||
print user.name
|
(doctype, name, fieldname, password, salt, encrypted)
|
||||||
|
values (%s, %s, %s, %s, %s, %s)""",
|
||||||
|
(auth.doctype, auth.name, auth.fieldname, auth.password, auth.salt, auth.encrypted))
|
||||||
|
|
||||||
|
print u.name
|
||||||
|
|
||||||
frappe.db.sql('delete from `tabService Provider`')
|
frappe.db.sql('delete from `tabService Provider`')
|
||||||
partners = source.sql('select * from `tabFrappe Partner`', as_dict=True)
|
partners = source.sql('select * from `tabFrappe Partner`', as_dict=True)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
foundation.patches.v0_0.update_erpnext_job_route
|
||||||
0
foundation/patches/__init__.py
Normal file
0
foundation/patches/__init__.py
Normal file
0
foundation/patches/v0_0/__init__.py
Normal file
0
foundation/patches/v0_0/__init__.py
Normal file
7
foundation/patches/v0_0/update_erpnext_job_route.py
Normal file
7
foundation/patches/v0_0/update_erpnext_job_route.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
for job in frappe.get_all("Portal Job"):
|
||||||
|
print job.name
|
||||||
|
frappe.db.set_value("Portal Job", job.name, "route", "erpnext-job/{0}".format(job.name.encode('utf-8')),
|
||||||
|
update_modified=False)
|
||||||
Reference in New Issue
Block a user