Esempio n. 1
0
 def add_view(self, xferview, menu_parent, menu_desc, right_admin):
     if self._views is not None:
         xferview.__module__ = "%s.%s" % (PluginManager.setting_name(),
                                          xferview.__module__)
         self._views.append(
             MenuManage.describ(
                 lambda request: self.permission(right_admin, request),
                 menu_parent=menu_parent,
                 menu_desc=menu_desc)(xferview))
Esempio n. 2
0
File: views.py Progetto: povtux/core
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom, XFER_DBOX_INFORMATION
from lucterios.framework.xfercomponents import XferCompPassword, XferCompImage, XferCompLabelForm, XferCompGrid, XferCompSelect, \
    XferCompMemo, XferCompFloat, XferCompXML, XferCompEdit
from lucterios.framework.xferadvance import XferListEditor, XferAddEditor, XferDelete, XferSave
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework.filetools import get_user_dir, xml_validator, read_file, \
    md5sum
from lucterios.framework import signal_and_lock, tools
from lucterios.CORE.parameters import Params, secure_mode_connect,\
    notfree_mode_connect
from lucterios.CORE.models import Parameter, Label, PrintModel, SavedCriteria, \
    LucteriosUser
from django.apps.registry import apps
from lucterios.framework.signal_and_lock import Signal

MenuManage.add_sub('core.menu', None, '', '', '', 0)
MenuManage.add_sub(
    'core.general', None, 'images/general.png', _('General'), _('Generality'), 1)
MenuManage.add_sub('core.admin', None, 'images/admin.png',
                   _('Management'), _('Manage settings and configurations.'), 100)


@MenuManage.describ('', FORMTYPE_MODAL, 'core.menu', _("Summary"))
class StatusMenu(XferContainerCustom):
    caption = _("Summary")
    icon = "status.png"

    def fillresponse(self):
        signal_and_lock.Signal.call_signal("summary", self)

Esempio n. 3
0
    SELECT_MULTI, CLOSE_YES
from lucterios.framework.xfercomponents import XferCompLabelForm, \
    XferCompCheckList, XferCompButton, XferCompSelect, XferCompDate, \
    XferCompImage, XferCompEdit, XferCompGrid, XferCompFloat, XferCompCheck
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.tools import convert_date, same_day_months_after
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework import signal_and_lock

from lucterios.CORE.parameters import Params

from diacamma.member.models import Adherent, Subscription, Season, Age, Team, Activity, License, DocAdherent, SubscriptionType, CommandManager
from lucterios.contacts.models import Individual


MenuManage.add_sub("association", None, "diacamma.member/images/association.png", _("Association"), _("Association tools"), 30)

MenuManage.add_sub("member.actions", "association", "diacamma.member/images/member.png",
                   _("Adherents"), _("Management of adherents and subscriptions."), 50)


class AdherentFilter(object):

    def get_filter(self):
        team = self.getparam("team", ())
        activity = self.getparam("activity", ())
        genre = self.getparam("genre", 0)
        age = self.getparam("age", ())
        status = self.getparam("status", -1)
        dateref = convert_date(self.getparam("dateref", ""), Season.current_season().date_ref)
        if self.getparam('is_renew', False):
Esempio n. 4
0
from lucterios.framework.xfercomponents import XferCompButton, XferCompLabelForm, \
    XferCompCheckList, XferCompImage, XferCompUpLoad, \
    XferCompDownLoad
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework import signal_and_lock
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.filetools import get_tmp_dir, get_user_dir
from lucterios.CORE.parameters import notfree_mode_connect
from lucterios.CORE.models import LucteriosGroup

from lucterios.documents.models import Folder, Document
from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from logging import getLogger


MenuManage.add_sub(
    "documents.conf", "core.extensions", "", _("Document"), "", 10)


@MenuManage.describ('documents.change_folder', FORMTYPE_NOMODAL, 'documents.conf', _("Management of document's folders"))
class FolderList(XferListEditor):
    caption = _("Folders")
    icon = "documentConf.png"
    model = Folder
    field_id = 'folder'


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_grid(TITLE_MODIFY, "images/edit.png", unique=SELECT_SINGLE)
@MenuManage.describ('documents.add_folder')
class FolderAddModify(XferAddEditor):
    icon = "documentConf.png"
Esempio n. 5
0
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompEdit, XferCompFloat, XferCompMemo, XferCompDate, XferCompGrid
from lucterios.framework.xfercomponents import XferCompTime, XferCompDateTime, XferCompCheck, XferCompSelect, XferCompCheckList, XferCompButton
from lucterios.framework.xferadvance import XferListEditor, XferAddEditor, XferShowEditor, XferDelete,\
    TITLE_EDIT, TITLE_ADD, TITLE_MODIFY, TITLE_DELETE, TITLE_PRINT,\
    TITLE_LISTING, TITLE_LABEL
from lucterios.framework import signal_and_lock
from lucterios.framework.models import LucteriosScheduler

from lucterios.CORE.xferprint import XferPrintAction, XferPrintListing, XferPrintLabel, XferPrintReporting
from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from lucterios.CORE.parameters import Params
from lucterios.CORE.models import Parameter

from lucterios.dummy.models import Example, Other

MenuManage.add_sub('dummy.foo', None, 'lucterios.dummy/images/10.png', _('Dummy'), _('Dummy menu'), 20)


@MenuManage.describ('', FORMTYPE_NOMODAL, 'dummy.foo', _("Bidule action."))
class Bidule(XferContainerAcknowledge):
    caption = _("_Bidule")
    icon = "1.png"

    def fillresponse(self, error):
        from lucterios.framework.error import LucteriosException, GRAVE
        if error is None:
            raise LucteriosException(GRAVE, "Error of bidule")
        else:
            raise AttributeError("Other error:" + error)

Esempio n. 6
0
from lucterios.framework.xferadvance import XferShowEditor
from lucterios.framework.xferadvance import XferDelete
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage, SELECT_SINGLE, CLOSE_YES, SELECT_MULTI,\
    get_icon_path, FORMTYPE_REFRESH, WrapAction, CLOSE_NO
from lucterios.framework.xfergraphic import XferContainerAcknowledge,\
    XferContainerCustom
from lucterios.CORE.xferprint import XferPrintReporting

from lucterios.contacts.tools import ContactSelection

from lucterios.mailing.models import Message, add_mailing_in_scheduler
from lucterios.framework.xfercomponents import XferCompImage, XferCompLabelForm, XferCompCheck
from lucterios.documents.models import Document
from lucterios.documents.views import DocumentSearch

MenuManage.add_sub("mailing.actions", "office", "lucterios.mailing/images/mailing.png",
                   _("Mailing"), _("Create and send mailing to contacts."), 60)


@MenuManage.describ('mailing.change_message', FORMTYPE_NOMODAL, 'mailing.actions', _('Manage list of message for mailing.'))
class MessageList(XferListEditor):
    icon = "mailing.png"
    model = Message
    field_id = 'message'
    caption = _("Messages")

    def fillresponse(self):
        XferListEditor.fillresponse(self)
        abs_url = self.request.META.get('HTTP_REFERER', self.request.build_absolute_uri()).split('/')
        root_url = '/'.join(abs_url[:-2])
        add_mailing_in_scheduler(check_nb=True, http_root_address=root_url)
Esempio n. 7
0
from django.utils.translation import ugettext_lazy as _
from django.db.models import Q

from lucterios.framework.xferadvance import XferListEditor, TITLE_DELETE, TITLE_MODIFY, TITLE_ADD, TITLE_EDIT,\
    TITLE_CREATE
from lucterios.framework.xferadvance import XferAddEditor
from lucterios.framework.xferadvance import XferShowEditor
from lucterios.framework.xferadvance import XferDelete
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage, SELECT_SINGLE, FORMTYPE_REFRESH, CLOSE_NO, SELECT_MULTI, CLOSE_YES
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.xfercomponents import XferCompSelect
from diacamma.member.models import Season, Period, SubscriptionType, Document, Prestation
from lucterios.CORE.parameters import Params

MenuManage.add_sub("member.conf", "core.extensions", "", _("Member"), "", 5)


@MenuManage.describ('member.change_season', FORMTYPE_NOMODAL, 'member.conf',
                    _('Management of seasons and subscriptions'))
class SeasonSubscription(XferListEditor):
    icon = "season.png"
    model = Season
    field_id = 'season'
    caption = _("Seasons and subscriptions")

    def fillresponse_header(self):
        self.new_tab(_('Season'))
        show_filter = self.getparam('show_filter', 0)
        edt = XferCompSelect("show_filter")
        edt.set_select([(0, _('Near active')), (1, _('All'))])
Esempio n. 8
0
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework import signal_and_lock

from lucterios.CORE.xferprint import XferPrintAction, XferPrintReporting
from lucterios.CORE.parameters import Params
from lucterios.CORE.editors import XferSavedCriteriaSearchEditor

from lucterios.contacts.models import Individual, LegalEntity

from diacamma.invoice.models import Article, Bill, Detail
from diacamma.accounting.models import FiscalYear, Third
from diacamma.payoff.views import PayoffAddModify
from diacamma.payoff.models import Payoff

MenuManage.add_sub("invoice", "financial", "diacamma.invoice/images/invoice.png", _("invoice"), _("Manage of billing"), 20)


def _add_bill_filter(xfer, row):
    status_filter = xfer.getparam('status_filter', -1)
    lbl = XferCompLabelForm('lbl_filter')
    lbl.set_value_as_name(_('Filter by type'))
    lbl.set_location(0, row)
    xfer.add_component(lbl)
    dep_field = Bill.get_field_by_name('status')
    sel_list = list(dep_field.choices)
    sel_list.insert(0, (-1, _('building+valid')))
    edt = XferCompSelect("status_filter")
    edt.set_select(sel_list)
    edt.set_value(status_filter)
    edt.set_location(1, row)
Esempio n. 9
0
from lucterios.framework.xferadvance import XferShowEditor
from lucterios.framework.xferadvance import XferDelete
from lucterios.framework.tools import FORMTYPE_NOMODAL, FORMTYPE_REFRESH, CLOSE_NO, SELECT_SINGLE, WrapAction, SELECT_MULTI, SELECT_NONE,\
    FORMTYPE_MODAL, CLOSE_YES
from lucterios.framework.tools import ActionsManage, MenuManage
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompImage
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.signal_and_lock import Signal
from lucterios.framework import signal_and_lock
from lucterios.CORE.xferprint import XferPrintListing
from lucterios.CORE.views import ObjectMerge

from diacamma.accounting.models import ChartsAccount, FiscalYear
from django.utils import six

MenuManage.add_sub("bookkeeping", "financial", "diacamma.accounting/images/accounting.png", _("Bookkeeping"), _("Manage of Bookkeeping"), 30)


@MenuManage.describ('accounting.change_chartsaccount', FORMTYPE_NOMODAL, 'bookkeeping', _('Editing and modifying of Charts of accounts for current fiscal year'))
class ChartsAccountList(XferListEditor):
    icon = "account.png"
    model = ChartsAccount
    field_id = 'chartsaccount'
    caption = _("charts of account")
    multi_page = False

    def fillresponse_header(self):
        select_year = self.getparam('year')
        select_type = self.getparam('type_of_account', 0)
        self.item.year = FiscalYear.get_current(select_year)
        self.fill_from_model(0, 1, False, ['year', 'type_of_account'])
Esempio n. 10
0
from lucterios.framework.xferadvance import XferAddEditor
from lucterios.framework.tools import FORMTYPE_MODAL, ActionsManage, MenuManage, SELECT_SINGLE, CLOSE_NO, SELECT_MULTI
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.xfercomponents import XferCompButton, XferCompLabelForm, XferCompSelect, XferCompImage, XferCompDownLoad
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework import signal_and_lock
from lucterios.CORE.parameters import Params
from lucterios.CORE.views import ParamEdit
from lucterios.CORE.models import Parameter

from diacamma.accounting.models import FiscalYear, Journal, AccountThird, ChartsAccount, ModelLineEntry
from diacamma.accounting.system import accounting_system_list, accounting_system_name
from diacamma.accounting.tools import clear_system_account, correct_accounting_code
from django.utils import six

MenuManage.add_sub("financial.conf", "core.extensions", "", _("Financial"), "", 2)


def select_account_system(xfer):
    current_account_system = Params.getvalue("accounting-system")
    if current_account_system == '':
        edt = XferCompSelect("account_system")
        account_systems = list(accounting_system_list().items())
        account_systems.insert(0, ('', '---'))
        edt.set_select(account_systems)
        edt.set_action(xfer.request, ConfigurationAccountingSystem.get_action(), modal=FORMTYPE_MODAL, close=CLOSE_NO)
    else:
        edt = XferCompLabelForm("account_system")
    edt.set_value(accounting_system_name(current_account_system))
    edt.set_location(1, xfer.get_max_row() + 1)
    xfer.add_component(edt)
Esempio n. 11
0
from lucterios.framework.xfersearch import XferSearchEditor
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage,\
    SELECT_MULTI, CLOSE_NO, FORMTYPE_MODAL, WrapAction, CLOSE_YES, FORMTYPE_REFRESH, SELECT_SINGLE
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompImage, XferCompSelect, XferCompMemo
from lucterios.CORE.xferprint import XferPrintAction
from lucterios.CORE.parameters import Params
from lucterios.contacts.tools import ContactSelection
from lucterios.contacts.models import Individual

from diacamma.member.views import AdherentSelection
from diacamma.member.models import Season
from diacamma.event.models import Event, Organizer, Participant, Degree

MenuManage.add_sub("event.actions", "association",
                   "diacamma.event/images/event.png", _("Events"),
                   _("Management of events."), 80)


class GenericEventList(XferListEditor):
    model = Event
    field_id = 'event'
    event_type = None

    def fillresponse_header(self):
        self.filter = Q(event_type=self.event_type)
        self.params['event_type'] = self.event_type

    def fillresponse(self):
        XferListEditor.fillresponse(self)
        grid = self.get_components(self.field_id)
Esempio n. 12
0
from lucterios.framework.tools import (
    FORMTYPE_NOMODAL,
    ActionsManage,
    MenuManage,
    SELECT_SINGLE,
    FORMTYPE_REFRESH,
    CLOSE_NO,
    SELECT_MULTI,
    CLOSE_YES,
)
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompSelect

from diacamma.member.models import Season, Period, SubscriptionType, Document

MenuManage.add_sub("member.conf", "core.extensions", "", _("Member"), "", 5)


@MenuManage.describ(
    "member.change_season", FORMTYPE_NOMODAL, "member.conf", _("Management of seasons and subscriptions")
)
class SeasonSubscription(XferListEditor):
    icon = "season.png"
    model = Season
    field_id = "season"
    caption = _("Seasons and subscriptions")

    def fillresponse_header(self):
        self.new_tab(_("Season"))
        show_filter = self.getparam("show_filter", 0)
        lbl = XferCompLabelForm("lbl_showing")
Esempio n. 13
0
from lucterios.framework.xfersearch import XferSearchEditor
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage,\
    SELECT_MULTI, CLOSE_NO, FORMTYPE_MODAL, WrapAction, CLOSE_YES, FORMTYPE_REFRESH, SELECT_SINGLE
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompImage, XferCompSelect, XferCompMemo
from lucterios.framework.models import get_value_if_choices
from lucterios.CORE.xferprint import XferPrintAction
from lucterios.CORE.parameters import Params
from lucterios.contacts.tools import ContactSelection
from lucterios.contacts.models import Individual

from diacamma.member.views import AdherentSelection
from diacamma.member.models import Season
from diacamma.event.models import Event, Organizer, Participant, Degree

MenuManage.add_sub("event.actions", "association", "diacamma.event/images/event.png",
                   _("Events"), _("Management of events."), 80)


@MenuManage.describ('event.change_event', FORMTYPE_NOMODAL, 'event.actions', _('Event manage'))
class EventList(XferListEditor):
    icon = "event.png"
    model = Event
    field_id = 'event'
    caption = _("Event")


@MenuManage.describ('event.change_event', FORMTYPE_NOMODAL, 'event.actions', _('To find an event'))
class EventSearch(XferSearchEditor):
    icon = "event.png"
    model = Event
    field_id = 'event'
Esempio n. 14
0
@MenuManage.describ('CORE.add_parameter')
class OwnerLinkDel(XferDelete):
    caption = _("Delete owner link")
    icon = "condominium.png"
    model = OwnerLink
    field_id = 'ownerlink'

    def fillresponse(self):
        for sub_item in self.items:
            if sub_item.id in (1, 2):
                raise LucteriosException(IMPORTANT, _('Link not deletable !'))
        XferDelete.fillresponse(self)


MenuManage.add_sub("condominium", None,
                   "diacamma.condominium/images/condominium.png",
                   _("condominium"), _("Manage of condominium"), 20)

MenuManage.add_sub("condominium.manage", "condominium",
                   "diacamma.condominium/images/condominium.png", _("Manage"),
                   _("Manage of condominium"), 10)


@MenuManage.describ('condominium.change_set', FORMTYPE_NOMODAL,
                    'condominium.manage', _('Manage of class loads'))
class SetList(XferListEditor):
    icon = "set.png"
    model = Set
    field_id = 'set'
    caption = _("Class loads")
Esempio n. 15
0
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _
from django.db.models import Q

from lucterios.framework.xferadvance import XferDelete, XferAddEditor, XferListEditor, TITLE_ADD, TITLE_MODIFY, TITLE_DELETE
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompGrid
from lucterios.framework.tools import MenuManage, FORMTYPE_NOMODAL, SELECT_SINGLE, SELECT_MULTI, ActionsManage
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework.signal_and_lock import LucteriosSession
from lucterios.CORE.models import LucteriosGroup, LucteriosUser
from lucterios.framework.models import LucteriosScheduler

MenuManage.add_sub("core.right", 'core.admin', "images/permissions.png",
                   _("_Rights manage"), _("To manage users, groups and permissions."), 40)


@MenuManage.describ('auth.change_group', FORMTYPE_NOMODAL, 'core.right', _("To manage permissions groupes."))
class GroupsList(XferListEditor):
    caption = _("Groups")
    icon = "group.png"
    model = LucteriosGroup
    field_id = 'group'


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_grid(TITLE_MODIFY, "images/edit.png", unique=SELECT_SINGLE)
@MenuManage.describ('auth.add_group')
class GroupsEdit(XferAddEditor):
    caption_add = _("Add a group")
Esempio n. 16
0
from lucterios.framework.tools import MenuManage, FORMTYPE_NOMODAL, ActionsManage, \
    FORMTYPE_MODAL, CLOSE_NO, FORMTYPE_REFRESH, SELECT_SINGLE, SELECT_NONE, \
    WrapAction, CLOSE_YES, SELECT_MULTI
from lucterios.framework.xfercomponents import XferCompButton, XferCompLabelForm, \
    XferCompCheckList, XferCompImage, XferCompUpLoad, \
    XferCompDownLoad
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework import signal_and_lock
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.filetools import get_tmp_dir, get_user_dir
from lucterios.CORE.parameters import notfree_mode_connect
from lucterios.CORE.models import LucteriosGroup

from lucterios.documents.models import Folder, Document

MenuManage.add_sub("documents.conf", "core.extensions", "", _("Document"), "",
                   10)


@MenuManage.describ('documents.change_folder', FORMTYPE_NOMODAL,
                    'documents.conf', _("Management of document's folders"))
class FolderList(XferListEditor):
    caption = _("Folders")
    icon = "documentConf.png"
    model = Folder
    field_id = 'folder'


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_grid(TITLE_MODIFY,
                           "images/edit.png",
                           unique=SELECT_SINGLE)
Esempio n. 17
0
def auth_action_contact(actions_basic):
    actions_basic.append(CreateAccount.get_action())


@MenuManage.describ('CORE.add_parameter')
class CurrentStructureAddModify(XferAddEditor):
    icon = "ourDetails.png"
    model = LegalEntity
    field_id = 1
    caption_add = _("Our details")
    caption_modify = _("Our details")
    locked = True
    redirect_to_show = False


MenuManage.add_sub("contact.conf", "core.extensions", "", _("Contact"), "", 1)


@MenuManage.describ(
    'CORE.change_parameter', FORMTYPE_NOMODAL, 'contact.conf',
    _('Management functions of individuals and categories of legal entities.'))
class Configuration(XferListEditor):
    caption = _("Contacts configuration")
    icon = "contactsConfig.png"

    def _fill_functions(self):
        self.new_tab(_("Functions and responsabilities"))
        img = XferCompImage('imgFunction')
        img.set_value(get_icon_path('lucterios.contacts/images/function.png'))
        img.set_location(0, 0)
        self.add_component(img)
Esempio n. 18
0
 def fillresponse(self):
     from lucterios.framework.tools import MenuManage
     self.responsejson["menus"] = MenuManage.filljson(self.request, None)
Esempio n. 19
0
from lucterios.framework.xfercomponents import XferCompPassword, XferCompImage, XferCompLabelForm, XferCompGrid, XferCompSelect, \
    XferCompMemo, XferCompFloat, XferCompXML, XferCompEdit, XferCompDownLoad, XferCompUpLoad, XferCompButton
from lucterios.framework.xferadvance import XferListEditor, XferAddEditor, XferDelete, XferSave, TITLE_MODIFY, TITLE_DELETE, \
    TITLE_CLONE, TITLE_OK, TITLE_CANCEL, TITLE_CLOSE, TEXT_TOTAL_NUMBER, action_list_sorted,\
    TITLE_CREATE
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework.filetools import get_user_dir, xml_validator, read_file, md5sum
from lucterios.framework import signal_and_lock, tools

from lucterios.CORE.parameters import Params, secure_mode_connect, notfree_mode_connect
from lucterios.CORE.models import Parameter, Label, PrintModel, SavedCriteria, LucteriosUser, LucteriosGroup
from lucterios.CORE.views_usergroup import UsersList, GroupsList
from re import sub


MenuManage.add_sub('core.menu', None, '', '', '', 0)
MenuManage.add_sub('core.general', None, 'images/general.png', _('General'), _('Generality'), 1)
MenuManage.add_sub('core.admin', None, 'images/admin.png', _('Management'), _('Manage settings and configurations.'), 100)


def right_status(request):
    return signal_and_lock.Signal.call_signal("summary", request) > 0


@MenuManage.describ(right_status, FORMTYPE_MODAL, 'core.menu', _("Summary"))
class StatusMenu(XferContainerCustom):
    caption = _("Summary")
    icon = "status.png"

    def fillresponse(self):
        signal_and_lock.Signal.call_signal("summary", self)
Esempio n. 20
0
def auth_action_contact(actions_basic):
    actions_basic.append(CreateAccount.get_action())


@MenuManage.describ('CORE.add_parameter')
class CurrentStructureAddModify(XferAddEditor):
    icon = "ourDetails.png"
    model = LegalEntity
    field_id = 1
    caption_add = _("Our details")
    caption_modify = _("Our details")
    locked = True
    redirect_to_show = False


MenuManage.add_sub("contact.conf", "core.extensions", "", _("Contact"), "", 1)


@MenuManage.describ('CORE.change_parameter', FORMTYPE_NOMODAL, 'contact.conf', _('Management functions of individuals and categories of legal entities.'))
class Configuration(XferListEditor):
    caption = _("Contacts configuration")
    icon = "contactsConfig.png"

    def _fill_functions(self):
        self.new_tab(_("Functions and responsabilities"))
        img = XferCompImage('imgFunction')
        img.set_value(get_icon_path('lucterios.contacts/images/function.png'))
        img.set_location(0, 0)
        self.add_component(img)
        img = XferCompLabelForm('titleFunction')
        img.set_value_as_title(_("Functions list"))
Esempio n. 21
0
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompEdit, XferCompButton, XferCompSelect, XferCompImage, XferCompDate, XferCompGrid
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage, FORMTYPE_REFRESH, CLOSE_NO, WrapAction, FORMTYPE_MODAL, SELECT_SINGLE,\
    SELECT_MULTI, SELECT_NONE
from lucterios.framework.error import LucteriosException
from lucterios.CORE.xferprint import XferPrintListing
from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from lucterios.contacts.tools import ContactSelection
from lucterios.contacts.models import AbstractContact

from diacamma.accounting.models import Third, AccountThird, FiscalYear, \
    EntryLineAccount, ModelLineEntry, EntryAccount
from diacamma.accounting.views_admin import Configuration
from diacamma.accounting.tools import correct_accounting_code

MenuManage.add_sub("financial", None, "diacamma.accounting/images/financial.png", _("Financial"), _("Financial tools"), 50)


@MenuManage.describ('accounting.change_third', FORMTYPE_NOMODAL, 'financial', _('Management of third account'))
class ThirdList(XferListEditor):
    icon = "thirds.png"
    model = Third
    field_id = 'third'
    caption = _("Thirds")

    def get_items_from_filter(self):
        items = XferListEditor.get_items_from_filter(self)
        items = sorted(items, key=lambda t: six.text_type(t).lower())
        if self.getparam('show_filter', 0) == 2:
            items = [item for item in items if abs(item.get_total()) > 0.0001]
        res = QuerySet(model=Third)
Esempio n. 22
0
from lucterios.framework.xfergraphic import XferContainerAcknowledge, XferContainerCustom
from lucterios.framework.xfercomponents import XferCompGrid, XferCompSelect,\
    XferCompCheckList, XferCompButton, XferCompImage, XferCompLabelForm
from lucterios.framework.tools import MenuManage, FORMTYPE_NOMODAL, SELECT_SINGLE, SELECT_MULTI, ActionsManage,\
    FORMTYPE_REFRESH, CLOSE_NO, SELECT_NONE, FORMTYPE_MODAL
from lucterios.framework.error import LucteriosException, IMPORTANT
from lucterios.framework.signal_and_lock import LucteriosSession, Signal
from lucterios.framework.models import LucteriosScheduler, LucteriosLogEntry

from lucterios.CORE.models import LucteriosGroup, LucteriosUser, Parameter, set_auditlog_states
from lucterios.CORE.parameters import Params
from django.contrib.contenttypes.models import ContentType
from django.utils import six

MenuManage.add_sub("core.right", 'core.admin', "images/permissions.png",
                   _("_Rights manage"),
                   _("To manage users, groups and permissions."), 40)


@MenuManage.describ('auth.change_group', FORMTYPE_NOMODAL, 'core.right',
                    _("To manage permissions groupes."))
class GroupsList(XferListEditor):
    caption = _("Groups")
    icon = "group.png"
    model = LucteriosGroup
    field_id = 'group'


@ActionsManage.affect_grid(TITLE_CREATE, "images/new.png")
@ActionsManage.affect_grid(TITLE_MODIFY,
                           "images/edit.png",
Esempio n. 23
0
from lucterios.framework.xferadvance import XferAddEditor, XferDelete, XferShowEditor, XferListEditor, XferSave,\
    TITLE_ADD, TITLE_MODIFY, TITLE_EDIT, TITLE_PRINT, TITLE_DELETE, TITLE_LABEL,\
    TITLE_LISTING
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompEdit, XferCompImage, XferCompGrid,\
    XferCompButton
from lucterios.framework.xfersearch import XferSearchEditor
from lucterios.framework import signal_and_lock

from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from lucterios.CORE.models import LucteriosUser
from lucterios.CORE.xferprint import XferPrintAction, XferPrintListing, XferPrintLabel
from lucterios.CORE.views import ObjectMerge, ObjectPromote

from lucterios.contacts.models import LegalEntity, Individual, Responsability, AbstractContact

MenuManage.add_sub(
    "office", None, "lucterios.contacts/images/office.png", _("Office"), _("Office tools"), 70)

MenuManage.add_sub("contact.actions", "office", "lucterios.contacts/images/contacts.png",
                   _("Addresses and contacts"), _("Management of men or women and organizations saved."), 50)


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_show(TITLE_MODIFY, "images/edit.png", close=CLOSE_YES)
@MenuManage.describ('contacts.add_abstractcontact')
class LegalEntityAddModify(XferAddEditor):
    icon = "legalEntity.png"
    model = LegalEntity
    field_id = 'legal_entity'
    caption_add = _("Add legal entity")
    caption_modify = _("Modify legal entity")
Esempio n. 24
0
from lucterios.framework.xferadvance import XferListEditor, TITLE_EDIT, TITLE_ADD, TITLE_MODIFY, TITLE_DELETE, TITLE_CLONE,\
    XferTransition
from lucterios.framework.xferadvance import XferAddEditor
from lucterios.framework.xferadvance import XferShowEditor
from lucterios.framework.xferadvance import XferDelete
from lucterios.framework.tools import FORMTYPE_NOMODAL, ActionsManage, MenuManage, SELECT_SINGLE, CLOSE_YES, SELECT_MULTI
from lucterios.framework.xfergraphic import XferContainerAcknowledge
from lucterios.CORE.xferprint import XferPrintReporting

from lucterios.contacts.tools import ContactSelection

from lucterios.mailing.functions import will_mail_send
from lucterios.mailing.models import Message

MenuManage.add_sub("mailing.actions", "office", "lucterios.mailing/images/mailing.png",
                   _("Mailing"), _("Create and send mailing to contacts."), 60)


@MenuManage.describ('mailing.change_message', FORMTYPE_NOMODAL, 'mailing.actions', _('Manage list of message for mailing.'))
class MessageList(XferListEditor):
    icon = "mailing.png"
    model = Message
    field_id = 'message'
    caption = _("Messages")


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_show(TITLE_MODIFY, "images/edit.png", close=CLOSE_YES, condition=lambda xfer: xfer.item.status == 0)
@MenuManage.describ('mailing.add_message')
class MessageAddModify(XferAddEditor):
    icon = "mailing.png"
Esempio n. 25
0
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompEdit, XferCompFloat, XferCompMemo, XferCompDate, XferCompGrid
from lucterios.framework.xfercomponents import XferCompTime, XferCompDateTime, XferCompCheck, XferCompSelect, XferCompCheckList, XferCompButton
from lucterios.framework.xferadvance import XferListEditor, XferAddEditor, XferShowEditor, XferDelete,\
    TITLE_EDIT, TITLE_ADD, TITLE_MODIFY, TITLE_DELETE, TITLE_PRINT,\
    TITLE_LISTING, TITLE_LABEL
from lucterios.framework import signal_and_lock
from lucterios.framework.model_fields import LucteriosScheduler

from lucterios.CORE.xferprint import XferPrintAction, XferPrintListing, XferPrintLabel, XferPrintReporting
from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from lucterios.CORE.parameters import Params
from lucterios.CORE.models import Parameter

from lucterios.dummy.models import Example, Other

MenuManage.add_sub('dummy.foo', None, 'lucterios.dummy/images/10.png',
                   _('Dummy'), _('Dummy menu'), 20)


@MenuManage.describ('', FORMTYPE_NOMODAL, 'dummy.foo', _("Bidule action."))
class Bidule(XferContainerAcknowledge):
    caption = _("_Bidule")
    icon = "1.png"

    def fillresponse(self, error):
        from lucterios.framework.error import LucteriosException, GRAVE
        if error is None:
            raise LucteriosException(GRAVE, "Error of bidule")
        else:
            raise AttributeError("Other error:" + error)

Esempio n. 26
0
    get_icon_path
from lucterios.framework.xfergraphic import XferContainerCustom
from lucterios.framework.xfercomponents import XferCompImage, XferCompSelect, XferCompGrid, XferCompLabelForm
from lucterios.framework.xferadvance import TITLE_CLOSE, TITLE_PRINT
from lucterios.CORE.parameters import Params

from diacamma.accounting.models import FiscalYear, EntryAccount
from diacamma.accounting.views_reports import FiscalYearReportPrint
from diacamma.accounting.tools import current_system_account, format_devise
from diacamma.accounting.tools_reports import get_spaces, convert_query_to_account, add_item_in_grid, fill_grid, add_cell_in_grid
from diacamma.condominium.models import Set
from lucterios.framework.filetools import get_user_path, readimage_to_base64
from os.path import exists

MenuManage.add_sub("condominium.print", "condominium",
                   "diacamma.condominium/images/report.png", _("Report"),
                   _("Report of condominium"), 20)


class CondominiumReport(XferContainerCustom):
    model = FiscalYear
    field_id = 'year'
    icon = "report.png"

    def __init__(self, **kwargs):
        XferContainerCustom.__init__(self, **kwargs)
        self.filter = None
        self.lastfilter = None

    def current_image(self, icon_path=None):
        img_path = get_user_path("contacts", "Image_1.jpg")
Esempio n. 27
0
 def fillresponse(self):
     from lucterios.framework.tools import MenuManage
     main_menu = etree.SubElement(self.responsexml, "MENUS")
     MenuManage.fill(self.request, None, main_menu)
Esempio n. 28
0
from lucterios.framework.xferadvance import XferAddEditor, XferDelete, XferShowEditor, XferListEditor, XferSave,\
    TITLE_ADD, TITLE_MODIFY, TITLE_EDIT, TITLE_PRINT, TITLE_DELETE, TITLE_LABEL,\
    TITLE_LISTING
from lucterios.framework.xfercomponents import XferCompLabelForm, XferCompEdit, XferCompImage, XferCompGrid,\
    XferCompButton
from lucterios.framework.xfersearch import XferSearchEditor
from lucterios.framework import signal_and_lock

from lucterios.CORE.editors import XferSavedCriteriaSearchEditor
from lucterios.CORE.models import LucteriosUser
from lucterios.CORE.xferprint import XferPrintAction, XferPrintListing, XferPrintLabel
from lucterios.CORE.views import ObjectMerge, ObjectPromote

from lucterios.contacts.models import LegalEntity, Individual, Responsability, AbstractContact

MenuManage.add_sub(
    "office", None, "lucterios.contacts/images/office.png", _("Office"), _("Office tools"), 70)

MenuManage.add_sub("contact.actions", "office", "lucterios.contacts/images/contacts.png",
                   _("Addresses and contacts"), _("Management of men or women and organizations saved."), 50)


@ActionsManage.affect_grid(TITLE_ADD, "images/add.png")
@ActionsManage.affect_show(TITLE_MODIFY, "images/edit.png", close=CLOSE_YES)
@MenuManage.describ('contacts.add_abstractcontact')
class LegalEntityAddModify(XferAddEditor):
    icon = "legalEntity.png"
    model = LegalEntity
    field_id = 'legal_entity'
    caption_add = _("Add legal entity")
    caption_modify = _("Modify legal entity")
Esempio n. 29
0
 def fillresponse(self):
     from lucterios.framework.tools import MenuManage
     self.responsejson["menus"] = MenuManage.filljson(self.request, None)