diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 42a219cd3ff..3bccc54204f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1155,7 +1155,7 @@ class CMailFile $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Transfer-Encoding: base64".$this->eol; - $out.= "Content-Description: File Attachment".$this->eol; + $out.= "Content-Description: ".$filename_list[$i].$this->eol; $out.= $this->eol; $out.= $encoded; $out.= $this->eol; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 84c25573e85..612a76e2877 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6004,9 +6004,9 @@ abstract class CommonObject } else { $value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object. } + //var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value); break; } - //var_dump($value); if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { @@ -6041,12 +6041,12 @@ abstract class CommonObject // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('date','datetime'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('price','double'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix,'int',3)):$this->array_options['options_'.$key]; + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)):$this->array_options['options_'.$key]; } $labeltoshow = $langs->trans($label); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c5f87777d6d..153efd5b8c9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1846,13 +1846,14 @@ class ExtraFields } else if (in_array($key_type,array('price','double'))) { - $value_arr=GETPOST("options_".$key); + $value_arr=GETPOST("options_".$key, 'alpha'); $value_key=price2num($value_arr); } else { $value_key=GETPOST("options_".$key); } + $object->array_options["options_".$key]=$value_key; } diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index f3e41d8d212..417f175422f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1410,7 +1410,7 @@ class SMTPs $content = 'Content-Type: ' . $_msgData['mimeType'] . '; charset="' . $this->getCharSet() . '"' . "\r\n" . 'Content-Transfer-Encoding: ' . $this->getTransEncodeType() . "\r\n" . 'Content-Disposition: inline' . "\r\n" - . 'Content-Description: message' . "\r\n"; + . 'Content-Description: Message' . "\r\n"; if ( $this->getMD5flag() ) $content .= 'Content-MD5: ' . $_msgData['md5'] . "\r\n"; @@ -1459,7 +1459,7 @@ class SMTPs . 'Content-Disposition: attachment; filename="' . $_data['fileName'] . '"' . "\r\n" . 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['fileName'] . '"' . "\r\n" . 'Content-Transfer-Encoding: base64' . "\r\n" - . 'Content-Description: File Attachment' . "\r\n"; + . 'Content-Description: ' . $_data['fileName'] ."\r\n"; if ( $this->getMD5flag() ) $content .= 'Content-MD5: ' . $_data['md5'] . "\r\n"; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 4d3461db873..70506ec202f 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -710,6 +710,10 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f -- VMYSQL4.1 ALTER TABLE llx_product_association ADD COLUMN rowid integer AUTO_INCREMENT PRIMARY KEY; - +-- drop very old table (bad name) DROP TABLE llx_c_accountancy_category; + +UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders'); +UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort'); + diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index e03195ed473..954469df861 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -40,6 +40,7 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer; ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer; ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFAULT 'page'; +-- drop very old table (bad name) DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index b1cf4d9773b..4135d547be3 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -274,12 +274,11 @@ elseif ($action == 'updateoptions') $conf->global->PROJECT_USE_SEARCH_TO_SELECT = $companysearch; } } -} -else if ($action == "linkOtherCompany") -{ - $projectToSelect = GETPOST('projectToSelect'); - - dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + if (GETPOST('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) + { + $projectToSelect = GETPOST('projectToSelect','alpha'); + dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + } } diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index d9d6b5f9b56..43ff66dc656 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -82,6 +82,13 @@ if (empty($conf->cron->enabled)) exit(-1); } +// Check module cron is activated +if (empty($conf->cron->enabled)) +{ + print "Error: module Scheduled jobs (cron) not activated\n"; + exit(-1); +} + // Check security key if ($key != $conf->global->CRON_KEY) {