Fix several small bugs

This commit is contained in:
Dany De Bontridder 2016-05-05 12:13:48 +02:00
parent 2fcebf3d1f
commit fcc25550c2
5 changed files with 33 additions and 9 deletions

View file

@ -42,3 +42,11 @@ define ("dbname","");
// define ("SYSINFO_DISPLAY",true);
// For developpement
// define ("NOALYSS VERSION",9999);
// If you want to override the parameters you have to define OVERRIDE_PARAM
// and give your own parameters for max_execution_time and memory limit
// define ('OVERRIDE_PARAM',1);
// ini_set ('max_execution_time',240);
// ini_set ('memory_limit','256M');
//

View file

@ -62,12 +62,15 @@ if ( strpos($inc_path,";") != 0 ) {
$os=1; /* $os is 1 for unix */
}
set_include_path($new_path);
ini_set ('session.use_cookies',1);
ini_set ('session.use_only_cookies','on');
ini_set ('magic_quotes_gpc','off');
ini_set ('max_execution_time',240);
ini_set ('memory_limit','256M');
ini_set ('default_charset',"UTF-8");
ini_set ('session.use_cookies',1);
ini_set ('magic_quotes_gpc','off');
ini_set ('session.use_only_cookies','on');
if ( ! defined('OVERRIDE_PARAM')) {
ini_set ('max_execution_time',240);
ini_set ('memory_limit','256M');
}
@ini_set ('session.use_trans_sid','on');
@session_start();

View file

@ -47,7 +47,7 @@ class Database
function __construct($p_database_id=0, $p_type='dos')
{
if (IsNumber($p_database_id)==false||strlen($p_database_id)>5)
if (IsNumber($p_database_id)==false||strlen($p_database_id)>10)
die("-->Dossier invalide [$p_database_id]");
$noalyss_user=(defined("noalyss_user"))?noalyss_user:phpcompta_user;
$password=(defined("noalyss_password"))?noalyss_password:phpcompta_password;

View file

@ -25,6 +25,7 @@
* @author dany
*/
require_once NOALYSS_INCLUDE.'/lib/class_filetosend.php';
require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
class Sendmail
{
@ -158,7 +159,7 @@ class Sendmail
// Increment email amount
$repo =new Database();
$date=date('Ymd');
$dossier=Dossier::id();
$dossier=HtmlInput::default_value_request("gDossier", -1);
$this->increment_mail($repo,$dossier,$date);
}
/**
@ -228,6 +229,7 @@ class Sendmail
*/
function increment_mail(Database $p_repo,$p_dossier,$p_date)
{
if ( $p_dossier == -1) return ;
$email_sent = $this->get_email_sent($p_repo,$p_dossier,$p_date);
if ( $email_sent == 0 ){
$p_repo->exec_sql("insert into public.dossier_sent_email(de_sent_email,dos_id,de_date) values($1,$2,$3)",

View file

@ -198,6 +198,10 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
print ("\r\n");
print ( '// define ("NOALYSS_TEMPLATE","");');
print ("\r\n");
print ( '// define ("NOALYSS_INCLUDE","");');
print ("\r\n");
print ( '// define ("NOALYSS_TEMPLATE","");');
print ("\r\n");
print ( "// Fix an issue with PDF when exporting receipt in PDF in ANCGL"."\r\n");
print ( '// define ("FIX_BROKEN_PDF","NO");');
print ("\r\n");
@ -205,7 +209,7 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
print ("// With the unoconv tool");
print ( "//define ('OFFICE','HOME=/tmp unoconv ');");
print ("\r\n");
printf("//define ('GENERATE_PDF','YES');");
print ("//define ('GENERATE_PDF','YES');");
print ("\r\n");
print ( "// Uncomment if you don't want "."\r\n");
print ( "// to be informed when a new release is "."\r\n");
@ -216,10 +220,17 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
print ( '// define ("SYSINFO_DISPLAY",true);'."\r\n");
print ( '// For developpement'."\r\n");
print ( '// define ("NOALYSS VERSION",9999);'."\r\n");
print (' // If you want to override the parameters you have to define OVERRIDE_PARAM'."\r\n");
print ('// and give your own parameters for max_execution_time and memory_limit'."\r\n");
print ("// define ('OVERRIDE_PARAM',1);\r\n");
print ("// ini_set ('max_execution_time',240);\r\n");
print ("// ini_set ('memory_limit','256M');\r\n");
//
}
/*!\brief create the config file
*/
function config_file_create($p_array,$p_os=1)
function config_file_create($p_array,$from_setup,$p_os=1)
{
extract ($p_array);
$hFile= fopen(NOALYSS_INCLUDE.'/config.inc.php','w');