Ejemplo n.º 1
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):
Ejemplo n.º 2
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)

Ejemplo n.º 3
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"
Ejemplo n.º 4
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"))
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
 def fillresponse(self):
     from lucterios.framework.tools import MenuManage
     main_menu = etree.SubElement(self.responsexml, "MENUS")
     MenuManage.fill(self.request, None, main_menu)
Ejemplo n.º 7
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)
Ejemplo n.º 8
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)
Ejemplo n.º 9
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")
Ejemplo 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)
Ejemplo n.º 11
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")
Ejemplo n.º 12
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'])
Ejemplo n.º 13
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")
Ejemplo n.º 14
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'
Ejemplo n.º 15
0
Archivo: views.py Proyecto: 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)

Ejemplo n.º 16
0
 def fillresponse(self):
     from lucterios.framework.tools import MenuManage
     self.responsejson["menus"] = MenuManage.filljson(self.request, None)