Skip to content

Instantly share code, notes, and snippets.

View orthagh's full-sized avatar
🦇

Alexandre Delaunay orthagh

🦇
View GitHub Profile
@orthagh
orthagh / superasset_item.class.php
Last active March 20, 2017 14:49
superasset_item.class.php
<?php
class PluginMypluginSuperasset_Item extends CommonDBTM {
static function getTypeName($nb=0) {
return _n('Item', 'Items', $nb);
}
/**
* Tabs title
@orthagh
orthagh / keybase.md
Created December 16, 2016 11:25
keybase.md

Keybase proof

I hereby claim:

  • I am orthagh on github.
  • I am alexandred (https://keybase.io/alexandred) on keybase.
  • I have a public key whose fingerprint is 43D4 6FF0 2F62 81AC 3DEA 4DED DE51 3038 673C 0F63

To claim this, I am signing this object:

@orthagh
orthagh / keybase.md
Created June 15, 2016 07:07
keybase.md

Keybase proof

I hereby claim:

  • I am orthagh on github.
  • I am alexandred (https://keybase.io/alexandred) on keybase.
  • I have a public key whose fingerprint is 086A 2854 C526 20B1 B983 97FA EB7E 94A2 3F11 7EBD

To claim this, I am signing this object:

@orthagh
orthagh / shift_select_checkboxes.patch
Last active April 21, 2016 14:07
shift select for glpi list
diff --git a/css/styles.css b/css/styles.css
index 47f7ed9..5e8fca0 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -50,6 +50,15 @@ body.iframed {
background: inherit;
}
+.unselectable {
+ -moz-user-select: none;
@orthagh
orthagh / accent_insensitive_entitytreesearch.patch
Last active February 15, 2016 08:11
glpi search with insensitive accents
diff --git a/ajax/entitytreesearch.php b/ajax/entitytreesearch.php
index 04a655c..1c7c6a2 100644
--- a/ajax/entitytreesearch.php
+++ b/ajax/entitytreesearch.php
@@ -49,7 +49,7 @@ $res = array();
if (isset($_POST['search_string'])) {
$query = "SELECT *
FROM `glpi_entities`
- WHERE `name` LIKE '%".$_POST['search_string']."%'
+ WHERE CONVERT(`name` USING utf8) LIKE _utf8 '%".$_POST['search_string']."%' COLLATE utf8_general_ci
diff --git a/front/export.massive.php b/front/export.massive.php
index 5d7347b..e072439 100644
--- a/front/export.massive.php
+++ b/front/export.massive.php
@@ -29,42 +29,11 @@
include ("../../../inc/includes.php");
-Plugin::load('pdf', true);
-
diff --git a/inc/ruleticket.class.php b/inc/ruleticket.class.php
index df9843f..6ecf235 100644
--- a/inc/ruleticket.class.php
+++ b/inc/ruleticket.class.php
@@ -434,6 +434,9 @@ class RuleTicket extends Rule {
$criterias['priority']['name'] = __('Priority');
$criterias['priority']['type'] = 'dropdown_priority';
+ $criterias['status']['name'] = __('Status');
+ $criterias['status']['type'] = 'dropdown_status';
Verifying that +alexandredelaunay is my blockchain ID. https://onename.com/alexandredelaunay
@orthagh
orthagh / force_getempty.patch
Created December 8, 2015 14:13
force getempty on create
diff --git a/inc/commondbtm.class.php b/inc/commondbtm.class.php
index 492dcb7..b1bfdf9 100644
--- a/inc/commondbtm.class.php
+++ b/inc/commondbtm.class.php
@@ -2330,10 +2330,8 @@ class CommonDBTM extends CommonGLPI {
// Create process
if ($this->isNewID($ID)) {
- if (!isset($this->fields['id'])) {
- // Only once
@orthagh
orthagh / addNeededInfoToInput.patch
Created December 8, 2015 14:06
force entities_id mandatory
diff --git a/inc/commondbtm.class.php b/inc/commondbtm.class.php
index 492dcb7..1aa9e01 100644
--- a/inc/commondbtm.class.php
+++ b/inc/commondbtm.class.php
@@ -981,6 +981,9 @@ class CommonDBTM extends CommonGLPI {
* @return the modified $input array
**/
function addNeededInfoToInput($input) {
+ if (!isset($input['entities_id'])) {
+ $input['entities_id'] = $_SESSION['glpiactive_entity'];