workPro Documentation
The WorkPro mobile app automatically downloads essential data to enable offline functionality. This document describes what data is downloaded, when it's triggered, and how it's stored.
API Endpoint: /workpro/webview/api/dropdowns.php
Downloaded automatically when the main page loads (if no data exists or data is older than 24 hours).
| # | Data Type | Source Table | Fields Downloaded | Grouping | Limit |
|---|---|---|---|---|---|
| 1 | Vendors | vendor |
id, name |
Flat list | 10 |
| 2 | Projects | project |
id, name, vendor_id |
By vendor | 50 |
| 3 | Data Centers (DCs) | boq (distinct) |
id, name, vendor_id, project_id |
By vendor_project | 100 |
| 4 | Activities | boq (distinct) |
id, name, dc_id |
By dc | 200 |
| 5 | Schedules | boq (distinct) |
id, name, activity_id |
By activity | 500 |
| 6 | Feeders | boq (distinct) |
id, name, schedule_id |
By schedule | 1000 |
| 7 | BOQ Items | boq + item JOIN |
id, boq_id, item_code, name, uom, feeder_id |
By feeder | No limit |
| 8 | MSPs | msp |
id, name |
Flat list (global) | 100 |
Data Filtering:
vendorId, projectId, and dcIdData Hierarchy:
Vendor → Project → DC → Activity → Schedule → Feeder → Item
↓
MSP (global)
API Endpoint: /workpro/webview/api/offline-pages.php
Downloaded in background after page loads (if not already cached).
| # | Page | Description | Purpose |
|---|---|---|---|
| 1 | Dashboard | index.php |
Main menu when offline |
| 2 | Work Entry | work-entry.php |
Create work entries offline |
| 3 | Pending | Pending entries page | View queued entries |
| 4 | Error | Error/offline notice page | Show when network fails |
| Data | Purpose |
|---|---|
version |
Timestamp of data download |
lastSyncTime |
When data was last synced |
userContext |
userId, vendorId, projectId, dcId, role |
stats |
Count of each data type downloaded |
On Login
index.phpinitOfflineSection() runsautoDownloadOfflineData() triggers if no data or data is staleOn Auto-Login
index.php loads → auto-download triggersManual Refresh
// Auto-download triggers when ALL conditions are met:
1. Running in WorkPro Android app (WorkProDevice is defined)
2. Device is online (navigator.onLine === true)
3. No offline data exists OR data is older than 24 hours
workpro_offline.db):| Table | Columns | Index |
|---|---|---|
vendors |
id, name |
- |
projects |
id, name, vendor_id |
vendor_id |
dcs |
id, name, vendor_id, project_id |
vendor_id, project_id |
activities |
id, name, dc_id |
dc_id |
schedules |
id, name, activity_id |
activity_id |
feeders |
id, name, schedule_id |
schedule_id |
items |
id, item_code, name, uom, feeder_id |
feeder_id |
msps |
id, name, vendor_id, project_id |
vendor_id, project_id |
pending_submissions |
id, form_data, created_at, status |
status |
WorkProOfflineData):| Key | Value |
|---|---|
data_version |
Timestamp of last successful download |
last_sync |
Milliseconds since epoch |
offline_pages/):| File | Content |
|---|---|
dashboard.html |
Cached dashboard page |
work-entry.html |
Cached work entry form |
pending.html |
Cached pending entries page |
error.html |
Cached error page |
index.php:// Check and initialize offline section
initOfflineSection()
// Auto-download if no data exists
autoDownloadOfflineData()
// Silent background download (no UI)
downloadOfflineDataSilent()
// Manual download with progress UI
downloadOfflineData()
// Check and download offline HTML pages
checkAndDownloadOfflinePages()
WorkProDevice):// Store dropdown data
WorkProDevice.storeOfflineDropdowns(jsonData)
// Check if data exists
WorkProDevice.hasOfflineData()
// Get last sync time
WorkProDevice.getOfflineDataSyncTime()
// Download offline pages
WorkProDevice.downloadOfflinePages()
// Check if pages exist
WorkProDevice.hasOfflinePages()
/workpro/webview/api/dropdowns.php Response:{
"success": true,
"version": 1735789200,
"generatedAt": "2026-01-02 10:00:00",
"userContext": {
"userId": 123,
"vendorId": 1,
"projectId": 2,
"dcId": 3,
"role": "VENDOR"
},
"dropdowns": {
"vendors": [{"id": 1, "name": "Vendor A"}],
"projects": {"vendor_1": [{"id": 2, "name": "Project X"}]},
"dcs": {"vendor_1_project_2": [{"id": 3, "name": "DC Alpha"}]},
"activities": {"dc_3": [{"id": 10, "name": "Installation"}]},
"schedules": {"activity_10": [{"id": 20, "name": "Phase 1"}]},
"feeders": {"schedule_20": [{"id": 30, "name": "Feeder A"}]},
"items": {"feeder_30": [{"id": 100, "boq_id": 100, "item_code": "ITM001", "name": "Cable", "uom": "m"}]},
"msps": [{"id": 1, "name": "John Doe"}]
},
"stats": {
"vendors": 1,
"projects": 1,
"dcs": 1,
"activities": 5,
"schedules": 10,
"feeders": 25,
"items": 150,
"msps": 10,
"totalRecords": 203
}
}
"Download Data" fails with SQL error
MSPs not populating in offline mode
Data not auto-downloading
[AutoDownload] logsStale data after 24 hours
webview/api/dropdowns.phpwebview/api/offline-pages.phpwebview/index.php (auto-download logic)webview/work-entry.php (uses offline data)app/.../OfflineDataManager.javaapp/.../OfflinePagesManager.javaapp/.../DeviceInfoInterface.javawebview/js/android-bridge.jsLast Updated: January 2, 2026