Demo dataset

For a demonstration, a training or a test run, the module can build a complete dataset in one minute: third parties, services, projects, tasks, time spent over the last three weeks and demo accounts. It can then remove everything with the same reliability, without ever touching real data.

The page appears in no menu: an administrator reaches it directly at the address

/custom/capyourtime/admin/demo.php

from the Dolibarr back office.

Demo dataset page after generation, with the accounts and the list of tasks ready to scan

Where generation is allowed

The dataset creates accounts that share a known password and the purge deletes data in bulk: generation and purge are therefore refused on an instance that looks like production. They are only allowed if one of these conditions is met:

  • the CAPYOURTIME_ALLOW_DEMO_DATA constant is 1 (Home > Setup > Other settings), explicit consent for this site ;
  • the instance is a throwaway demo instance (DEMO_INSTANCE constant at 1) ;
  • the instance is in development mode (MAIN_FEATURES_LEVEL at 2 or more).

As long as none is met, the page remains viewable, a warning explains how to allow generation, generation and purge are refused and the accounts' password is not displayed.

Generating the dataset

  1. Open the Project time entry (mobile) > Demo dataset tab page (direct access above).
  2. Tick the confirmation checkbox I confirm that I want to modify the data of this database.
  3. Click Generate the demo dataset.

The generation builds in order: the module configuration (chips, service filter on a demo category), three third parties with their contacts, four billable services, three projects of which one deliberately in draft, eight tasks, then several hundred time entries spread over the last three working weeks. A detailed report is displayed at the end of the run: each [OK] line confirms a creation verified in the database, each [WARN] line flags a partially created item.

Preferably use it on a test instance: it also adjusts a few module settings (link validity duration, chips, service filter) so that all the demonstration functions are reachable.

The demo accounts

The generation creates three accounts attached to a group with the required permissions (read projects, enter time):

  • demo.chef (Claire Vasseur, project manager),
  • demo.tech1 (Hugo Mariotte, traveling technician),
  • demo.tech2 (Nadia Sorel, workshop technician).

The password is displayed on the generation page, only where generation is allowed. These accounts serve both to log in to the Dolibarr back office to see the projects and to enter time from the phone: the first QR scanned with a demo account also opens a short guided tour of the mobile page.

Scanning the demo tasks

Once the dataset is generated, the page lists all the tasks of the open projects with two links: the native time page (where the QR code appears at the bottom right) and a mobile link directly usable from a browser, handy for a demonstration on a shared screen without going through the camera.

Purging the dataset

The purge deletes the whole dataset, in the reverse order of dependencies: time spent, tasks, projects, accounts, group, third parties and contacts, services and category. If an object cannot be deleted (an integrity constraint set by another module on an account, for example), it is flagged in the report and, for a user account, deactivated so that the password displayed in the demo does not remain usable.

The marking relies on the technical import_key field (CYT-DEMO): any data created outside the generator is out of the purge's reach. Generate and purge as many times as needed, even in the middle of real data.