Skip to content

Commit

Permalink
Version 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
doloresjuliana committed Dec 20, 2018
0 parents commit dbb649d
Show file tree
Hide file tree
Showing 30 changed files with 1,380 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
*.pyc
*.egg-info
*.swp
tags
pibiapp/docs/current
18 changes: 18 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include MANIFEST.in
include requirements.txt
include *.json
include *.md
include *.py
include *.txt
recursive-include pibiapp *.css
recursive-include pibiapp *.csv
recursive-include pibiapp *.html
recursive-include pibiapp *.ico
recursive-include pibiapp *.js
recursive-include pibiapp *.json
recursive-include pibiapp *.md
recursive-include pibiapp *.png
recursive-include pibiapp *.py
recursive-include pibiapp *.svg
recursive-include pibiapp *.txt
recursive-exclude pibiapp *.pyc
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

## Pibiapp

Pibiapp is an application developed on the Frappe framework to integrate it with other systems and expand the functionality of applications on this framework.

#### Current modules

- Nextcloud

Connect Frappe and Nextcloud, store the attachments on the Nextcloud server

Create folders to archive by application and module.

Share the link with Nextcloud users that belong to the group corresponding to the module

### License

GNU General Public License v3. See license.txt

### Install

You must have previously installed the Frappe framework and bench

Go to your bench folder and setup the new app

```
bench get-app pibiapp https://github.com/doloresjuliana/pibiapp
bench --site yoursite install-app pibiapp
```

Login to your site to configure the app.
192 changes: 192 additions & 0 deletions license.txt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pibiapp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

__version__ = '0.0.1'

Empty file added pibiapp/app_pibi/__init__.py
Empty file.
Empty file added pibiapp/config/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions pibiapp/config/desktop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _

def get_data():
return [
{
"module_name": "Nextcloud",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Nextcloud"),
"hidden": 1
}
]
11 changes: 11 additions & 0 deletions pibiapp/config/docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
Configuration for docs
"""

# source_link = "https://github.com/pibico/pibiapp"
# docs_base_url = "https://pibico.github.io/pibiapp"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"

def get_context(context):
context.brand_html = "App Pibico"
16 changes: 16 additions & 0 deletions pibiapp/config/nextcloud.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from __future__ import unicode_literals
from frappe import _

def get_data():
return [
{
"label": _("Settings"),
"items": [
{
"type": "doctype",
"name": "Nextcloud Settings",
"description": _("Connect Nexcloud with Frappe apps"),
}
]
}
]
129 changes: 129 additions & 0 deletions pibiapp/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version

app_name = "pibiapp"
app_title = "App Pibi"
app_publisher = "Dolores Juliana"
app_description = "Application on the Frappe framework composed of modules that integrate the Frappe attachments with Nextcloud and will extend the functionality of ERPnext"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "doloresjuliana@yahoo.es"
app_license = "GNU General Public License v3"

# Includes in <head>
# ------------------

# include js, css files in header of desk.html
# app_include_css = "/assets/pibiapp/css/pibiapp.css"
# app_include_js = "/assets/pibiapp/js/pibiapp.js"

# include js, css files in header of web template
# web_include_css = "/assets/pibiapp/css/pibiapp.css"
# web_include_js = "/assets/pibiapp/js/pibiapp.js"

# include js in page
# page_js = {"page" : "public/js/file.js"}

# include js in doctype views
# doctype_js = {"doctype" : "public/js/doctype.js"}
# doctype_list_js = {"doctype" : "public/js/doctype_list.js"}
# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"}
# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"}

# Home Pages
# ----------

# application home page (will override Website Settings)
# home_page = "login"

# website user home page (by Role)
# role_home_page = {
# "Role": "home_page"
# }

# Website user home page (by function)
# get_website_user_home_page = "pibiapp.utils.get_home_page"

# Generators
# ----------

# automatically create page for each record of this doctype
# website_generators = ["Web Page"]

# Installation
# ------------

# before_install = "pibiapp.install.before_install"
# after_install = "pibiapp.install.after_install"

# Desk Notifications
# ------------------
# See frappe.core.notifications.get_notification_config

# notification_config = "pibiapp.notifications.get_notification_config"

# Permissions
# -----------
# Permissions evaluated in scripted ways

# permission_query_conditions = {
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
# }
#
# has_permission = {
# "Event": "frappe.desk.doctype.event.event.has_permission",
# }

# Document Events
# ---------------
# Hook on document methods and events

# doc_events = {
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# }

doc_events = {
"File": {
"after_insert": "pibiapp.nextcloud.nextcloud_link.nextcloud_insert",
"after_delete": "pibiapp.nextcloud.nextcloud_link.nextcloud_delete"
}
}

# Scheduled Tasks
# ---------------

# scheduler_events = {
# "all": [
# "pibiapp.tasks.all"
# ],
# "daily": [
# "pibiapp.tasks.daily"
# ],
# "hourly": [
# "pibiapp.tasks.hourly"
# ],
# "weekly": [
# "pibiapp.tasks.weekly"
# ]
# "monthly": [
# "pibiapp.tasks.monthly"
# ]
# }

# Testing
# -------

# before_tests = "pibiapp.install.before_tests"

# Overriding Whitelisted Methods
# ------------------------------
#
# override_whitelisted_methods = {
# "frappe.desk.doctype.event.event.get_events": "pibiapp.event.get_events"
# }

1 change: 1 addition & 0 deletions pibiapp/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nextcloud
Empty file added pibiapp/nextcloud/__init__.py
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2018-12-18 18:10:51.973223",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "excluded_module",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Excluded Module",
"length": 0,
"no_copy": 0,
"options": "Module Def",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-12-18 18:12:26.625047",
"modified_by": "Administrator",
"module": "Nextcloud",
"name": "Nextcloud Excluded Module",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Pibico and contributors
# For license information, please see license.txt

from __future__ import unicode_literals
import frappe
from frappe.model.document import Document

class NextcloudExcludedModule(Document):
pass
Empty file.
25 changes: 25 additions & 0 deletions pibiapp/nextcloud/doctype/nextcloud_settings/nextcloud_settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2018, Pibico
// For license information, please see license.txt

frappe.ui.form.on('Nextcloud Settings', {
refresh: function(frm) {
frm.clear_custom_buttons();
},

allow_nextcloud_access: function(frm) {
if (frm.doc.client_id && frm.doc.client_secret) {
frappe.call({
method: "pibiapp.nextcloud.nextcloud_link.nextcloud_callback",
callback: function(r) {
if(!r.exc) {
frm.save();
window.open(r.message.url);
}
}
});
}
else {
frappe.msgprint(__("Please enter values for Nextcloud Access Key and Nextcloud Access Secret"))
}
}
});
Loading

0 comments on commit dbb649d

Please sign in to comment.