[knowledge base] removed and added patch to move to notes

This commit is contained in:
Rushabh Mehta
2013-05-24 16:33:10 +05:30
parent 7e118cd875
commit 9c5f4fe165
48 changed files with 15 additions and 1289 deletions

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,22 +0,0 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl

View File

@@ -1,80 +0,0 @@
[
{
"creation": "2012-03-27 14:36:01",
"docstatus": 0,
"modified": "2012-03-27 14:36:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_trash": 1,
"autoname": "_ANS.#######",
"doctype": "DocType",
"in_create": 1,
"module": "Utilities",
"name": "__common__",
"read_only": 1,
"section_style": "Simple",
"show_in_menu": 0,
"version": 3
},
{
"doctype": "DocField",
"name": "__common__",
"parent": "Answer",
"parentfield": "fields",
"parenttype": "DocType",
"permlevel": 0
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Answer",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "All",
"write": 1
},
{
"doctype": "DocType",
"name": "Answer"
},
{
"doctype": "DocPerm"
},
{
"doctype": "DocField",
"fieldname": "question",
"fieldtype": "Link",
"label": "Question",
"options": "Question"
},
{
"doctype": "DocField",
"fieldname": "answer",
"fieldtype": "Text",
"label": "Answer",
"oldfieldname": "question",
"oldfieldtype": "Text"
},
{
"doctype": "DocField",
"fieldname": "points",
"fieldtype": "Int",
"label": "Points"
},
{
"doctype": "DocField",
"fieldname": "_users_voted",
"fieldtype": "Text",
"hidden": 1,
"label": "Users Voted",
"print_hide": 1
}
]

View File

@@ -1,7 +0,0 @@
[
"Question",
"Utilities",
"Answer",
"Points",
"Users Voted"
]

View File

@@ -1,7 +0,0 @@
{
"Answer": "\u0625\u062c\u0627\u0628\u0629",
"Points": "\u0646\u0642\u0627\u0637",
"Question": "\u0633\u0624\u0627\u0644",
"Users Voted": "\u0635\u0648\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646",
"Utilities": "\u062e\u062f\u0645\u0627\u062a"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Beantworten",
"Points": "Punkte",
"Question": "Frage",
"Users Voted": "Nutzer",
"Utilities": "Dienstprogramme"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Responder",
"Points": "Puntos",
"Question": "Cuesti\u00f3n",
"Users Voted": "Los usuarios Votado",
"Utilities": "Utilidades"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "R\u00e9pondre",
"Points": "Points",
"Question": "Question",
"Users Voted": "Des internautes Yahoo!",
"Utilities": "Utilitaires"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "\u091c\u0935\u093e\u092c",
"Points": "\u00bb",
"Question": "\u0938\u0935\u093e\u0932",
"Users Voted": "\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e \u0935\u094b\u091f \u0926\u093f\u092f\u093e",
"Utilities": "\u0909\u092a\u092f\u094b\u0917\u093f\u0924\u093e\u090f\u0901"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Odgovoriti",
"Points": "Bodovi",
"Question": "Pitanje",
"Users Voted": "Korisnici Glasao",
"Utilities": "Komunalne usluge"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Beantwoorden",
"Points": "Punten",
"Question": "Vraag",
"Users Voted": "Gebruikers Verkozen",
"Utilities": "Utilities"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Resposta",
"Points": "Pontos",
"Question": "Pergunta",
"Users Voted": "Votos de usu\u00e1rios",
"Utilities": "Utilit\u00e1rios"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "Responder",
"Points": "Pontos",
"Question": "Pergunta",
"Users Voted": "Votado usu\u00e1rios",
"Utilities": "Utilit\u00e1rios"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "\u041e\u0434\u0433\u043e\u0432\u043e\u0440",
"Points": "\u0422\u0430\u0447\u043a\u0435",
"Question": "\u041f\u0438\u0442\u0430\u045a\u0435",
"Users Voted": "\u041a\u043e\u0440\u0438\u0441\u043d\u0438\u0446\u0438 \u0413\u043b\u0430\u0441\u0430\u043e",
"Utilities": "\u041a\u043e\u043c\u0443\u043d\u0430\u043b\u043d\u0435 \u0443\u0441\u043b\u0443\u0433\u0435"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "\u0baa\u0ba4\u0bbf\u0bb2\u0bcd",
"Points": "\u0baa\u0bc1\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bb3\u0bcd",
"Question": "\u0bb5\u0bbf\u0ba9\u0bbe",
"Users Voted": "\u0baa\u0baf\u0ba9\u0bb0\u0bcd \u0ba4\u0bb3\u0bae\u0bcd",
"Utilities": "\u0baa\u0baf\u0ba9\u0bcd\u0baa\u0bbe\u0b9f\u0bc1\u0b95\u0bb3\u0bcd"
}

View File

@@ -1,7 +0,0 @@
{
"Answer": "\u0e15\u0e2d\u0e1a",
"Points": "\u0e08\u0e38\u0e14",
"Question": "\u0e04\u0e33\u0e16\u0e32\u0e21",
"Users Voted": "\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e42\u0e2b\u0e27\u0e15",
"Utilities": "\u0e22\u0e39\u0e17\u0e34\u0e25\u0e34\u0e15\u0e35\u0e49"
}

View File

@@ -8,12 +8,13 @@ class DocType:
self.doc, self.doclist = d, dl
def onload(self):
if webnotes.session.user != self.doc.owner:
if not self.doc.public and webnotes.session.user != self.doc.owner:
if webnotes.session.user not in [d.user for d in self.doclist if d.doctype=="Note User"]:
webnotes.msgprint("You are not authorized to read this record.", raise_exception=True)
def validate(self):
if webnotes.session.user != self.doc.owner:
if webnotes.session.user not in webnotes.conn.sql_list("""select user from `tabNote User`
where parent=%s and permission='Edit'""", self.doc.name):
webnotes.msgprint("You are not authorized to edit this record.", raise_exception=True)
if not self.doc.fields.get("__islocal"):
if webnotes.session.user != self.doc.owner:
if webnotes.session.user not in webnotes.conn.sql_list("""select user from `tabNote User`
where parent=%s and permission='Edit'""", self.doc.name):
webnotes.msgprint("You are not authorized to edit this record.", raise_exception=True)

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 13:41:00",
"docstatus": 0,
"modified": "2013-05-24 15:47:11",
"modified": "2013-05-24 16:24:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -62,6 +62,13 @@
"fieldtype": "Section Break",
"label": "Share"
},
{
"description": "Everyone can read",
"doctype": "DocField",
"fieldname": "public",
"fieldtype": "Check",
"label": "Public"
},
{
"doctype": "DocField",
"fieldname": "share_with",

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,9 +0,0 @@
[
"User Tags",
"Question",
"Utilities",
"Answer",
"Points",
"File List",
"Users Voted"
]

View File

@@ -1,9 +0,0 @@
{
"Answer": "\u0625\u062c\u0627\u0628\u0629",
"File List": "\u0645\u0644\u0641 \u0642\u0627\u0626\u0645\u0629",
"Points": "\u0646\u0642\u0627\u0637",
"Question": "\u0633\u0624\u0627\u0644",
"User Tags": "\u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645",
"Users Voted": "\u0635\u0648\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646",
"Utilities": "\u062e\u062f\u0645\u0627\u062a"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Beantworten",
"File List": "Dateiliste",
"Points": "Punkte",
"Question": "Frage",
"User Tags": "Nutzertags",
"Users Voted": "Nutzer",
"Utilities": "Dienstprogramme"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Responder",
"File List": "Lista de archivos",
"Points": "Puntos",
"Question": "Cuesti\u00f3n",
"User Tags": "Nube de etiquetas",
"Users Voted": "Los usuarios Votado",
"Utilities": "Utilidades"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "R\u00e9pondre",
"File List": "Liste des fichiers",
"Points": "Points",
"Question": "Question",
"User Tags": "Nuage de Tags",
"Users Voted": "Des internautes Yahoo!",
"Utilities": "Utilitaires"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "\u091c\u0935\u093e\u092c",
"File List": "\u092b\u093c\u093e\u0907\u0932 \u0938\u0942\u091a\u0940",
"Points": "\u00bb",
"Question": "\u0938\u0935\u093e\u0932",
"User Tags": "\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e \u0915\u0947 \u091f\u0948\u0917",
"Users Voted": "\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e \u0935\u094b\u091f \u0926\u093f\u092f\u093e",
"Utilities": "\u0909\u092a\u092f\u094b\u0917\u093f\u0924\u093e\u090f\u0901"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Odgovoriti",
"File List": "Popis datoteka",
"Points": "Bodovi",
"Question": "Pitanje",
"User Tags": "Upute Tags",
"Users Voted": "Korisnici Glasao",
"Utilities": "Komunalne usluge"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Beantwoorden",
"File List": "File List",
"Points": "Punten",
"Question": "Vraag",
"User Tags": "Gebruiker-tags",
"Users Voted": "Gebruikers Verkozen",
"Utilities": "Utilities"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Resposta",
"File List": "Lista de Arquivos",
"Points": "Pontos",
"Question": "Pergunta",
"User Tags": "Etiquetas de Usu\u00e1rios",
"Users Voted": "Votos de usu\u00e1rios",
"Utilities": "Utilit\u00e1rios"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "Responder",
"File List": "Lista de Arquivos",
"Points": "Pontos",
"Question": "Pergunta",
"User Tags": "Etiquetas de usu\u00e1rios",
"Users Voted": "Votado usu\u00e1rios",
"Utilities": "Utilit\u00e1rios"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "\u041e\u0434\u0433\u043e\u0432\u043e\u0440",
"File List": "\u0424\u0438\u043b\u0435 \u041b\u0438\u0441\u0442",
"Points": "\u0422\u0430\u0447\u043a\u0435",
"Question": "\u041f\u0438\u0442\u0430\u045a\u0435",
"User Tags": "\u041a\u043e\u0440\u0438\u0441\u043d\u0438\u043a \u0422\u0430\u0433\u0441:",
"Users Voted": "\u041a\u043e\u0440\u0438\u0441\u043d\u0438\u0446\u0438 \u0413\u043b\u0430\u0441\u0430\u043e",
"Utilities": "\u041a\u043e\u043c\u0443\u043d\u0430\u043b\u043d\u0435 \u0443\u0441\u043b\u0443\u0433\u0435"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "\u0baa\u0ba4\u0bbf\u0bb2\u0bcd",
"File List": "\u0b95\u0bc7\u0bbe\u0baa\u0bcd\u0baa\u0bc1 \u0baa\u0b9f\u0bcd\u0b9f\u0bbf\u0baf\u0bb2\u0bcd",
"Points": "\u0baa\u0bc1\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bb3\u0bcd",
"Question": "\u0bb5\u0bbf\u0ba9\u0bbe",
"User Tags": "\u0baa\u0baf\u0ba9\u0bb0\u0bcd \u0b95\u0bc1\u0bb1\u0bbf\u0b9a\u0bcd\u0b9a\u0bc6\u0bbe\u0bb1\u0bcd\u0b95\u0bb3\u0bcd",
"Users Voted": "\u0baa\u0baf\u0ba9\u0bb0\u0bcd \u0ba4\u0bb3\u0bae\u0bcd",
"Utilities": "\u0baa\u0baf\u0ba9\u0bcd\u0baa\u0bbe\u0b9f\u0bc1\u0b95\u0bb3\u0bcd"
}

View File

@@ -1,9 +0,0 @@
{
"Answer": "\u0e15\u0e2d\u0e1a",
"File List": "\u0e23\u0e32\u0e22\u0e0a\u0e37\u0e48\u0e2d\u0e44\u0e1f\u0e25\u0e4c",
"Points": "\u0e08\u0e38\u0e14",
"Question": "\u0e04\u0e33\u0e16\u0e32\u0e21",
"User Tags": "\u0e41\u0e17\u0e47\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49",
"Users Voted": "\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e42\u0e2b\u0e27\u0e15",
"Utilities": "\u0e22\u0e39\u0e17\u0e34\u0e25\u0e34\u0e15\u0e35\u0e49"
}

View File

@@ -1,25 +0,0 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def on_trash(self):
import webnotes
webnotes.conn.sql("delete from tabAnswer where question=%s", self.doc.name)

View File

@@ -1,84 +0,0 @@
[
{
"creation": "2013-01-02 17:08:46",
"docstatus": 0,
"modified": "2013-01-01 18:58:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"autoname": "QUES.#######",
"doctype": "DocType",
"in_create": 1,
"module": "Utilities",
"name": "__common__",
"read_only": 1
},
{
"doctype": "DocField",
"name": "__common__",
"parent": "Question",
"parentfield": "fields",
"parenttype": "DocType",
"permlevel": 0
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Question",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "All",
"submit": 0,
"write": 1
},
{
"doctype": "DocType",
"name": "Question"
},
{
"doctype": "DocField",
"fieldname": "question",
"fieldtype": "Text",
"label": "Question",
"oldfieldname": "question",
"oldfieldtype": "Text"
},
{
"doctype": "DocField",
"fieldname": "points",
"fieldtype": "Int",
"hidden": 1,
"label": "Points"
},
{
"doctype": "DocField",
"fieldname": "answer",
"fieldtype": "Text Editor",
"label": "Answer",
"oldfieldname": "answer",
"oldfieldtype": "Text Editor"
},
{
"doctype": "DocField",
"fieldname": "_user_tags",
"fieldtype": "Data",
"hidden": 1,
"label": "User Tags"
},
{
"doctype": "DocField",
"fieldname": "_users_voted",
"fieldtype": "Text",
"label": "Users Voted"
},
{
"doctype": "DocPerm"
}
]