Documentation

Roles and Permissions

The "Roles and Permissions" section allows administrators to create roles, define permissions, and assign these permissions to roles and individual users. Below are the details and functionalities available in this section.

Create Role

To create a new role:

  1. Enter the role name in the provided input field.
  2. Click the "Create Role" button to save the new role. This option is only available if you have the 'Write Admin' permission.

Create Permission

To create a new permission:

  1. Enter the permission name in the provided input field.
  2. Provide a description for the permission.
  3. Click the "Create Permission" button to save the new permission. This option is only available if you have the 'Write Admin' permission.

Here is a list of the built-in permissions currently in the system:

Creating a Custom Permission is easy. Just add a permission Name and a basic Description. It is simple to implement into the system. Here are a basic example:

            <?php if (userHasPermission($pdo, $_SESSION['user_id'], 'Task Status Changes')): ?>
                <input type="submit" name="jobComplete" value="Job Complete">
            <?php endif; ?>
                        

Assign Permissions to Roles

To assign permissions to roles:

  1. Select a role from the list of roles displayed as fieldsets.
  2. For each role, check the boxes corresponding to the permissions you want to assign.
  3. Click the "Update Role Permissions" button to save the changes. This option is only available if you have the 'Write Admin' permission.

Assign Permissions to Users

To assign permissions to individual users:

  1. Select a user from the list of users displayed as fieldsets.
  2. For each user, check the boxes corresponding to the permissions you want to assign.
  3. Click the "Update User Permissions" button to save the changes. This option is only available if you have the 'Write Admin' permission.

Permissions Required

Access to create and assign roles and permissions is restricted based on user permissions. The required permission for these actions is 'Write Admin'.

Manage Jobs

Managing jobs involves creating job types, tasks, and task status changes. Each of these elements is integral to organizing and tracking jobs within the system. Below are the steps and permissions required for each operation.

Create Job Type

To create a new job type, follow these steps:

  1. Enter the job type name in the provided input field.
  2. Click the "Create" button to save the new job type. Note that this option is only available if you have the 'Write Admin' permission.

Manage Job Types

To manage existing job types, you can select the job types you want to remove:

  1. Check the checkboxes next to the job types you want to remove.
  2. Click the "Remove Selected" button. Note that this option is only available if you have the 'Write Admin' permission.

Create Task

To create a new task for a job type, follow these steps:

  1. Enter the task name in the provided input field.
  2. Select the job types to which this task will be associated.
  3. Click the "Create" button to save the new task. Note that this option is only available if you have the 'Write Admin' permission.

Manage Tasks

To manage existing tasks, you can select the tasks you want to remove:

  1. Check the checkboxes next to the tasks you want to remove.
  2. Click the "Remove Selected" button. Note that this option is only available if you have the 'Write Admin' permission.

Create Task Status Change

To create a new task status change, follow these steps:

  1. Enter the status change name in the provided input field.
  2. Select the tasks to which this status change will be associated.
  3. Click the "Create Task Status Change" button to save the new status change. Note that this option is only available if you have the 'Write Admin' permission.

Manage Task Status Changes

To manage existing task status changes, you can select the status changes you want to remove:

  1. Check the checkboxes next to the status changes you want to remove.
  2. Click the "Remove Selected Status Changes" button. Note that this option is only available if you have the 'Write Admin' permission.

Job Details Page (job_details.php)

The job_details.php page is responsible for displaying and managing the details of a specific job in the work order system.

Core Functionalities

Database Tables Involved

  • Jobs - Stores job details, status, and descriptions.
  • ClientWorkOrders - Links jobs to clients.
  • WorkOrderNotes - Stores job-related notes.
  • JobSiteImages - Stores images uploaded for job sites.
  • TaskStatusChanges - Tracks task progress.

Security Considerations

Clients

Create Clients

To create a new client in the system, follow these steps:

  1. Select the client type from the dropdown menu. The available client types are dynamically fetched from the server.
  2. Based on the selected client type, additional fields will appear. Fill out these fields as required. The fields are dynamically generated based on the client type and can include text inputs, numbers, dates, checkboxes, and more.
  3. If an address field is present, you can use the Google Places Autocomplete to help fill it out. This feature will also display the client's location on a map.
  4. Click the "Create Client" button to save the new client to the database.

The form is submitted to a server-side script (`Private Files/save_client.php`) that handles saving the client details.

Master Client List

The Master Client List allows you to view and search for clients within the system. Follow these steps to use this feature:

  1. Use the search bar at the top to filter clients by their names or other details. As you type, the list of clients will dynamically update to show only those that match your search query.
  2. Select the client type from the dropdown menu to filter the list further. The available client types are fetched from the server and will populate the dropdown dynamically.
  3. The client table below will display a list of clients based on the selected client type and the search query. The table columns and rows are generated dynamically to reflect the client data.
  4. You can view, manage work orders, or delete a client using the action buttons provided for each client in the list.

The form provides a user-friendly way to navigate and manage client information, ensuring that you can quickly find and review client details as needed.

View Client

The "View Client" section allows users to view and update client information based on their client type and ID. Below are the details and functionalities available in this section.

Client Information

Displays detailed information about the client, including:

Update Client Information

Allows users to update the client's information:

  1. Each field is displayed with its current value.
  2. The user can update the values of the fields and submit the form to save the changes.

Location on Map

The client information includes an address, the address is used to display the location on a Google Map:

Permissions

Access to this section is restricted based on user permissions. The required permissions include:

Steps to View Client Information

  1. Select the client type from the dropdown menu in Master Client List
  2. Search for the Client
  3. Click the "View Client" button to display the client's information.

Steps to Update Client Information

  1. Modify the values of the fields as needed.
  2. Click the "Update Client" button to save the changes.

Client Dashboard

This section provides an overview and details on managing the client dashboard functionalities.

  1. Overview of the client dashboard
  2. Managing client interactions and services
  3. Monitoring client activities and updates

Customer Registration

This section guides users through the customer registration process, including validation and data handling.

  1. Step-by-step guide for customer registration
  2. Validating customer information
  3. Saving and managing customer profiles

Account Management

Create Account

To create a new user account, follow these steps:

  1. Fill in the required fields, including Username, Password, Verify Password, Full Name, and Email Address.
  2. Select a role for the user from the dropdown menu. The roles available are fetched from the server and will populate the dropdown dynamically.
  3. Click the "Create Account" button to save the new user account. Note that this option is only available if you have the 'Write Admin' permission.

Delete User Account

To delete an existing user account, follow these steps:

  1. Select the user you want to delete from the dropdown menu. The list of users is fetched from the server and will populate the dropdown dynamically.
  2. Click the "Delete User" button to remove the selected user account. Note that this action is irreversible and should be performed with caution.

Notice & Groups Management

This section allows you to create and manage notice types, assign status changes to notices, create and manage work order groups, and assign/remove users and notices to/from groups.

Create Notice Type

To create a new notice type:

  1. Enter the notice type in the provided input field.
  2. Click the "Create Notice" button to save the new notice type. This option is only available if you have the 'Write Admin' permission.

Delete Notice Types

To delete existing notice types:

  1. Select the notice types you want to delete by checking the corresponding checkboxes.
  2. Click the "Delete Selected Notice Types" button to remove them from the system.

Assign Status Changes to Notice Type

To assign status changes to a notice type:

  1. Select the notice type from the dropdown menu.
  2. Select the status changes to assign to the notice type from the multi-select dropdown.
  3. Click the "Assign Status to Notice Type" button to save the assignments.

Remove Status Changes from Notice Type

To remove status changes from a notice type:

  1. Select the notice type from the dropdown menu. The associated status changes will be loaded dynamically.
  2. Select the status changes you want to remove by checking the corresponding checkboxes.
  3. Click the "Remove Selected Status Changes" button to remove them from the notice type.

Create WorkOrder Group

To create a new work order group:

  1. Enter the group name in the provided input field.
  2. Click the "Create Group" button to save the new group.

Delete WorkOrder Group

To delete an existing work order group:

  1. Select the group you want to delete from the dropdown menu.
  2. Click the "Delete WorkOrder Group" button. Note that this action cannot be undone and will permanently remove the group.

Add Users to Group

To add users to a group:

  1. Select the group from the dropdown menu.
  2. Select the users you want to add to the group from the multi-select dropdown.
  3. Click the "Assign Users to Group" button to save the assignments.

Remove Users from Group

To remove users from a group:

  1. Select the group from the dropdown menu. The associated users will be loaded dynamically.
  2. Select the users you want to remove by checking the corresponding checkboxes.
  3. Click the "Remove Selected Users" button to save the changes.

Add Notice Types to Group

To add notice types to a group:

  1. Select the notice type from the dropdown menu.
  2. Select the groups to which you want to assign the notice type from the multi-select dropdown.
  3. Click the "Assign Notice to Groups" button to save the assignments.

Remove Notice Types from Group

To remove notice types from a group:

  1. Select the group from the dropdown menu. The associated notice types will be loaded dynamically.
  2. Select the notice types you want to remove by checking the corresponding checkboxes.
  3. Click the "Remove Selected Notice Types" button to save the changes.

Assign Custom Message to Status Change for Twilio

To assign a custom message to a status change for Twilio:

  1. Select the notice type from the dropdown menu.
  2. Select the corresponding status change from the dropdown menu.
  3. Enter the custom message in the provided text area.
  4. Click the "Assign Custom Message" button to save the message.

Remove Assigned Messages

To remove a previously assigned message from a status change:

  1. Select the notice type from the dropdown menu. The associated assigned messages will be loaded dynamically.
  2. Select the assigned message you want to remove from the dropdown menu.
  3. Click the "Remove Assigned Message" button to delete the message.

Custom Field Management

This section allows administrators to create, update, and delete custom fields for different job types. Custom fields help in adding specific attributes to job types, enhancing the ability to manage job-related data effectively.

Add Custom Field

To add a new custom field for a job type:

  1. Select the job type from the dropdown menu.
  2. Enter the field title in the provided input field.
  3. Select the field type (e.g., Text, Checkbox, Dropdown).
  4. If the field type is a dropdown, provide the options as a comma-separated list in the options field.
  5. Enter a description for the field (optional).
  6. Click the "Add Custom Field" button to save the new field. This option is only available if you have the 'Write Admin' permission.

Update/Delete Custom Fields

To update or delete existing custom fields for a selected job type:

  1. Select the job type from the dropdown menu. The existing custom fields for the selected job type will be displayed.
  2. Update the field title, description, and options (for dropdown fields) as needed.
  3. Click the "Update" button to save the changes or the "Delete" button to remove the custom field.

Client Type Management

This section allows administrators to create and delete client types. Client types define the structure of client information, including the fields required for each type. Follow the instructions below to manage client types effectively.

Create Client Type

To create a new client type, follow these steps:

  1. Enter the client type name in the provided input field.
  2. Preset fields ("Name," "Address," and "Phone") are already included. You can add additional fields as needed:
    • Click the "Add Field" button to add a new field.
    • For each new field, enter the field name and select the field type from the dropdown menu.
    • If the field type is "ENUM" or "SET," provide the options as a comma-separated list.
    • Enable Photo Gallery Creates a photo Gallery for Client system
  3. Click the "Create Client Type" button to save the new client type. This option is only available if you have the 'Write Admin' permission.

Field Types

Update Client Type

To update an existing client type, follow these steps:

  1. Select the client type you wish to update from the dropdown menu.
  2. To add a new field:
    • Enter the field name in the provided input field.
    • Select the field type from the dropdown menu.
    • If the field type is "SET," provide the options as a comma-separated list.
  3. To remove existing fields:
    • Select the fields you want to remove by checking the corresponding checkboxes.
  4. Click the "Update Client Table" button to save the changes. This option is only available if you have the 'Write Admin' permission.

Delete Client Type

To delete an existing client type, follow these steps:

  1. Select the client type you want to delete from the dropdown menu.
  2. Click the "Delete Client Type" button to remove the selected client type. Note that this action cannot be undone and will permanently delete the client type and its associated data.

Assign Jobs

The "Assign Jobs" section allows users to create and assign jobs to individuals or groups within the system. Below are the steps and details needed for each operation.

Job Description

Allows the user to enter a detailed description of the job.

Job Type

The user can select the type of job from a dynamically populated dropdown list.

Deadline

The user can set a deadline for the job using a datetime-local input field.

Priority

The user can select the priority level of the job (Low, Normal, High).

Assigned To

The user can assign the job to a specific user from a dropdown list.

User Group

Optionally, the user can select a group to which the job will be assigned.

Attach Client

The user can search for and attach clients to the job. The search results are displayed dynamically as checkboxes.

Submit

The "Create Job" button submits the form, creating the job and attaching the selected clients.

All Jobs

The "All Jobs" section provides a comprehensive view of all jobs within the system, allowing users to search, filter, and manage job assignments. Below are the details and functionalities available in this section.

Search Jobs

The user can search for jobs using the search bar. The table dynamically updates to show jobs that match the search query.

Enable Auto Update

Users can enable or disable auto-update functionality. When enabled, the page refreshes every 10 seconds to display the most current job data.

Assign Selected Jobs

The user can select multiple jobs and assign them to a specific user by choosing from a dropdown list and setting the priority level. Upon submission, the selected jobs are reassigned accordingly.

Column Visibility

Users can toggle the visibility of specific columns in the job table to customize their view. The available columns are:

Job Table

The job table displays the following columns:

View Notices

The "View Notices" section allows users to view jobs based on their associated notice types. Users can select a notice type to filter the jobs accordingly. Below are the details and functionalities available in this section.

Select Notice Type

The user can select a notice type from a dynamically populated dropdown list. Upon selection, the form automatically submits, and the jobs are filtered based on the selected notice type.

Job Table

The job table displays the following columns:

Enable Auto Update

Users can enable or disable auto-update functionality. When enabled, the page refreshes every 10 seconds to display the most current job data.

Dashboard Management

This section provides an overview of the main dashboard functionalities and user navigation capabilities within the application.

  1. Centralized user interface for accessing various system features.
  2. Session-based user verification for secure access, ensuring only logged-in users can interact with the dashboard.
  3. Incorporates FullCalendar to visually display job due dates, enhancing scheduling and time management.
  4. Embedded chat sidebar for easy user communication, allowing users to view and search for other users, select a contact, and engage in real-time chat.
  5. Sticky Notes feature for adding personalized notes on the dashboard, enabling users to create, drag, and delete notes that are color-coded and persist between sessions.
  6. Timezone setting configured to Central Standard Time (CST) for consistent time tracking across user interactions.
  7. Security checks to prevent unauthorized access, including session validation and prevention of direct access to sensitive pages.

Chat Support

This section provides an overview of the Chat system, enabling real-time communication between users within the application.

  1. Allows users to view a sidebar with a searchable list of available contacts for chat interactions.
  2. Displays the latest message for each contact, making it easier for users to quickly find ongoing conversations.
  3. Supports selecting a user to initiate or continue a chat, displaying the chat history in the main chat area.
  4. Includes a responsive chat box where users can send and receive messages in real-time, with messages distinguished by sender and receiver styles.
  5. Utilizes periodic polling every 3 seconds to fetch new messages, ensuring the chat is updated with minimal delay.

Detailed Reporting Dashboard

This section provides an overview of the Detailed Reporting Dashboard, designed to monitor job metrics and generate reports based on various criteria.

  1. Displays summary metrics and visual charts to analyze system performance and job status.
  2. Includes filter options to generate customized reports based on Job Type, Start Date, and End Date.
  3. Presents job data in a tabular format, including details like Job ID, Job Type, Assigned User, Status, Deadline, and Priority.
  4. Offers export functionality, allowing users to download reports in PDF and Excel formats for offline review and analysis.
  5. Visualizes data using charts powered by Chart.js, showing Task Completion Rate and Late Jobs, providing quick insights at a glance.
## Admin Menu: Schedule System

Admin Menu: Schedule System

This section describes how the scheduling interface functions and how administrators can view, create, and manage both user and job schedules from the admin panel.

Menu Location

To access the schedule system, go to:

Admin Panel → Master Schedule System

This screen is available to users with the Write Admin permission depending on functionality access.

Features

How to Use

  1. Open the Schedule page from the admin dashboard.
  2. Use the top navigation to browse months or weeks.
  3. To assign a new shift, use the Assign Work Hours form at the bottom of the page.
  4. Click a job or shift to open the modal for editing, or drag it to a new user/day to update it instantly.
  5. Delete any shift using the 🗑️ icon, or modify via ✏️.

Permissions

Related Files

Add New Inventory Item

This section allows users to add new items to the inventory database.

  1. Input fields for item details:
    • Item Name: Text input for the item's name.
    • Description: Textarea for a brief item description.
    • Quantity: Numeric input for the quantity of the item.
    • Price: Numeric input for the item's price, supporting decimal values.
    • SKU: Text input for the item's unique identifier (SKU).
  2. A submit button triggers an AJAX request to send data to the database.
  3. Displays success or error messages dynamically after the request.

Edit Inventory Items

This section provides functionality to edit existing inventory items.

  1. Inventory items are dynamically loaded from the database using AJAX.
  2. Each item is displayed with editable fields:
    • Name: Editable name field.
    • Description: Editable description textarea.
    • Quantity: Numeric input to update stock.
    • Price: Editable numeric price field with decimal support.
    • SKU: Editable SKU field.
  3. Submitting changes sends an AJAX request to update the item in the database.
  4. Displays success or error messages and refreshes the inventory list automatically.

Update Inventory Stock

This section provides functionality to update inventory stock levels.

  1. A dropdown menu dynamically populated with available inventory items.
  2. Input fields:
    • Quantity: The quantity to add or remove.
    • Transaction Type: Dropdown to select "Add Stock" or "Remove Stock."
    • Notes: Optional textarea for transaction details.
  3. A submit button triggers an AJAX request to update stock levels in the database.
  4. Displays success or error messages dynamically and refreshes the dropdown after updates.

View Inventory

This section provides a table view of all inventory items.

  1. Displays the following columns for each item:
    • ID: Unique identifier for the item.
    • Name: The item's name.
    • Description: A brief description of the item.
    • Quantity: The current stock level.
    • Price: The item's price.
    • SKU: The item's unique identifier (SKU).
  2. Data is retrieved dynamically from the database using PHP.
  3. The table updates automatically when new items are added or edited.

Manage Suppliers

This section provides functionality for managing suppliers in the system.

  1. Add Supplier Form:
    • Name: Text input for the supplier's name.
    • Contact Information: Textarea for contact details.
  2. A submit button sends an AJAX request to add the supplier to the database.
  3. Displays success or error messages dynamically after the request.
  4. View and Manage Suppliers:
    • Displays a table of existing suppliers with columns:
      • ID
      • Name
      • Contact Information
      • Actions (e.g., delete button).
    • Suppliers are fetched dynamically using AJAX.
    • The delete button sends a request to remove the supplier from the database.

Service Type Management

This section allows you to create, delete, and manage service types, upload KML files, and configure service area details.

Create Service Type

To create a new service type:

  1. Enter the service type in the provided input field.
  2. Click the "Create Service Type" button to save it. This option is only available if you have the 'Write Admin' permission.

Delete Service Types

To delete existing service types:

  1. Select the service types you want to delete by checking the corresponding checkboxes.
  2. Click the "Delete Selected Service Types" button to remove them from the system.

Service Type Setup

To configure a service type with additional details:

  1. Select the service type from the dropdown menu.
  2. Upload a KML file to define the service area.
  3. Provide a public description that customers can see.
  4. Provide an admin description for internal use.
  5. Click the "Save Details" button to save the configuration.

View Existing KML Files

To view KML files associated with a service type:

  1. Select a service type from the dropdown menu.
  2. Existing KML files and their descriptions will be displayed.

Service Area Map

The service area map dynamically displays polygons from uploaded KML files. To update the map:

  1. Select a service type to load its polygons.
  2. The polygons will be drawn on the map to indicate service areas.
  3. Click on a polygon to edit or add notes about the service area.

Admin Menu: Twilio IVR & SMS Menu System

This section explains how the admin_menu.php interface is used to build and manage a Twilio-driven interactive menu system that supports both voice and SMS text-based interactions.

Purpose

The admin_menu.php file provides a visual interface for administrators to define menu trees for use with Twilio. These menus can be used in:

Menu Options

Each entry in the menu is saved in the twilio_menu database table and includes the following fields:

How to Use

  1. Go to admin_menu.php as an administrator.
  2. Use the Add Menu Option form to create new entries for voice or SMS flows.
  3. Choose the appropriate action type and value depending on the desired response or behavior.
  4. Save the entry and view it in the Existing Menus table for verification.
  5. The menu structure is automatically used by both incoming voice calls and SMS messages through twilio_webhook.php.

Supported Input

Related Files

Task System

The Task System allows users to view, filter, and manage tasks assigned to them either directly or via their role. Admins with the "Task Management" permission can also create new tasks. Tasks can be filtered by different statuses such as All, Today, This Week, Pending, or Completed.

Key Features:

Tables Used:

Permissions:

Task Creation Process:

Important Notes: