Skip to content

monta990/phonebg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phone Background Plugin Logo

Phone Background

GLPI plugin — Generates personalized PNG wallpapers for corporate phones registered in GLPI

GLPI 11 compatibility GLPI 12 compatibility License PHP GitHub Downloads (all assets, all releases)


Overview

Phone Background generates personalized PNG wallpapers for corporate phones registered in GLPI. It overlays the phone's name, assigned line number, and up to two configurable custom text labels onto a custom PNG template. Each phone record owner can preview, download, or send the wallpaper by email directly from the Phone asset tab.


Requirements

Requirement Minimum version
GLPI ≥ 11.0
PHP ≥ 8.2
PHP extension GD (image processing)

Installation

  1. Download the latest release .zip from Releases
  2. Copy the phonebg/ folder into your GLPI marketplace/ or plugins/ directory.
  3. In GLPI, go to Setup → Plugins and click Install, then Enable.
  4. Go to Setup → Plugins → Phone Background to upload your PNG template.

Configuration

Template tab

Upload a PNG image (max 500 KB) that will serve as the wallpaper background. The image can be any resolution and the plugin adapts to it automatically. For server security and stability, template dimensions are limited to a maximum of 8000x8000 pixels (which covers all standard devices, including 8K resolutions).

Fonts tab

The Fonts tab lets you upload custom TrueType (TTF) or OpenType (OTF) fonts that will be available for the wallpaper text. Uploaded fonts are stored in files/_plugins/phonebg/fonts/ and survive plugin upgrades. The bundled DejaVuSans.ttf is always available as a fallback.

Email tab

The Email tab configures the message sent when a user clicks Send by email on the phone tab.

  • Subject — email subject line; supports {name} (assigned user's full name) and {line} (phone line number) tokens.
  • Body — email body; same tokens supported. Markdown formatting available: **bold**, *italic*, __underline__.
  • Footer — optional footer appended below a horizontal rule (smaller, muted text). Same tokens and markdown supported.
  • Send test email — sends a test message to your own GLPI address to verify delivery. Disabled if GLPI outgoing mail is not configured or if subject/body are empty.

Requires GLPI outgoing mail configured under Setup → Notifications → Email followups.

Positions tab

The Positions tab (visible once a template has been uploaded) provides a full-size visual drag-and-drop editor:

  • Drag the Device name, Line number, Label 1, and Label 2 handles directly over the template to position them.
  • Adjust font size (px) and font color per field using the table inputs.
  • Select the font to use from the dropdown (populated from uploaded fonts).
  • X = 0 centers the text horizontally regardless of image width.
  • Label 1 / Label 2: enter custom static text, enable the toggle, and position the label. Disabled labels are not rendered.
  • Click Save to persist the settings, or Reset to defaults to restore the original values.

Positions are stored in the glpi_plugin_phonebg_config database table and survive plugin upgrades.

Usage

  1. Open any Phone asset in GLPI.
  2. Click the Background tab. Note on permissions: For security and privacy reasons, only GLPI Administrators, Technicians, or the specific User assigned to the phone can generate and preview/download the background.
  3. Click Preview to see the generated wallpaper inline, Download background to save the PNG file, or Send by email to deliver the wallpaper as an attachment to the assigned user's default email address.

File structure

phonebg/
├── fonts/
│   └── DejaVuSans.ttf          # Bundled TrueType font
├── front/
│   ├── config.form.php         # Admin settings page — POST handlers + data prep
│   ├── download.php            # PNG generation, download & preview endpoint
│   ├── send.php                # Email send endpoint (phone tab + test send)
│   └── resource.send.php       # Authenticated template image server
├── inc/
│   ├── background.class.php    # GD image generation logic
│   ├── config.class.php        # DB-backed layout configuration
│   ├── paths.class.php         # Centralized paths & URLs
│   ├── phone.class.php         # Phone asset tab integration
│   └── renderer.class.php      # Twig template renderer helper
├── templates/
│   ├── config_form.html.twig   # Admin settings page HTML
│   └── phone_tab.html.twig     # Phone asset tab HTML + preview modal
├── locales/                    # i18n: es_MX, en_US, en_GB, fr_FR
├── logo.png                    # Plugin icon (128×128, transparent background)
├── setup.php                   # Registration, hooks, install/uninstall
├── LICENSE                     # GPLv3
└── README.md                   # This file

Uninstallation

Disabling and uninstalling via Setup → Plugins drops the glpi_plugin_phonebg_config table. The uploaded template and generated files in files/_plugins/phonebg/ are intentionally preserved.


Changelog

See CHANGELOG.md.


Author

Edwin Elias AlvarezGitHub


Buy me a coffee :)

If you like my work, you can support me by a donate here:

Buy Me A Coffee


License

GPL v3 or later. See LICENSE.

Issues

Report bugs or request features on the issue tracker.

About

Phone Background — GLPI Plugin — Generates personalized PNG wallpapers for corporate phones registered in GLPI

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors