Skip to content

Commit

Permalink
Fix upload pics & Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr committed Jun 15, 2022
1 parent 46e2d39 commit 2a4c552
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 265 deletions.
169 changes: 0 additions & 169 deletions front/upload.php

This file was deleted.

54 changes: 27 additions & 27 deletions inc/imageitem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static function showAllItems($myname, $types, $value_type = 0, $value = 0, $enti
'locations_id' => $locations_id];

Ajax::updateItemOnSelectEvent("dropdown_$myname$rand", "show_$myname$rand",
PLUGIN_POSITIONS_WEBDIR ."/ajax/dropdownAllItems.php", $params);
PLUGIN_POSITIONS_WEBDIR . "/ajax/dropdownAllItems.php", $params);

echo "</td><td>\n";
echo "<span id='show_$myname$rand'>&nbsp;</span>\n";
Expand Down Expand Up @@ -134,11 +134,11 @@ function addItemImage($values) {
if ($values["type"] != '-1') {
if ($this->GetfromDBbyType($values["itemtype"], $values["type"])) {
$this->update(['id' => $this->fields['id'],
'img' => $values["img"]]);
'img' => $values["img"]]);
} else {
$this->add(['itemtype' => $values["itemtype"],
'type' => $values["type"],
'img' => $values["img"]]);
'type' => $values["type"],
'img' => $values["img"]]);
}
} else {
$dbu = new DbUtils();
Expand All @@ -151,11 +151,11 @@ function addItemImage($values) {
$type_table = $DB->result($result, $i, "id");
if ($this->GetfromDBbyType($values["itemtype"], $type_table)) {
$this->update(['id' => $this->fields['id'],
'img' => $values["img"]]);
'img' => $values["img"]]);
} else {
$this->add(['itemtype' => $values["itemtype"],
'type' => $type_table,
'img' => $values["img"]]);
'type' => $type_table,
'img' => $values["img"]]);
}
$i++;
}
Expand Down Expand Up @@ -217,25 +217,25 @@ function showConfigForm() {
echo "</th></tr>";

echo "<tr class='tab_bg_1'><td colspan='2'>";

echo "<span class='upload' id='plugin_position_container'></span>";

echo "<img src='../pics/select.png' id='pickfiles'
title=\"" . __('Select pictures to upload (gif, jpg, png)', 'positions') . "\">&nbsp;";
echo __('Select pictures to upload (gif, jpg, png)', 'positions');
echo "</td><td>";
echo "<span class='upload' id='filelist'></span>";
echo "<img src='../pics/upload.png' id='uploadfiles'
title=\"" . __('upload pictures to the server', 'positions') . "\">&nbsp;";
echo __('Then', 'positions') . "&nbsp;";
echo __('upload pictures to the server', 'positions');
echo "</td><td colspan='2'>";

echo "<a href='" . $_SERVER['PHP_SELF'] . "'><img src='../pics/refresh.png'
title=\"" . __s('refresh this form', 'positions') . "\"></a>&nbsp;";
echo __('Then', 'positions') . "&nbsp;";
echo __('refresh this form', 'positions');
echo "</span>";
echo __('Upload yours pics into files/_plugins/positions/pics/ folder', 'positions');
// echo "<span class='upload' id='plugin_position_container'></span>";
//
// echo "<img src='../pics/select.png' id='pickfiles'
// title=\"" . __('Select pictures to upload (gif, jpg, png)', 'positions') . "\">&nbsp;";
// echo __('Select pictures to upload (gif, jpg, png)', 'positions');
// echo "</td><td>";
// echo "<span class='upload' id='filelist'></span>";
// echo "<img src='../pics/upload.png' id='uploadfiles'
// title=\"" . __('upload pictures to the server', 'positions') . "\">&nbsp;";
// echo __('Then', 'positions') . "&nbsp;";
// echo __('upload pictures to the server', 'positions');
// echo "</td><td colspan='2'>";
//
// echo "<a href='" . $_SERVER['PHP_SELF'] . "'><img src='../pics/refresh.png'
// title=\"" . __s('refresh this form', 'positions') . "\"></a>&nbsp;";
// echo __('Then', 'positions') . "&nbsp;";
// echo __('refresh this form', 'positions');
// echo "</span>";

echo "</td></tr>";

Expand All @@ -248,7 +248,7 @@ function showConfigForm() {
self::showAllItems("type", $types, 0, 0, $_SESSION["glpiactive_entity"], -1, 'showType');
echo "</td><td>";

// echo Html::hidden('_glpi_csrf_token', ['value' => '']);
// echo Html::hidden('_glpi_csrf_token', ['value' => '']);
echo "</td><td>";
self::showUploadedFilesDropdown("img");
echo "</td><td>";
Expand Down
5 changes: 5 additions & 0 deletions positions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<author>Infotel</author>
</authors>
<versions>
<version>
<num>6.0.1</num>
<compatibility>~10.0</compatibility>
<download_url>https://github.com/InfotelGLPI/positions/releases/download/6.0.1/glpi-positions-6.0.1.tar.bz2</download_url>
</version>
<version>
<num>6.0.0</num>
<compatibility>~10.0</compatibility>
Expand Down
6 changes: 3 additions & 3 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Init the hooks of the plugins -Needed

define('PLUGIN_POSITIONS_VERSION', '6.0.0');
define('PLUGIN_POSITIONS_VERSION', '6.0.1');

if (!defined("PLUGIN_POSITIONS_DIR")) {
define("PLUGIN_POSITIONS_DIR", Plugin::getPhpDir("positions"));
Expand Down Expand Up @@ -63,10 +63,10 @@ function plugin_init_positions() {
// Add specific files to add to the header : javascript or css
$PLUGIN_HOOKS['add_javascript']['positions'] = [
//file upload
"lib/plupload/plupload.full.js",
// "lib/plupload/plupload.full.js",
"lib/extjs/adapter/ext/ext-base.js",
"lib/extjs/ext-all.js",
"upload.js",
// "upload.js",
"positions.js",
"geoloc.js",
"lib/canvas/canvasXpress.min.js",
Expand Down
66 changes: 0 additions & 66 deletions upload.js

This file was deleted.

0 comments on commit 2a4c552

Please sign in to comment.