Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
1591a5ac3b
@ -632,27 +632,27 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
|||||||
{
|
{
|
||||||
// Insert line
|
// Insert line
|
||||||
$result = $object->addline(
|
$result = $object->addline(
|
||||||
$object->id,
|
$object->id,
|
||||||
$desc,
|
$desc,
|
||||||
$pu_ht,
|
$pu_ht,
|
||||||
GETPOST('qty'),
|
GETPOST('qty'),
|
||||||
$tva_tx,
|
$tva_tx,
|
||||||
$localtax1_tx,
|
$localtax1_tx,
|
||||||
$localtax2_tx,
|
$localtax2_tx,
|
||||||
GETPOST('idprod'),
|
GETPOST('idprod'),
|
||||||
GETPOST('remise_percent'),
|
GETPOST('remise_percent'),
|
||||||
$info_bits,
|
$info_bits,
|
||||||
0,
|
0,
|
||||||
$price_base_type,
|
$price_base_type,
|
||||||
$pu_ttc,
|
$pu_ttc,
|
||||||
$date_start,
|
$date_start,
|
||||||
$date_end,
|
$date_end,
|
||||||
$type,
|
$type,
|
||||||
-1,
|
-1,
|
||||||
'',
|
'',
|
||||||
GETPOST('fk_parent_line'),
|
GETPOST('fk_parent_line'),
|
||||||
GETPOST('np_fournprice'),
|
GETPOST('np_fournprice'),
|
||||||
GETPOST('np_buying_price')
|
GETPOST('np_buying_price')
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
|||||||
@ -43,9 +43,9 @@ class RemiseCheque extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function RemiseCheque($DB)
|
function RemiseCheque($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
$this->next_id = 0;
|
$this->next_id = 0;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ function SetXmlHeaders()
|
|||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
|
|
||||||
// Set the response format.
|
// Set the response format.
|
||||||
header( 'Content-Type: text/xml; charset=utf-8' );
|
header('Content-Type: text/xml; charset=utf-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
function CreateXmlHeader( $command, $resourceType, $currentFolder )
|
function CreateXmlHeader( $command, $resourceType, $currentFolder )
|
||||||
@ -58,7 +58,7 @@ function CreateXmlHeader( $command, $resourceType, $currentFolder )
|
|||||||
echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
|
echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
|
||||||
|
|
||||||
// Add the current folder node.
|
// Add the current folder node.
|
||||||
echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;
|
echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType, $currentFolder, $command)) . '" />' ;
|
||||||
|
|
||||||
$GLOBALS['HeaderSent'] = true ;
|
$GLOBALS['HeaderSent'] = true ;
|
||||||
}
|
}
|
||||||
@ -68,14 +68,21 @@ function CreateXmlFooter()
|
|||||||
echo '</Connector>' ;
|
echo '</Connector>' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendError( $number, $text )
|
/**
|
||||||
|
* SendError
|
||||||
|
*
|
||||||
|
* @param unknown_type $number Number
|
||||||
|
* @param unknown_type $text Text
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function SendError($number, $text)
|
||||||
{
|
{
|
||||||
if ( $_GET['Command'] == 'FileUpload' )
|
if ( $_GET['Command'] == 'FileUpload' )
|
||||||
SendUploadResults( $number, "", "", $text );
|
SendUploadResults($number, "", "", $text);
|
||||||
|
|
||||||
if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
|
if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
|
||||||
{
|
{
|
||||||
SendErrorNode( $number, $text );
|
SendErrorNode($number, $text);
|
||||||
CreateXmlFooter();
|
CreateXmlFooter();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -87,17 +94,17 @@ function SendError( $number, $text )
|
|||||||
|
|
||||||
echo '<Connector>' ;
|
echo '<Connector>' ;
|
||||||
|
|
||||||
SendErrorNode( $number, $text );
|
SendErrorNode($number, $text);
|
||||||
|
|
||||||
echo '</Connector>' ;
|
echo '</Connector>' ;
|
||||||
}
|
}
|
||||||
exit ;
|
exit ;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendErrorNode( $number, $text )
|
function SendErrorNode($number, $text)
|
||||||
{
|
{
|
||||||
if ($text)
|
if ($text)
|
||||||
echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
|
echo '<Error number="' . $number . '" text="' . htmlspecialchars($text) . '" />' ;
|
||||||
else
|
else
|
||||||
echo '<Error number="' . $number . '" />' ;
|
echo '<Error number="' . $number . '" />' ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,10 +29,9 @@ require('./util.php');
|
|||||||
require('./io.php');
|
require('./io.php');
|
||||||
require('./basexml.php');
|
require('./basexml.php');
|
||||||
require('./commands.php');
|
require('./commands.php');
|
||||||
require('./phpcompat.php');
|
|
||||||
|
|
||||||
if ( !$Config['Enabled'] )
|
if ( !$Config['Enabled'] )
|
||||||
SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' );
|
SendError(1, 'This connector is disabled. Please check the "editor/filemanager/connectors/php/config.php" file');
|
||||||
|
|
||||||
DoResponse();
|
DoResponse();
|
||||||
|
|
||||||
@ -50,33 +49,33 @@ function DoResponse()
|
|||||||
$sCurrentFolder = GetCurrentFolder();
|
$sCurrentFolder = GetCurrentFolder();
|
||||||
|
|
||||||
// Check if it is an allowed command
|
// Check if it is an allowed command
|
||||||
if ( ! IsAllowedCommand( $sCommand ) )
|
if (! IsAllowedCommand($sCommand))
|
||||||
SendError( 1, 'The "' . $sCommand . '" command isn\'t allowed' );
|
SendError(1, 'The "' . $sCommand . '" command isn\'t allowed');
|
||||||
|
|
||||||
// Check if it is an allowed type.
|
// Check if it is an allowed type.
|
||||||
if ( !IsAllowedType( $sResourceType ) )
|
if (! IsAllowedType($sResourceType))
|
||||||
SendError( 1, 'Invalid type specified' );
|
SendError(1, 'Invalid type specified');
|
||||||
|
|
||||||
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
|
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
|
||||||
if ( $sCommand == 'FileUpload' )
|
if ( $sCommand == 'FileUpload' )
|
||||||
{
|
{
|
||||||
FileUpload( $sResourceType, $sCurrentFolder, $sCommand );
|
FileUpload($sResourceType, $sCurrentFolder, $sCommand);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder );
|
CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder);
|
||||||
|
|
||||||
// Execute the required command.
|
// Execute the required command.
|
||||||
switch ( $sCommand )
|
switch ( $sCommand )
|
||||||
{
|
{
|
||||||
case 'GetFolders' :
|
case 'GetFolders' :
|
||||||
GetFolders( $sResourceType, $sCurrentFolder );
|
GetFolders($sResourceType, $sCurrentFolder);
|
||||||
break ;
|
break ;
|
||||||
case 'GetFoldersAndFiles' :
|
case 'GetFoldersAndFiles' :
|
||||||
GetFoldersAndFiles( $sResourceType, $sCurrentFolder );
|
GetFoldersAndFiles($sResourceType, $sCurrentFolder);
|
||||||
break ;
|
break ;
|
||||||
case 'CreateFolder' :
|
case 'CreateFolder' :
|
||||||
CreateFolder( $sResourceType, $sCurrentFolder );
|
CreateFolder($sResourceType, $sCurrentFolder);
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
if ( !isset( $_SERVER ) ) {
|
|
||||||
$_SERVER = $HTTP_SERVER_VARS ;
|
|
||||||
}
|
|
||||||
if ( !isset( $_GET ) ) {
|
|
||||||
$_GET = $HTTP_GET_VARS ;
|
|
||||||
}
|
|
||||||
if ( !isset( $_FILES ) ) {
|
|
||||||
$_FILES = $HTTP_POST_FILES ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! defined('DIRECTORY_SEPARATOR'))
|
|
||||||
{
|
|
||||||
define('DIRECTORY_SEPARATOR', strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/');
|
|
||||||
}
|
|
||||||
@ -26,17 +26,16 @@ require('./config.php');
|
|||||||
require('./util.php');
|
require('./util.php');
|
||||||
require('./io.php');
|
require('./io.php');
|
||||||
require('./commands.php');
|
require('./commands.php');
|
||||||
require('./phpcompat.php');
|
|
||||||
|
|
||||||
function SendError( $number, $text )
|
function SendError( $number, $text )
|
||||||
{
|
{
|
||||||
SendUploadResults( $number, '', '', $text );
|
SendUploadResults($number, '', '', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if this uploader has been enabled.
|
// Check if this uploader has been enabled.
|
||||||
if ( !$Config['Enabled'] )
|
if ( !$Config['Enabled'] )
|
||||||
SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' );
|
SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file');
|
||||||
|
|
||||||
$sCommand = 'QuickUpload' ;
|
$sCommand = 'QuickUpload' ;
|
||||||
|
|
||||||
@ -46,12 +45,12 @@ $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
|
|||||||
$sCurrentFolder = "/" ;
|
$sCurrentFolder = "/" ;
|
||||||
|
|
||||||
// Is enabled the upload?
|
// Is enabled the upload?
|
||||||
if ( ! IsAllowedCommand( $sCommand ) )
|
if (! IsAllowedCommand($sCommand))
|
||||||
SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' );
|
SendUploadResults('1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed');
|
||||||
|
|
||||||
// Check if it is an allowed type.
|
// Check if it is an allowed type.
|
||||||
if ( !IsAllowedType( $sType ) )
|
if (! IsAllowedType($sType))
|
||||||
SendUploadResults( 1, '', '', 'Invalid type specified' );
|
SendUploadResults(1, '', '', 'Invalid type specified');
|
||||||
|
|
||||||
|
|
||||||
// DOL_CHANGE
|
// DOL_CHANGE
|
||||||
|
|||||||
@ -25,15 +25,20 @@
|
|||||||
function RemoveFromStart( $sourceString, $charToRemove )
|
function RemoveFromStart( $sourceString, $charToRemove )
|
||||||
{
|
{
|
||||||
$sPattern = '|^' . $charToRemove . '+|' ;
|
$sPattern = '|^' . $charToRemove . '+|' ;
|
||||||
return preg_replace( $sPattern, '', $sourceString );
|
return preg_replace($sPattern, '', $sourceString);
|
||||||
}
|
}
|
||||||
|
|
||||||
function RemoveFromEnd( $sourceString, $charToRemove )
|
function RemoveFromEnd( $sourceString, $charToRemove)
|
||||||
{
|
{
|
||||||
$sPattern = '|' . $charToRemove . '+$|' ;
|
$sPattern = '|' . $charToRemove . '+$|' ;
|
||||||
return preg_replace( $sPattern, '', $sourceString );
|
return preg_replace($sPattern, '', $sourceString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FindBadUtf8
|
||||||
|
*
|
||||||
|
* @param unknown_type $string String
|
||||||
|
*/
|
||||||
function FindBadUtf8( $string )
|
function FindBadUtf8( $string )
|
||||||
{
|
{
|
||||||
$regex =
|
$regex =
|
||||||
@ -57,6 +62,11 @@ function FindBadUtf8( $string )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ConvertToXmlAttribute
|
||||||
|
*
|
||||||
|
* @param unknown_type $value
|
||||||
|
*/
|
||||||
function ConvertToXmlAttribute( $value )
|
function ConvertToXmlAttribute( $value )
|
||||||
{
|
{
|
||||||
if ( defined( 'PHP_OS' ) )
|
if ( defined( 'PHP_OS' ) )
|
||||||
@ -173,10 +183,9 @@ function DetectHtml( $filePath )
|
|||||||
* Currently this function validates only image files.
|
* Currently this function validates only image files.
|
||||||
* Returns false if file is invalid.
|
* Returns false if file is invalid.
|
||||||
*
|
*
|
||||||
* @param string $filePath absolute path to file
|
* @param string $filePath Absolute path to file
|
||||||
* @param string $extension file extension
|
* @param string $extension File extension
|
||||||
* @param integer $detectionLevel 0 = none, 1 = use getimagesize for images, 2 = use DetectHtml for images
|
* @return boolean True or false
|
||||||
* @return boolean
|
|
||||||
*/
|
*/
|
||||||
function IsImageValid( $filePath, $extension )
|
function IsImageValid( $filePath, $extension )
|
||||||
{
|
{
|
||||||
@ -206,11 +215,11 @@ function IsImageValid( $filePath, $extension )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !in_array( $extension, $imageCheckExtensions ) ) {
|
if (!in_array($extension, $imageCheckExtensions) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( @getimagesize( $filePath ) === false ) {
|
if (@getimagesize($filePath) === false) {
|
||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -784,7 +784,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
||||||
|
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||||
}
|
}
|
||||||
@ -808,7 +808,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
// Categories prospects/customers
|
// Categories prospects/customers
|
||||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
$newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||||
}
|
}
|
||||||
@ -816,7 +816,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
if ($conf->fournisseur->enabled)
|
if ($conf->fournisseur->enabled)
|
||||||
{
|
{
|
||||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
|
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||||
}
|
}
|
||||||
@ -913,7 +913,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
$newmenu->add("/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||||
}
|
}
|
||||||
@ -939,7 +939,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||||
if (! isset($user->societe_id) || $user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||||
}
|
}
|
||||||
@ -1126,7 +1126,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
if (! empty($conf->product->enabled))
|
if (! empty($conf->product->enabled))
|
||||||
{
|
{
|
||||||
$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
|
$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
|
$newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
|
||||||
$newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
$newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
||||||
@ -1145,7 +1145,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
if (! empty($conf->service->enabled))
|
if (! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
|
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
|
$newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
|
||||||
}
|
}
|
||||||
@ -1161,7 +1161,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
{
|
{
|
||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/categories/fiche.php?action=create&type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
$newmenu->add("/categories/fiche.php?action=create&type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||||
}
|
}
|
||||||
@ -1204,7 +1204,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
$newmenu->add("/fourn/index.php?leftmenu=suppliers", $langs->trans("Suppliers"), 0, $user->rights->societe->lire && $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
$newmenu->add("/fourn/index.php?leftmenu=suppliers", $langs->trans("Suppliers"), 0, $user->rights->societe->lire && $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id == 0)
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
$newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
||||||
}
|
}
|
||||||
@ -1367,7 +1367,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
|
|
||||||
$tabMenu=array();
|
$tabMenu=array();
|
||||||
$menuArbo = new Menubase($db,'eldy','left');
|
$menuArbo = new Menubase($db,'eldy','left');
|
||||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'eldy',$tabMenu);
|
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -700,7 +700,7 @@ function write_main_file($mainfile,$main_dir)
|
|||||||
{
|
{
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
fputs($fp, '<?php'."\n");
|
fputs($fp, '<?php'."\n");
|
||||||
fputs($fp, "# Wrapper to include main into htdocs\n");
|
fputs($fp, "// Wrapper to include main into htdocs\n");
|
||||||
fputs($fp, "include_once('".$main_dir."/main.inc.php');\n");
|
fputs($fp, "include_once('".$main_dir."/main.inc.php');\n");
|
||||||
fputs($fp, '?>');
|
fputs($fp, '?>');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@ -722,7 +722,7 @@ function write_master_file($masterfile,$main_dir)
|
|||||||
{
|
{
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
fputs($fp, '<?php'."\n");
|
fputs($fp, '<?php'."\n");
|
||||||
fputs($fp, "# Wrapper to include master into htdocs\n");
|
fputs($fp, "// Wrapper to include master into htdocs\n");
|
||||||
fputs($fp, "include_once('".$main_dir."/master.inc.php');\n");
|
fputs($fp, "include_once('".$main_dir."/master.inc.php');\n");
|
||||||
fputs($fp, '?>');
|
fputs($fp, '?>');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user