Coder Social home page Coder Social logo

itop-gravatar's Introduction

Gravatar support for iTop

๐Ÿ‘ค Description

This extension adds Gravatar support for iTop : when installed, it changes the Person.picture attribute HTML rendering. If no picture are already loaded, then a Gravatar call using the Person.email value as email is done.

This means that for every Person object with no picture defined and having an email, the image will be loaded from Gravatar service. This will change rendering in all iTop screens like lists, form details, extended portal.

โœ”๏ธ Requirements

iTop version 2.3.0 (enhanced portal support).

๐Ÿ’ฃ Known problems

  • There should not be any other overrides of the \Person::Get method !
  • The default image won't be displayed if used from a private server (not visible from the Gravatar service).

๐Ÿ”ง How it works

In an ideal world, just adding a new specific attribute type, and overriding the datamodel class attribute type with XML would be enough. .. But it's not as simple as that ๐Ÿ˜ฑ ! Actually lots of the code around attributes is hard coded in iTop, for example in the \MFCompiler::CompileClass...

The extensions adds :

  • a new ormGravatarImage object
  • overrides Person::Get method
  • overrides 'p_object_document_display' enhanced portal route

So for the specific Person.picture attribute, a new value object is returned, implementing a custom URL generation code.

The Gravatar URL generation is done using Ember Labs GravatarLib, thanks to them for this wonderful library ๐Ÿ‘ !

itop-gravatar's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

itop-gravatar's Issues

Crash on installation

Hello @piRGoif

When trying to install the extension on a hosted webserver I get the following error every single time:

Parse error:  syntax error, unexpected 'version' (T_STRING) in /XXX/env-production/itop-gravatar/datamodel.itop-gravatar.xml on line 1
PHP error occured : msg=syntax error, unexpected 'version' (T_STRING), no=4, file=/XXX/env-production/itop-gravatar/datamodel.itop-gravatar.xml, line=1

When deploying on my local iTop instance, everything goes fine, but when deploying on the prodcution server it happens every time. If I remove the extension, the setup run smoothly.

Running PHP7.2 on Apache on both servers.
Any dea?

Guillaume

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.