Skip to content

Instantly share code, notes, and snippets.

View orthagh's full-sized avatar
🦇

Alexandre Delaunay orthagh

🦇
View GitHub Profile
Index: ajax/dropdownValue.php
===================================================================
--- ajax/dropdownValue.php (révision 21867)
+++ ajax/dropdownValue.php (copie de travail)
@@ -547,9 +547,24 @@
$paramscomment = array('value' => '__VALUE__',
'table' => $table);
- Ajax::updateItemOnSelectEvent("dropdown_".$_POST["myname"].$_POST["rand"],
- "comment_".$_POST["myname"].$_POST["rand"],
diff --git a/inc/dropdown.class.php b/inc/dropdown.class.php
index b4ddd98..7b9de08 100644
--- a/inc/dropdown.class.php
+++ b/inc/dropdown.class.php
@@ -190,6 +190,7 @@ class Dropdown {
if ($params['comments']) {
$comment_id = Html::cleanId("comment_".$params['name'].$params['rand']);
$options_tooltip = array('contentid' => $comment_id,
+ 'linkid' => "link".$comment_id,
'display' => false);
diff --git a/inc/ticket.class.php b/inc/ticket.class.php
index bc911c0..5a5e09e 100644
--- a/inc/ticket.class.php
+++ b/inc/ticket.class.php
@@ -201,7 +201,7 @@ class PluginBehaviorsTicket {
$msg = sprintf(__('%1$s (%2$s)'), __("Can't save, item have been updated", "behaviors"),
getUserName($ticket->fields['users_id_lastupdater']).', '.
- Html::convDateTime($config->fields['date_mod']));
+ Html::convDateTime($ticket->fields['date_mod']));
@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'];
@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
Verifying that +alexandredelaunay is my blockchain ID. https://onename.com/alexandredelaunay
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';
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);
-
@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
@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;