Fix: mass convert line delimiters
This commit is contained in:
parent
5270ec06cb
commit
ee1cf819f7
@ -152,7 +152,7 @@ print '</td></tr>';
|
||||
print '</table></form>';
|
||||
|
||||
print '<br>';
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -35,8 +35,8 @@ $error=0; $mesg='';
|
||||
$action = GETPOST("action");
|
||||
$syslog_file_on=(defined('SYSLOG_FILE_ON') && constant('SYSLOG_FILE_ON'))?1:0;
|
||||
$syslog_syslog_on=(defined('SYSLOG_SYSLOG_ON') && constant('SYSLOG_SYSLOG_ON'))?1:0;
|
||||
$syslog_firephp_on=(defined('SYSLOG_FIREPHP_ON') && constant('SYSLOG_FIREPHP_ON'))?1:0;
|
||||
$syslog_chromephp_on=(defined('SYSLOG_CHROMEPHP_ON') && constant('SYSLOG_CHROMEPHP_ON'))?1:0;
|
||||
$syslog_firephp_on=(defined('SYSLOG_FIREPHP_ON') && constant('SYSLOG_FIREPHP_ON'))?1:0;
|
||||
$syslog_chromephp_on=(defined('SYSLOG_CHROMEPHP_ON') && constant('SYSLOG_CHROMEPHP_ON'))?1:0;
|
||||
|
||||
|
||||
/*
|
||||
@ -55,7 +55,7 @@ if ($action == 'set')
|
||||
$syslog_file_on=0;
|
||||
$syslog_syslog_on=0;
|
||||
$syslog_firephp_on=0;
|
||||
$syslog_chromephp_on=0;
|
||||
$syslog_chromephp_on=0;
|
||||
|
||||
if (! $error && GETPOST("filename"))
|
||||
{
|
||||
@ -225,30 +225,30 @@ catch(Exception $e)
|
||||
print '<!-- FirePHP no available into PHP -->'."\n";
|
||||
}
|
||||
|
||||
// Output to Chrome
|
||||
try
|
||||
{
|
||||
set_include_path('/usr/share/php/');
|
||||
$res=@include_once 'ChromePhp.php';
|
||||
restore_include_path();
|
||||
if ($res)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_CHROMEPHP_ON" '.$option.' value="1" ';
|
||||
if (! class_exists('ChromePHP')) print ' disabled="disabled"';
|
||||
else print ($syslog_chromephp_on?' checked="checked"':"");
|
||||
print '> '.$langs->trans("ChromePHP").'</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '</td>';
|
||||
print "<td align=\"left\">".$form->textwithpicto('','ChromePHP must be installed onto PHP path and ChromePHP plugin for Chrome must also be installed');
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// Do nothing
|
||||
print '<!-- ChromePHP no available into PHP -->'."\n";
|
||||
}
|
||||
// Output to Chrome
|
||||
try
|
||||
{
|
||||
set_include_path('/usr/share/php/');
|
||||
$res=@include_once 'ChromePhp.php';
|
||||
restore_include_path();
|
||||
if ($res)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_CHROMEPHP_ON" '.$option.' value="1" ';
|
||||
if (! class_exists('ChromePHP')) print ' disabled="disabled"';
|
||||
else print ($syslog_chromephp_on?' checked="checked"':"");
|
||||
print '> '.$langs->trans("ChromePHP").'</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '</td>';
|
||||
print "<td align=\"left\">".$form->textwithpicto('','ChromePHP must be installed onto PHP path and ChromePHP plugin for Chrome must also be installed');
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// Do nothing
|
||||
print '<!-- ChromePHP no available into PHP -->'."\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action == 'add_action')
|
||||
}
|
||||
|
||||
$fulldayevent=GETPOST('fullday');
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
$datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
|
||||
@ -455,9 +455,9 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Instant message and no email
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
||||
@ -643,7 +643,7 @@ else
|
||||
{
|
||||
print '<td colspan="2"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
||||
@ -843,7 +843,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -120,18 +120,18 @@ if (file_exists($fullpathselecteddir))
|
||||
if ($tmpval['fullrelativename'] == (($selecteddir != '/'?$selecteddir.'/':'').$file)) // We found equivalent record into database
|
||||
{
|
||||
$val=$tmpval;
|
||||
$resarray=tree_showpad($sqltree,$key,1);
|
||||
$resarray=tree_showpad($sqltree,$key,1);
|
||||
|
||||
// Refresh cache for this subdir
|
||||
if (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] < 0) // Cache is not up to date, so we update it for this directory t
|
||||
{
|
||||
$result=$ecmdirstatic->fetch($val['id']);
|
||||
$ecmdirstatic->ref=$ecmdirstatic->label;
|
||||
|
||||
$result=$ecmdirstatic->refreshcachenboffile(0);
|
||||
$val['cachenbofdoc']=$result;
|
||||
}
|
||||
|
||||
// Refresh cache for this subdir
|
||||
if (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] < 0) // Cache is not up to date, so we update it for this directory t
|
||||
{
|
||||
$result=$ecmdirstatic->fetch($val['id']);
|
||||
$ecmdirstatic->ref=$ecmdirstatic->label;
|
||||
|
||||
$result=$ecmdirstatic->refreshcachenboffile(0);
|
||||
$val['cachenbofdoc']=$result;
|
||||
}
|
||||
|
||||
$a=$resarray[0];
|
||||
$nbofsubdir=$resarray[1];
|
||||
$nboffilesinsubdir=$resarray[2];
|
||||
|
||||
@ -269,7 +269,7 @@ class Conf
|
||||
// External modules storage
|
||||
if (! empty($this->modules_parts['dir']))
|
||||
{
|
||||
foreach($this->modules_parts['dir'] as $module => $dirs)
|
||||
foreach($this->modules_parts['dir'] as $module => $dirs)
|
||||
{
|
||||
foreach($dirs as $type => $name)
|
||||
{
|
||||
|
||||
@ -1001,7 +1001,7 @@ class Form
|
||||
{
|
||||
if (! empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity;
|
||||
}
|
||||
|
||||
@ -58,8 +58,8 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
if (! class_exists('HookManager')) {
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
'sortorder' => $sortorder,
|
||||
'loaddate' => $loaddate,
|
||||
'loadsize' => $loadsize
|
||||
);
|
||||
);
|
||||
$reshook=$hookmanager->executeHooks('getNodesList', $parameters);
|
||||
|
||||
// $reshook may contain returns stacked by other modules
|
||||
@ -94,103 +94,103 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! is_dir($newpath)) return array();
|
||||
|
||||
if ($dir = opendir($newpath))
|
||||
{
|
||||
$filedate='';
|
||||
$filesize='';
|
||||
$file_list = array();
|
||||
|
||||
while (false !== ($file = readdir($dir)))
|
||||
{
|
||||
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory
|
||||
|
||||
$qualified=1;
|
||||
|
||||
// Define excludefilterarray
|
||||
$excludefilterarray=array('^\.');
|
||||
if (is_array($excludefilter))
|
||||
{
|
||||
$excludefilterarray=array_merge($excludefilterarray,$excludefilter);
|
||||
}
|
||||
else if ($excludefilter) $excludefilterarray[]=$excludefilter;
|
||||
// Check if file is qualified
|
||||
foreach($excludefilterarray as $filt)
|
||||
{
|
||||
if (preg_match('/'.$filt.'/i',$file)) {
|
||||
$qualified=0; break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
$isdir=is_dir(dol_osencode($path."/".$file));
|
||||
// Check whether this is a file or directory and whether we're interested in that type
|
||||
if ($isdir && (($types=="directories") || ($types=="all") || $recursive))
|
||||
{
|
||||
// Add entry into file_list array
|
||||
if (($types=="directories") || ($types=="all"))
|
||||
{
|
||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||
|
||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize,
|
||||
"type" => 'dir'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// if we're in a directory and we want recursive behavior, call this function again
|
||||
if ($recursive)
|
||||
{
|
||||
$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode));
|
||||
}
|
||||
}
|
||||
else if (! $isdir && (($types == "files") || ($types == "all")))
|
||||
{
|
||||
// Add file into file_list array
|
||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||
|
||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize,
|
||||
"type" => 'file'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
// Obtain a list of columns
|
||||
if (! empty($sortcriteria))
|
||||
{
|
||||
$myarray=array();
|
||||
foreach ($file_list as $key => $row)
|
||||
{
|
||||
$myarray[$key] = (isset($row[$sortcriteria])?$row[$sortcriteria]:'');
|
||||
}
|
||||
// Sort the data
|
||||
if ($sortorder) array_multisort($myarray, $sortorder, $file_list);
|
||||
}
|
||||
|
||||
return $file_list;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
if (! is_dir($newpath)) return array();
|
||||
|
||||
if ($dir = opendir($newpath))
|
||||
{
|
||||
$filedate='';
|
||||
$filesize='';
|
||||
$file_list = array();
|
||||
|
||||
while (false !== ($file = readdir($dir)))
|
||||
{
|
||||
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory
|
||||
|
||||
$qualified=1;
|
||||
|
||||
// Define excludefilterarray
|
||||
$excludefilterarray=array('^\.');
|
||||
if (is_array($excludefilter))
|
||||
{
|
||||
$excludefilterarray=array_merge($excludefilterarray,$excludefilter);
|
||||
}
|
||||
else if ($excludefilter) $excludefilterarray[]=$excludefilter;
|
||||
// Check if file is qualified
|
||||
foreach($excludefilterarray as $filt)
|
||||
{
|
||||
if (preg_match('/'.$filt.'/i',$file)) {
|
||||
$qualified=0; break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
$isdir=is_dir(dol_osencode($path."/".$file));
|
||||
// Check whether this is a file or directory and whether we're interested in that type
|
||||
if ($isdir && (($types=="directories") || ($types=="all") || $recursive))
|
||||
{
|
||||
// Add entry into file_list array
|
||||
if (($types=="directories") || ($types=="all"))
|
||||
{
|
||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||
|
||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize,
|
||||
"type" => 'dir'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// if we're in a directory and we want recursive behavior, call this function again
|
||||
if ($recursive)
|
||||
{
|
||||
$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode));
|
||||
}
|
||||
}
|
||||
else if (! $isdir && (($types == "files") || ($types == "all")))
|
||||
{
|
||||
// Add file into file_list array
|
||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||
|
||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
||||
{
|
||||
$file_list[] = array(
|
||||
"name" => $file,
|
||||
"fullname" => $path.'/'.$file,
|
||||
"date" => $filedate,
|
||||
"size" => $filesize,
|
||||
"type" => 'file'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
// Obtain a list of columns
|
||||
if (! empty($sortcriteria))
|
||||
{
|
||||
$myarray=array();
|
||||
foreach ($file_list as $key => $row)
|
||||
{
|
||||
$myarray[$key] = (isset($row[$sortcriteria])?$row[$sortcriteria]:'');
|
||||
}
|
||||
// Sort the data
|
||||
if ($sortorder) array_multisort($myarray, $sortorder, $file_list);
|
||||
}
|
||||
|
||||
return $file_list;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -554,43 +554,43 @@ function dol_unescapefile($filename)
|
||||
return trim(basename($filename), ".\x00..\x20");
|
||||
}
|
||||
|
||||
/**
|
||||
* Make control on an uploaded file from an GUI page and move it to final destination.
|
||||
* If there is errors (virus found, antivir in error, bad filename), file is not moved.
|
||||
/**
|
||||
* Make control on an uploaded file from an GUI page and move it to final destination.
|
||||
* If there is errors (virus found, antivir in error, bad filename), file is not moved.
|
||||
* Note: This function can be used only into a HTML page context. Use dol_move if you are outside.
|
||||
*
|
||||
* @param string $src_file Source full path filename ($_FILES['field']['tmp_name'])
|
||||
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
|
||||
* @param int $allowoverwrite 1=Overwrite target file if it already exists
|
||||
* @param int $disablevirusscan 1=Disable virus scan
|
||||
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
||||
*
|
||||
* @param string $src_file Source full path filename ($_FILES['field']['tmp_name'])
|
||||
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
|
||||
* @param int $allowoverwrite 1=Overwrite target file if it already exists
|
||||
* @param int $disablevirusscan 1=Disable virus scan
|
||||
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @param string $varfiles _FILES var name
|
||||
* @param string $varfiles _FILES var name
|
||||
* @return int >0 if OK, <0 or string if KO
|
||||
* @see dolCheckUploadedFile, dol_move
|
||||
*/
|
||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0, $varfiles='addedfile')
|
||||
{
|
||||
* @see dolCheckUploadedFile, dol_move
|
||||
*/
|
||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0, $varfiles='addedfile')
|
||||
{
|
||||
global $db, $hookmanager;
|
||||
global $object;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Check uploaded file
|
||||
$dest_file=dolCheckUploadedFile($src_file, $dest_file, $disablevirusscan, $uploaderrorcode);
|
||||
global $object;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Check uploaded file
|
||||
$dest_file=dolCheckUploadedFile($src_file, $dest_file, $disablevirusscan, $uploaderrorcode);
|
||||
if (is_array($dest_file) && isset($dest_file['error'])) return $dest_file['error'];
|
||||
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
if (! class_exists('HookManager')) {
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
}
|
||||
$hookmanager->initHooks(array('fileslib'));
|
||||
|
||||
$parameters=array('dest_file' => $dest_file, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite, 'notrigger' => $notrigger);
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
if (! class_exists('HookManager')) {
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
}
|
||||
$hookmanager->initHooks(array('fileslib'));
|
||||
|
||||
$parameters=array('dest_file' => $dest_file, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite, 'notrigger' => $notrigger);
|
||||
$reshook=$hookmanager->executeHooks('dolMoveUploadedFile', $parameters, $object);
|
||||
|
||||
if (empty($reshook)) {
|
||||
@ -598,92 +598,92 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check an uploaded file.
|
||||
* If there is errors (virus found, antivir in error, bad filename), file is not moved.
|
||||
*
|
||||
* @param string $src_file Source full path filename ($_FILES['field']['tmp_name'])
|
||||
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
|
||||
* @param int $disablevirusscan 1=Disable virus scan
|
||||
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
||||
/**
|
||||
* Check an uploaded file.
|
||||
* If there is errors (virus found, antivir in error, bad filename), file is not moved.
|
||||
*
|
||||
* @param string $src_file Source full path filename ($_FILES['field']['tmp_name'])
|
||||
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
|
||||
* @param int $disablevirusscan 1=Disable virus scan
|
||||
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
||||
* @return int >0 if OK, <0 or string if KO
|
||||
* @see dol_move_uploaded_file
|
||||
*/
|
||||
function dolCheckUploadedFile($src_file, $dest_file, $disablevirusscan=0, $uploaderrorcode=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$file_name = $dest_file;
|
||||
// If an upload error has been reported
|
||||
if ($uploaderrorcode)
|
||||
{
|
||||
switch($uploaderrorcode)
|
||||
{
|
||||
case UPLOAD_ERR_INI_SIZE: // 1
|
||||
return array('error' => 'ErrorFileSizeTooLarge');
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE: // 2
|
||||
return array('error' => 'ErrorFileSizeTooLarge');
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL: // 3
|
||||
return array('error' => 'ErrorPartialFile');
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR: //
|
||||
return array('error' => 'ErrorNoTmpDir');
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
return array('error' => 'ErrorFailedToWriteInDir');
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
return array('error' => 'ErrorUploadBlockedByAddon');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we need to make a virus scan
|
||||
if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
|
||||
{
|
||||
if (! class_exists('AntiVir')) {
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php';
|
||||
}
|
||||
$antivir=new AntiVir($db);
|
||||
$result = $antivir->dol_avscan_file($src_file);
|
||||
if ($result < 0) // If virus or error, we stop here
|
||||
{
|
||||
$reterrors=$antivir->errors;
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$file_name.'") KO with antivirus: result='.$result.' errors='.join(',',$antivir->errors), LOG_WARNING);
|
||||
return array('error' => 'ErrorFileIsInfectedWithAVirus: '.join(',',$reterrors));
|
||||
}
|
||||
}
|
||||
|
||||
// Security:
|
||||
// Disallow file with some extensions. We renamed them.
|
||||
// Car si on a mis le rep documents dans un rep de la racine web (pas bien), cela permet d'executer du code a la demande.
|
||||
if (preg_match('/\.htm|\.html|\.php|\.pl|\.cgi$/i',$file_name))
|
||||
{
|
||||
$file_name.= '.noexe';
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit fichiers caches, remontees de repertoire ainsi que les pipes dans les noms de fichiers.
|
||||
if (preg_match('/^\./',$src_file) || preg_match('/\.\./',$src_file) || preg_match('/[<>|]/',$src_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING);
|
||||
return array('error' => -1);
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit fichiers caches, remontees de repertoire ainsi que les pipe dans
|
||||
// les noms de fichiers.
|
||||
if (preg_match('/^\./',$dest_file) || preg_match('/\.\./',$dest_file) || preg_match('/[<>|]/',$dest_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$dest_file, LOG_WARNING);
|
||||
return array('error' => -2);
|
||||
}
|
||||
|
||||
return $file_name;
|
||||
* @see dol_move_uploaded_file
|
||||
*/
|
||||
function dolCheckUploadedFile($src_file, $dest_file, $disablevirusscan=0, $uploaderrorcode=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$file_name = $dest_file;
|
||||
// If an upload error has been reported
|
||||
if ($uploaderrorcode)
|
||||
{
|
||||
switch($uploaderrorcode)
|
||||
{
|
||||
case UPLOAD_ERR_INI_SIZE: // 1
|
||||
return array('error' => 'ErrorFileSizeTooLarge');
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE: // 2
|
||||
return array('error' => 'ErrorFileSizeTooLarge');
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL: // 3
|
||||
return array('error' => 'ErrorPartialFile');
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR: //
|
||||
return array('error' => 'ErrorNoTmpDir');
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
return array('error' => 'ErrorFailedToWriteInDir');
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
return array('error' => 'ErrorUploadBlockedByAddon');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we need to make a virus scan
|
||||
if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
|
||||
{
|
||||
if (! class_exists('AntiVir')) {
|
||||
require DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php';
|
||||
}
|
||||
$antivir=new AntiVir($db);
|
||||
$result = $antivir->dol_avscan_file($src_file);
|
||||
if ($result < 0) // If virus or error, we stop here
|
||||
{
|
||||
$reterrors=$antivir->errors;
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$file_name.'") KO with antivirus: result='.$result.' errors='.join(',',$antivir->errors), LOG_WARNING);
|
||||
return array('error' => 'ErrorFileIsInfectedWithAVirus: '.join(',',$reterrors));
|
||||
}
|
||||
}
|
||||
|
||||
// Security:
|
||||
// Disallow file with some extensions. We renamed them.
|
||||
// Car si on a mis le rep documents dans un rep de la racine web (pas bien), cela permet d'executer du code a la demande.
|
||||
if (preg_match('/\.htm|\.html|\.php|\.pl|\.cgi$/i',$file_name))
|
||||
{
|
||||
$file_name.= '.noexe';
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit fichiers caches, remontees de repertoire ainsi que les pipes dans les noms de fichiers.
|
||||
if (preg_match('/^\./',$src_file) || preg_match('/\.\./',$src_file) || preg_match('/[<>|]/',$src_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING);
|
||||
return array('error' => -1);
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit fichiers caches, remontees de repertoire ainsi que les pipe dans
|
||||
// les noms de fichiers.
|
||||
if (preg_match('/^\./',$dest_file) || preg_match('/\.\./',$dest_file) || preg_match('/[<>|]/',$dest_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$dest_file, LOG_WARNING);
|
||||
return array('error' => -2);
|
||||
}
|
||||
|
||||
return $file_name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -2728,7 +2728,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
// Some test to guess with no need to make database access
|
||||
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
|
||||
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
|
||||
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
|
||||
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
|
||||
|
||||
$code_country=$thirdparty_seller->country_code;
|
||||
|
||||
|
||||
@ -808,7 +808,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -250,52 +250,52 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
@ -343,7 +343,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -145,9 +145,9 @@ class mailing_xinputuser extends MailingTargets
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorBadEMail",$email);
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -222,45 +222,45 @@ class modHoliday extends DolibarrModules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuConfCP',
|
||||
'mainmenu'=>'holiday',
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuConfCP',
|
||||
'mainmenu'=>'holiday',
|
||||
'leftmenu'=>'holiday_conf',
|
||||
'url'=>'/holiday/define_holiday.php?mainmenu=holiday&action=request',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>102,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->define_holiday', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuLogCP',
|
||||
'mainmenu'=>'holiday_def',
|
||||
'url'=>'/holiday/view_log.php?mainmenu=holiday&action=request',
|
||||
'url'=>'/holiday/define_holiday.php?mainmenu=holiday&action=request',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>102,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->define_holiday', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuLogCP',
|
||||
'mainmenu'=>'holiday_def',
|
||||
'url'=>'/holiday/view_log.php?mainmenu=holiday&action=request',
|
||||
'leftmenu'=>'holiday',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>103,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->view_log', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuReportMonth',
|
||||
'mainmenu'=>'holiday',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>103,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->view_log', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=holiday,fk_leftmenu=holiday', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MenuReportMonth',
|
||||
'mainmenu'=>'holiday',
|
||||
'leftmenu'=>'holiday_report',
|
||||
'url'=>'/holiday/month_report.php?mainmenu=holiday&action=request',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>104,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->view_log', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
'url'=>'/holiday/month_report.php?mainmenu=holiday&action=request',
|
||||
'langs'=>'holiday', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>104,
|
||||
'enabled'=>'$conf->holiday->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->holiday->view_log', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
// Exports
|
||||
$r=1;
|
||||
|
||||
@ -251,7 +251,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description of product line
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||
|
||||
@ -842,7 +842,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -635,7 +635,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -817,7 +817,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
@ -118,7 +118,7 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,25 +34,25 @@ print '<head>
|
||||
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
if (isset($conf->modules_parts['css']))
|
||||
{
|
||||
$arraycss=(array) $conf->modules_parts['css'];
|
||||
foreach($arraycss as $modcss => $filescss)
|
||||
{
|
||||
$filescss=(array) $filescss; // To be sure filecss is an array
|
||||
foreach($filescss as $cssfile)
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$modcss. '-->'."\n";
|
||||
}
|
||||
}
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
if (isset($conf->modules_parts['css']))
|
||||
{
|
||||
$arraycss=(array) $conf->modules_parts['css'];
|
||||
foreach($arraycss as $modcss => $filescss)
|
||||
{
|
||||
$filescss=(array) $filescss; // To be sure filecss is an array
|
||||
foreach($filescss as $cssfile)
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$modcss. '-->'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
@ -91,9 +91,9 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,16 +76,16 @@ $type = 'application/octet-stream';
|
||||
if (GETPOST('type','alpha')) $type=GETPOST('type','alpha');
|
||||
else $type=dol_mimetype($original_file);
|
||||
|
||||
// Define attachment (attachment=true to force choice popup 'open'/'save as')
|
||||
$attachment = true;
|
||||
// Define attachment (attachment=true to force choice popup 'open'/'save as')
|
||||
$attachment = true;
|
||||
if (preg_match('/\.(html|htm)$/i',$original_file)) $attachment = false;
|
||||
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment")?true:false;
|
||||
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
|
||||
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment")?true:false;
|
||||
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
|
||||
|
||||
// Suppression de la chaine de caractere ../ dans $original_file
|
||||
$original_file = str_replace("../","/", $original_file);
|
||||
|
||||
// Find the subdirectory name as the reference
|
||||
// Suppression de la chaine de caractere ../ dans $original_file
|
||||
$original_file = str_replace("../","/", $original_file);
|
||||
|
||||
// Find the subdirectory name as the reference
|
||||
$refname=basename(dirname($original_file)."/");
|
||||
|
||||
// Security check
|
||||
@ -343,12 +343,12 @@ if ($modulepart)
|
||||
$original_file=$conf->admin->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for upload file test
|
||||
else if ($modulepart == 'admin_temp')
|
||||
{
|
||||
if ($user->admin)
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->admin->dir_temp.'/'.$original_file;
|
||||
// Wrapping for upload file test
|
||||
else if ($modulepart == 'admin_temp')
|
||||
{
|
||||
if ($user->admin)
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->admin->dir_temp.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour BitTorrent
|
||||
|
||||
@ -52,118 +52,118 @@ if (isset($action) && ! empty($action))
|
||||
|
||||
$ecmdirstatic = new EcmDirectory($db);
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$diroutputslash=str_replace('\\', '/', $conf->$element->dir_output);
|
||||
$diroutputslash.='/';
|
||||
|
||||
// Scan directory tree on disk
|
||||
$disktree=dol_dir_list($conf->$element->dir_output,'directories',1,'',array('^temp$'),'','',0);
|
||||
|
||||
// Scan directory tree in database
|
||||
$sqltree=$ecmdirstatic->get_full_arbo(0);
|
||||
|
||||
$adirwascreated=0;
|
||||
|
||||
// Now we compare both trees to complete missing trees into database
|
||||
//var_dump($disktree);
|
||||
//var_dump($sqltree);
|
||||
foreach($disktree as $dirdesc) // Loop on tree onto disk
|
||||
clearstatcache();
|
||||
|
||||
$diroutputslash=str_replace('\\', '/', $conf->$element->dir_output);
|
||||
$diroutputslash.='/';
|
||||
|
||||
// Scan directory tree on disk
|
||||
$disktree=dol_dir_list($conf->$element->dir_output,'directories',1,'',array('^temp$'),'','',0);
|
||||
|
||||
// Scan directory tree in database
|
||||
$sqltree=$ecmdirstatic->get_full_arbo(0);
|
||||
|
||||
$adirwascreated=0;
|
||||
|
||||
// Now we compare both trees to complete missing trees into database
|
||||
//var_dump($disktree);
|
||||
//var_dump($sqltree);
|
||||
foreach($disktree as $dirdesc) // Loop on tree onto disk
|
||||
{
|
||||
set_time_limit(0); // To force restarts the timeout counter from zero
|
||||
|
||||
$dirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($conf->$element->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname'])
|
||||
{
|
||||
$dirisindatabase=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $dirisindatabase)
|
||||
{
|
||||
$txt="Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
|
||||
dol_syslog($txt);
|
||||
|
||||
// We must first find the fk_parent of directory to create $dirdesc['fullname']
|
||||
$fk_parent=-1;
|
||||
$relativepathmissing=str_replace($diroutputslash,'',$dirdesc['fullname']);
|
||||
$relativepathtosearchparent=$relativepathmissing;
|
||||
//dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
|
||||
if (preg_match('/\//',$relativepathtosearchparent))
|
||||
//while (preg_match('/\//',$relativepathtosearchparent))
|
||||
{
|
||||
$relativepathtosearchparent=preg_replace('/\/[^\/]*$/','',$relativepathtosearchparent);
|
||||
$txt="Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
|
||||
dol_syslog($txt);
|
||||
//print $txt." -> ";
|
||||
$parentdirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent)
|
||||
{
|
||||
$parentdirisindatabase=$dirsqldesc['id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($parentdirisindatabase > 0)
|
||||
{
|
||||
dol_syslog("Yes with id ".$parentdirisindatabase);
|
||||
//print "Yes with id ".$parentdirisindatabase."<br>\n";
|
||||
$fk_parent=$parentdirisindatabase;
|
||||
//break; // We found parent, we can stop the while loop
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("No");
|
||||
//print "No<br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Parent is root");
|
||||
$fk_parent=0; // Parent is root
|
||||
}
|
||||
|
||||
if ($fk_parent >= 0)
|
||||
{
|
||||
$ecmdirtmp=new EcmDirectory($db);
|
||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
|
||||
$ecmdirtmp->description = '';
|
||||
$ecmdirtmp->fk_parent = $fk_parent;
|
||||
|
||||
$txt="We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
$id = $ecmdirtmp->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
$newdirsql=array('id'=>$id,
|
||||
'id_mere'=>$ecmdirtmp->fk_parent,
|
||||
'label'=>$ecmdirtmp->label,
|
||||
'description'=>$ecmdirtmp->description,
|
||||
'fullrelativename'=>$relativepathmissing);
|
||||
$sqltree[]=$newdirsql; // We complete fulltree for following loops
|
||||
//var_dump($sqltree);
|
||||
$adirwascreated=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$txt="Parent of ".$dirdesc['fullname']." not found";
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||
|
||||
$dirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($conf->$element->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname'])
|
||||
{
|
||||
$dirisindatabase=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $dirisindatabase)
|
||||
{
|
||||
$txt="Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
|
||||
dol_syslog($txt);
|
||||
|
||||
// We must first find the fk_parent of directory to create $dirdesc['fullname']
|
||||
$fk_parent=-1;
|
||||
$relativepathmissing=str_replace($diroutputslash,'',$dirdesc['fullname']);
|
||||
$relativepathtosearchparent=$relativepathmissing;
|
||||
//dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
|
||||
if (preg_match('/\//',$relativepathtosearchparent))
|
||||
//while (preg_match('/\//',$relativepathtosearchparent))
|
||||
{
|
||||
$relativepathtosearchparent=preg_replace('/\/[^\/]*$/','',$relativepathtosearchparent);
|
||||
$txt="Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
|
||||
dol_syslog($txt);
|
||||
//print $txt." -> ";
|
||||
$parentdirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent)
|
||||
{
|
||||
$parentdirisindatabase=$dirsqldesc['id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($parentdirisindatabase > 0)
|
||||
{
|
||||
dol_syslog("Yes with id ".$parentdirisindatabase);
|
||||
//print "Yes with id ".$parentdirisindatabase."<br>\n";
|
||||
$fk_parent=$parentdirisindatabase;
|
||||
//break; // We found parent, we can stop the while loop
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("No");
|
||||
//print "No<br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Parent is root");
|
||||
$fk_parent=0; // Parent is root
|
||||
}
|
||||
|
||||
if ($fk_parent >= 0)
|
||||
{
|
||||
$ecmdirtmp=new EcmDirectory($db);
|
||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
|
||||
$ecmdirtmp->description = '';
|
||||
$ecmdirtmp->fk_parent = $fk_parent;
|
||||
|
||||
$txt="We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
$id = $ecmdirtmp->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
$newdirsql=array('id'=>$id,
|
||||
'id_mere'=>$ecmdirtmp->fk_parent,
|
||||
'label'=>$ecmdirtmp->label,
|
||||
'description'=>$ecmdirtmp->description,
|
||||
'fullrelativename'=>$relativepathmissing);
|
||||
$sqltree[]=$newdirsql; // We complete fulltree for following loops
|
||||
//var_dump($sqltree);
|
||||
$adirwascreated=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$txt="Parent of ".$dirdesc['fullname']." not found";
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* \ingroup holiday
|
||||
* \brief Class file of the module paid holiday.
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -41,7 +41,7 @@ $action=GETPOST('action');
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu'));
|
||||
|
||||
@ -113,23 +113,23 @@ elseif($action == 'add_event')
|
||||
$var=true;
|
||||
$i = 0;
|
||||
|
||||
$cp_events = $holiday->fetchEventsCP();
|
||||
|
||||
$cp_events = $holiday->fetchEventsCP();
|
||||
|
||||
if($cp_events == 1)
|
||||
{
|
||||
print '<br><form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<input type="hidden" name="action" value="add_event" />';
|
||||
|
||||
{
|
||||
print '<br><form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<input type="hidden" name="action" value="add_event" />';
|
||||
|
||||
print_fiche_titre($langs->trans('DefineEventUserCP'),'','');
|
||||
|
||||
print $langs->trans('MotifCP').' : ';
|
||||
print $holiday->selectEventCP();
|
||||
print ' '.$langs->trans('UserCP').' : ';
|
||||
print $form->select_users('',"userCP",1,"",0,'');
|
||||
print ' <input type="submit" value="'.$langs->trans("addEventToUserCP").'" name="bouton" class="button"/>';
|
||||
|
||||
print '</form><br>';
|
||||
}
|
||||
|
||||
print $langs->trans('MotifCP').' : ';
|
||||
print $holiday->selectEventCP();
|
||||
print ' '.$langs->trans('UserCP').' : ';
|
||||
print $form->select_users('',"userCP",1,"",0,'');
|
||||
print ' <input type="submit" value="'.$langs->trans("addEventToUserCP").'" name="bouton" class="button"/>';
|
||||
|
||||
print '</form><br>';
|
||||
}
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
|
||||
// Get parameters
|
||||
$myparam = GETPOST("myparam");
|
||||
@ -891,16 +891,16 @@ elseif(isset($_GET['id']))
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('StatutCP').'</td>';
|
||||
print '<td><b>'.$cp->getStatutCP($cp->statut).'</b></td>';
|
||||
print '</tr>';
|
||||
if($cp->statut == 5) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DetailRefusCP').'</td>';
|
||||
print '<td>'.$cp->detail_refuse.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('StatutCP').'</td>';
|
||||
print '<td><b>'.$cp->getStatutCP($cp->statut).'</b></td>';
|
||||
print '</tr>';
|
||||
if($cp->statut == 5) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DetailRefusCP').'</td>';
|
||||
print '<td>'.$cp->detail_refuse.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Description
|
||||
if(!$edit) {
|
||||
|
||||
@ -27,34 +27,34 @@ require('../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$page = GETPOST("page");
|
||||
$page = is_numeric($page) ? $page : 0;
|
||||
$page = $page == -1 ? 0 : $page;
|
||||
|
||||
if (! $sortfield) $sortfield="cp.rowid";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$search_ref = GETPOST('search_ref');
|
||||
$month_create = GETPOST('month_create');
|
||||
$year_create = GETPOST('year_create');
|
||||
$month_start = GETPOST('month_start');
|
||||
$year_start = GETPOST('year_start');
|
||||
$month_end = GETPOST('month_end');
|
||||
$year_end = GETPOST('year_end');
|
||||
$search_employe = GETPOST('search_employe');
|
||||
$search_valideur = GETPOST('search_valideur');
|
||||
$search_statut = GETPOST('select_statut');
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$page = GETPOST("page");
|
||||
$page = is_numeric($page) ? $page : 0;
|
||||
$page = $page == -1 ? 0 : $page;
|
||||
|
||||
if (! $sortfield) $sortfield="cp.rowid";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$search_ref = GETPOST('search_ref');
|
||||
$month_create = GETPOST('month_create');
|
||||
$year_create = GETPOST('year_create');
|
||||
$month_start = GETPOST('month_start');
|
||||
$year_start = GETPOST('year_start');
|
||||
$month_end = GETPOST('month_end');
|
||||
$year_end = GETPOST('year_end');
|
||||
$search_employe = GETPOST('search_employe');
|
||||
$search_valideur = GETPOST('search_valideur');
|
||||
$search_statut = GETPOST('select_statut');
|
||||
|
||||
|
||||
/*
|
||||
@ -74,7 +74,7 @@ $min_year = 10;
|
||||
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu'));
|
||||
|
||||
$order = $db->order($sortfield,$sortorder).$db->plimit($conf->liste_limit + 1, $offset);
|
||||
$order = $db->order($sortfield,$sortorder).$db->plimit($conf->liste_limit + 1, $offset);
|
||||
|
||||
// WHERE
|
||||
if(!empty($search_ref)){
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
require('../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@ -33,7 +33,7 @@ require_once $dolibarr_main_document_root . '/core/lib/security.lib.php'; // for
|
||||
|
||||
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto';
|
||||
$langs->setDefaultLang($setuplang);
|
||||
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
|
||||
@ -48,8 +48,8 @@ $versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($arg
|
||||
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("install");
|
||||
$langs->load("errors");
|
||||
$langs->load("install");
|
||||
$langs->load("errors");
|
||||
|
||||
if ($dolibarr_main_db_type == "mysql") $choix=1;
|
||||
if ($dolibarr_main_db_type == "mysqli") $choix=1;
|
||||
@ -155,16 +155,16 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
||||
dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version");
|
||||
|
||||
// Test database version
|
||||
$versionmindb=getStaticMember(get_class($db),'versionmin');
|
||||
$versionmindb=getStaticMember(get_class($db),'versionmin');
|
||||
//print join('.',$versionarray).' - '.join('.',$versionmindb);
|
||||
if (count($versionmindb) && count($versionarray)
|
||||
if (count($versionmindb) && count($versionarray)
|
||||
&& versioncompare($versionarray,$versionmindb) < 0)
|
||||
{
|
||||
// Warning: database version too low.
|
||||
print "<tr><td>".$langs->trans("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb))."</td><td align=\"right\">".$langs->trans("Error")."</td></tr>\n";
|
||||
dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb)));
|
||||
$ok=0;
|
||||
}
|
||||
print "<tr><td>".$langs->trans("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb))."</td><td align=\"right\">".$langs->trans("Error")."</td></tr>\n";
|
||||
dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb)));
|
||||
$ok=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
||||
$dir = "mysql/migration/"; // We use mysql migration scripts whatever is database driver
|
||||
|
||||
// For minor version
|
||||
$newversionfrom=preg_replace('/(\.[0-9]+)$/i','.0',$versionfrom);
|
||||
$newversionfrom=preg_replace('/(\.[0-9]+)$/i','.0',$versionfrom);
|
||||
$newversionto=preg_replace('/(\.[0-9]+)$/i','.0',$versionto);
|
||||
|
||||
$filelist=array();
|
||||
|
||||
@ -963,11 +963,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/jnotify.js"></script>'."\n";
|
||||
}
|
||||
// jQuery blockUI
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI'))
|
||||
{
|
||||
// jQuery blockUI
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI'))
|
||||
{
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/blockUI/jquery.blockUI.js"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/blockUI.js"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/blockUI.js"></script>'."\n";
|
||||
}
|
||||
// Flot
|
||||
if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT))
|
||||
|
||||
@ -78,7 +78,7 @@ if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE'
|
||||
$conf->file->strict_mode = empty($dolibarr_strict_mode)?'':$dolibarr_strict_mode;
|
||||
// Force Multi-Company transverse mode
|
||||
$conf->multicompany->transverse_mode = empty($multicompany_transverse_mode)?'':$multicompany_transverse_mode;
|
||||
// Force entity in login page
|
||||
// Force entity in login page
|
||||
$conf->multicompany->force_entity = empty($multicompany_force_entity)?'':(int) $multicompany_force_entity;
|
||||
|
||||
// Chargement des includes principaux de librairies communes
|
||||
|
||||
@ -40,7 +40,7 @@ $oldvatrate=GETPOST('oldvatrate');
|
||||
$newvatrate=GETPOST('newvatrate');
|
||||
//$price_base_type=GETPOST('price_base_type');
|
||||
|
||||
$objectstatic = new Product($db);
|
||||
$objectstatic = new Product($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -96,7 +96,7 @@ if ($action == 'convert')
|
||||
if ($newminprice > $newprice) $newminprice=$newprice;
|
||||
$newvat=str_replace('*','',$newvatrate);
|
||||
$newnpr=$objectstatic->recuperableonly;
|
||||
$newlevel=0;
|
||||
$newlevel=0;
|
||||
|
||||
$ret=$objectstatic->updatePrice($objectstatic->id, $newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
|
||||
if ($ret < 0) $error++;
|
||||
@ -106,7 +106,7 @@ if ($action == 'convert')
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -1028,14 +1028,14 @@ class Product extends CommonObject
|
||||
|
||||
$this->_log_price($user,$level);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PRODUCT_PRICE_MODIFY',$this,$user,$langs,$conf);
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PRODUCT_PRICE_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
{
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
else
|
||||
|
||||
@ -262,31 +262,31 @@ if ($action == 'add')
|
||||
$result=$adh->send_an_email($conf->global->ADHERENT_AUTOREGISTER_MAIL,$conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT,array(),array(),array(),"","",0,-1);
|
||||
}
|
||||
|
||||
// Send email to the foundation to say a new member subscribed with autosubscribe form
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
|
||||
! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL) )
|
||||
// Send email to the foundation to say a new member subscribed with autosubscribe form
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
|
||||
! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL) )
|
||||
{
|
||||
$to=$adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||
$from=$conf->global->ADHERENT_MAIL_FROM;
|
||||
$mailfile = new CMailFile(
|
||||
$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
|
||||
$to,
|
||||
$from,
|
||||
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
|
||||
array(),
|
||||
array(),
|
||||
array(),
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
-1
|
||||
);
|
||||
|
||||
if (! $mailfile->sendfile())
|
||||
{
|
||||
dol_syslog($langs->trans("ErrorFailedToSendMail",$from,$to), LOG_ERR);
|
||||
}
|
||||
}
|
||||
$from=$conf->global->ADHERENT_MAIL_FROM;
|
||||
$mailfile = new CMailFile(
|
||||
$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
|
||||
$to,
|
||||
$from,
|
||||
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
|
||||
array(),
|
||||
array(),
|
||||
array(),
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
-1
|
||||
);
|
||||
|
||||
if (! $mailfile->sendfile())
|
||||
{
|
||||
dol_syslog($langs->trans("ErrorFailedToSendMail",$from,$to), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($backtopage)) $urlback=$backtopage;
|
||||
else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)
|
||||
|
||||
@ -56,7 +56,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
@ -34,25 +34,25 @@ print '<head>
|
||||
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
if (isset($conf->modules_parts['css']))
|
||||
{
|
||||
$arraycss=(array) $conf->modules_parts['css'];
|
||||
foreach($arraycss as $modcss => $filescss)
|
||||
{
|
||||
$filescss=(array) $filescss; // To be sure filecss is an array
|
||||
foreach($filescss as $cssfile)
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$modcss. '-->'."\n";
|
||||
}
|
||||
}
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
if (isset($conf->modules_parts['css']))
|
||||
{
|
||||
$arraycss=(array) $conf->modules_parts['css'];
|
||||
foreach($arraycss as $modcss => $filescss)
|
||||
{
|
||||
$filescss=(array) $filescss; // To be sure filecss is an array
|
||||
foreach($filescss as $cssfile)
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$modcss. '-->'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
@ -86,7 +86,7 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'div') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,12 +51,12 @@ $username = GETPOST('username');
|
||||
$passwordmd5 = GETPOST('passwordmd5');
|
||||
$conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
|
||||
|
||||
// Instantiate hooks of thirdparty module only if not already define
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
// Instantiate hooks of thirdparty module only if not already define
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
$hookmanager->initHooks(array('passwordforgottenpage'));
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ else
|
||||
$conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang;
|
||||
$conf_css = DOL_URL_ROOT.$conf->css;
|
||||
|
||||
$jquerytheme = 'smoothness';
|
||||
$jquerytheme = 'smoothness';
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
|
||||
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
|
||||
@ -225,9 +225,9 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
|
||||
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
||||
}
|
||||
|
||||
// Execute hook getPasswordForgottenPageOptions
|
||||
// Should be an array with differents options in $hookmanager->resArray
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
// Execute hook getPasswordForgottenPageOptions
|
||||
// Should be an array with differents options in $hookmanager->resArray
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
||||
|
||||
Loading…
Reference in New Issue
Block a user