Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-09-03 09:45:44 +02:00
commit fdf787fca4
24 changed files with 376 additions and 242 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,13 +24,17 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("users");
$langs->load("admin");
$langs->load("other");
if (!$user->admin) accessforbidden();
if (! $user->admin)
accessforbidden();
$action=GETPOST('action','alpha');
$upload_dir=$conf->admin->dir_temp;
@ -43,65 +47,75 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_add_file_process($upload_dir,0,0);
dol_add_file_process($upload_dir, 0, 0, 'userfile');
}
if ($_GET["action"] == 'activate_captcha')
if (preg_match('/set_(.*)/',$action,$reg))
{
dolibarr_set_const($db, "MAIN_SECURITY_ENABLECAPTCHA", '1','chaine',0,'',$conf->entity);
header("Location: security_other.php");
exit;
}
else if ($_GET["action"] == 'disable_captcha')
{
dolibarr_del_const($db, "MAIN_SECURITY_ENABLECAPTCHA",$conf->entity);
header("Location: security_other.php");
exit;
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if ($_GET["action"] == 'activate_advancedperms')
else if (preg_match('/del_(.*)/',$action,$reg))
{
dolibarr_set_const($db, "MAIN_USE_ADVANCED_PERMS", '1','chaine',0,'',$conf->entity);
header("Location: security_other.php");
exit;
}
else if ($_GET["action"] == 'disable_advancedperms')
{
dolibarr_del_const($db, "MAIN_USE_ADVANCED_PERMS",$conf->entity);
header("Location: security_other.php");
exit;
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if ($_GET["action"] == 'MAIN_SESSION_TIMEOUT')
else if ($action == 'MAIN_SESSION_TIMEOUT')
{
if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else $mesg=$langs->trans("RecordModifiedSuccessfully");
}
if ($_GET["action"] == 'MAIN_UPLOAD_DOC')
else if ($action == 'MAIN_UPLOAD_DOC')
{
if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else $mesg=$langs->trans("RecordModifiedSuccessfully");
}
if ($_GET["action"] == 'MAIN_UMASK')
else if ($action == 'MAIN_UMASK')
{
if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else $mesg=$langs->trans("RecordModifiedSuccessfully");
}
if ($_GET["action"] == 'MAIN_ANTIVIRUS_COMMAND')
else if ($action == 'MAIN_ANTIVIRUS_COMMAND')
{
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else $mesg=$langs->trans("RecordModifiedSuccessfully");
}
if ($_GET["action"] == 'MAIN_ANTIVIRUS_PARAM')
else if ($action == 'MAIN_ANTIVIRUS_PARAM')
{
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else $mesg=$langs->trans("RecordModifiedSuccessfully");
}
// Delete file
else if ($action == 'delete')
{
$langs->load("other");
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
Header('Location: '.$_SERVER["PHP_SELF"]);
exit;
}
/*
* View
@ -168,14 +182,21 @@ print '<td colspan="3">'.$langs->trans("UseCaptchaCode").'</td>';
print '<td align="right">';
if (function_exists("imagecreatefrompng"))
{
if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 0)
{
print '<a href="security_other.php?action=activate_captcha">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1)
{
print '<a href="security_other.php?action=disable_captcha">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA');
}
else
{
if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Enabled"),'on').'</a>';
}
}
}
else
{
@ -183,35 +204,34 @@ else
$desc = $form->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning');
print $desc;
}
print "</td>";
print "</td>";
print '</tr>';
print '</td></tr>';
// Enable advanced perms
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="3">'.$langs->trans("UseAdvancedPerms").'</td>';
print '<td align="right">';
if ($conf->global->MAIN_USE_ADVANCED_PERMS == 0)
if (! empty($conf->use_javascript_ajax))
{
print '<a href="security_other.php?action=activate_advancedperms">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS');
}
if($conf->global->MAIN_USE_ADVANCED_PERMS == 1)
else
{
print '<a href="security_other.php?action=disable_advancedperms">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Enabled"),'on').'</a>';
}
}
print "</td>";
print "</td>";
print '</tr>';
print "</td></tr>";
print '</table>';
print '<br>';
// Upload options
$var=false;
@ -274,7 +294,7 @@ if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING);
}
}
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND).'">';
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">';
print "</td>";
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
@ -291,7 +311,7 @@ print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
print $langs->trans("AntiVirusParamExample");
print '</td>';
print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM).'">';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">';
print "</td>";
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
@ -301,19 +321,16 @@ print '</form>';
print '</table>';
print '</div>';
// Form to test upload
dol_htmloutput_mesg($mesg);
// Affiche formulaire upload
print '<br>';
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/admin/security_other.php',$langs->trans("FormToTestFileUploadForm"),0,0,1);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1);
// List of document
$filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
$formfile->list_of_documents($filearray, '', 'admin_temp', '');
llxFooter();
$db->close();
?>

View File

@ -120,11 +120,11 @@ class ActionComm extends CommonObject
if (empty($this->punctual)) $this->punctual = 0;
if ($this->percentage > 100) $this->percentage = 100;
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep);
if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date);
if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep;
if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date;
if ($this->fk_project < 0) $this->fk_project = 0;
if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep);
if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date);
if (! empty($this->datep) && ! empty($this->datef) && $this->datep > $this->datef) $this->datef=$this->datep;
if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date;
if (! isset($this->fk_project) || $this->fk_project < 0) $this->fk_project = 0;
if ($this->elementtype=='facture') $this->elementtype='invoice';
if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract';
@ -186,19 +186,19 @@ class ActionComm extends CommonObject
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
//$sql.= (strval($this->date)!=''?"'".$this->db->idate($this->date)."'":"null").",";
//$sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
$sql.= ($this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
//$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
$sql.= " '".$this->type_id."',";
$sql.= ($this->societe->id>0?" '".$this->societe->id."'":"null").",";
$sql.= ($this->fk_project>0?" '".$this->fk_project."'":"null").",";
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
$sql.= " '".$this->db->escape($this->note)."',";
$sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").",";
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
$sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
$sql.= (isset($this->contact->id) && $this->contact->id > 0?"'".$this->contact->id."'":"null").",";
$sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
$sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
$sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',";
$sql.= ($this->fk_element?$this->fk_element:"null").",";
$sql.= ($this->elementtype?"'".$this->elementtype."'":"null").",";
$sql.= (! empty($this->fk_element)?$this->fk_element:"null").",";
$sql.= (! empty($this->elementtype)?"'".$this->elementtype."'":"null").",";
$sql.= $conf->entity;
$sql.= ")";

View File

@ -1688,7 +1688,7 @@ class Facture extends CommonInvoice
$result=$this->client->set_as_client();
// Si active on decremente le produit principal et ses composants a la validation de facture
if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL)
if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");

View File

@ -30,6 +30,8 @@ if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$action=GETPOST('action','alpha');
$name=GETPOST('name','alpha');
/*
* View
@ -45,17 +47,16 @@ top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
// Registering the location of boxes
if ((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
if (! empty($action) && ! empty($name))
{
$entity = GETPOST('entity','int');
$action = GETPOST('action', 'alpha');
$name = GETPOST('name', 'alpha');
$value = (GETPOST('value')?GETPOST('value'):1);
if ($user->admin)
{
if ($action == 'set')
{
dolibarr_set_const($db, $name, 1, 'chaine', 0, '', $entity);
dolibarr_set_const($db, $name, $value, 'chaine', 0, '', $entity);
}
else if ($action == 'del')
{

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -50,11 +50,11 @@ abstract class CommonDocGenerator
'myuser_lastname'=>$user->lastname,
'myuser_firstname'=>$user->firstname,
'myuser_login'=>$user->login,
'myuser_phone'=>$user->officephone,
'myuser_fax'=>$user->officefax,
'myuser_phone'=>$user->office_phone,
'myuser_fax'=>$user->office_fax,
'myuser_mobile'=>$user->user_mobile,
'myuser_email'=>$user->user_email,
'myuser_web'=>$user->url
'myuser_email'=>$user->email,
//'myuser_web'=>$user->url // FIXME url not exist in $user object
);
}

View File

@ -382,6 +382,9 @@ class Conf
if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2;
if (! isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) $this->global->MAIN_MAX_DECIMALS_SHOWN=8;
// Default max file size for upload
$this->maxfilesize = (! empty($this->global->MAIN_UPLOAD_DOC) ? $this->global->MAIN_UPLOAD_DOC * 1024 : 2097152);
// Timeouts
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;
if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) $this->global->MAIN_USE_RESPONSE_TIMEOUT=30;

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -714,10 +714,10 @@ class DoliDBMysql
global $conf;
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
$cryptType = (isset($conf->db->dolibarr_main_db_encryption)?$conf->db->dolibarr_main_db_encryption:0);
//Encryption key
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
$cryptKey = (! empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
$return = ($withQuotes?"'":"").$this->escape($fieldorvalue).($withQuotes?"'":"");

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -709,10 +709,10 @@ class DoliDBMysqli
global $conf;
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
$cryptType = (isset($conf->db->dolibarr_main_db_encryption)?$conf->db->dolibarr_main_db_encryption:0);
//Encryption key
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
$cryptKey = (! empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
$return = ($withQuotes?"'":"").$this->escape($fieldorvalue).($withQuotes?"'":"");

View File

@ -1,5 +1,5 @@
// Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
// Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -627,8 +627,134 @@ function hideMessage(fieldId,message) {
if (textbox.value == message) textbox.value = '';
}
/*
*
*/
function setConstant(url, code, input, entity) {
$.get( url, {
action: "set",
name: code,
entity: entity
},
function() {
$("#set_" + code).hide();
$("#del_" + code).show();
$.each(input, function(type, data) {
// Enable another element
if (type == "disabled") {
$.each(data, function(key, value) {
$("#" + value).removeAttr("disabled");
if ($("#" + value).hasClass("butActionRefused") == true) {
$("#" + value).removeClass("butActionRefused");
$("#" + value).addClass("butAction");
}
});
// Show another element
} else if (type == "showhide" || type == "show") {
$.each(data, function(key, value) {
$("#" + value).show();
});
// Set another constant
} else if (type == "set") {
$.each(data, function(key, value) {
$("#set_" + key).hide();
$("#del_" + key).show();
$.get( url, {
action: "set",
name: key,
value: value,
entity: entity
});
});
}
});
});
}
/*
*
*/
function delConstant(url, code, input, entity) {
$.get( url, {
action: "del",
name: code,
entity: entity
},
function() {
$("#del_" + code).hide();
$("#set_" + code).show();
$.each(input, function(type, data) {
// Disable another element
if (type == "disabled") {
$.each(data, function(key, value) {
$("#" + value).attr("disabled", true);
if ($("#" + value).hasClass("butAction") == true) {
$("#" + value).removeClass("butAction");
$("#" + value).addClass("butActionRefused");
}
});
// Hide another element
} else if (type == "showhide" || type == "hide") {
$.each(data, function(key, value) {
$("#" + value).hide();
});
// Delete another constant
} else if (type == "del") {
$.each(data, function(key, value) {
$("#del_" + value).hide();
$("#set_" + value).show();
$.get( url, {
action: "del",
name: value,
entity: entity
});
});
}
});
});
}
/*
*
*/
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) {
$("#confirm_" + code)
.attr("title", box.title)
.html(box.content)
.dialog({
resizable: false,
height: 170,
width: 500,
modal: true,
buttons: [
{
text : yesButton,
click : function() {
if (action == "set") {
setConstant(url, code, input, entity);
} else if (action == "del") {
delConstant(url, code, input, entity);
}
// Close dialog
$(this).dialog("close");
// Execute another function
if (box.function) {
var fnName = box.function;
if (window.hasOwnProperty(fnName)) {
window[fnName]();
}
}
}
},
{
text : noButton,
click : function() {
$(this).dialog("close");
}
}
]
});
}
/* This is to allow to transform all select box into ajax autocomplete box
* with just one line: $(function() { $( "#listmotifcons" ).combobox(); });

View File

@ -277,7 +277,7 @@ function ajax_dialog($title,$message,$w=350,$h=150)
modal: true,
buttons: {
Ok: function() {
jQuery(this ).dialog(\'close\');
jQuery(this).dialog(\'close\');
}
}
});
@ -346,11 +346,11 @@ function ajax_combobox($htmlname, $event=array())
* On/off button for constant
*
* @param string $code Name of constant
* @param array $input Input element
* @param array $input Input element (enable/disable or show/hide another element, set/del another constant)
* @param int $entity Entity to set
* @return void
*/
function ajax_constantonoff($code,$input=array(),$entity=false)
function ajax_constantonoff($code, $input=array(), $entity=false)
{
global $conf, $langs;
@ -359,65 +359,33 @@ function ajax_constantonoff($code,$input=array(),$entity=false)
$out= '<script type="text/javascript">
$(function() {
var input = '.json_encode($input).';
var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\';
var code = \''.$code.'\';
var entity = \''.$entity.'\';
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
// Set constant
$("#set_'.$code.'").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/constantonoff.php", {
action: \'set\',
name: \''.$code.'\',
entity: \''.$entity.'\'
},
function() {
$("#set_'.$code.'").hide();
$("#del_'.$code.'").show();
// Enable another element
if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) {
$("#" + value).removeAttr("disabled");
if ($("#" + value).hasClass("butActionRefused") == true) {
$("#" + value).removeClass("butActionRefused");
$("#" + value).addClass("butAction");
}
});
// Show another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).show();
});
}
});
$("#set_" + code).click(function() {
if (input.alert && input.alert.set) {
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
} else {
setConstant(url, code, input, entity);
}
});
// Del constant
$("#del_'.$code.'").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/constantonoff.php", {
action: \'del\',
name: \''.$code.'\',
entity: \''.$entity.'\'
},
function() {
$("#del_'.$code.'").hide();
$("#set_'.$code.'").show();
// Disable another element
if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) {
$("#" + value).attr("disabled", true);
if ($("#" + value).hasClass("butAction") == true) {
$("#" + value).removeClass("butAction");
$("#" + value).addClass("butActionRefused");
}
});
// Hide another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).hide();
});
}
});
$("#del_" + code).click(function() {
if (input.alert && input.alert.del) {
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
} else {
delConstant(url, code, input, entity);
}
});
});
</script>';
$out.= '<div id="confirm_'.$code.'" title="" style="display: none;"></div>';
$out.= '<span id="set_'.$code.'" class="linkobject '.(! empty($conf->global->$code)?'hideobject':'').'">'.img_picto($langs->trans("Disabled"),'switch_off').'</span>';
$out.= '<span id="del_'.$code.'" class="linkobject '.(! empty($conf->global->$code)?'':'hideobject').'">'.img_picto($langs->trans("Enabled"),'switch_on').'</span>';

View File

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -43,10 +43,10 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
global $db, $conf, $langs;
$idprod=$line->fk_product;
$label=$line->label; if (empty($label)) $label=$line->libelle;
$desc=$line->desc; if (empty($desc)) $desc=$line->description;
$ref_supplier=$line->ref_supplier; if (empty($ref_supplier)) $ref_supplier=$line->ref_fourn; // TODO Not yet saved for supplier invoices, only supplier orders
$note=$line->note;
$label=(! empty($line->label)?$line->label:(! empty($line->libelle)?$line->libelle:''));
$desc=(! empty($line->desc)?$line->desc:(! empty($line->description)?$line->description:''));
$ref_supplier=(! empty($line->ref_supplier)?$line->ref_supplier:(! empty($line->ref_fourn)?$line->ref_fourn:'')); // TODO Not yet saved for supplier invoices, only supplier orders
$note=(! empty($line->note)?$line->note:'');
if ($issupplierline) $prodser = new ProductFournisseur($db);
else $prodser = new Product($db);
@ -55,7 +55,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
{
$prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated
if ($conf->global->MAIN_MULTILANGS && ($outputlangs->defaultlang != $langs->defaultlang))
if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang))
{
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
@ -89,7 +89,8 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
{
if ($idprod)
{
if ( empty($hidedesc) ) $libelleproduitservice.=$desc;
if (empty($hidedesc))
$libelleproduitservice.=$desc;
}
else
{
@ -106,9 +107,9 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
{
$prefix_prodserv = "";
$ref_prodserv = "";
if ($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS) // In standard mode, we do not show this
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
{
if($prodser->isservice())
if ($prodser->isservice())
{
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
}
@ -118,7 +119,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
}
}
if ( empty($hideref) )
if (empty($hideref))
{
if ($issupplierline) $ref_prodserv = $prodser->ref.' ('.$outputlangs->trans("SupplierRef").' '.$ref_supplier.')'; // Show local ref and supplier ref
else $ref_prodserv = $prodser->ref; // Show local ref only
@ -130,7 +131,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
}
}
if ($line->date_start || $line->date_end)
if (! empty($line->date_start) || ! empty($line->date_end))
{
$format='day';
// Show duration if exists

View File

@ -139,12 +139,12 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
closedir($dir);
// Obtain a list of columns
if ($sortcriteria)
if (! empty($sortcriteria))
{
$myarray=array();
foreach ($file_list as $key => $row)
{
$myarray[$key] = $row[$sortcriteria];
$myarray[$key] = (isset($row[$sortcriteria])?$row[$sortcriteria]:'');
}
// Sort the data
if ($sortorder) array_multisort($myarray, $sortorder, $file_list);

View File

@ -3033,12 +3033,13 @@ function get_exdir($num,$level=3,$alpha=0,$withoutslash=0)
/**
* Creation of a directory (this can create recursive subdir)
*
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @return int < 0 if KO, 0 = already exists, > 0 if OK
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @param string $dataroot Data root directory (to avoid having the data root in the loop)
* @return int < 0 if KO, 0 = already exists, > 0 if OK
*/
function dol_mkdir($dir)
function dol_mkdir($dir, $dataroot='')
{
global $conf;
global $db, $conf;
dol_syslog("functions.lib::dol_mkdir: dir=".$dir,LOG_INFO);
@ -3048,8 +3049,14 @@ function dol_mkdir($dir)
$nberr=0;
$nbcreated=0;
$ccdir = '';
$cdir = explode("/",$dir);
$ccdir='';
if (! empty($dataroot)) {
// Remove data root from loop
$dir = str_replace($dataroot.'/', '', $dir);
$ccdir = $dataroot.'/';
}
$cdir = explode("/", $dir);
$num=count($cdir);
for ($i = 0; $i < $num; $i++)
{

View File

@ -1170,7 +1170,7 @@ abstract class DolibarrModules
$err=0;
if (is_array($this->dirs))
if (isset($this->dirs) && is_array($this->dirs) && ! empty($this->dirs))
{
foreach ($this->dirs as $key => $value)
{
@ -1184,19 +1184,19 @@ abstract class DolibarrModules
$subname = empty($this->dirs[$key][3])?'':strtoupper($this->dirs[$key][3]); // Add submodule name (ex: $conf->module->submodule->dir_output)
$forcename = empty($this->dirs[$key][4])?'':strtoupper($this->dirs[$key][4]); // Change the module name if different
if ($forcename) $constname = 'MAIN_MODULE_'.$forcename."_DIR_";
if ($subname) $constname = $constname.$subname."_";
if (! empty($forcename)) $constname = 'MAIN_MODULE_'.$forcename."_DIR_";
if (! empty($subname)) $constname = $constname.$subname."_";
$name = $constname.strtoupper($this->dirs[$key][0]);
$name = $constname.strtoupper($this->dirs[$key][0]);
}
// Define directory full path ($dir must start with "/")
if (empty($conf->global->MAIN_MODULE_MULTICOMPANY) || $conf->entity == 1) $fulldir = DOL_DATA_ROOT.$dir;
else $fulldir = DOL_DATA_ROOT."/".$conf->entity.$dir;
// Create dir if it does not exists
if ($fulldir && ! file_exists($fulldir))
if (! empty($fulldir) && ! file_exists($fulldir))
{
if (dol_mkdir($fulldir) < 0)
if (dol_mkdir($fulldir, DOL_DATA_ROOT) < 0)
{
$this->error = $langs->trans("ErrorCanNotCreateDir",$fulldir);
dol_syslog(get_class($this)."::_init ".$this->error, LOG_ERR);
@ -1205,9 +1205,9 @@ abstract class DolibarrModules
}
// Define the constant in database if requested (not the default mode)
if ($addtodatabase)
if (! empty($addtodatabase))
{
$result = $this->insert_dirs($name,$dir);
$result = $this->insert_dirs($name, $dir);
if ($result) $err++;
}
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -108,12 +109,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures
'object_ref'=>$object->ref,
'object_ref_ext'=>$object->ref_ext,
'object_ref_customer'=>$object->ref_client,
'object_ref_supplier'=>$object->ref_fournisseur,
'object_ref_supplier'=>(! empty($object->ref_fournisseur)?$object->ref_fournisseur:''),
'object_source_invoice_ref'=>$invoice_source->ref,
'object_date'=>dol_print_date($object->date,'day'),
'object_date_limit'=>dol_print_date($object->date_lim_reglement,'day'),
'object_date_creation'=>dol_print_date($object->date_creation,'day'),
'object_date_modification'=>dol_print_date($object->date_modification,'day'),
'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''),
'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'),
'object_payment_mode_code'=>$object->mode_reglement_code,
'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),
@ -122,7 +123,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
'object_total_ht'=>price($object->total_ht,0,$outputlangs),
'object_total_vat'=>price($object->total_tva,0,$outputlangs),
'object_total_ttc'=>price($object->total_ttc,0,$outputlangs),
'object_vatrate'=>vatrate($object->tva),
'object_vatrate'=>(isset($object->tva)?vatrate($object->tva):''),
'object_note_private'=>$object->note,
'object_note'=>$object->note_public,
// Payments
@ -339,7 +340,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -95,21 +95,23 @@ class ImportCsv extends ModeleImports
}
/**
* getDriverLabel
* getDriverLabel
*
* @return string Label
* @param string $key Key
* @return string Label
*/
function getDriverLabel()
function getDriverLabel($key='')
{
return $this->label;
}
/**
* getDriverDesc
* getDriverDesc
*
* @return string Description
* @param string $key Key
* @return string Description
*/
function getDriverDesc()
function getDriverDesc($key='')
{
return $this->desc;
}
@ -125,21 +127,23 @@ class ImportCsv extends ModeleImports
}
/**
* getDriverVersion
* getDriverVersion
*
* @return string Driver version
* @param string $key Key
* @return string Driver version
*/
function getDriverVersion()
function getDriverVersion($key='')
{
return $this->version;
}
/**
* getDriverLabel
* getDriverLabel
*
* @return string Label of external lib
* @param string $key Key
* @return string Label of external lib
*/
function getLibLabel()
function getLibLabel($key='')
{
return $this->label_lib;
}
@ -147,9 +151,10 @@ class ImportCsv extends ModeleImports
/**
* getLibVersion
*
* @return string Version of external lib
* @param string $key Key
* @return string Version of external lib
*/
function getLibVersion()
function getLibVersion($key='')
{
return $this->version_lib;
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -567,9 +567,9 @@ class EcmDirectory // extends CommonObject
$this->cats[$obj->rowid]['fk_user_c'] = $obj->fk_user_c;
$this->cats[$obj->rowid]['login_c'] = $obj->login_c;
if ($obj->rowid_fille)
if (! empty($obj->rowid_fille))
{
if (is_array($this->cats[$obj->rowid]['id_children']))
if (isset($this->cats[$obj->rowid]['id_children']) && is_array($this->cats[$obj->rowid]['id_children']))
{
$newelempos=count($this->cats[$obj->rowid]['id_children']);
//print "this->cats[$i]['id_children'] est deja un tableau de $newelem elements<br>";

View File

@ -48,9 +48,9 @@ $result = restrictedArea($user, 'ecm','');
$user->getrights('ecm');
// Get parameters
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
$action = isset($_GET["action"])?$_GET["action"]:$_POST['action'];
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
$socid = GETPOST('socid','int');
$action = GETPOST('action','alpha');
$section=GETPOST('section');
if (! $section) $section=0;
$upload_dir = $conf->ecm->dir_output.'/'.$section;
@ -66,9 +66,9 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$ecmdir = new EcmDirectory($db);
if (! empty($_REQUEST["section"]))
if (! empty($section))
{
$result=$ecmdir->fetch($_REQUEST["section"]);
$result=$ecmdir->fetch($section);
if (! $result > 0)
{
dol_print_error($db,$ecmdir->error);
@ -123,10 +123,8 @@ print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("Search"));
//print "<br>\n";
print $langs->trans("FeatureNotYetAvailable").'.<br><br>';
if ($mesg) { print $mesg."<br>"; }
// Tool bar
$head = ecm_prepare_head_fm($fac);
$head = ecm_prepare_head_fm($ecmdir);
//dol_fiche_head($head, 'search_form', '', 1);
@ -210,7 +208,6 @@ print '</table>';
print '<br>';
// End of page
$db->close();
llxFooter();
$db->close();
?>

View File

@ -96,7 +96,7 @@ class Import
require_once $file;
$module = new $classname($this->db);
if (is_array($module->import_code))
if (isset($module->import_code) && is_array($module->import_code))
{
foreach($module->import_code as $r => $value)
{
@ -138,7 +138,7 @@ class Import
// Array of tables to import (key=alias, value=tablename)
$this->array_import_tables[$i]=$module->import_tables_array[$r];
// Array of tables creator field to import (key=alias, value=creator field)
$this->array_import_tables_creator[$i]=$module->import_tables_creator_array[$r];
$this->array_import_tables_creator[$i]=(isset($module->import_tables_creator_array[$r])?$module->import_tables_creator_array[$r]:'');
// Array of fields to import (key=field, value=label)
$this->array_import_fields[$i]=$module->import_fields_array[$r];
// Array of hidden fields to import (key=field, value=label)
@ -150,7 +150,7 @@ class Import
// Tableau des alias a exporter (cle=champ, valeur=exemple)
$this->array_import_examplevalues[$i]=$module->import_examplevalues_array[$r];
// Tableau des regles de conversion d'une valeur depuis une autre source (cle=champ, valeur=tableau des regles)
$this->array_import_convertvalue[$i]=$module->import_convertvalue_array[$r];
$this->array_import_convertvalue[$i]=(isset($module->import_convertvalue_array[$r])?$module->import_convertvalue_array[$r]:'');
// Module
$this->array_import_module[$i]=$module;

View File

@ -35,8 +35,8 @@ $langs->load("exports");
$langs->load("errors");
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'import',$origin_id,'');
if (! empty($user->societe_id)) $socid=$user->societe_id;
$result=restrictedArea($user, 'import');
$entitytoicon=array(
'invoice'=>'bill','invoice_line'=>'bill',
@ -68,7 +68,8 @@ $entitytolang=array( // Translation code
$datatoimport = GETPOST('datatoimport');
$format = GETPOST('format');
$filetoimport = GETPOST('filetoimport');
$action = GETPOST('action');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$step = (GETPOST('step') ? GETPOST('step') : 1);
$import_name = GETPOST('import_name');
$hexa = GETPOST('hexa');
@ -92,7 +93,7 @@ foreach($fieldsarray as $elem)
{
$tabelem=explode('=',$elem,2);
$key=$tabelem[0];
$val=$tabelem[1];
$val=(isset($tabelem[1])?$tabelem[1]:'');
if ($key && $val)
{
$array_match_file_to_database[$key]=$val;
@ -192,7 +193,7 @@ if ($action == 'add_import_model')
if ($step == 3 && $datatoimport)
{
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
dol_mkdir($conf->import->dir_temp);
$nowyearmonth=dol_print_date(dol_now(),'%Y%m%d%H%M%S');
@ -451,6 +452,14 @@ if ($step == 3 && $datatoimport)
dol_fiche_head($head, 'step3', $langs->trans("NewImport"));
/*
* Confirm delete file
*/
if ($action == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
print '<table width="100%" class="border">';
@ -511,7 +520,7 @@ if ($step == 3 && $datatoimport)
print "</tr>\n";
// Search available imports
$filearray=dol_dir_list($conf->import->dir_temp,'files',0,'','','name',SORT_DESC);
$filearray=dol_dir_list($conf->import->dir_temp, 'files', 0, '', '', 'name', SORT_DESC);
if (count($filearray) > 0)
{
$dir=$conf->import->dir_temp;
@ -545,8 +554,7 @@ if ($step == 3 && $datatoimport)
// Affiche date fichier
print '<td align="right">'.dol_print_date(dol_filemtime($dir.'/'.$file),'dayhour').'</td>';
// Del button
print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&step=3'.$param.'&modulepart='.$modulepart.'&file='.urlencode($relativepath);
print '&urlsource='.urlencode($urlsource);
print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=delete&step=3'.$param.'&urlfile='.urlencode($relativepath);
print '">'.img_delete().'</a></td>';
// Action button
print '<td align="right">';

View File

@ -1000,7 +1000,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js"></script>'."\n";
}
// jQuery File Upload
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || defined('REQUIRE_JQUERY_FILEUPLOAD'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min.js"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n";

View File

@ -436,7 +436,7 @@ abstract class ActionsCardCommon
$res=dol_include_once($dirroot.$module.'.php');
if ($res) break;
}
$modCodeClient = new $module;
$modCodeClient = new $module($db);
$this->tpl['auto_customercode'] = $modCodeClient->code_auto;
// We verified if the tag prefix is used
if ($modCodeClient->code_auto) $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed();
@ -714,4 +714,4 @@ abstract class ActionsCardCommon
}
?>
?>

View File

@ -1013,7 +1013,7 @@ else
$res=dol_include_once($dirroot.$module.'.php');
if ($res) break;
}
$modCodeClient = new $module;
$modCodeClient = new $module($db);
// We verified if the tag prefix is used
if ($modCodeClient->code_auto)
{
@ -1031,7 +1031,7 @@ else
$res=dol_include_once($dirroot.$module.'.php');
if ($res) break;
}
$modCodeFournisseur = new $module;
$modCodeFournisseur = new $module($db);
// On verifie si la balise prefix est utilisee
if ($modCodeFournisseur->code_auto)
{