# Sistema de Modulos

## Registro y carga

- Un modulo vive en `modules/<Modulo>/`.
- El registro operativo se refleja en `tabdata.php`, `parent_tabdata.php`, tablas `vtiger_tab`, `vtiger_field`, `vtiger_blocks`, `vtiger_links` y `vtiger_ws_operation`.
- `vtlib/Vtiger/Module.php`, `Block.php`, `Field.php`, `Link.php`, `Package.php` administran instalacion/extensiones.
- `vtlib_handler($moduleName, $eventType)` ejecuta hooks como `module.postinstall`, `module.enabled`, `module.disabled`.

## Archivos minimos por modulo

- Entidad: `modules/<Modulo>/<Modulo>.php`.
- Metadatos DB: `schema.xml` cuando aplica.
- Acciones: `actions/*.php` si hay operaciones propias.
- Modelos: `models/*.php` si sobreescribe comportamiento base.
- Vistas: `views/*.php` si tiene UI propia.
- Layouts: `layouts/v7/modules/<Modulo>/` para TPL/JS/CSS.

## Modulos registrados detectados

`tabdata.php` incluye CRM core y extensiones: Accounts, Contacts, Leads, Potentials, Products, Services, Quotes, SalesOrder, PurchaseOrder, Invoice, Calendar, Documents, Users, Reports, MailManager, Mobile, Google, PBXManager, SMSNotifier, CustomerPortal, Webforms, WSAPP, Logistica y GeoCuentas.

## Personalizacion Gravimex

- `Logistica` aparece como tab 50 en `tabdata.php` y en Inventory dentro de `parent_tabdata.php`.
- `GeoCuentas` aparece como tab 51 y tambien bajo Marketing.
- `WSAPP` aparece como tab 35 y tiene webservices/sync.
- `GeoCuentas` modifica Accounts agregando campos de geolocalizacion en `vtiger_accountscf`.

## Obsolescencia probable

- `Install`, `Migration`, `migrate/`, `pkg/`, `test/` quedan en webroot.
- `layouts/vlayout` convive con `layouts/v7`.
- Paquetes zip de marketplace/optional/mandatory permanecen desplegados.
