Coder Social home page Coder Social logo

collective / collective.contact.core Goto Github PK

View Code? Open in Web Editor NEW
6.0 109.0 11.0 2.41 MB

part of the collective.contact.* suite that provides a directory where you create persons, organizations, sub-organizations and positions

Home Page: https://github.com/collective/collective.contact.demo

Python 91.21% Shell 0.12% CSS 0.45% RobotFramework 4.92% JavaScript 3.29%

collective.contact.core's Introduction

https://coveralls.io/repos/collective/collective.contact.core/badge.png?branch=master

Introduction

This add-on is part of the collective.contact.* suite. For an overview and a demo of these suite, see collective.contact.demo.

A Plone add-on that provides a directory where you create persons, organizations, sub-organizations and positions.

How-to

First, create a directory in your site. This directory will contain all the informations related to your contacts.

You can then add organizations to this directory. An organization can contain organizations (such as services, divisions or department) or positions (such as CEO, mayor or developer).

You can also add persons to this directory. A person is a physical person that can hold one or more positions or be member of one or more organizations. To associate a person with an organization or a position, add a held position content type in the person's context.

Consider the following:

  • the person type will contain personal contact details
  • the held_position type will contain professional contact details

Modify your directory to customize the organization types and the position types that you will associate with your organizations, sub-organizations and positions.

Look at the test data profile collective.contact.core test data for detailed examples.

Configuration

The following configuration can be adapted in the plone registry (prefix=IContactCoreParameters):

  • person_contact_details_private : boolean, default to True.
    The person contact details are private and will not be used in other context, like held position.
  • person_title_in_title : boolean, default to True.
    Display person title in displayed person's title.
  • use_held_positions_to_search_person : boolean, default to True.
    Use held positions to search persons.
  • use_description_to_search_person : boolean, default to True.
    Use description to search persons.
  • display_contact_photo_on_organization_view : boolean, default to True.
    Display contact photo on organization view.
  • contact_source_metadata_content : choice, default to get_full_title.
    Choose information displayed after a search in contact widget.

Localization

In some countries (i.e. France) the format of an address is <nr> <street> instead of <street> <nr>.

You can provide a translation for the address_line i18n-msgid in the collective.contact.core translations if this is the case for your country.

You can also patch collective.contact.core.behaviors.ADDRESS_FIELDS to make the number field show up before the street in add and edit forms.

In your addon, create a patches.py file with this content:

from collective.contact.core import behaviors
behaviors.ADDRESS_FIELDS[0:2] = reversed(behaviors.ADDRESS_FIELDS[0:2])
behaviors.ADDRESS_FIELDS_PLUS_PARENT[2:4] = reversed(behaviors.ADDRESS_FIELDS_PLUS_PARENT[2:4])

and import it in your __init__.py so the patches takes effect.

Translations

This product has been translated into

  • German.
  • Spanish.
  • French.
  • Italian.
  • Slovenian.

You can contribute for any message missing or other new languages, join us at Plone Collective Team into Transifex.net service with all world Plone translators community.

Installation

Install collective.contact.core by adding it to your buildout file:

[buildout]

...

eggs =
collective.contact.core

and then running "bin/buildout", next enable the product in your plone site.

Contribute

Have an idea? Found a bug? Let us know by opening a ticket.

collective.contact.core's People

Contributors

agitator avatar bleybaert avatar boulch avatar bsuttor avatar cedricmessiant avatar cewing avatar daggelpop avatar ebrehault avatar frederic-peters avatar frisi avatar gagaro avatar gbastien avatar jochumdev avatar keul avatar laulaz avatar macagua avatar mpeeters avatar mrtango avatar odelaere avatar sgeulette avatar tdesvenain avatar vincentfretin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collective.contact.core's Issues

Installing this add-on break ZMI Zope root control panel (Debug Information)

Not sure is a problem of this add-on, maybe something related to dependencies

After adding this add-on to the buildout I'm no more able to access http://localhost:8080/Control_Panel/DebugInfo/manage_workspace:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module App.special_dtml, line 185, in _exec
  Module DocumentTemplate.DT_In, line 630, in renderwob
  Module DocumentTemplate.DT_Util, line 210, in eval
   - __traceback_info__: refcount
  Module <string>, line 1, in <module>
  Module App.ApplicationManager, line 167, in refcount
  Module pip._vendor.six, line 90, in __get__
AttributeError: winreg could not be imported

Looking more into this, _winreg is a Python module that must only be here on Windows.
If I search for who is importing it I get:

$ grep -r winreg *|grep import
Products.MimetypesRegistry-2.0.5-py2.7.egg/Products/MimetypesRegistry/mime_types/windows_mimetypes.py:import _winreg
python_dateutil-1.5-py2.7.egg/dateutil/tzwin.py:import _winreg
vobject-0.6.6-py2.7.egg/vobject/win32tz.py:import _winreg

Maybe one of the dependency is loading the windows module in any case?

Position type on held_position

Hi @vincentfretin @tdesvenain @sgeulette

for now we have the possibility to define position types on the directory then it generates a vocabulary that is used for the "position type" field of the "position" content.

I think it is more "coherent" to be able to select the "position type" on a held_position as it could be not linked to a position but directly to an organization.

I would like to add the same field "position type" on a held_position and to add a special value "use position type from linekd position" to the vocabulary and to manage the selected value thru validation (because master select is so complicated as we use an autocomplete widget to select orga/position linked to the held_position) :

  • either the held_position is linked to a position, in this case the value to select must be "use position type on linked position";
  • or the held_position is not linked to a position, in this case the selected value must be anything but "use position type on linked position".

I would add a parameter to the directory letting people activate position type on held_position, especially because now, it would require a migration when using held_positions not linked to a position.

So by default, parameter "use_position_type_on_held_position" would False.

What do you think and who is using the position_type now?

Thank you for suggestions.

Gauthier

Overlayed actions on heldpositions in person view

Actually the view of a person lists the contained held positions.
On each held position, there are several actions icons (view, edit, delete).
The target actions views are displayed in overlay.
I think the overlay is not necessary because main information is already displayed.
I will remove the overlay and I can add a configuration option if someone want the overlay back.

Display help positions the same way everywhere

Hi @vincentfretin @tdesvenain

On an organization, held positions linked to a position are not displayed the same way "other contacts" that also displays held positions.

First case are displayed as links and "other contacts" will display the contact logo and so on.

There should be a "@@display-help_position" view called on every held_position displayed everywhere so it is consistent.

Does that seem correct to you? If so, I would propose a PR.

Gauthier

Allow nested Directories or Subfolders

We've got the usecase to support two groups of users:

  • contact-editors
  • contact-admins

contact-editors can:

  • read / export / use all contacts within the directory
  • only edit contacts they are responsible for

contact-admins can:

  • read / export / use all contacts within the directory
  • edit all contacts within the directory

i'd implement this by allowing subfolders in directories (no nested directories since these define additional attributes (available organizationtypes and so on)

this way it is easy to grant the editor role to specific users for certain subfolders.
straight forward, and very plonish.

is this something you want collectice.contact.core to support?
i.e add a new type "subdirectory" or "directoryfolder" that is addable in directories and allows to add persons and organizations

thanks for your opinions @ebrehault @tdesvenain @vincentfretin @sgeulette (and of course other users of this package)

vcard download on plone 4 produces UnicodeDecodeError on "Général Charles De Gaulle"

To fix the vcard export on Plone 5, I bootstrapped a checkout from master.
But there as well it produces the same error

2020-01-14 17:18:14 ERROR Zope.SiteErrorLog 1579018694.920.37539377374 http://localhost:8081/Plone/mydirectory/degaulle/@@contact.vcf
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module grokcore.view.components, line 151, in __call__
  Module zope.publisher.publish, line 107, in mapply
   - __traceback_info__: <bound method ContactVCF.render of <collective.contact.core.browser.vcard_export.ContactVCF object at 0x10e06d5d0>>
  Module zope.publisher.publish, line 113, in debug_call
  Module collective.contact.core.browser.vcard_export, line 20, in render
  Module vobject.base, line 186, in serialize
  Module vobject.behavior, line 157, in serialize
  Module vobject.base, line 945, in defaultSerialize
  Module vobject.base, line 186, in serialize
  Module vobject.behavior, line 157, in serialize
  Module vobject.base, line 958, in defaultSerialize
  Module codecs, line 369, in write
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)

Anyone else seen this?

localization for Person Title

Person title is added automically based on gender and can be overridden.
How to add localized terms for other languages?

Popup "Add organization" does not close after having added an organization

Hi,

while adding a contact using popups, we open a first popup, then click on "add organization", define the organization, click on save and there, the popup is not closed because of a js error "TypeError: token is not defined", this is because in addcontact.py, line 127, we do 👍

var token = view['oform.widgets.organization'];

and we should do :

var token = view['oform.widgets.organization:list'];

Is this a know issue for you also?

Gauthier

streetnumber shown before street

is there a reason why the number of the screet is shown before the street name?

maybe this is handeled differently in different countries?
at least in germany/austria/uk people are used to this format:
<streetname> <number>

collective contact core shows the input field for the number above the input field for the street and also in the view template:
eg

Address:
1 Kirchplatz 

is this a localization problem, or can we change the order to streetname - streetnumber and it fits your usecase in france too?

address format localizations

the standard address format (french) is
10 Streetname

in german the address would be
Streetname 10

how could this be implemented (besides overriding views)?

ImportError: No module named CMFDefault.utils

I got this error when try to starting my plone through bin/plonectl fg

from Products.CMFDefault.utils import checkEmailAddress
ZopeXMLConfigurationError: File "/home/jpnps/pljpnps/buildout-cache/eggs/plone.app.z3cform-1.2.1-py2.7.egg/plone/app/z3cform/configure.zcml", line 10.2-10.41
ZopeXMLConfigurationError: File "/home/jpnps/pljpnps/buildout-cache/eggs/plone.app.widgets-2.0.6-py2.7.egg/plone/app/widgets/configure.zcml", line 12.2-12.41
ZopeXMLConfigurationError: File "/home/jpnps/pljpnps/buildout-cache/eggs/Products.CMFPlone-5.0.6rc1-py2.7.egg/Products/CMFPlone/configure.zcml", line 108.4-112.10
ZopeXMLConfigurationError: File "/home/jpnps/pljpnps/buildout-cache/eggs/collective.contact.core-1.11-py2.7.egg/collective/contact/core/configure.zcml", line 13.2-13.27
ImportError: No module named CMFDefault.utils

layout not working in Default Plone 4.3.2

Hi,

The add'on looks very promising, but when doing a short test on default Plone the default view of a directory displays the contact info through the Plone Sunburst footer.

I assume the main developers are using collective.contact.core in customer projects where also a custom themes is activated in the site that fixes or hides these problemes.

It's a bit difficult for me to estimate how much work it would be to contribute to the project to fix the display issues in standard Plone 4.3 and what the implications would be for the projects where you are already deploying this add'on.

collective-contact-core

Overriding AddContactFromOrganization

We want to change the schema used in AddContactFromOrganization.

So we did the following:
overrides.zcml:

    <browser:page
        name="add-contact"
        for="collective.contact.core.content.organization.IOrganization"
        class=".contacts.addcontact.MyAddContact"
        permission="cmf.AddPortalContent"
        />

addcontact.py:

from collective.contact.core.browser.addcontact import AddContactFromOrganization, IAddContact

class IMyAddContact(IAddContact):
    email = schema.TextLine(
        title=_(u"Email"),
        constraint=validateEmail,
        required=False,
    )
    phone = schema.TextLine(
        title=_(u"Phone"),
        required=False,
        constraint=validatePhone,
    )
    cell_phone = schema.TextLine(
        title=_(u"Cell phone"),
        required=False,
    )
class MyAddContact(AddContactFromOrganization):
    schema = IMyAddContact

That's a basic override, but it does not work.
Surprisingly, in the form create method, it tries to adapt the context (which is a held_position) to IMyAddContact (and it fails of course).
Without our override, it adapts the context to IHeldPosition (which is allowed), not with IAddContact. Why does it tries to adapt it to IMyAddContact when we override?

Privacy on contacts

Hi,
we use contacts in our internal applications.
We manage in the same directory external contacts but also internal contacts, professional data but also private data.
Actually each employee can access to all contacts and all data.
Regarding the GDPR, we have to limit data access: you can only access data if it is necessary for your job.

I see 2 solutions:

  1. restrict contact access following usage context but it limits the approach of a global directory. Duplicates can appear (if you don't see a contact, you will create a new one).

  2. show by default a limited set of data and add a button on which the employee can click to show the full set of data. => The employee is responsible of his action and we can log it.

I think the second solution is the better one.

Those restriction would depend of an option:

  • see all
  • demand confirmation to see a set of private data

What do you think it about ?

@cedricmessiant @tdesvenain @vincentfretin @ebrehault @frisi @gbastien @bsuttor

You can not reinstall this product, use portal_setup to re-apply the relevant profile!

Traceback (innermost last):

    Module ZPublisher.Publish, line 138, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 48, in call_object
    Module <string>, line 6, in reinstallProducts
    Module AccessControl.requestmethod, line 70, in _curried
    Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 775, in reinstallProducts
    Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 686, in installProducts
    Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 603, in installProduct
    __traceback_info__: ('zhref.site',)
    Module Products.GenericSetup.tool, line 379, in runAllImportStepsFromProfile
    __traceback_info__: profile-zhref.site:default
    Module Products.GenericSetup.tool, line 1414, in _runImportStepsFromContext
    Module Products.GenericSetup.tool, line 1226, in _doRunImportStep
    __traceback_info__: collective.contact.core-postInstall
    Module collective.contact.core.setuphandlers, line 40, in postInstall

Exception: You can not reinstall this product, use portal_setup to re-apply the relevant profile !

what's the reason for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.