User Tools

Site Tools


questionnairedetailslangguide

This is an old revision of the document!


Steps to Fill in the Modules Table (Complete Guide)

This guide provides a step-by-step approach to correctly fill the Modules table. The Modules table is used to store information about various functional modules in the system. Each module represents a component of the system that can:

  • Operate independently or depend on other modules.
  • Be activated/inactivated per client.
  • Be displayed in both front-end and back-end applications.

The table also supports:

  • Parent-child relationships between modules.
  • Default module selection for specific clients.
  • Uploading module icons/logos.
  • Enabling/disabling modules per client.

👉 You can find the detailed structure of the Modules table here: Modules Table Structure

1. Add the Module ID (id)

The id column serves as the Primary Key for the Modules table.
This value is auto-incremented, meaning the database automatically assigns a unique ID to each module.
You do not need to fill this manually when inserting a module.

Example:

Scenario id
First Module 1
Second Module 2

The clientid column acts as a Foreign Key linking the module to a specific client.
This is crucial for multi-client systems where each client has distinct modules.

Why is this important?

  • It ensures that modules are client-specific.
  • Clients will only see the modules assigned to them in the front-end.

Example: Suppose you have two clients:

Client clientid
Client A 101
Client B 102

If creating a module for Client A: `clientid = 101`

If creating a module for Client B: `clientid = 102`

✅ 3. Set the Parent Module ID (parentid)

The parentid column is used to define a parent-child relationship between modules.
If the module has a parent module, enter the id of the parent module here. If the module is independent (no parent module), leave it as NULL.

Why use a Parent Module?

  • This creates a hierarchical structure.
  • Sub-modules will only appear when the parent module is enabled.

Example: Suppose you have:

  • Parent Module: Reports (`id = 1`)
  • Child Module: Sales Reports (`id = 2`)

You should enter: `parentid = 1` for Sales Reports.

Module Name id parentid
Reports 1 NULL
Sales Reports 2 1

Leave this blank (NULL) if the module has no parent.

✅ 4. Set the Module Name (name)

The name column contains the visible name of the module in both the:

  • Back-end (admin panel)
  • Front-end (client panel)

✅ 5. Set the Module Description (description)

The description column is used to provide a short explanation of what the module does.
This description will usually appear as a tooltip or small info block.

Example:

Module Name description
Reports Provides access to reports & dashboards
Sales Reports Shows detailed sales performance reports
User Management Manage client-level access and roles

Keep the description under 255 characters.

6. Upload the Module Icon (iconfile) (optional)

The iconfile column allows you to upload a small image/logo representing the module.
This is useful when displaying a visual menu of modules in the front-end.

Supported formats:

  • PNG
  • JPG
  • SVG

Maximum size:

  • 100×100 pixels

Example:

Module Name iconfile
Reports reports_icon.png
User Management user_icon.svg

This field can be left blank if no icon is needed.

7. Activate or Inactivate the Module (active)

The active column defines whether the module is active or inactive for the client.

Possible values:

Value Meaning
1 Active
0 Inactive

Set 1 if the module is available. Set 0 if the module is hidden.

8. Set the Default Module (isdefault)

The isdefault column determines if the module is the default module when a client logs in.
Only one module can be marked as the default per client.

Possible values:

Value Meaning
1 Default module
0 Not default

Example:

Module Name isdefault
Dashboard 1
Reports 0

If no module is marked as default, the system will redirect to the first active module.

✅ 9. Set the Module Order (sortorder)

The sortorder column controls the display order of the modules in the front-end.
Modules with lower sortorder appear first.

Example:

Module Name sortorder
Dashboard 1
Reports 2

10. Add the Created Date (createdate)

The createdate column stores the date and time the module was added.
Format: `YYYY-MM-DD HH:MM:SS`

Example: `createdate = 2025-03-10 12:45:00`

11. Add the Last Modified Date (lastmodifieddate)

The lastmodifieddate column stores the date and time the module was last updated.
Format: `YYYY-MM-DD HH:MM:SS`

Example: `lastmodifieddate = 2025-03-10 14:30:00`

✅ 12. Add the Modified By User (modifiedby)

The modifiedby column stores the user ID of the person who last modified the module.

Example: `modifiedby = 25`

✅ Example: Final Record

Here’s how a complete record would look:

id clientid parentid name description iconfile active isdefault sortorder createdate lastmodifieddate modifiedby
—-———-———-——————————————-—————–——–———–———–———————–————————————
1 101 NULL Reports View reports & dashboards reports_icon.png 1 1 1 2025-03-10 12:45:00 2025-03-10 14:30:00 25

Always ensure:

  • parentid is correctly linked.
  • sortorder is unique.
  • Modules for the same client have unique names.
questionnairedetailslangguide.1741591293.txt.gz · Last modified: 2025/03/10 07:21 by gloria