Skip to content

Commit

Permalink
TAG 1.9.0 for GLPI 0.84
Browse files Browse the repository at this point in the history
git-svn-id: https://forge.glpi-project.org/svn/order/tags/1.9.0@820 349b9182-4a13-0410-896f-e5e9767dd1b3
  • Loading branch information
wawax committed Dec 10, 2014
0 parents commit 5e3e22e
Show file tree
Hide file tree
Showing 113 changed files with 30,393 additions and 0 deletions.
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions ajax/billactions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/*
* @version $Id$
LICENSE
This file is part of the order plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with Order. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package order
@author the order plugin team
@copyright Copyright (c) 2010-2011 Order plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/order
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */

include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

if (!defined('GLPI_ROOT')) {
die("Can not acces directly to this file");
}

if (isset($_POST["action"])) {
switch($_POST["action"]) {
case "bill":
echo "&nbsp;<input type='hidden' name='plugin_order_orders_id' " .
" value='".$_POST["plugin_order_orders_id"]."'>";
PluginOrderBill::Dropdown(array('condition' =>
"`plugin_order_orders_id`='".$_POST['plugin_order_orders_id']."'"));
break;
}

PluginOrderBillState::Dropdown(array('comments' => true));
echo"&nbsp;<input type='submit' name='action' class='submit' " .
" value='"._sx('button', 'Post')."'>";
}

?>
57 changes: 57 additions & 0 deletions ajax/detail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/*
* @version $Id: bill.tabs.php 530 2011-06-30 11:30:17Z walid $
LICENSE
This file is part of the order plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with Order. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package order
@author the order plugin team
@copyright Copyright (c) 2010-2011 Order plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/order
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */

include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

if (!defined('GLPI_ROOT')){
die("Can not acces directly to this file");
}

Session::checkCentralAccess();

$rand = $_POST["rand"];
$paramsaction = array('plugin_order_references_id' => '__VALUE__',
'entity_restrict' => $_POST["entity_restrict"],
'suppliers_id' => $_POST["suppliers_id"],
'itemtype' => $_POST['itemtype']);
$fields = array ("quantity", "priceht", "pricediscounted", "taxe", "validate");

foreach ($fields as $field) {
$paramsaction['update'] = $field;
Ajax::updateItem("show_$field", $CFG_GLPI["root_doc"]."/plugins/order/ajax/referencedetail.php",
$paramsaction, "dropdown_reference$rand");
Ajax::updateItemOnSelectEvent("dropdown_reference$rand", "show_$field",
$CFG_GLPI["root_doc"]."/plugins/order/ajax/referencedetail.php",
$paramsaction);
}

?>
51 changes: 51 additions & 0 deletions ajax/detailref.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/*
* @version $Id: bill.tabs.php 530 2011-06-30 11:30:17Z walid $
LICENSE
This file is part of the order plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with Order. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package order
@author the order plugin team
@copyright Copyright (c) 2010-2011 Order plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/order
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */

include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

if (!defined('GLPI_ROOT')){
die("Can not acces directly to this file");
}

Session::checkCentralAccess();

$params = array('itemtype' => $_POST['itemtype'],
'orders_id' => $_POST['orders_id'],
'suppliers_id' => $_POST['suppliers_id'],
'entity' => $_POST['entity_restrict'],
'span' => $_POST['span'],
'action' => $CFG_GLPI["root_doc"]."/plugins/order/ajax/detail.php",
'condition' => '');
$ref = new PluginOrderReference();
$ref->dropdownReferencesByEnterprise("PluginOrderReference",$params);

?>
100 changes: 100 additions & 0 deletions ajax/dropdownContact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php
/*
* @version $Id: bill.tabs.php 530 2011-06-30 11:30:17Z walid $
LICENSE
This file is part of the order plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with Order. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package order
@author the order plugin team
@copyright Copyright (c) 2010-2011 Order plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/order
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */

if (strpos($_SERVER['PHP_SELF'],"dropdownContact.php")) {
include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
}
if (!defined('GLPI_ROOT')) {
die("Can not acces directly to this file");
}

Session::checkCentralAccess();

// Make a select box with all glpi users
$where=" WHERE `glpi_contacts_suppliers`.`contacts_id` = `glpi_contacts`.`id` " .
" AND (`glpi_contacts_suppliers`.`suppliers_id` = '".$_POST['suppliers_id']."' " .
" AND `glpi_contacts`.`is_deleted` = '0' ) ";


if (isset($_POST["entity_restrict"])) {
if (!is_numeric($_POST["entity_restrict"]) && !is_array($_POST["entity_restrict"])) {
$_POST["entity_restrict"] = unserialize(Toolbox::stripslashes_deep($_POST["entity_restrict"]));
}
$where.=getEntitiesRestrictRequest("AND","glpi_contacts",'',$_POST["entity_restrict"],true);
} else {
$where.=getEntitiesRestrictRequest("AND","glpi_contacts",'','',true);
}

if ($_POST['searchText']!=$CFG_GLPI["ajax_wildcard"])
$where.=" AND `glpi_contacts`.`name` ".makeTextSearch($_POST['searchText']);

$NBMAX=$CFG_GLPI["dropdown_max"];
$LIMIT="LIMIT 0,$NBMAX";
if ($_POST['searchText']==$CFG_GLPI["ajax_wildcard"]) $LIMIT="";


$query = "SELECT `glpi_contacts`.*
FROM `glpi_contacts`,`glpi_contacts_suppliers`
$where
ORDER BY `entities_id`, `name` $LIMIT";
//error_log($query);
$result = $DB->query($query);

echo "<select name=\"contacts_id\">";

echo "<option value=\"0\">".Dropdown::EMPTY_VALUE."</option>";

if ($DB->numrows($result)) {
$prev=-1;
while ($data=$DB->fetch_array($result)) {
if ($data["entities_id"]!=$prev) {
if ($prev>=0) {
echo "</optgroup>";
}
$prev=$data["entities_id"];
echo "<optgroup label=\"". Dropdown::getDropdownName("glpi_entities", $prev) ."\">";
}
$output=formatUserName($data["id"],"",$data["name"],$data["firstname"]);
if($_SESSION["glpiis_ids_visible"]||empty($output)){
$output.=" (".$data["id"].")";
}
echo "<option value=\"".$data["id"]."\" title=\"$output\">".
substr($output,0,$CFG_GLPI["dropdown_chars_limit"])."</option>";
}
if ($prev>=0) {
echo "</optgroup>";
}
}

echo "</select>";

?>
68 changes: 68 additions & 0 deletions ajax/dropdownSupplier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
/*
* @version $Id: bill.tabs.php 530 2011-06-30 11:30:17Z walid $
LICENSE
This file is part of the order plugin.
Order plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Order plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; along with Order. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package order
@author the order plugin team
@copyright Copyright (c) 2010-2011 Order plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/order
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */

if (strpos($_SERVER['PHP_SELF'],"dropdownSupplier.php")) {
include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
}

Session::checkCentralAccess();

// Make a select box

if (isset($_POST["suppliers_id"])) {

$rand=$_POST['rand'];

$use_ajax=false;
if ($CFG_GLPI["use_ajax"] &&
countElementsInTable('glpi_suppliers',
"`glpi_suppliers`.`id` = '".$_POST["suppliers_id"]."' ".
getEntitiesRestrictRequest("AND", "glpi_suppliers","",
$_POST["entity_restrict"],true)) >
$CFG_GLPI["ajax_limit_count"]){
$use_ajax = true;
}

$paramssuppliers_id=array('searchText' => '__VALUE__',
'suppliers_id' => $_POST["suppliers_id"],
'entity_restrict'=> $_POST["entity_restrict"],
'rand' => $_POST['rand'],
'myname' => $_POST['myname']);

$default="<select name='".$_POST["myname"]."'><option value='0'>".Dropdown::EMPTY_VALUE.
"</option></select>";
Ajax::Dropdown($use_ajax,"/plugins/order/ajax/dropdownContact.php", $paramssuppliers_id, $default,
$rand);

}

?>
Loading

0 comments on commit 5e3e22e

Please sign in to comment.