Draft:Specification Module Public Portal

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

Specification for a module of a Public Portal

We need a new module to offer a public portal


Some requirements

  • Must be a Dolibarr module called "WebPortal"
  • Only 1 permission will be used : "Administer users of the customer/partner webportal module"
  • The portal must be pages hosted into /public/webportal/
  • Code must follow dolibarr development rules (https://wiki.dolibarr.org/index.php?title=Language_and_development_rules)
  • Code for page list or crud classes must follow templates available into modulebuilder directory.

Login

A table, called llx_societe_account, already exists to store login/pass for external portals or external websites.

It is already used to store :

  • login from external website (for example stripe customer key of a thirdparty). The column site contains "stripe".
  • login from website for users of a website. The column site contains "dolibarr_website" and we store the id of website into fk_website

So we will also use it to store login for the external portal access too:

  • the column "site" will contains "dolibarr_portal" and fk_soc will contains the id of the thirdparty. This column must appears into the form "Type of website" with possible "Web site (CMS Dolibarr)" if module website dolibarr is on, "Native Dolibarr portal" (if module webportal is on), ...


On the record of a thirdparty, enabling the Module Public Portal must enable the new tab will be visible to show all accounts/login (=record of table llx_societe_account) linked to this thirdparty.

Note: This tab already exists but is enabled only when WEBSITE_USE_WEBSITE_ACCOUNTS is on. We found this into core/lib/company.lib.php

if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && ($user->hasRight('societe', 'lire'))) {

We must enable the tab also when the module WebPortal is on. This tab shows all existing access. A button + in top of list allow to add one access.

Setup page of the module

The setup page must allow to enable features in the portal like:

  • Enable access to the membership record (Hidden / Visible or Editable)
  • Enable access to the partnership record
  • Enable access to the proposals (list with date, end of validity date, ref, amount, status + download link)
  • Enable access to the orders (list with date, delivery date, ref, amount, status + download link)
  • Enable access to the invoices (list with date, due date, ref, amount, remain to pay, status + download link)

Other need will be added in the future...

The portal page

The portal web site must contains:

  • A top banner similar to other public pages
  • Must be able to surcharge the CSS by adding CSS in a textarea
  • A home page
  • A tab/menu with membership data in read or edit mode (if option was set)
  • A tab/menu with partnership data in read or edit mode (if option was set)
  • A tab/menu with list of proposals
  • A tab/menu with list of orders
  • A tab/menu with list of invoices
  • No dependency on external javascript libraries (except the jquery already present into Dolibarr)