Work on PHPSane module

This commit is contained in:
Laurent Destailleur 2010-11-11 16:32:17 +00:00
parent 1ffda88421
commit 74cb81b8d3
4 changed files with 30 additions and 11 deletions

View File

@ -132,7 +132,7 @@ class FormFile
* @param genallowed Generation is allowed (1/0 or array of formats)
* @param delallowed Remove is allowed (1/0)
* @param modelselected Model to preselect by default
* @param allowgenifempty Show warning if no model activated
* @param allowgenifempty Show warning if no model activated
* @param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
* @param iconPDF Show only PDF icon with link (1/0)
* @param maxfilenamelength Max length for filename shown

View File

@ -397,6 +397,13 @@ if ($modulepart)
$original_file=$conf->adherent->dir_output.'/'.$original_file;
}
// Wrapping for PHPSane
else if ($modulepart == 'phpsane_user_temp')
{
$accessallowed=1;
$original_file=$conf->phpsane->dir_temp.'/'.$user->id.'/'.$original_file;
}
// Generic wrapping
else
{

View File

@ -37,11 +37,11 @@ $langs->load("suppliers");
$langs->load("bills");
// If socid provided by ajax company selector
if (! empty($_REQUEST['id_fourn_id']))
if (! empty($_REQUEST['search_fourn_id']))
{
$_GET['id_fourn'] = $_GET['id_fourn_id'];
$_POST['id_fourn'] = $_POST['id_fourn_id'];
$_REQUEST['id_fourn'] = $_REQUEST['id_fourn_id'];
$_GET['id_fourn'] = $_GET['search_fourn_id'];
$_POST['id_fourn'] = $_POST['search_fourn_id'];
$_REQUEST['id_fourn'] = $_REQUEST['search_fourn_id'];
}
// Security check
@ -89,19 +89,24 @@ if ($_GET["action"] == 'remove_pf')
if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$id_fourn=GETPOST("id_fourn");
if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn");
$ref_fourn=GETPOST("ref_fourn");
if (empty($ref_fourn)) $id_fourn=GETPOST("search_ref_fourn");
$product = new ProductFournisseur($db);
$result=$product->fetch($_REQUEST["id"]);
$result=$product->fetch(GETPOST("id"));
if ($result > 0)
{
$db->begin();
$error=0;
if (! $_POST["ref_fourn"])
if (! $ref_fourn)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
}
if ($_POST["id_fourn"] <= 0)
if ($id_fourn <= 0)
{
//print "eee".$_POST["id_fourn"];
$error++;
@ -110,7 +115,7 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
if (! $error)
{
$ret=$product->add_fournisseur($user, $_POST["id_fourn"], $_POST["ref_fourn"]);
$ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn);
if ($ret == -3)
{
$error++;
@ -134,7 +139,7 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
if ($_POST["price"] >= 0)
{
$supplier=new Fournisseur($db);
$result=$supplier->fetch($_POST["id_fourn"]);
$result=$supplier->fetch($id_fourn);
$ret=$product->update_buyprice($_POST["qty"], $_POST["price"], $user, $_POST["price_base_type"], $supplier);
if ($ret < 0)

View File

@ -270,7 +270,14 @@ if ($modulepart)
$original_file=$conf->mailing->dir_temp.'/'.$original_file;
}
// GENERIC Wrapping
// Wrapping pour les icones de background des mailings
elseif ($modulepart == 'phpsane_user_temp')
{
$accessallowed=1;
$original_file=$conf->phpsane->dir_temp.'/'.$user->id.'/'.$original_file;
}
// GENERIC Wrapping
// If modulepart=module_user_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp/iduser
// If modulepart=module_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp
// If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/iduser