├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── invite-contributors.yml └── settings.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── RoboFile.php ├── composer.json ├── composer.lock ├── db ├── install.sql └── uninstall.sql ├── front └── notificationwebsocketsetting.form.php ├── hook.php ├── hook.php.tpl ├── inc ├── bot.class.php ├── cron.class.php ├── notificationeventwebsocket.class.php ├── notificationwebsocket.class.php ├── notificationwebsocketsetting.class.php └── user.class.php ├── screenshots ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png ├── screenshot4.png └── screenshot5.png ├── setup.php ├── setup.php.tpl ├── telegrambot.png ├── telegrambot.xml └── tools └── HEADER /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | # Change these settings to your own preference 10 | indent_style = space 11 | indent_size = 3 12 | 13 | # We recommend you to keep these unchanged 14 | end_of_line = crlf 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | # tab_width = 2 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Observed Results 4 | 5 | 6 | 7 | ### Expected behavior 8 | 9 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Changes description 2 | 3 | 4 | 5 | ### Checklist 6 | 7 | Please check if your PR fulfills the following specifications: 8 | 9 | - [ ] Tests for the changes have been added 10 | - [ ] Docs have been added/updated 11 | 12 | ### References 13 | 14 | 15 | 16 | Close #N/A -------------------------------------------------------------------------------- /.github/invite-contributors.yml: -------------------------------------------------------------------------------- 1 | isOutside: true 2 | # Team Name 3 | contributors -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | repository: 2 | name: telegrambot 3 | description: Telegram Bot for GLPI 4 | homepage: https://pluginsGLPI.github.io/telegrambot/ 5 | topics: telegram, bot, plugin, glpi 6 | private: false 7 | has_issues: true 8 | has_wiki: false 9 | has_downloads: true 10 | default_branch: develop 11 | allow_squash_merge: true 12 | allow_merge_commit: false 13 | allow_rebase_merge: true 14 | labels: 15 | - name: bug 16 | color: f44336 17 | - name: build 18 | color: 795548 19 | - name: ci 20 | color: fbca04 21 | - name: documentation 22 | color: 607d8b 23 | - name: duplicate 24 | color: 9e9e9e 25 | - name: feature 26 | color: 3f51b5 27 | - name: hacktoberfest 28 | color: ff625f 29 | - name: invalid 30 | color: cddc39 31 | - name: performance 32 | color: 009688 33 | - name: question 34 | color: ff5722 35 | - name: refactor 36 | color: 9c27b0 37 | - name: style 38 | color: 2196f3 39 | - name: test 40 | color: 8bc34a 41 | - name: wontfix 42 | color: ffffff 43 | - name: help wanted 44 | color: 33aa3f 45 | - name: good first issue 46 | color: 7057ff -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | vendor/ 3 | .gh_token 4 | *.min.* 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 5.5 4 | - 5.6 5 | - 7.0 6 | - 7.1 7 | - nightly 8 | 9 | #env: 10 | # global: 11 | # - DB=mysql 12 | # matrix: 13 | # - GLPIVER=9.1/bugfixes 14 | # - GLPIVER=master 15 | 16 | before_script: 17 | - composer self-update 18 | # - git clone --depth=1 https://github.com/glpi-project/glpi -b $GLPIVER ../glpi && cd ../glpi 19 | # - composer install --no-dev 20 | # - mysql -u root -e 'create database glpitest;' 21 | # - php tools/cliinstall.php --db=glpi-test --user=travis --tests 22 | # - mv ../telegrambot plugins/telegrambot 23 | # - cd plugins/telegrambot 24 | - composer install -o 25 | 26 | 27 | script: 28 | - vendor/bin/robo --no-interaction code:cs 29 | # - mysql -u root -e 'select version();' 30 | # - ./vendor/bin/atoum -bf tests/bootstrap.php -d tests/units/ 31 | 32 | 33 | matrix: 34 | # exclude: 35 | # - php: 5.4 36 | # env: GLPIVER=master 37 | allow_failures: 38 | - php: nightly 39 | 40 | cache: 41 | directories: 42 | - $HOME/.composer/cache 43 | 44 | #notifications: 45 | # irc: 46 | # channels: 47 | # - "irc.freenode.org#channel" 48 | # on_success: change 49 | # on_failure: always 50 | # use_notice: true 51 | # skip_join: true 52 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | As contributors and maintainers of the telegrambot project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities. 4 | 5 | Communication through any of our channels (GitHub, Telegram, mailing lists, Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 6 | 7 | We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the telegrambot project to do the same. 8 | 9 | If any member of the community violates this code of conduct, the maintainers of the telegrambot projects may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate. 10 | 11 | If you are subject to or witness unacceptable behavior, or have any other concerns, please contact us. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute to TelegramBot 2 | 3 | Welcome to our ever-growing community :octocat:! 4 | 5 | We are more than happy to accept external contributions to the project in the form of feedback, translations, bug reports, and even better, pull requests. 6 | 7 | We present you here the guidelines to start contributing in the Telegram Bot project. 8 | 9 | # Table of contents 10 | 11 | - 1 [See what’s going on](#1) 12 | - 1.1 [Issue Dashboard](#1.1) 13 | - 1.2 [Pull Request Dashboard](#1.2) 14 | - 2 [Assistance](#2) 15 | - 2.1 [Live support](#2.1) 16 | - 2.2 [Contact](#2.2) 17 | - 3 [Feature Requests](#3) 18 | - 3.1 [Requirement for a Feature Request](#3.1) 19 | - 3.1.1 [Major Feature Request](#3.1.1) 20 | - 3.1.2 [Minor Feature Request](#3.1.2) 21 | - 3.2 [Request a New Feature](#3.2) 22 | - 4 [Submitting](#4) 23 | - 4.1 [How to Submit an Issue or Bugs](#4.1) 24 | - 4.1.1 [Check for Past Issues or Bugs](#4.1.1) 25 | - 4.1.2 [Try to Reproduce It!](#4.1.2) 26 | - 4.1.3 [Isolate the Problem](#4.1.3) 27 | - 4.1.4 [Information Needed for the Report](#4.1.4) 28 | - 4.1.5 [Submit an Issue](#4.1.5) 29 | - 4.2 [How to Create a Pull Request (PR)](#4.2) 30 | - 4.2.1 [Create a Branch and Naming it](#4.2.1) 31 | - 4.2.2 [Make Changes](#4.2.2) 32 | - 4.2.3 [Commit Your Changes](#4.2.3) 33 | - 4.2.3.1 [Rules to Follow](#4.2.3.1) 34 | - 4.2.3.2 [Commit Format](#4.2.3.2) 35 | - 4.2.3.2.1 [Header: Writing a `type`](#4.2.3.2.1) 36 | - 4.2.3.2.2 [Header: Writing the `(optional scope)`](#4.2.3.2.2 ) 37 | - 4.2.3.2.3 [Header: Writing a `description`](#4.2.3.2.3) 38 | - 4.2.3.2.4 [Header Lenght](#4.2.3.2.4) 39 | - 4.2.3.2.5 [Writing the `optional body`](#4.2.3.2.5) 40 | - 4.2.3.2.6 [Writing the `optional footer`](#4.2.3.2.6) 41 | - 4.2.3.3 [Commit Examples](#4.2.3.3) 42 | - 4.2.4 [Push your Changes](#4.2.4) 43 | - 4.2.5 [Create a Pull Request](#4.2.5) 44 | - 4.2.5.1 [How to Write a Title for a Pull Request](#4.2.5.1) 45 | - 4.2.5.2 [Before Send a Pull Request](#4.2.5.2) 46 | - 4.2.5.3 [How We Check your Submission](#4.2.5.3) 47 | - 4.2.5.3.1 [Status Check](#4.2.5.3.1) 48 | - 4.2.5.3.2 [App/Bots List](#4.2.5.3.2) 49 | - 4.2.6 [How to proceed with suggestions](#4.2.6) 50 | - 5 [What to do next?](#5) 51 | - 6 [Coding Rules](#6) 52 | 53 | # 1. See what's going on! [:top:](#top) 54 | 55 | ## 1.1 Issue Dashboard 56 | If you want to know all the issues we're dealing with right now, take a look at our [Issue Dashboard](https://github.com/pluginsGLPI/telegrambot/issues) and look for areas in which you can help. 57 | 58 | 59 | ## 1.2 Pull Request Dashboard 60 | If you want to give us a hand solving issues then great, take a look at our [Pull Request Dashboard](https://github.com/pluginsGLPI/telegrambot/pulls) and check for an open or closed PR. We don’t want to duplicate efforts. 61 | 62 | # 2. Assistance [:top:](#top) 63 | 64 | ## 2.1 Live suppot 65 | You can contact us through our [Telegram group](https://telegram.me/tgbotglpi). 66 | 67 | ## 2.2 Contact 68 | You can fill a form in the plugin's [Contact section](http://plugins.glpi-project.org/#/contact). 69 | 70 | # 3. Feature Requests [:top:](#top) 71 | 72 | ## 3.1 Requirement for a Feature Request 73 | If you like to _implement_ a new feature please [submit an Issue](https://github.com/pluginsGLPI/telegrambot/issues/new) with a proposal, so we can be sure it's relevant. 74 | 75 | ### 3.1.1 Major Feature Request 76 | For a major new feature request, [open an Issue](https://github.com/pluginsGLPI/telegrambot/issues/new) and outline your proposal so it can be discussed. 77 | 78 | ### 3.1.2 Minor Feature Request 79 | For a minor new feature request, you can craft it and directly [submit it as a Pull Request](https://github.com/pluginsGLPI/telegrambot/pulls), we'll take care of it. 80 | 81 | ## 3.2 Request a New Feature 82 | You can request a new feature by [submitting an Issue](https://github.com/pluginsGLPI/telegrambot/issues/new) 83 | 84 | # 4. Submitting [:top:](#top) 85 | 86 | ## 4.1 How to Submit an Issue or Bugs 87 | 88 | A good Issue/Bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What would you expect to be the outcome? All these details will help people to fix any potential bugs. 89 | 90 | A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful, here are steps to follow to build a good one: 91 | 92 | ### 4.1.1 Check for Past Issues or Bugs 93 | Before submitting the issue please check the [Issue Tracker](https://github.com/pluginsGLPI/telegrambot/issues/), maybe the issue/bug was already reported by another contributor. By doing this you help us maximize the effort spent on solving problems and the addition of new features. 94 | 95 | ### 4.1.2 Try to Reproduce It! 96 | Try to reproduce this issue/bug using the latest `develop` branch in the repository [Check it here](https://github.com/pluginsGLPI/telegrambot/branches). 97 | 98 | ### 4.1.3 Isolate the Problem 99 | Ideally, create a reduced test case. We prefer bug reports with small, portable test cases. 100 | 101 | ### 4.1.4 Information Needed for the Report 102 | We require the following information: 103 | 104 | * :warning: **Observed Results:** A brief description of the problem. 105 | * :mag_right: **What steps will reproduce the issue?:** If suitable, including the steps required to reproduce the bug. 106 | * :boom: **Expected Results:** What did you expect to happen? 107 | 108 | ### 4.1.5 Submit an Issue. :rocket: 109 | Having all data at hand, file the new issue by filling out our [Issue form](https://github.com/pluginsGLPI/telegrambot/issues/new). 110 | 111 | **— That's it! :tada:** 112 | 113 | ## 4.2 How to Create a Pull Request (PR) 114 | 115 | Before submitting your Pull Request check for an open or closed PR that relates to your submission. We don't want to duplicate efforts. 116 | 117 | ### 4.2.1 Create a Branch and Naming it 118 | 119 | The project is organized according to the branch model [Git Flow.](http://nvie.com/posts/a-successful-git-branching-model/) Create a new branch before committing any changes. A _branch is a parallel version of a repository._ It is contained within the repository but does not affect the **`primary or master`** branch. 120 | 121 | :heavy_exclamation_mark: **Branch Name Format: `feature/my-killer-feature`**. 122 | 123 | :no_entry_sign: **Important:** Do not commit to our default **`develop`** branch. Name it anything _except master, develop, release-*, or hotfix-*_. We'll use **`created-branch`** an example. 124 | 125 | ### 4.2.2 Make Changes 126 | 127 | Make your changes in your **newly created** branch. 128 | 129 | ```console 130 | git checkout -b feature/created-branch develop 131 | ``` 132 | 133 | ### 4.2.3 Commit Your Changes 134 | A commit, or "revision", is an individual change to a file (or set of files). It's like when you save a file, except with Git, every time you save it creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep a record of what changes were made when and by who. Commits usually contain a commit message which is a brief description of what changes were made. 135 | 136 | ### 4.2.3.1 Rules to Follow 137 | For commits, we follow the [Conventional Commit](http://conventionalcommits.org/). This leads to **more readable messages** that are easy to follow when looking through the project history. But also, we use the git commit messages to **automatically generate changelogs** from these messages. 138 | 139 | ### 4.2.3.2 Commit Format 140 | Each commit message consists of a **header**, a **body**, and a **footer**. The header has a special 141 | format that includes a **type**, a **scope**, and a **description**: 142 | 143 | **:warning: Important:** Please avoid generic terms. 144 | 145 | The commit message should be structured as follows: 146 | 147 | ```console 148 | type(optional scope): description 149 | 150 | optional body 151 | 152 | optional footer 153 | ``` 154 | 155 | ### 4.2.3.2.1 Header: Writing a `type` 156 | Commits must be prefixed with a type, which consists of a verb, **feat, fix, build,** followed by a colon and space. 157 | 158 | **Your options:** 159 | 160 | * **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm). 161 | * **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs). 162 | * **docs**: Documentation only changes. 163 | * **feat**: A new feature. 164 | * **fix**: A bug fix. 165 | * **perf**: A code change that improves performance. 166 | * **refactor**: A code change that neither fixes a bug or adds a feature. 167 | * **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). 168 | * **test**: Adding missing tests or correcting existing tests. 169 | 170 | --- 171 | >**Example for `type`:** 172 | >:point_right:feat:point_left:(parser): add ability to parse arrays 173 | --- 174 | 175 | ### 4.2.3.2.2 Header: Writing the `(optional scope)` 176 | Refers to the extent, subject matter or contextual information about your changes. A scope is a phrase describing the file modified or a section of the codebase, it’s always enclosed in parenthesis. 177 | 178 | --- 179 | > **Example for a `(optional scope)`:** 180 | > feat:point_right:(parser):point_left:: add ability to parse arrays 181 | --- 182 | 183 | ### 4.2.3.2.3 Header: Writing a `description` 184 | A description must immediately follow the **`type(optional scope):`** The description is a short description of the commit. 185 | 186 | **Important** 187 | * About commit character length, keep it concise and don't write more than **50 characters**. 188 | * Use the imperative present tense: change, make, add, update, fix, etc; Do not use changed, changes, added, fixes, fixed, etc. 189 | * Don't capitalize the first letter. 190 | * Do not use a dot (.) at the end. 191 | 192 | --- 193 | >**Example for ``**: 194 | >feat(parser)::point_right:add ability to parse arrays:point_left: 195 | --- 196 | 197 | ### 4.2.3.2.4 Header Lenght 198 | The **header** cannot be longer than 100 characters. This allows the message to be easier to read on GitHub as well as in various git tools. 199 | 200 | ### 4.2.3.2.5 Writing the `optional body` 201 | The body should include the motivation for the change and contrast this with previous behavior. 202 | 203 | --- 204 | >**Example for `optional body`**: 205 | ```console 206 | fix orthography 207 | remove out of date paragraph 208 | fix broken links 209 | ``` 210 | --- 211 | 212 | ### 4.2.3.2.6 Writing the `optional footer` 213 | The `` should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-using-keywords/) if any. 214 | 215 | For example, to close an issue numbered **`123`**, you could use the phrases **`Closes #123`** in your pull request description or commit message. Once the branch is merged into the default branch, the issue will close. 216 | 217 | --- 218 | >**Example for `optional footer`**: 219 | >:point_right:Closes #123:point_left: 220 | --- 221 | 222 | ### 4.2.3.3 Commit Examples 223 | :shit: 224 | **Bad** 225 | 226 | ```console 227 | docs(readme): fix orthography, remove out of date paragraph and fix broken links 228 | ``` 229 | 230 | :+1: 231 | **Good** 232 | 233 | ```console 234 | docs(readme): document design improvement change content 235 | 236 | fix orthography 237 | remove out of date paragraph 238 | fix broken links 239 | ``` 240 | 241 | ### 4.2.4 Push your Changes 242 | Pushing refers to **sending your committed changes to a remote repository**, such as a repository hosted on GitHub. For instance, if you change something locally, you'd want to then push those changes so that others may access them. 243 | 244 | After working on your changes you need to Push it (upload) your **newly created branch** to GitHub 245 | 246 | ```console 247 | git push origin feature/created-branch 248 | ``` 249 | 250 | ### 4.2.5 Create a Pull Request 251 | 252 | Pull requests or PR are **proposed changes** to a repository submitted by a user and accepted or rejected by a repository's collaborators. 253 | 254 | After all the work being pushed to the newly created branch, In GitHub, send a pull request to our [repository.](https://github.com/pluginsGLPI/telegrambot/pulls) 255 | 256 | ### 4.2.5.1 How to Write a Title for a Pull Request 257 | Pull Request should be named in reference to the main fix or feature you provide; minor information can be added to the description. Please be specific and don't use generic terms. 258 | 259 | **:warning: Important:** Please avoid generic terms. 260 | 261 | :straight_ruler: 262 | **Title Length:** Keep it concise and don't write more than **50 characters** in the title. 263 | 264 | :construction: 265 | **For Work in Progress (WIP):** If you don’t want your PR to be merged accidentally, add the word "wip" or "WIP" to its title and the [WIP bot](https://github.com/apps/wip) will set its status to error. 266 | 267 | --- 268 | >**Example for `Titles for work in progress (WIP):`** 269 | >:point_right:WIP Added a Table of Content for the Contributing Guideline Document.:point_left: 270 | --- 271 | 272 | :white_check_mark: 273 | **Finalized Work:** If you are done with your work and want it to be merged, just write a descriptive title with no more than 50 characters. 274 | 275 | --- 276 | >**Example for `Titles for Finalized Work:`** 277 | >:point_right:Added a Table of Content for the Contributing Guideline Document.:point_left: 278 | --- 279 | 280 | ### 4.2.5.2 Before Send a Pull Request 281 | 282 | **1 - Pull Request Description:** Write a description about the changes, we provide a [template](https://github.com/pluginsGLPI/telegrambot/community) for Pull Request descriptions. When you're creating a Pull Request it'll be shown automatically. Just fill it out and you're done. 283 | 284 | **2 - Choose the right label**: Look at the [list of available labels.](https://github.com/pluginsGLPI/telegrambot/issues/labels) 285 | 286 | **3 - Smash that button!** Press that _Create Pull Request_ button and you're done. 287 | 288 | **— That's it! :tada:** 289 | 290 | ### 4.2.5.3 How We Check your Submission 291 | 292 | #### 4.2.5.3.1 Status Check :rotating_light: 293 | 294 | Required status checks ensure us that all required tests are passing before collaborators can make changes to a protected branch. We enforce status checks before a branch is merged. 295 | 296 | The type of required status check we choose is _Loose_, not all of them are required but some of them determines whether your changes will be reviewed or not. Some of them are here on this list, although, some of them may not be implemented in all repositories: 297 | 298 | #### 4.2.5.3.2 App/Bots List :traffic_light: 299 | 300 | **WIP:** Refers to Work In Progress, this app helps you to prevent your PR to be merged accidentally, add the word "wip" or "WIP" to its title and WIP bot will set its status to error. When you write WIP in the PR title it means that your changes are still in progress or unfinished, so it won't be reviewed until the WIP is removed. 301 | 302 | _WIP: Maintainers: Required / Contributors: Required_ 303 | 304 | **AccessLint:** When a pull request is opened, AccessLint reviews the changes and comments with any new accessibility issues, giving you quick, timely, and targeted feedback, before code goes live. 305 | 306 | _AccessLint: Maintainers: Required / Contributors: Required_ 307 | 308 | **commitlint:** Runs commitlint against all commits of new or edited pull requests and sets an appropriate status check. 309 | 310 | _commitlint: Maintainers: Required / Contributors: Required_ 311 | 312 | **DCO:** This App enforces the Developer Certificate of Origin (DCO) on Pull Requests. It requires all commit messages to contain the Signed-off-by line with an email address that matches the commit author. 313 | 314 | _DCO: Maintainers: Required / Contributors: Optional_ 315 | 316 | **DEP:** A Github App that helps to manage Pull Request dependencies. That App works similar to typical CI services ( e.g Travis) but instead of running a test suite, It will check whether a pull request dependencies are resolved. 317 | 318 | _DEP: Maintainers: Required / Contributors: Required_ 319 | 320 | **ci/circleci build:** CircleCI acts as a platform for both Continuous Integration and Continuous Deployment. If your tests pass, then you can deploy your code to development, staging, production, or other environments. 321 | 322 | _ci/circleci build: Maintainers: Required / Contributors: Required_ 323 | 324 | **continuous-integration/travis-ci/push(and pr):** An automatic construction of the requested changes is carried out and the tests are executed automatically. 325 | 326 | _continuous-integration/travis-ci/push(and pr): Maintainers: Required / Contributors: Required_ 327 | 328 | ### 4.2.6 How to proceed with suggestions 329 | 330 | If we suggest changes then: 331 | * Make the required updates. 332 | * Re-run the test suites to ensure tests are still passing. 333 | * Rebase your branch and force push to your GitHub repository (this will update your Pull Request): 334 | 335 | ```shell 336 | git rebase develop -i 337 | git push -f 338 | ``` 339 | :warning: 340 | **Remove the WIP label:** When a PR is ready for review, remove the prefix WIP in the PR title. 341 | 342 | # 5. What to do next? [:top:](#top) 343 | 344 | After your pull request is merged, you can safely delete your branch and pull the changes 345 | from the main (upstream) repository: 346 | 347 | * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: 348 | 349 | ```shell 350 | git push origin --delete feature/created-branch 351 | ``` 352 | 353 | * Check out the develop branch: 354 | 355 | ```shell 356 | git checkout develop -f 357 | ``` 358 | 359 | * Delete the local branch: 360 | 361 | ```shell 362 | git branch -D feature/created-branch 363 | ``` 364 | 365 | * Update develop with the latest upstream version: 366 | 367 | ```shell 368 | git pull --ff upstream develop 369 | ``` 370 | 371 | # 6. Coding Rules [:top:](#top) 372 | 373 | To ensure consistency throughout the source code, keep these rules in mind as you are working: 374 | 375 | * All features or bug fixes must be tested by one or more specs (unit-tests). 376 | * All methods must be documented. 377 | * Follow the [GLPI Developer Documentation](http://glpi-developer-documentation.readthedocs.io/en/latest/index.html). 378 | 379 | # Good luck! :tada: -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Telegram Bot for GLPI 2 | 3 | ![GLPI Banner](https://user-images.githubusercontent.com/29282308/31666160-8ad74b1a-b34b-11e7-839b-043255af4f58.png) 4 | 5 | [![License GPL 3.0](https://img.shields.io/badge/License-GPL%203.0-blue.svg)](./license) 6 | [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) 7 | [![Telegram Group](https://img.shields.io/badge/Telegram-Group-blue.svg)](https://telegram.me/tgbotglpi) 8 | [![Github All Releases](https://img.shields.io/github/downloads/pluginsGLPI/telegrambot/total.svg)](http://plugins.glpi-project.org/#/plugin/telegrambot) 9 | [![Follow Twitter](https://img.shields.io/badge/Twitter-GLPI%20Project-26A2FA.svg)](https://twitter.com/GLPI_PROJECT) 10 | [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) 11 | 12 | ## Table of Contents 13 | 14 | * [Synopsis](#synopsis) 15 | * [Build Status](#build-status) 16 | * [Installation](#installation) 17 | * [Documentation](#documentation) 18 | * [Versioning](#versioning) 19 | * [Contact](#contact) 20 | * [Professional Services](#professional-services) 21 | * [Contribute](#contribute) 22 | * [Copying](#copying) 23 | 24 | ## Synopsis 25 | 26 | This Bot for GLPI allows you to get notifications on Telegram when a ticket is created on GLPI, keeping you up to date with what's happening in your IT infrastructure.. 27 | 28 | ## Build Status 29 | 30 | |**Release channel**|Beta Channel| 31 | |:---:|:---:| 32 | |[![Travis CI build](https://api.travis-ci.org/pluginsGLPI/telegrambot.svg?branch=master)](https://travis-ci.org/pluginsGLPI/telegrambot/)|[![Travis CI build](https://api.travis-ci.org/pluginsGLPI/telegrambot.svg?branch=develop)](https://travis-ci.org/pluginsGLPI/telegrambot/)| 33 | 34 | ## Installation 35 | 36 | Click on the image to view the video preview. 37 | 38 | [![Everything Is AWESOME](http://img.youtube.com/vi/TKqIpIaAIAE/0.jpg)](https://youtu.be/TKqIpIaAIAE) 39 | 40 | ## Documentation 41 | 42 | We maintain a detailed documentation of the project on the website, see our [How-tos](https://pluginsGLPI.github.io/telegrambot/howtos) and [Development](https://pluginsGLPI.github.io/telegrambot/) sections. 43 | 44 | ## Versioning 45 | 46 | In order to provide transparency on our release cycle and to maintain backward compatibility, this project is maintained under [the Semantic Versioning guidelines](http://semver.org/). We are committed to following and complying with the rules, the best we can. 47 | 48 | See [the tags section of our GitHub project](https://github.com/pluginsGLPI/telegrambot/tags) for changelogs for each release version. 49 | 50 | ## Contact 51 | 52 | You can sen us a message through [Telegram](https://telegram.me/tgbotglpi). 53 | 54 | ## Professional Services 55 | 56 | The GLPI Network services are available through our [Partner's Network](http://www.teclib-edition.com/en/partners/). We provide special training, bug fixes with editor subscription, contributions for new features, and more. 57 | 58 | Obtain a personalized service experience, associated with benefits and opportunities. 59 | 60 | ## Contribute 61 | 62 | Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our 63 | guidelines for [contributing](./CONTRIBUTING.md) and then check out one of our issues in the [Issues Dashboard](https://github.com/pluginsGLPI/telegrambot/issues). 64 | 65 | ## Copying 66 | 67 | * **Name**: [GLPI](http://glpi-project.org/) is a registered trademark of [Teclib'](http://www.teclib-edition.com/en/). 68 | * **Code**: you can redistribute it and/or modifyit under the terms of the GNU General Public License ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)). 69 | * **Documentation**: released under Attribution 4.0 International ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)). -------------------------------------------------------------------------------- /RoboFile.php: -------------------------------------------------------------------------------- 1 | =5.5" 27 | }, 28 | "require-dev": { 29 | "ext-curl": "*", 30 | "phpunit/phpunit": "^4.0 || ^5.0", 31 | "psr/log": "^1.0" 32 | }, 33 | "suggest": { 34 | "psr/log": "Required for using the Log middleware" 35 | }, 36 | "type": "library", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "6.2-dev" 40 | } 41 | }, 42 | "autoload": { 43 | "files": [ 44 | "src/functions_include.php" 45 | ], 46 | "psr-4": { 47 | "GuzzleHttp\\": "src/" 48 | } 49 | }, 50 | "notification-url": "https://packagist.org/downloads/", 51 | "license": [ 52 | "MIT" 53 | ], 54 | "authors": [ 55 | { 56 | "name": "Michael Dowling", 57 | "email": "mtdowling@gmail.com", 58 | "homepage": "https://github.com/mtdowling" 59 | } 60 | ], 61 | "description": "Guzzle is a PHP HTTP client library", 62 | "homepage": "http://guzzlephp.org/", 63 | "keywords": [ 64 | "client", 65 | "curl", 66 | "framework", 67 | "http", 68 | "http client", 69 | "rest", 70 | "web service" 71 | ], 72 | "time": "2017-06-22T18:50:49+00:00" 73 | }, 74 | { 75 | "name": "guzzlehttp/promises", 76 | "version": "v1.3.1", 77 | "source": { 78 | "type": "git", 79 | "url": "https://github.com/guzzle/promises.git", 80 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 81 | }, 82 | "dist": { 83 | "type": "zip", 84 | "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 85 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 86 | "shasum": "" 87 | }, 88 | "require": { 89 | "php": ">=5.5.0" 90 | }, 91 | "require-dev": { 92 | "phpunit/phpunit": "^4.0" 93 | }, 94 | "type": "library", 95 | "extra": { 96 | "branch-alias": { 97 | "dev-master": "1.4-dev" 98 | } 99 | }, 100 | "autoload": { 101 | "psr-4": { 102 | "GuzzleHttp\\Promise\\": "src/" 103 | }, 104 | "files": [ 105 | "src/functions_include.php" 106 | ] 107 | }, 108 | "notification-url": "https://packagist.org/downloads/", 109 | "license": [ 110 | "MIT" 111 | ], 112 | "authors": [ 113 | { 114 | "name": "Michael Dowling", 115 | "email": "mtdowling@gmail.com", 116 | "homepage": "https://github.com/mtdowling" 117 | } 118 | ], 119 | "description": "Guzzle promises library", 120 | "keywords": [ 121 | "promise" 122 | ], 123 | "time": "2016-12-20T10:07:11+00:00" 124 | }, 125 | { 126 | "name": "guzzlehttp/psr7", 127 | "version": "1.4.2", 128 | "source": { 129 | "type": "git", 130 | "url": "https://github.com/guzzle/psr7.git", 131 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" 132 | }, 133 | "dist": { 134 | "type": "zip", 135 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 136 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 137 | "shasum": "" 138 | }, 139 | "require": { 140 | "php": ">=5.4.0", 141 | "psr/http-message": "~1.0" 142 | }, 143 | "provide": { 144 | "psr/http-message-implementation": "1.0" 145 | }, 146 | "require-dev": { 147 | "phpunit/phpunit": "~4.0" 148 | }, 149 | "type": "library", 150 | "extra": { 151 | "branch-alias": { 152 | "dev-master": "1.4-dev" 153 | } 154 | }, 155 | "autoload": { 156 | "psr-4": { 157 | "GuzzleHttp\\Psr7\\": "src/" 158 | }, 159 | "files": [ 160 | "src/functions_include.php" 161 | ] 162 | }, 163 | "notification-url": "https://packagist.org/downloads/", 164 | "license": [ 165 | "MIT" 166 | ], 167 | "authors": [ 168 | { 169 | "name": "Michael Dowling", 170 | "email": "mtdowling@gmail.com", 171 | "homepage": "https://github.com/mtdowling" 172 | }, 173 | { 174 | "name": "Tobias Schultze", 175 | "homepage": "https://github.com/Tobion" 176 | } 177 | ], 178 | "description": "PSR-7 message implementation that also provides common utility methods", 179 | "keywords": [ 180 | "http", 181 | "message", 182 | "request", 183 | "response", 184 | "stream", 185 | "uri", 186 | "url" 187 | ], 188 | "time": "2017-03-20T17:10:46+00:00" 189 | }, 190 | { 191 | "name": "longman/telegram-bot", 192 | "version": "0.50.0", 193 | "source": { 194 | "type": "git", 195 | "url": "https://github.com/php-telegram-bot/core.git", 196 | "reference": "54823db1306a791830a7915072f03ff84fd7c4f3" 197 | }, 198 | "dist": { 199 | "type": "zip", 200 | "url": "https://api.github.com/repos/php-telegram-bot/core/zipball/54823db1306a791830a7915072f03ff84fd7c4f3", 201 | "reference": "54823db1306a791830a7915072f03ff84fd7c4f3", 202 | "shasum": "" 203 | }, 204 | "require": { 205 | "ext-curl": "*", 206 | "ext-mbstring": "*", 207 | "ext-pdo": "*", 208 | "guzzlehttp/guzzle": "^6.2", 209 | "monolog/monolog": "^1.22", 210 | "php": "^5.5|^7.0" 211 | }, 212 | "require-dev": { 213 | "phpunit/phpunit": "^4.8|^5.7|^6.1", 214 | "squizlabs/php_codesniffer": "^2.8" 215 | }, 216 | "type": "library", 217 | "autoload": { 218 | "psr-4": { 219 | "Longman\\TelegramBot\\": "src/" 220 | } 221 | }, 222 | "notification-url": "https://packagist.org/downloads/", 223 | "license": [ 224 | "MIT" 225 | ], 226 | "authors": [ 227 | { 228 | "name": "Avtandil Kikabidze aka LONGMAN", 229 | "email": "akalongman@gmail.com", 230 | "homepage": "http://longman.me", 231 | "role": "Developer" 232 | } 233 | ], 234 | "description": "PHP Telegram bot", 235 | "homepage": "https://github.com/php-telegram-bot/core", 236 | "keywords": [ 237 | "api", 238 | "bot", 239 | "telegram" 240 | ], 241 | "time": "2017-10-17T12:09:43+00:00" 242 | }, 243 | { 244 | "name": "monolog/monolog", 245 | "version": "1.23.0", 246 | "source": { 247 | "type": "git", 248 | "url": "https://github.com/Seldaek/monolog.git", 249 | "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" 250 | }, 251 | "dist": { 252 | "type": "zip", 253 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", 254 | "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", 255 | "shasum": "" 256 | }, 257 | "require": { 258 | "php": ">=5.3.0", 259 | "psr/log": "~1.0" 260 | }, 261 | "provide": { 262 | "psr/log-implementation": "1.0.0" 263 | }, 264 | "require-dev": { 265 | "aws/aws-sdk-php": "^2.4.9 || ^3.0", 266 | "doctrine/couchdb": "~1.0@dev", 267 | "graylog2/gelf-php": "~1.0", 268 | "jakub-onderka/php-parallel-lint": "0.9", 269 | "php-amqplib/php-amqplib": "~2.4", 270 | "php-console/php-console": "^3.1.3", 271 | "phpunit/phpunit": "~4.5", 272 | "phpunit/phpunit-mock-objects": "2.3.0", 273 | "ruflin/elastica": ">=0.90 <3.0", 274 | "sentry/sentry": "^0.13", 275 | "swiftmailer/swiftmailer": "^5.3|^6.0" 276 | }, 277 | "suggest": { 278 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 279 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 280 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 281 | "ext-mongo": "Allow sending log messages to a MongoDB server", 282 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 283 | "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", 284 | "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", 285 | "php-console/php-console": "Allow sending log messages to Google Chrome", 286 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 287 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 288 | "sentry/sentry": "Allow sending log messages to a Sentry server" 289 | }, 290 | "type": "library", 291 | "extra": { 292 | "branch-alias": { 293 | "dev-master": "2.0.x-dev" 294 | } 295 | }, 296 | "autoload": { 297 | "psr-4": { 298 | "Monolog\\": "src/Monolog" 299 | } 300 | }, 301 | "notification-url": "https://packagist.org/downloads/", 302 | "license": [ 303 | "MIT" 304 | ], 305 | "authors": [ 306 | { 307 | "name": "Jordi Boggiano", 308 | "email": "j.boggiano@seld.be", 309 | "homepage": "http://seld.be" 310 | } 311 | ], 312 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 313 | "homepage": "http://github.com/Seldaek/monolog", 314 | "keywords": [ 315 | "log", 316 | "logging", 317 | "psr-3" 318 | ], 319 | "time": "2017-06-19T01:22:40+00:00" 320 | }, 321 | { 322 | "name": "psr/http-message", 323 | "version": "1.0.1", 324 | "source": { 325 | "type": "git", 326 | "url": "https://github.com/php-fig/http-message.git", 327 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 328 | }, 329 | "dist": { 330 | "type": "zip", 331 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 332 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 333 | "shasum": "" 334 | }, 335 | "require": { 336 | "php": ">=5.3.0" 337 | }, 338 | "type": "library", 339 | "extra": { 340 | "branch-alias": { 341 | "dev-master": "1.0.x-dev" 342 | } 343 | }, 344 | "autoload": { 345 | "psr-4": { 346 | "Psr\\Http\\Message\\": "src/" 347 | } 348 | }, 349 | "notification-url": "https://packagist.org/downloads/", 350 | "license": [ 351 | "MIT" 352 | ], 353 | "authors": [ 354 | { 355 | "name": "PHP-FIG", 356 | "homepage": "http://www.php-fig.org/" 357 | } 358 | ], 359 | "description": "Common interface for HTTP messages", 360 | "homepage": "https://github.com/php-fig/http-message", 361 | "keywords": [ 362 | "http", 363 | "http-message", 364 | "psr", 365 | "psr-7", 366 | "request", 367 | "response" 368 | ], 369 | "time": "2016-08-06T14:39:51+00:00" 370 | }, 371 | { 372 | "name": "psr/log", 373 | "version": "1.0.2", 374 | "source": { 375 | "type": "git", 376 | "url": "https://github.com/php-fig/log.git", 377 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" 378 | }, 379 | "dist": { 380 | "type": "zip", 381 | "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 382 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 383 | "shasum": "" 384 | }, 385 | "require": { 386 | "php": ">=5.3.0" 387 | }, 388 | "type": "library", 389 | "extra": { 390 | "branch-alias": { 391 | "dev-master": "1.0.x-dev" 392 | } 393 | }, 394 | "autoload": { 395 | "psr-4": { 396 | "Psr\\Log\\": "Psr/Log/" 397 | } 398 | }, 399 | "notification-url": "https://packagist.org/downloads/", 400 | "license": [ 401 | "MIT" 402 | ], 403 | "authors": [ 404 | { 405 | "name": "PHP-FIG", 406 | "homepage": "http://www.php-fig.org/" 407 | } 408 | ], 409 | "description": "Common interface for logging libraries", 410 | "homepage": "https://github.com/php-fig/log", 411 | "keywords": [ 412 | "log", 413 | "psr", 414 | "psr-3" 415 | ], 416 | "time": "2016-10-10T12:19:37+00:00" 417 | } 418 | ], 419 | "packages-dev": [ 420 | { 421 | "name": "consolidation/annotated-command", 422 | "version": "2.8.1", 423 | "source": { 424 | "type": "git", 425 | "url": "https://github.com/consolidation/annotated-command.git", 426 | "reference": "7f94009d732922d61408536f9228aca8f22e9135" 427 | }, 428 | "dist": { 429 | "type": "zip", 430 | "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7f94009d732922d61408536f9228aca8f22e9135", 431 | "reference": "7f94009d732922d61408536f9228aca8f22e9135", 432 | "shasum": "" 433 | }, 434 | "require": { 435 | "consolidation/output-formatters": "^3.1.12", 436 | "php": ">=5.4.0", 437 | "psr/log": "^1", 438 | "symfony/console": "^2.8|~3", 439 | "symfony/event-dispatcher": "^2.5|^3", 440 | "symfony/finder": "^2.5|^3" 441 | }, 442 | "require-dev": { 443 | "phpunit/phpunit": "^4.8", 444 | "satooshi/php-coveralls": "^1.0", 445 | "squizlabs/php_codesniffer": "^2.7" 446 | }, 447 | "type": "library", 448 | "extra": { 449 | "branch-alias": { 450 | "dev-master": "2.x-dev" 451 | } 452 | }, 453 | "autoload": { 454 | "psr-4": { 455 | "Consolidation\\AnnotatedCommand\\": "src" 456 | } 457 | }, 458 | "notification-url": "https://packagist.org/downloads/", 459 | "license": [ 460 | "MIT" 461 | ], 462 | "authors": [ 463 | { 464 | "name": "Greg Anderson", 465 | "email": "greg.1.anderson@greenknowe.org" 466 | } 467 | ], 468 | "description": "Initialize Symfony Console commands from annotated command class methods.", 469 | "time": "2017-10-17T01:48:51+00:00" 470 | }, 471 | { 472 | "name": "consolidation/config", 473 | "version": "1.0.6", 474 | "source": { 475 | "type": "git", 476 | "url": "https://github.com/consolidation/config.git", 477 | "reference": "a57ff3a302aac6f7e6fc0d81fe0778550a0fe9aa" 478 | }, 479 | "dist": { 480 | "type": "zip", 481 | "url": "https://api.github.com/repos/consolidation/config/zipball/a57ff3a302aac6f7e6fc0d81fe0778550a0fe9aa", 482 | "reference": "a57ff3a302aac6f7e6fc0d81fe0778550a0fe9aa", 483 | "shasum": "" 484 | }, 485 | "require": { 486 | "dflydev/dot-access-data": "^1.1.0", 487 | "grasmash/yaml-expander": "^1.1", 488 | "php": ">=5.4.0" 489 | }, 490 | "require-dev": { 491 | "phpunit/phpunit": "^4", 492 | "satooshi/php-coveralls": "^1.0", 493 | "squizlabs/php_codesniffer": "2.*", 494 | "symfony/console": "^2.5|^3" 495 | }, 496 | "type": "library", 497 | "extra": { 498 | "branch-alias": { 499 | "dev-master": "1.x-dev" 500 | } 501 | }, 502 | "autoload": { 503 | "psr-4": { 504 | "Consolidation\\Config\\": "src" 505 | } 506 | }, 507 | "notification-url": "https://packagist.org/downloads/", 508 | "license": [ 509 | "MIT" 510 | ], 511 | "authors": [ 512 | { 513 | "name": "Greg Anderson", 514 | "email": "greg.1.anderson@greenknowe.org" 515 | } 516 | ], 517 | "description": "Provide configuration services for a commandline tool.", 518 | "time": "2017-10-17T17:09:36+00:00" 519 | }, 520 | { 521 | "name": "consolidation/log", 522 | "version": "1.0.3", 523 | "source": { 524 | "type": "git", 525 | "url": "https://github.com/consolidation/log.git", 526 | "reference": "74ba81b4edc585616747cc5c5309ce56fec41254" 527 | }, 528 | "dist": { 529 | "type": "zip", 530 | "url": "https://api.github.com/repos/consolidation/log/zipball/74ba81b4edc585616747cc5c5309ce56fec41254", 531 | "reference": "74ba81b4edc585616747cc5c5309ce56fec41254", 532 | "shasum": "" 533 | }, 534 | "require": { 535 | "php": ">=5.5.0", 536 | "psr/log": "~1.0", 537 | "symfony/console": "~2.5|~3.0" 538 | }, 539 | "require-dev": { 540 | "phpunit/phpunit": "4.*", 541 | "squizlabs/php_codesniffer": "2.*" 542 | }, 543 | "type": "library", 544 | "extra": { 545 | "branch-alias": { 546 | "dev-master": "1.x-dev" 547 | } 548 | }, 549 | "autoload": { 550 | "psr-4": { 551 | "Consolidation\\Log\\": "src" 552 | } 553 | }, 554 | "notification-url": "https://packagist.org/downloads/", 555 | "license": [ 556 | "MIT" 557 | ], 558 | "authors": [ 559 | { 560 | "name": "Greg Anderson", 561 | "email": "greg.1.anderson@greenknowe.org" 562 | } 563 | ], 564 | "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", 565 | "time": "2016-03-23T23:46:42+00:00" 566 | }, 567 | { 568 | "name": "consolidation/output-formatters", 569 | "version": "3.1.12", 570 | "source": { 571 | "type": "git", 572 | "url": "https://github.com/consolidation/output-formatters.git", 573 | "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a" 574 | }, 575 | "dist": { 576 | "type": "zip", 577 | "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", 578 | "reference": "88ef346a1cefb92aab8b57a3214a6d5fc63f5d2a", 579 | "shasum": "" 580 | }, 581 | "require": { 582 | "php": ">=5.4.0", 583 | "symfony/console": "^2.8|~3", 584 | "symfony/finder": "~2.5|~3.0" 585 | }, 586 | "require-dev": { 587 | "phpunit/phpunit": "^4.8", 588 | "satooshi/php-coveralls": "^1.0", 589 | "squizlabs/php_codesniffer": "^2.7", 590 | "victorjonsson/markdowndocs": "^1.3" 591 | }, 592 | "type": "library", 593 | "extra": { 594 | "branch-alias": { 595 | "dev-master": "3.x-dev" 596 | } 597 | }, 598 | "autoload": { 599 | "psr-4": { 600 | "Consolidation\\OutputFormatters\\": "src" 601 | } 602 | }, 603 | "notification-url": "https://packagist.org/downloads/", 604 | "license": [ 605 | "MIT" 606 | ], 607 | "authors": [ 608 | { 609 | "name": "Greg Anderson", 610 | "email": "greg.1.anderson@greenknowe.org" 611 | } 612 | ], 613 | "description": "Format text by applying transformations provided by plug-in formatters.", 614 | "time": "2017-10-12T19:38:03+00:00" 615 | }, 616 | { 617 | "name": "consolidation/robo", 618 | "version": "dev-master", 619 | "source": { 620 | "type": "git", 621 | "url": "https://github.com/consolidation/Robo.git", 622 | "reference": "7eea0d3cf92ef0d76dbf0917b172b12054007621" 623 | }, 624 | "dist": { 625 | "type": "zip", 626 | "url": "https://api.github.com/repos/consolidation/Robo/zipball/7eea0d3cf92ef0d76dbf0917b172b12054007621", 627 | "reference": "7eea0d3cf92ef0d76dbf0917b172b12054007621", 628 | "shasum": "" 629 | }, 630 | "require": { 631 | "consolidation/annotated-command": "^2.8.1", 632 | "consolidation/config": "^1.0.1", 633 | "consolidation/log": "~1", 634 | "consolidation/output-formatters": "^3.1.5", 635 | "league/container": "^2.2", 636 | "php": ">=5.5.0", 637 | "symfony/console": "~2.8|~3.0", 638 | "symfony/event-dispatcher": "~2.5|~3.0", 639 | "symfony/filesystem": "~2.5|~3.0", 640 | "symfony/finder": "~2.5|~3.0", 641 | "symfony/process": "~2.5|~3.0" 642 | }, 643 | "replace": { 644 | "codegyre/robo": "< 1.0" 645 | }, 646 | "require-dev": { 647 | "codeception/aspect-mock": "~1", 648 | "codeception/base": "^2.2.6", 649 | "codeception/verify": "^0.3.2", 650 | "henrikbjorn/lurker": "~1", 651 | "natxet/cssmin": "3.0.4", 652 | "patchwork/jsqueeze": "~2", 653 | "pear/archive_tar": "^1.4.2", 654 | "phpunit/php-code-coverage": "~2|~4", 655 | "satooshi/php-coveralls": "~1", 656 | "squizlabs/php_codesniffer": "^2.8" 657 | }, 658 | "suggest": { 659 | "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", 660 | "natxet/CssMin": "For minifying CSS files in taskMinify", 661 | "patchwork/jsqueeze": "For minifying JS files in taskMinify", 662 | "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." 663 | }, 664 | "bin": [ 665 | "robo" 666 | ], 667 | "type": "library", 668 | "extra": { 669 | "branch-alias": { 670 | "dev-master": "1.x-dev", 671 | "dev-state": "1.x-dev" 672 | } 673 | }, 674 | "autoload": { 675 | "classmap": [ 676 | "scripts/composer/ScriptHandler.php" 677 | ], 678 | "psr-4": { 679 | "Robo\\": "src" 680 | } 681 | }, 682 | "notification-url": "https://packagist.org/downloads/", 683 | "license": [ 684 | "MIT" 685 | ], 686 | "authors": [ 687 | { 688 | "name": "Davert", 689 | "email": "davert.php@resend.cc" 690 | } 691 | ], 692 | "description": "Modern task runner", 693 | "time": "2017-10-19T18:38:53+00:00" 694 | }, 695 | { 696 | "name": "container-interop/container-interop", 697 | "version": "1.2.0", 698 | "source": { 699 | "type": "git", 700 | "url": "https://github.com/container-interop/container-interop.git", 701 | "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" 702 | }, 703 | "dist": { 704 | "type": "zip", 705 | "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", 706 | "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", 707 | "shasum": "" 708 | }, 709 | "require": { 710 | "psr/container": "^1.0" 711 | }, 712 | "type": "library", 713 | "autoload": { 714 | "psr-4": { 715 | "Interop\\Container\\": "src/Interop/Container/" 716 | } 717 | }, 718 | "notification-url": "https://packagist.org/downloads/", 719 | "license": [ 720 | "MIT" 721 | ], 722 | "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", 723 | "homepage": "https://github.com/container-interop/container-interop", 724 | "time": "2017-02-14T19:40:03+00:00" 725 | }, 726 | { 727 | "name": "dflydev/dot-access-data", 728 | "version": "v1.1.0", 729 | "source": { 730 | "type": "git", 731 | "url": "https://github.com/dflydev/dflydev-dot-access-data.git", 732 | "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" 733 | }, 734 | "dist": { 735 | "type": "zip", 736 | "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", 737 | "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", 738 | "shasum": "" 739 | }, 740 | "require": { 741 | "php": ">=5.3.2" 742 | }, 743 | "type": "library", 744 | "extra": { 745 | "branch-alias": { 746 | "dev-master": "1.0-dev" 747 | } 748 | }, 749 | "autoload": { 750 | "psr-0": { 751 | "Dflydev\\DotAccessData": "src" 752 | } 753 | }, 754 | "notification-url": "https://packagist.org/downloads/", 755 | "license": [ 756 | "MIT" 757 | ], 758 | "authors": [ 759 | { 760 | "name": "Dragonfly Development Inc.", 761 | "email": "info@dflydev.com", 762 | "homepage": "http://dflydev.com" 763 | }, 764 | { 765 | "name": "Beau Simensen", 766 | "email": "beau@dflydev.com", 767 | "homepage": "http://beausimensen.com" 768 | }, 769 | { 770 | "name": "Carlos Frutos", 771 | "email": "carlos@kiwing.it", 772 | "homepage": "https://github.com/cfrutos" 773 | } 774 | ], 775 | "description": "Given a deep data structure, access data by dot notation.", 776 | "homepage": "https://github.com/dflydev/dflydev-dot-access-data", 777 | "keywords": [ 778 | "access", 779 | "data", 780 | "dot", 781 | "notation" 782 | ], 783 | "time": "2017-01-20T21:14:22+00:00" 784 | }, 785 | { 786 | "name": "glpi-project/coding-standard", 787 | "version": "0.5", 788 | "source": { 789 | "type": "git", 790 | "url": "https://github.com/glpi-project/coding-standard.git", 791 | "reference": "e19495c896a01199a2fec2e65b7613310598cf96" 792 | }, 793 | "dist": { 794 | "type": "zip", 795 | "url": "https://api.github.com/repos/glpi-project/coding-standard/zipball/e19495c896a01199a2fec2e65b7613310598cf96", 796 | "reference": "e19495c896a01199a2fec2e65b7613310598cf96", 797 | "shasum": "" 798 | }, 799 | "require": { 800 | "squizlabs/php_codesniffer": "~2.0" 801 | }, 802 | "type": "library", 803 | "notification-url": "https://packagist.org/downloads/", 804 | "license": [ 805 | "GPLv3" 806 | ], 807 | "authors": [ 808 | { 809 | "name": "Teclib'", 810 | "email": "contact@teclib.com", 811 | "homepage": "https://teclib.com" 812 | } 813 | ], 814 | "description": "GLPI PHP CodeSniffer Coding Standard", 815 | "keywords": [ 816 | "codesniffer", 817 | "glpi", 818 | "phpcs" 819 | ], 820 | "time": "2017-01-06T11:10:46+00:00" 821 | }, 822 | { 823 | "name": "glpi-project/tools", 824 | "version": "0.1.2", 825 | "source": { 826 | "type": "git", 827 | "url": "https://github.com/glpi-project/tools.git", 828 | "reference": "55b3ba30c9c7f32acf5d9e8d6747e1e369809b13" 829 | }, 830 | "dist": { 831 | "type": "zip", 832 | "url": "https://api.github.com/repos/glpi-project/tools/zipball/55b3ba30c9c7f32acf5d9e8d6747e1e369809b13", 833 | "reference": "55b3ba30c9c7f32acf5d9e8d6747e1e369809b13", 834 | "shasum": "" 835 | }, 836 | "require": { 837 | "consolidation/robo": "dev-master@dev", 838 | "glpi-project/coding-standard": "0.5", 839 | "natxet/cssmin": "~3.0", 840 | "patchwork/jsqueeze": "~1.0" 841 | }, 842 | "bin": [ 843 | "tools/plugin-release", 844 | "tools/extract_template.sh", 845 | "tools/modify_headers.pl" 846 | ], 847 | "type": "library", 848 | "autoload": { 849 | "psr-4": { 850 | "Glpi\\": "src/" 851 | } 852 | }, 853 | "notification-url": "https://packagist.org/downloads/", 854 | "license": [ 855 | "GPLv3" 856 | ], 857 | "authors": [ 858 | { 859 | "name": "Teclib'", 860 | "email": "glpi@teclib.com", 861 | "homepage": "https://teclib.com" 862 | } 863 | ], 864 | "description": "Various tools for GLPI and its plugins", 865 | "keywords": [ 866 | "glpi", 867 | "plugins", 868 | "tools" 869 | ], 870 | "time": "2017-03-03T14:40:45+00:00" 871 | }, 872 | { 873 | "name": "grasmash/yaml-expander", 874 | "version": "1.2.0", 875 | "source": { 876 | "type": "git", 877 | "url": "https://github.com/grasmash/yaml-expander.git", 878 | "reference": "9ec59ccc7a630eb2637639e8214e70d27675456b" 879 | }, 880 | "dist": { 881 | "type": "zip", 882 | "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/9ec59ccc7a630eb2637639e8214e70d27675456b", 883 | "reference": "9ec59ccc7a630eb2637639e8214e70d27675456b", 884 | "shasum": "" 885 | }, 886 | "require": { 887 | "dflydev/dot-access-data": "^1.1.0", 888 | "php": ">=5.4", 889 | "symfony/yaml": "^2.8.11|^3" 890 | }, 891 | "require-dev": { 892 | "phpunit/phpunit": "^4.8|^5.5.4", 893 | "satooshi/php-coveralls": "^1.0", 894 | "squizlabs/php_codesniffer": "^2.7" 895 | }, 896 | "type": "library", 897 | "extra": { 898 | "branch-alias": { 899 | "dev-master": "1.x-dev" 900 | } 901 | }, 902 | "autoload": { 903 | "psr-4": { 904 | "Grasmash\\YamlExpander\\": "src/" 905 | } 906 | }, 907 | "notification-url": "https://packagist.org/downloads/", 908 | "license": [ 909 | "MIT" 910 | ], 911 | "authors": [ 912 | { 913 | "name": "Matthew Grasmick" 914 | } 915 | ], 916 | "description": "Expands internal property references in a yaml file.", 917 | "time": "2017-09-26T16:57:45+00:00" 918 | }, 919 | { 920 | "name": "league/container", 921 | "version": "2.4.1", 922 | "source": { 923 | "type": "git", 924 | "url": "https://github.com/thephpleague/container.git", 925 | "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" 926 | }, 927 | "dist": { 928 | "type": "zip", 929 | "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", 930 | "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", 931 | "shasum": "" 932 | }, 933 | "require": { 934 | "container-interop/container-interop": "^1.2", 935 | "php": "^5.4.0 || ^7.0" 936 | }, 937 | "provide": { 938 | "container-interop/container-interop-implementation": "^1.2", 939 | "psr/container-implementation": "^1.0" 940 | }, 941 | "replace": { 942 | "orno/di": "~2.0" 943 | }, 944 | "require-dev": { 945 | "phpunit/phpunit": "4.*" 946 | }, 947 | "type": "library", 948 | "extra": { 949 | "branch-alias": { 950 | "dev-2.x": "2.x-dev", 951 | "dev-1.x": "1.x-dev" 952 | } 953 | }, 954 | "autoload": { 955 | "psr-4": { 956 | "League\\Container\\": "src" 957 | } 958 | }, 959 | "notification-url": "https://packagist.org/downloads/", 960 | "license": [ 961 | "MIT" 962 | ], 963 | "authors": [ 964 | { 965 | "name": "Phil Bennett", 966 | "email": "philipobenito@gmail.com", 967 | "homepage": "http://www.philipobenito.com", 968 | "role": "Developer" 969 | } 970 | ], 971 | "description": "A fast and intuitive dependency injection container.", 972 | "homepage": "https://github.com/thephpleague/container", 973 | "keywords": [ 974 | "container", 975 | "dependency", 976 | "di", 977 | "injection", 978 | "league", 979 | "provider", 980 | "service" 981 | ], 982 | "time": "2017-05-10T09:20:27+00:00" 983 | }, 984 | { 985 | "name": "natxet/CssMin", 986 | "version": "v3.0.5", 987 | "source": { 988 | "type": "git", 989 | "url": "https://github.com/natxet/CssMin.git", 990 | "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d" 991 | }, 992 | "dist": { 993 | "type": "zip", 994 | "url": "https://api.github.com/repos/natxet/CssMin/zipball/9580f5448f05a82c96cfe6c7063a77807d8ec56d", 995 | "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d", 996 | "shasum": "" 997 | }, 998 | "require": { 999 | "php": ">=5.0" 1000 | }, 1001 | "type": "library", 1002 | "extra": { 1003 | "branch-alias": { 1004 | "dev-master": "3.0-dev" 1005 | } 1006 | }, 1007 | "autoload": { 1008 | "classmap": [ 1009 | "src/" 1010 | ] 1011 | }, 1012 | "notification-url": "https://packagist.org/downloads/", 1013 | "license": [ 1014 | "MIT" 1015 | ], 1016 | "authors": [ 1017 | { 1018 | "name": "Joe Scylla", 1019 | "email": "joe.scylla@gmail.com", 1020 | "homepage": "https://profiles.google.com/joe.scylla" 1021 | } 1022 | ], 1023 | "description": "Minifying CSS", 1024 | "homepage": "http://code.google.com/p/cssmin/", 1025 | "keywords": [ 1026 | "css", 1027 | "minify" 1028 | ], 1029 | "time": "2017-10-04T16:54:00+00:00" 1030 | }, 1031 | { 1032 | "name": "patchwork/jsqueeze", 1033 | "version": "v1.0.7", 1034 | "source": { 1035 | "type": "git", 1036 | "url": "https://github.com/tchwork/jsqueeze.git", 1037 | "reference": "f90a933213534b93e4ff3c2c3026ff7458f7721b" 1038 | }, 1039 | "dist": { 1040 | "type": "zip", 1041 | "url": "https://api.github.com/repos/tchwork/jsqueeze/zipball/f90a933213534b93e4ff3c2c3026ff7458f7721b", 1042 | "reference": "f90a933213534b93e4ff3c2c3026ff7458f7721b", 1043 | "shasum": "" 1044 | }, 1045 | "require": { 1046 | "php": ">=5.1.4" 1047 | }, 1048 | "type": "library", 1049 | "autoload": { 1050 | "psr-0": { 1051 | "JSqueeze": "class/" 1052 | } 1053 | }, 1054 | "notification-url": "https://packagist.org/downloads/", 1055 | "license": [ 1056 | "(Apache-2.0 or GPL-2.0)" 1057 | ], 1058 | "authors": [ 1059 | { 1060 | "name": "Nicolas Grekas", 1061 | "email": "p@tchwork.com" 1062 | } 1063 | ], 1064 | "description": "Efficient JavaScript minification in PHP", 1065 | "homepage": "https://github.com/tchwork/jsqueeze", 1066 | "keywords": [ 1067 | "compression", 1068 | "javascript", 1069 | "minification" 1070 | ], 1071 | "time": "2015-03-25T10:11:08+00:00" 1072 | }, 1073 | { 1074 | "name": "psr/container", 1075 | "version": "1.0.0", 1076 | "source": { 1077 | "type": "git", 1078 | "url": "https://github.com/php-fig/container.git", 1079 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 1080 | }, 1081 | "dist": { 1082 | "type": "zip", 1083 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 1084 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 1085 | "shasum": "" 1086 | }, 1087 | "require": { 1088 | "php": ">=5.3.0" 1089 | }, 1090 | "type": "library", 1091 | "extra": { 1092 | "branch-alias": { 1093 | "dev-master": "1.0.x-dev" 1094 | } 1095 | }, 1096 | "autoload": { 1097 | "psr-4": { 1098 | "Psr\\Container\\": "src/" 1099 | } 1100 | }, 1101 | "notification-url": "https://packagist.org/downloads/", 1102 | "license": [ 1103 | "MIT" 1104 | ], 1105 | "authors": [ 1106 | { 1107 | "name": "PHP-FIG", 1108 | "homepage": "http://www.php-fig.org/" 1109 | } 1110 | ], 1111 | "description": "Common Container Interface (PHP FIG PSR-11)", 1112 | "homepage": "https://github.com/php-fig/container", 1113 | "keywords": [ 1114 | "PSR-11", 1115 | "container", 1116 | "container-interface", 1117 | "container-interop", 1118 | "psr" 1119 | ], 1120 | "time": "2017-02-14T16:28:37+00:00" 1121 | }, 1122 | { 1123 | "name": "squizlabs/php_codesniffer", 1124 | "version": "2.9.1", 1125 | "source": { 1126 | "type": "git", 1127 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 1128 | "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" 1129 | }, 1130 | "dist": { 1131 | "type": "zip", 1132 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", 1133 | "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", 1134 | "shasum": "" 1135 | }, 1136 | "require": { 1137 | "ext-simplexml": "*", 1138 | "ext-tokenizer": "*", 1139 | "ext-xmlwriter": "*", 1140 | "php": ">=5.1.2" 1141 | }, 1142 | "require-dev": { 1143 | "phpunit/phpunit": "~4.0" 1144 | }, 1145 | "bin": [ 1146 | "scripts/phpcs", 1147 | "scripts/phpcbf" 1148 | ], 1149 | "type": "library", 1150 | "extra": { 1151 | "branch-alias": { 1152 | "dev-master": "2.x-dev" 1153 | } 1154 | }, 1155 | "autoload": { 1156 | "classmap": [ 1157 | "CodeSniffer.php", 1158 | "CodeSniffer/CLI.php", 1159 | "CodeSniffer/Exception.php", 1160 | "CodeSniffer/File.php", 1161 | "CodeSniffer/Fixer.php", 1162 | "CodeSniffer/Report.php", 1163 | "CodeSniffer/Reporting.php", 1164 | "CodeSniffer/Sniff.php", 1165 | "CodeSniffer/Tokens.php", 1166 | "CodeSniffer/Reports/", 1167 | "CodeSniffer/Tokenizers/", 1168 | "CodeSniffer/DocGenerators/", 1169 | "CodeSniffer/Standards/AbstractPatternSniff.php", 1170 | "CodeSniffer/Standards/AbstractScopeSniff.php", 1171 | "CodeSniffer/Standards/AbstractVariableSniff.php", 1172 | "CodeSniffer/Standards/IncorrectPatternException.php", 1173 | "CodeSniffer/Standards/Generic/Sniffs/", 1174 | "CodeSniffer/Standards/MySource/Sniffs/", 1175 | "CodeSniffer/Standards/PEAR/Sniffs/", 1176 | "CodeSniffer/Standards/PSR1/Sniffs/", 1177 | "CodeSniffer/Standards/PSR2/Sniffs/", 1178 | "CodeSniffer/Standards/Squiz/Sniffs/", 1179 | "CodeSniffer/Standards/Zend/Sniffs/" 1180 | ] 1181 | }, 1182 | "notification-url": "https://packagist.org/downloads/", 1183 | "license": [ 1184 | "BSD-3-Clause" 1185 | ], 1186 | "authors": [ 1187 | { 1188 | "name": "Greg Sherwood", 1189 | "role": "lead" 1190 | } 1191 | ], 1192 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 1193 | "homepage": "http://www.squizlabs.com/php-codesniffer", 1194 | "keywords": [ 1195 | "phpcs", 1196 | "standards" 1197 | ], 1198 | "time": "2017-05-22T02:43:20+00:00" 1199 | }, 1200 | { 1201 | "name": "symfony/console", 1202 | "version": "v3.3.10", 1203 | "source": { 1204 | "type": "git", 1205 | "url": "https://github.com/symfony/console.git", 1206 | "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" 1207 | }, 1208 | "dist": { 1209 | "type": "zip", 1210 | "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", 1211 | "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", 1212 | "shasum": "" 1213 | }, 1214 | "require": { 1215 | "php": "^5.5.9|>=7.0.8", 1216 | "symfony/debug": "~2.8|~3.0", 1217 | "symfony/polyfill-mbstring": "~1.0" 1218 | }, 1219 | "conflict": { 1220 | "symfony/dependency-injection": "<3.3" 1221 | }, 1222 | "require-dev": { 1223 | "psr/log": "~1.0", 1224 | "symfony/config": "~3.3", 1225 | "symfony/dependency-injection": "~3.3", 1226 | "symfony/event-dispatcher": "~2.8|~3.0", 1227 | "symfony/filesystem": "~2.8|~3.0", 1228 | "symfony/process": "~2.8|~3.0" 1229 | }, 1230 | "suggest": { 1231 | "psr/log": "For using the console logger", 1232 | "symfony/event-dispatcher": "", 1233 | "symfony/filesystem": "", 1234 | "symfony/process": "" 1235 | }, 1236 | "type": "library", 1237 | "extra": { 1238 | "branch-alias": { 1239 | "dev-master": "3.3-dev" 1240 | } 1241 | }, 1242 | "autoload": { 1243 | "psr-4": { 1244 | "Symfony\\Component\\Console\\": "" 1245 | }, 1246 | "exclude-from-classmap": [ 1247 | "/Tests/" 1248 | ] 1249 | }, 1250 | "notification-url": "https://packagist.org/downloads/", 1251 | "license": [ 1252 | "MIT" 1253 | ], 1254 | "authors": [ 1255 | { 1256 | "name": "Fabien Potencier", 1257 | "email": "fabien@symfony.com" 1258 | }, 1259 | { 1260 | "name": "Symfony Community", 1261 | "homepage": "https://symfony.com/contributors" 1262 | } 1263 | ], 1264 | "description": "Symfony Console Component", 1265 | "homepage": "https://symfony.com", 1266 | "time": "2017-10-02T06:42:24+00:00" 1267 | }, 1268 | { 1269 | "name": "symfony/debug", 1270 | "version": "v3.3.10", 1271 | "source": { 1272 | "type": "git", 1273 | "url": "https://github.com/symfony/debug.git", 1274 | "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" 1275 | }, 1276 | "dist": { 1277 | "type": "zip", 1278 | "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", 1279 | "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", 1280 | "shasum": "" 1281 | }, 1282 | "require": { 1283 | "php": "^5.5.9|>=7.0.8", 1284 | "psr/log": "~1.0" 1285 | }, 1286 | "conflict": { 1287 | "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" 1288 | }, 1289 | "require-dev": { 1290 | "symfony/http-kernel": "~2.8|~3.0" 1291 | }, 1292 | "type": "library", 1293 | "extra": { 1294 | "branch-alias": { 1295 | "dev-master": "3.3-dev" 1296 | } 1297 | }, 1298 | "autoload": { 1299 | "psr-4": { 1300 | "Symfony\\Component\\Debug\\": "" 1301 | }, 1302 | "exclude-from-classmap": [ 1303 | "/Tests/" 1304 | ] 1305 | }, 1306 | "notification-url": "https://packagist.org/downloads/", 1307 | "license": [ 1308 | "MIT" 1309 | ], 1310 | "authors": [ 1311 | { 1312 | "name": "Fabien Potencier", 1313 | "email": "fabien@symfony.com" 1314 | }, 1315 | { 1316 | "name": "Symfony Community", 1317 | "homepage": "https://symfony.com/contributors" 1318 | } 1319 | ], 1320 | "description": "Symfony Debug Component", 1321 | "homepage": "https://symfony.com", 1322 | "time": "2017-10-02T06:42:24+00:00" 1323 | }, 1324 | { 1325 | "name": "symfony/event-dispatcher", 1326 | "version": "v3.3.10", 1327 | "source": { 1328 | "type": "git", 1329 | "url": "https://github.com/symfony/event-dispatcher.git", 1330 | "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" 1331 | }, 1332 | "dist": { 1333 | "type": "zip", 1334 | "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", 1335 | "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", 1336 | "shasum": "" 1337 | }, 1338 | "require": { 1339 | "php": "^5.5.9|>=7.0.8" 1340 | }, 1341 | "conflict": { 1342 | "symfony/dependency-injection": "<3.3" 1343 | }, 1344 | "require-dev": { 1345 | "psr/log": "~1.0", 1346 | "symfony/config": "~2.8|~3.0", 1347 | "symfony/dependency-injection": "~3.3", 1348 | "symfony/expression-language": "~2.8|~3.0", 1349 | "symfony/stopwatch": "~2.8|~3.0" 1350 | }, 1351 | "suggest": { 1352 | "symfony/dependency-injection": "", 1353 | "symfony/http-kernel": "" 1354 | }, 1355 | "type": "library", 1356 | "extra": { 1357 | "branch-alias": { 1358 | "dev-master": "3.3-dev" 1359 | } 1360 | }, 1361 | "autoload": { 1362 | "psr-4": { 1363 | "Symfony\\Component\\EventDispatcher\\": "" 1364 | }, 1365 | "exclude-from-classmap": [ 1366 | "/Tests/" 1367 | ] 1368 | }, 1369 | "notification-url": "https://packagist.org/downloads/", 1370 | "license": [ 1371 | "MIT" 1372 | ], 1373 | "authors": [ 1374 | { 1375 | "name": "Fabien Potencier", 1376 | "email": "fabien@symfony.com" 1377 | }, 1378 | { 1379 | "name": "Symfony Community", 1380 | "homepage": "https://symfony.com/contributors" 1381 | } 1382 | ], 1383 | "description": "Symfony EventDispatcher Component", 1384 | "homepage": "https://symfony.com", 1385 | "time": "2017-10-02T06:42:24+00:00" 1386 | }, 1387 | { 1388 | "name": "symfony/filesystem", 1389 | "version": "v3.3.10", 1390 | "source": { 1391 | "type": "git", 1392 | "url": "https://github.com/symfony/filesystem.git", 1393 | "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" 1394 | }, 1395 | "dist": { 1396 | "type": "zip", 1397 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", 1398 | "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", 1399 | "shasum": "" 1400 | }, 1401 | "require": { 1402 | "php": "^5.5.9|>=7.0.8" 1403 | }, 1404 | "type": "library", 1405 | "extra": { 1406 | "branch-alias": { 1407 | "dev-master": "3.3-dev" 1408 | } 1409 | }, 1410 | "autoload": { 1411 | "psr-4": { 1412 | "Symfony\\Component\\Filesystem\\": "" 1413 | }, 1414 | "exclude-from-classmap": [ 1415 | "/Tests/" 1416 | ] 1417 | }, 1418 | "notification-url": "https://packagist.org/downloads/", 1419 | "license": [ 1420 | "MIT" 1421 | ], 1422 | "authors": [ 1423 | { 1424 | "name": "Fabien Potencier", 1425 | "email": "fabien@symfony.com" 1426 | }, 1427 | { 1428 | "name": "Symfony Community", 1429 | "homepage": "https://symfony.com/contributors" 1430 | } 1431 | ], 1432 | "description": "Symfony Filesystem Component", 1433 | "homepage": "https://symfony.com", 1434 | "time": "2017-10-03T13:33:10+00:00" 1435 | }, 1436 | { 1437 | "name": "symfony/finder", 1438 | "version": "v3.3.10", 1439 | "source": { 1440 | "type": "git", 1441 | "url": "https://github.com/symfony/finder.git", 1442 | "reference": "773e19a491d97926f236942484cb541560ce862d" 1443 | }, 1444 | "dist": { 1445 | "type": "zip", 1446 | "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", 1447 | "reference": "773e19a491d97926f236942484cb541560ce862d", 1448 | "shasum": "" 1449 | }, 1450 | "require": { 1451 | "php": "^5.5.9|>=7.0.8" 1452 | }, 1453 | "type": "library", 1454 | "extra": { 1455 | "branch-alias": { 1456 | "dev-master": "3.3-dev" 1457 | } 1458 | }, 1459 | "autoload": { 1460 | "psr-4": { 1461 | "Symfony\\Component\\Finder\\": "" 1462 | }, 1463 | "exclude-from-classmap": [ 1464 | "/Tests/" 1465 | ] 1466 | }, 1467 | "notification-url": "https://packagist.org/downloads/", 1468 | "license": [ 1469 | "MIT" 1470 | ], 1471 | "authors": [ 1472 | { 1473 | "name": "Fabien Potencier", 1474 | "email": "fabien@symfony.com" 1475 | }, 1476 | { 1477 | "name": "Symfony Community", 1478 | "homepage": "https://symfony.com/contributors" 1479 | } 1480 | ], 1481 | "description": "Symfony Finder Component", 1482 | "homepage": "https://symfony.com", 1483 | "time": "2017-10-02T06:42:24+00:00" 1484 | }, 1485 | { 1486 | "name": "symfony/polyfill-mbstring", 1487 | "version": "v1.6.0", 1488 | "source": { 1489 | "type": "git", 1490 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1491 | "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" 1492 | }, 1493 | "dist": { 1494 | "type": "zip", 1495 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", 1496 | "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", 1497 | "shasum": "" 1498 | }, 1499 | "require": { 1500 | "php": ">=5.3.3" 1501 | }, 1502 | "suggest": { 1503 | "ext-mbstring": "For best performance" 1504 | }, 1505 | "type": "library", 1506 | "extra": { 1507 | "branch-alias": { 1508 | "dev-master": "1.6-dev" 1509 | } 1510 | }, 1511 | "autoload": { 1512 | "psr-4": { 1513 | "Symfony\\Polyfill\\Mbstring\\": "" 1514 | }, 1515 | "files": [ 1516 | "bootstrap.php" 1517 | ] 1518 | }, 1519 | "notification-url": "https://packagist.org/downloads/", 1520 | "license": [ 1521 | "MIT" 1522 | ], 1523 | "authors": [ 1524 | { 1525 | "name": "Nicolas Grekas", 1526 | "email": "p@tchwork.com" 1527 | }, 1528 | { 1529 | "name": "Symfony Community", 1530 | "homepage": "https://symfony.com/contributors" 1531 | } 1532 | ], 1533 | "description": "Symfony polyfill for the Mbstring extension", 1534 | "homepage": "https://symfony.com", 1535 | "keywords": [ 1536 | "compatibility", 1537 | "mbstring", 1538 | "polyfill", 1539 | "portable", 1540 | "shim" 1541 | ], 1542 | "time": "2017-10-11T12:05:26+00:00" 1543 | }, 1544 | { 1545 | "name": "symfony/process", 1546 | "version": "v3.3.10", 1547 | "source": { 1548 | "type": "git", 1549 | "url": "https://github.com/symfony/process.git", 1550 | "reference": "fdf89e57a723a29baf536e288d6e232c059697b1" 1551 | }, 1552 | "dist": { 1553 | "type": "zip", 1554 | "url": "https://api.github.com/repos/symfony/process/zipball/fdf89e57a723a29baf536e288d6e232c059697b1", 1555 | "reference": "fdf89e57a723a29baf536e288d6e232c059697b1", 1556 | "shasum": "" 1557 | }, 1558 | "require": { 1559 | "php": "^5.5.9|>=7.0.8" 1560 | }, 1561 | "type": "library", 1562 | "extra": { 1563 | "branch-alias": { 1564 | "dev-master": "3.3-dev" 1565 | } 1566 | }, 1567 | "autoload": { 1568 | "psr-4": { 1569 | "Symfony\\Component\\Process\\": "" 1570 | }, 1571 | "exclude-from-classmap": [ 1572 | "/Tests/" 1573 | ] 1574 | }, 1575 | "notification-url": "https://packagist.org/downloads/", 1576 | "license": [ 1577 | "MIT" 1578 | ], 1579 | "authors": [ 1580 | { 1581 | "name": "Fabien Potencier", 1582 | "email": "fabien@symfony.com" 1583 | }, 1584 | { 1585 | "name": "Symfony Community", 1586 | "homepage": "https://symfony.com/contributors" 1587 | } 1588 | ], 1589 | "description": "Symfony Process Component", 1590 | "homepage": "https://symfony.com", 1591 | "time": "2017-10-02T06:42:24+00:00" 1592 | }, 1593 | { 1594 | "name": "symfony/yaml", 1595 | "version": "v3.3.10", 1596 | "source": { 1597 | "type": "git", 1598 | "url": "https://github.com/symfony/yaml.git", 1599 | "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" 1600 | }, 1601 | "dist": { 1602 | "type": "zip", 1603 | "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", 1604 | "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", 1605 | "shasum": "" 1606 | }, 1607 | "require": { 1608 | "php": "^5.5.9|>=7.0.8" 1609 | }, 1610 | "require-dev": { 1611 | "symfony/console": "~2.8|~3.0" 1612 | }, 1613 | "suggest": { 1614 | "symfony/console": "For validating YAML files using the lint command" 1615 | }, 1616 | "type": "library", 1617 | "extra": { 1618 | "branch-alias": { 1619 | "dev-master": "3.3-dev" 1620 | } 1621 | }, 1622 | "autoload": { 1623 | "psr-4": { 1624 | "Symfony\\Component\\Yaml\\": "" 1625 | }, 1626 | "exclude-from-classmap": [ 1627 | "/Tests/" 1628 | ] 1629 | }, 1630 | "notification-url": "https://packagist.org/downloads/", 1631 | "license": [ 1632 | "MIT" 1633 | ], 1634 | "authors": [ 1635 | { 1636 | "name": "Fabien Potencier", 1637 | "email": "fabien@symfony.com" 1638 | }, 1639 | { 1640 | "name": "Symfony Community", 1641 | "homepage": "https://symfony.com/contributors" 1642 | } 1643 | ], 1644 | "description": "Symfony Yaml Component", 1645 | "homepage": "https://symfony.com", 1646 | "time": "2017-10-05T14:43:42+00:00" 1647 | } 1648 | ], 1649 | "aliases": [], 1650 | "minimum-stability": "dev", 1651 | "stability-flags": [], 1652 | "prefer-stable": true, 1653 | "prefer-lowest": false, 1654 | "platform": [], 1655 | "platform-dev": [] 1656 | } 1657 | -------------------------------------------------------------------------------- /db/install.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_users` ( 2 | `id` BIGINT NOT NULL, 3 | `username` VARCHAR(255) NOT NULL, 4 | PRIMARY KEY(`id`) 5 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 6 | 7 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_user` ( 8 | `id` bigint COMMENT 'Unique user identifier', 9 | `is_bot` tinyint(1) DEFAULT 0 COMMENT 'True if this user is a bot', 10 | `first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User''s first name', 11 | `last_name` CHAR(255) DEFAULT NULL COMMENT 'User''s last name', 12 | `username` CHAR(191) DEFAULT NULL COMMENT 'User''s username', 13 | `language_code` CHAR(10) DEFAULT NULL COMMENT 'User''s system language', 14 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 15 | `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date update', 16 | 17 | PRIMARY KEY (`id`), 18 | KEY `username` (`username`) 19 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 20 | 21 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_chat` ( 22 | `id` bigint COMMENT 'Unique user or chat identifier', 23 | `type` ENUM('private', 'group', 'supergroup', 'channel') NOT NULL COMMENT 'Chat type, either private, group, supergroup or channel', 24 | `title` CHAR(255) DEFAULT '' COMMENT 'Chat (group) title, is null if chat type is private', 25 | `username` CHAR(255) DEFAULT NULL COMMENT 'Username, for private chats, supergroups and channels if available', 26 | `all_members_are_administrators` tinyint(1) DEFAULT 0 COMMENT 'True if a all members of this group are admins', 27 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 28 | `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date update', 29 | `old_id` bigint DEFAULT NULL COMMENT 'Unique chat identifier, this is filled when a group is converted to a supergroup', 30 | 31 | PRIMARY KEY (`id`), 32 | KEY `old_id` (`old_id`) 33 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 34 | 35 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_user_chat` ( 36 | `user_id` bigint COMMENT 'Unique user identifier', 37 | `chat_id` bigint COMMENT 'Unique user or chat identifier', 38 | 39 | PRIMARY KEY (`user_id`, `chat_id`), 40 | 41 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, 42 | FOREIGN KEY (`chat_id`) REFERENCES `glpi_plugin_telegrambot_chat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE 43 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 44 | 45 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_inline_query` ( 46 | `id` bigint UNSIGNED COMMENT 'Unique identifier for this query', 47 | `user_id` bigint NULL COMMENT 'Unique user identifier', 48 | `location` CHAR(255) NULL DEFAULT NULL COMMENT 'Location of the user', 49 | `query` TEXT NOT NULL COMMENT 'Text of the query', 50 | `offset` CHAR(255) NULL DEFAULT NULL COMMENT 'Offset of the result', 51 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 52 | 53 | PRIMARY KEY (`id`), 54 | KEY `user_id` (`user_id`), 55 | 56 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) 57 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 58 | 59 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_chosen_inline_result` ( 60 | `id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry', 61 | `result_id` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Identifier for this result', 62 | `user_id` bigint NULL COMMENT 'Unique user identifier', 63 | `location` CHAR(255) NULL DEFAULT NULL COMMENT 'Location object, user''s location', 64 | `inline_message_id` CHAR(255) NULL DEFAULT NULL COMMENT 'Identifier of the sent inline message', 65 | `query` TEXT NOT NULL COMMENT 'The query that was used to obtain the result', 66 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 67 | 68 | PRIMARY KEY (`id`), 69 | KEY `user_id` (`user_id`), 70 | 71 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) 72 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 73 | 74 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_message` ( 75 | `chat_id` bigint COMMENT 'Unique chat identifier', 76 | `id` bigint UNSIGNED COMMENT 'Unique message identifier', 77 | `user_id` bigint NULL COMMENT 'Unique user identifier', 78 | `date` timestamp NULL DEFAULT NULL COMMENT 'Date the message was sent in timestamp format', 79 | `forward_from` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier, sender of the original message', 80 | `forward_from_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier, chat the original message belongs to', 81 | `forward_from_message_id` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier of the original message in the channel', 82 | `forward_date` timestamp NULL DEFAULT NULL COMMENT 'date the original message was sent in timestamp format', 83 | `reply_to_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier', 84 | `reply_to_message` bigint UNSIGNED DEFAULT NULL COMMENT 'Message that this message is reply to', 85 | `text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4', 86 | `entities` TEXT COMMENT 'For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text', 87 | `audio` TEXT COMMENT 'Audio object. Message is an audio file, information about the file', 88 | `document` TEXT COMMENT 'Document object. Message is a general file, information about the file', 89 | `photo` TEXT COMMENT 'Array of PhotoSize objects. Message is a photo, available sizes of the photo', 90 | `sticker` TEXT COMMENT 'Sticker object. Message is a sticker, information about the sticker', 91 | `video` TEXT COMMENT 'Video object. Message is a video, information about the video', 92 | `voice` TEXT COMMENT 'Voice Object. Message is a Voice, information about the Voice', 93 | `video_note` TEXT COMMENT 'VoiceNote Object. Message is a Video Note, information about the Video Note', 94 | `contact` TEXT COMMENT 'Contact object. Message is a shared contact, information about the contact', 95 | `location` TEXT COMMENT 'Location object. Message is a shared location, information about the location', 96 | `venue` TEXT COMMENT 'Venue object. Message is a Venue, information about the Venue', 97 | `caption` TEXT COMMENT 'For message with caption, the actual UTF-8 text of the caption', 98 | `new_chat_members` TEXT COMMENT 'List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)', 99 | `left_chat_member` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)', 100 | `new_chat_title` CHAR(255) DEFAULT NULL COMMENT 'A chat title was changed to this value', 101 | `new_chat_photo` TEXT COMMENT 'Array of PhotoSize objects. A chat photo was change to this value', 102 | `delete_chat_photo` tinyint(1) DEFAULT 0 COMMENT 'Informs that the chat photo was deleted', 103 | `group_chat_created` tinyint(1) DEFAULT 0 COMMENT 'Informs that the group has been created', 104 | `supergroup_chat_created` tinyint(1) DEFAULT 0 COMMENT 'Informs that the supergroup has been created', 105 | `channel_chat_created` tinyint(1) DEFAULT 0 COMMENT 'Informs that the channel chat has been created', 106 | `migrate_to_chat_id` bigint NULL DEFAULT NULL COMMENT 'Migrate to chat identifier. The group has been migrated to a supergroup with the specified identifier', 107 | `migrate_from_chat_id` bigint NULL DEFAULT NULL COMMENT 'Migrate from chat identifier. The supergroup has been migrated from a group with the specified identifier', 108 | `pinned_message` TEXT NULL COMMENT 'Message object. Specified message was pinned', 109 | 110 | PRIMARY KEY (`chat_id`, `id`), 111 | KEY `user_id` (`user_id`), 112 | KEY `forward_from` (`forward_from`), 113 | KEY `forward_from_chat` (`forward_from_chat`), 114 | KEY `reply_to_chat` (`reply_to_chat`), 115 | KEY `reply_to_message` (`reply_to_message`), 116 | KEY `left_chat_member` (`left_chat_member`), 117 | KEY `migrate_from_chat_id` (`migrate_from_chat_id`), 118 | KEY `migrate_to_chat_id` (`migrate_to_chat_id`), 119 | 120 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`), 121 | FOREIGN KEY (`chat_id`) REFERENCES `glpi_plugin_telegrambot_chat` (`id`), 122 | FOREIGN KEY (`forward_from`) REFERENCES `glpi_plugin_telegrambot_user` (`id`), 123 | FOREIGN KEY (`forward_from_chat`) REFERENCES `glpi_plugin_telegrambot_chat` (`id`), 124 | FOREIGN KEY (`reply_to_chat`, `reply_to_message`) REFERENCES `glpi_plugin_telegrambot_message` (`chat_id`, `id`), 125 | FOREIGN KEY (`forward_from`) REFERENCES `glpi_plugin_telegrambot_user` (`id`), 126 | FOREIGN KEY (`left_chat_member`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) 127 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 128 | 129 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_callback_query` ( 130 | `id` bigint UNSIGNED COMMENT 'Unique identifier for this query', 131 | `user_id` bigint NULL COMMENT 'Unique user identifier', 132 | `chat_id` bigint NULL COMMENT 'Unique chat identifier', 133 | `message_id` bigint UNSIGNED COMMENT 'Unique message identifier', 134 | `inline_message_id` CHAR(255) NULL DEFAULT NULL COMMENT 'Identifier of the message sent via the bot in inline mode, that originated the query', 135 | `data` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Data associated with the callback button', 136 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 137 | 138 | PRIMARY KEY (`id`), 139 | KEY `user_id` (`user_id`), 140 | KEY `chat_id` (`chat_id`), 141 | KEY `message_id` (`message_id`), 142 | 143 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`), 144 | FOREIGN KEY (`chat_id`, `message_id`) REFERENCES `glpi_plugin_telegrambot_message` (`chat_id`, `id`) 145 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 146 | 147 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_edited_message` ( 148 | `id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry', 149 | `chat_id` bigint COMMENT 'Unique chat identifier', 150 | `message_id` bigint UNSIGNED COMMENT 'Unique message identifier', 151 | `user_id` bigint NULL COMMENT 'Unique user identifier', 152 | `edit_date` timestamp NULL DEFAULT NULL COMMENT 'Date the message was edited in timestamp format', 153 | `text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8', 154 | `entities` TEXT COMMENT 'For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text', 155 | `caption` TEXT COMMENT 'For message with caption, the actual UTF-8 text of the caption', 156 | 157 | PRIMARY KEY (`id`), 158 | KEY `chat_id` (`chat_id`), 159 | KEY `message_id` (`message_id`), 160 | KEY `user_id` (`user_id`), 161 | 162 | FOREIGN KEY (`chat_id`) REFERENCES `glpi_plugin_telegrambot_chat` (`id`), 163 | FOREIGN KEY (`chat_id`, `message_id`) REFERENCES `glpi_plugin_telegrambot_message` (`chat_id`, `id`), 164 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) 165 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 166 | 167 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_telegram_update` ( 168 | `id` bigint UNSIGNED COMMENT 'Update''s unique identifier', 169 | `chat_id` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier', 170 | `message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique message identifier', 171 | `inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique inline query identifier', 172 | `chosen_inline_result_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Local chosen inline result identifier', 173 | `callback_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique callback query identifier', 174 | `edited_message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Local edited message identifier', 175 | 176 | PRIMARY KEY (`id`), 177 | KEY `message_id` (`chat_id`, `message_id`), 178 | KEY `inline_query_id` (`inline_query_id`), 179 | KEY `chosen_inline_result_id` (`chosen_inline_result_id`), 180 | KEY `callback_query_id` (`callback_query_id`), 181 | KEY `edited_message_id` (`edited_message_id`), 182 | 183 | FOREIGN KEY (`chat_id`, `message_id`) REFERENCES `glpi_plugin_telegrambot_message` (`chat_id`, `id`), 184 | FOREIGN KEY (`inline_query_id`) REFERENCES `glpi_plugin_telegrambot_inline_query` (`id`), 185 | FOREIGN KEY (`chosen_inline_result_id`) REFERENCES `glpi_plugin_telegrambot_chosen_inline_result` (`id`), 186 | FOREIGN KEY (`callback_query_id`) REFERENCES `glpi_plugin_telegrambot_callback_query` (`id`), 187 | FOREIGN KEY (`edited_message_id`) REFERENCES `glpi_plugin_telegrambot_edited_message` (`id`) 188 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 189 | 190 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_conversation` ( 191 | `id` bigint(20) unsigned AUTO_INCREMENT COMMENT 'Unique identifier for this entry', 192 | `user_id` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier', 193 | `chat_id` bigint NULL DEFAULT NULL COMMENT 'Unique user or chat identifier', 194 | `status` ENUM('active', 'cancelled', 'stopped') NOT NULL DEFAULT 'active' COMMENT 'Conversation state', 195 | `command` varchar(160) DEFAULT '' COMMENT 'Default command to execute', 196 | `notes` text DEFAULT NULL COMMENT 'Data stored from command', 197 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 198 | `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date update', 199 | 200 | PRIMARY KEY (`id`), 201 | KEY `user_id` (`user_id`), 202 | KEY `chat_id` (`chat_id`), 203 | KEY `status` (`status`), 204 | 205 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`), 206 | FOREIGN KEY (`chat_id`) REFERENCES `glpi_plugin_telegrambot_chat` (`id`) 207 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 208 | 209 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_botan_shortener` ( 210 | `id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry', 211 | `user_id` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier', 212 | `url` text NOT NULL COMMENT 'Original URL', 213 | `short_url` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Shortened URL', 214 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 215 | 216 | PRIMARY KEY (`id`), 217 | 218 | FOREIGN KEY (`user_id`) REFERENCES `glpi_plugin_telegrambot_user` (`id`) 219 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 220 | 221 | CREATE TABLE IF NOT EXISTS `glpi_plugin_telegrambot_request_limiter` ( 222 | `id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry', 223 | `chat_id` char(255) NULL DEFAULT NULL COMMENT 'Unique chat identifier', 224 | `inline_message_id` char(255) NULL DEFAULT NULL COMMENT 'Identifier of the sent inline message', 225 | `method` char(255) DEFAULT NULL COMMENT 'Request method', 226 | `created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation', 227 | 228 | PRIMARY KEY (`id`) 229 | ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; 230 | -------------------------------------------------------------------------------- /db/uninstall.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_users`; 2 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_request_limiter`; 3 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_botan_shortener`; 4 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_conversation`; 5 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_telegram_update`; 6 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_edited_message`; 7 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_callback_query`; 8 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_message`; 9 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_chosen_inline_result`; 10 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_inline_query`; 11 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_user_chat`; 12 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_chat`; 13 | DROP TABLE IF EXISTS `glpi_plugin_telegrambot_user`; 14 | -------------------------------------------------------------------------------- /front/notificationwebsocketsetting.form.php: -------------------------------------------------------------------------------- 1 | display(array('id' => 1)); 26 | 27 | Html::footer(); 28 | -------------------------------------------------------------------------------- /hook.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | /** 30 | * Plugin install process 31 | * 32 | * @return boolean 33 | */ 34 | function plugin_telegrambot_install() { 35 | global $DB; 36 | 37 | $DB->runFile(GLPI_ROOT . '/plugins/telegrambot/db/install.sql'); 38 | 39 | Config::setConfigurationValues('core', ['notifications_websocket' => 0]); 40 | Config::setConfigurationValues('plugin:telegrambot', ['token' => '', 'bot_username' => '']); 41 | 42 | CronTask::register( 43 | 'PluginTelegrambotCron', 44 | 'messagelistener', 45 | 5 * MINUTE_TIMESTAMP, 46 | array('comment' => '', 'mode' => CronTask::MODE_EXTERNAL) 47 | ); 48 | 49 | return true; 50 | } 51 | 52 | /** 53 | * Plugin uninstall process 54 | * 55 | * @return boolean 56 | */ 57 | function plugin_telegrambot_uninstall() { 58 | global $DB; 59 | $DB->runFile(GLPI_ROOT . '/plugins/telegrambot/db/uninstall.sql'); 60 | 61 | $config = new Config(); 62 | $config->deleteConfigurationValues('core', ['notifications_websocket']); 63 | $config->deleteConfigurationValues('plugin:telegrambot', ['token', 'bot_username']); 64 | 65 | return true; 66 | } 67 | 68 | function add_username_field(array $params) { 69 | $item = $params['item']; 70 | 71 | if ($item->getType() == 'User') { 72 | PluginTelegrambotUser::showUsernameField($item); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /hook.php.tpl: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | /** 30 | * Plugin install process 31 | * 32 | * @return boolean 33 | */ 34 | function plugin_telegrambot_install() { 35 | return true; 36 | } 37 | 38 | /** 39 | * Plugin uninstall process 40 | * 41 | * @return boolean 42 | */ 43 | function plugin_telegrambot_uninstall() { 44 | return true; 45 | } 46 | -------------------------------------------------------------------------------- /inc/bot.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | require GLPI_ROOT . '/plugins/telegrambot/vendor/autoload.php'; 30 | use Longman\TelegramBot\Request; 31 | 32 | class PluginTelegrambotBot { 33 | 34 | static public function getConfig($key) { 35 | return Config::getConfigurationValues('plugin:telegrambot')[$key]; 36 | } 37 | 38 | static public function setConfig($key, $value) { 39 | Config::setConfigurationValues('plugin:telegrambot', [$key => $value]); 40 | } 41 | 42 | static public function sendMessage($to, $content) { 43 | $chat_id = self::getChatID($to); 44 | $telegram = self::getTelegramInstance(); 45 | $result = Request::sendMessage(['chat_id' => $chat_id, 'text' => $content]); 46 | } 47 | 48 | static public function getUpdates() { 49 | $response = 'ok'; 50 | 51 | try { 52 | $telegram = self::getTelegramInstance(); 53 | $telegram->enableMySql(self::getDBCredentials(), 'glpi_plugin_telegrambot_'); 54 | $telegram->handleGetUpdates(); 55 | } catch (Longman\TelegramBot\Exception\TelegramException $e) { 56 | $response = $e->getMessage(); 57 | } 58 | 59 | return $response; 60 | } 61 | 62 | static public function getChatID($user_id) { 63 | global $DB; 64 | 65 | $chat_id = null; 66 | 67 | $result = $DB->request([ 68 | 'FROM' => 'glpi_plugin_telegrambot_users', 69 | 'INNER JOIN' => [ 70 | 'glpi_plugin_telegrambot_user' => [ 71 | 'FKEY' => [ 72 | 'glpi_plugin_telegrambot_users' => 'username', 73 | 'glpi_plugin_telegrambot_user' => 'username' 74 | ] 75 | ] 76 | ], 77 | 'WHERE' => ['glpi_plugin_telegrambot_users.id' => $user_id] 78 | ]); 79 | 80 | if ($row = $result->next()) { 81 | $chat_id = $row['id']; 82 | } 83 | 84 | return $chat_id; 85 | } 86 | 87 | static private function getTelegramInstance() { 88 | $bot_api_key = self::getConfig('token'); 89 | $bot_username = self::getConfig('bot_username'); 90 | 91 | return new Longman\TelegramBot\Telegram($bot_api_key, $bot_username); 92 | } 93 | 94 | static private function getDBCredentials() { 95 | global $DB; 96 | 97 | return array( 98 | 'host' => $DB->dbhost, 99 | 'user' => $DB->dbuser, 100 | 'password' => $DB->dbpassword, 101 | 'database' => $DB->dbdefault, 102 | ); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /inc/cron.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | class PluginTelegrambotCron { 30 | 31 | static function getTypeName($nb=0) { 32 | return 'TelegramBot'; 33 | } 34 | 35 | static function cronInfo($name) { 36 | switch ($name) { 37 | case 'messagelistener': 38 | return array('description' => __('Handles incoming bot messages', 'telegrambot')); 39 | } 40 | 41 | return array(); 42 | } 43 | 44 | static function cronMessageListener($task) { 45 | $response = PluginTelegrambotBot::getUpdates(); 46 | 47 | if ($response == 'ok') { 48 | $success = 1; 49 | $message = 'Action successfully completed'; 50 | } else { 51 | $success = 0; 52 | $message = "Error. $response"; 53 | } 54 | 55 | $task->log($message); 56 | return $success; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /inc/notificationeventwebsocket.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | class PluginTelegrambotNotificationEventWebsocket 30 | extends NotificationEventAbstract 31 | implements NotificationEventInterface { 32 | 33 | static public function getTargetFieldName() { 34 | return 'users_id'; 35 | } 36 | 37 | static public function getTargetField(&$data) { 38 | $field = self::getTargetFieldName(); 39 | 40 | if (!isset($data[$field])) { 41 | $data[$field] = null; 42 | } 43 | 44 | return $field; 45 | } 46 | 47 | static public function canCron() { 48 | return false; 49 | } 50 | 51 | static public function getAdminData() { 52 | return false; 53 | } 54 | 55 | static public function getEntityAdminsData($entity) { 56 | return false; 57 | } 58 | 59 | static public function send(array $data) { 60 | Toolbox::logDebug(__METHOD__ . ' should not be called!'); 61 | return false; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /inc/notificationwebsocket.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | class PluginTelegrambotNotificationWebsocket implements NotificationInterface { 30 | 31 | static function check($value, $options = []) { 32 | return true; 33 | } 34 | 35 | static function testNotification() { 36 | // TODO 37 | } 38 | 39 | function sendNotification($options=array()) { 40 | $to = $options['to']; 41 | $content = $options['content_text']; 42 | 43 | PluginTelegrambotBot::sendMessage($to, $content); 44 | return true; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /inc/notificationwebsocketsetting.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | if (!defined('GLPI_ROOT')) { 30 | die("Sorry. You can't access this file directly"); 31 | } 32 | 33 | /** 34 | * This class manages the sms notifications settings 35 | */ 36 | class PluginTelegrambotNotificationWebsocketSetting extends NotificationSetting { 37 | 38 | static function getTypeName($nb=0) { 39 | return __('Telegram followups configuration', 'telegrambot'); 40 | } 41 | 42 | public function getEnableLabel() { 43 | return __('Enable followups via Telegram', 'telegrambot'); 44 | } 45 | 46 | static public function getMode() { 47 | return Notification_NotificationTemplate::MODE_WEBSOCKET; 48 | } 49 | 50 | function showFormConfig($options = []) { 51 | global $CFG_GLPI; 52 | 53 | $bot_token = PluginTelegrambotBot::getConfig('token'); 54 | $bot_username = PluginTelegrambotBot::getConfig('bot_username'); 55 | 56 | $out = "
"; 57 | $out .= "
"; 58 | $out .= ""; 59 | $out .= "" . ""; 60 | 61 | $out .= ""; 62 | $out .= ""; 65 | 66 | $out .= ""; 67 | $out .= ""; 70 | 71 | echo $out; 72 | $this->showFormButtons($options); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /inc/user.class.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | class PluginTelegrambotUser extends CommonDBTM { 30 | 31 | static public function showUsernameField($item) { 32 | $username = null; 33 | 34 | if ($item->fields['id']) { 35 | $user = new self(); 36 | $user->getFromDB($item->fields['id']); 37 | 38 | if (!$user->isNewItem()) { 39 | $username = $user->fields['username']; 40 | } 41 | } 42 | 43 | $out = ""; 44 | $out .= ""; 45 | $out .= ""; 46 | $out .= ""; 47 | 48 | echo $out; 49 | } 50 | 51 | static public function item_add_user(User $item) { 52 | if ($item->input['telegram_username']) { 53 | $user = new self; 54 | $user->fields['id'] = $item->fields['id']; 55 | $user->fields['username'] = $item->input['telegram_username']; 56 | $user->addToDB(); 57 | } 58 | } 59 | 60 | static public function item_update_user(User $item) { 61 | $user = new self; 62 | $user->getFromDB($item->fields['id']); 63 | 64 | if ($user->isNewItem()) { 65 | self::item_add_user($item); 66 | } else { 67 | $user->fields['username'] = $item->input['telegram_username']; 68 | $user->updateInDB(array('username')); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /screenshots/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/screenshots/screenshot1.png -------------------------------------------------------------------------------- /screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/screenshots/screenshot2.png -------------------------------------------------------------------------------- /screenshots/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/screenshots/screenshot3.png -------------------------------------------------------------------------------- /screenshots/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/screenshots/screenshot4.png -------------------------------------------------------------------------------- /screenshots/screenshot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/screenshots/screenshot5.png -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | define('PLUGIN_TELEGRAMBOT_VERSION', '2.0.0'); 30 | 31 | /** 32 | * Init hooks of the plugin. 33 | * REQUIRED 34 | * 35 | * @return void 36 | */ 37 | function plugin_init_telegrambot() { 38 | global $PLUGIN_HOOKS; 39 | 40 | $PLUGIN_HOOKS['csrf_compliant']['telegrambot'] = true; 41 | $PLUGIN_HOOKS['post_item_form']['telegrambot'] = 'add_username_field'; 42 | $PLUGIN_HOOKS['item_add']['telegrambot'] = array('User' => array('PluginTelegrambotUser', 'item_add_user')); 43 | $PLUGIN_HOOKS['pre_item_update']['telegrambot'] = array('User' => array('PluginTelegrambotUser', 'item_update_user')); 44 | 45 | $plugin = new Plugin(); 46 | 47 | if ($plugin->isActivated('telegrambot')) { 48 | Notification_NotificationTemplate::registerMode( 49 | Notification_NotificationTemplate::MODE_WEBSOCKET, 50 | __('Telegram', 'plugin_telegrambot'), 51 | 'telegrambot' 52 | ); 53 | } 54 | } 55 | 56 | /** 57 | * Get the name and the version of the plugin 58 | * REQUIRED 59 | * 60 | * @return array 61 | */ 62 | function plugin_version_telegrambot() { 63 | return [ 64 | 'name' => 'TelegramBot', 65 | 'version' => PLUGIN_TELEGRAMBOT_VERSION, 66 | 'author' => 'Truly Systems', 67 | 'license' => 'GPLv2+', 68 | 'homepage' => 'https://github.com/pluginsGLPI/telegrambot', 69 | 'minGlpiVersion' => '9.2' 70 | ]; 71 | } 72 | 73 | /** 74 | * Check pre-requisites before install 75 | * OPTIONNAL, but recommanded 76 | * 77 | * @return boolean 78 | */ 79 | function plugin_telegrambot_check_prerequisites() { 80 | // Strict version check (could be less strict, or could allow various version) 81 | if (version_compare(GLPI_VERSION, '9.2', 'lt')) { 82 | if (method_exists('Plugin', 'messageIncompatible')) { 83 | echo Plugin::messageIncompatible('core', '9.2'); 84 | } else { 85 | echo "This plugin requires GLPI >= 9.2"; 86 | } 87 | return false; 88 | } 89 | return true; 90 | } 91 | 92 | /** 93 | * Check configuration process 94 | * 95 | * @param boolean $verbose Whether to display message on failure. Defaults to false 96 | * 97 | * @return boolean 98 | */ 99 | function plugin_telegrambot_check_config($verbose = false) { 100 | if (true) { // Your configuration check 101 | return true; 102 | } 103 | 104 | if ($verbose) { 105 | _e('Installed / not configured', 'telegrambot'); 106 | } 107 | return false; 108 | } 109 | -------------------------------------------------------------------------------- /setup.php.tpl: -------------------------------------------------------------------------------- 1 | . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | define('PLUGIN_TELEGRAMBOT_VERSION', '2.0.0'); 30 | 31 | /** 32 | * Init hooks of the plugin. 33 | * REQUIRED 34 | * 35 | * @return void 36 | */ 37 | function plugin_init_telegrambot() { 38 | global $PLUGIN_HOOKS; 39 | 40 | $PLUGIN_HOOKS['csrf_compliant']['telegrambot'] = true; 41 | } 42 | 43 | 44 | /** 45 | * Get the name and the version of the plugin 46 | * REQUIRED 47 | * 48 | * @return array 49 | */ 50 | function plugin_version_telegrambot() { 51 | return [ 52 | 'name' => 'TelegramBot', 53 | 'version' => PLUGIN_TELEGRAMBOT_VERSION, 54 | 'author' => 'Teclib\'', 55 | 'license' => '', 56 | 'homepage' => '', 57 | 'minGlpiVersion' => '9.1' 58 | ]; 59 | } 60 | 61 | /** 62 | * Check pre-requisites before install 63 | * OPTIONNAL, but recommanded 64 | * 65 | * @return boolean 66 | */ 67 | function plugin_telegrambot_check_prerequisites() { 68 | // Strict version check (could be less strict, or could allow various version) 69 | if (version_compare(GLPI_VERSION, '9.1', 'lt')) { 70 | if (method_exists('Plugin', 'messageIncompatible')) { 71 | echo Plugin::messageIncompatible('core', '9.1'); 72 | } else { 73 | echo "This plugin requires GLPI >= 9.1"; 74 | } 75 | return false; 76 | } 77 | return true; 78 | } 79 | 80 | /** 81 | * Check configuration process 82 | * 83 | * @param boolean $verbose Whether to display message on failure. Defaults to false 84 | * 85 | * @return boolean 86 | */ 87 | function plugin_telegrambot_check_config($verbose = false) { 88 | if (true) { // Your configuration check 89 | return true; 90 | } 91 | 92 | if ($verbose) { 93 | _e('Installed / not configured', 'telegrambot'); 94 | } 95 | return false; 96 | } 97 | -------------------------------------------------------------------------------- /telegrambot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluginsGLPI/telegrambot/8e6bb2d81968cd3e5f61536b06092d08467ece91/telegrambot.png -------------------------------------------------------------------------------- /telegrambot.xml: -------------------------------------------------------------------------------- 1 | 2 | TelegramBot 3 | telegrambot 4 | 5 | stable 6 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/telegrambot.png 7 | 8 | 9 | 10 | TelegramBot GLPI plugin. 11 | 12 | 13 | 14 | 15 | Telegram bot for GLPI. 16 | 17 | Video Preview 18 | -------- 19 | https://youtu.be/TKqIpIaAIAE 20 | 21 | 22 | 23 | https://github.com/pluginsGLPI/telegrambot 24 | https://github.com/pluginsGLPI/telegrambot/releases 25 | https://github.com/pluginsGLPI/telegrambot/issues 26 | https://github.com/pluginsGLPI/telegrambot/blob/master/README.md 27 | 28 | 29 | Truly Systems 30 | 31 | 32 | 33 | 34 | 2.0.0 35 | 36 | 9.2 37 | 38 | 39 | 40 | 41 | en_GB 42 | 43 | GPL V3+ 44 | 45 | 46 | Telegram 47 | Bot 48 | Notification 49 | Message 50 | 51 | 52 | 53 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/screenshots/screenshot1.png 54 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/screenshots/screenshot2.png 55 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/screenshots/screenshot3.png 56 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/screenshots/screenshot4.png 57 | https://raw.githubusercontent.com/pluginsGLPI/telegrambot/master/screenshots/screenshot5.png 58 | 59 | 60 | -------------------------------------------------------------------------------- /tools/HEADER: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------- 2 | TelegramBot plugin for GLPI 3 | Copyright (C) 2017 by the TelegramBot Development Team. 4 | 5 | https://github.com/pluginsGLPI/telegrambot 6 | ------------------------------------------------------------------------- 7 | 8 | LICENSE 9 | 10 | This file is part of TelegramBot. 11 | 12 | TelegramBot is free software; you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation; either version 2 of the License, or 15 | (at your option) any later version. 16 | 17 | TelegramBot is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with TelegramBot. If not, see . 24 | -------------------------------------------------------------------------- 25 | --------------------------------------------------------------------------------
" . _n('Telegram notification', 'Telegram notifications', Session::getPluralNumber()) . "
" . __('Bot token') . ""; 63 | $out .= ""; 64 | $out .= " 
" . __('Bot username') . ""; 68 | $out .= ""; 69 | $out .= " 
" . __('Telegram username') . "