From 398733ff9a336113da9ada8ff6276dccc6227e05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Aug 2017 23:44:16 +0200 Subject: [PATCH 1/4] Fix syntax error --- htdocs/compta/bank/bankentries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index d14bfe36afd..cec3d648450 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -433,7 +433,7 @@ if ($id > 0 || ! empty($ref)) if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { print ''.$langs->trans("Conciliate").''; } From 1101a1094f1ee8a38409a83f1a5fefc9506a279d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Aug 2017 16:07:38 +0200 Subject: [PATCH 2/4] Fix translation and migration --- htdocs/cron/admin/cron.php | 10 +++++----- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 17 +++++++++++------ htdocs/langs/en_US/admin.lang | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 62cca5a0f20..3efec52edfa 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -74,7 +74,7 @@ $head = cronadmin_prepare_head(); print '
'; print ''; -dol_fiche_head($head,'setup',$langs->trans("Module2300Name"),0,'cron'); +dol_fiche_head($head, 'setup', $langs->trans("Module2300Name"), -1, 'cron'); print "
\n"; @@ -91,16 +91,16 @@ print ''.$langs->trans("KeyForCronAccess").''; $disabled=''; if (! empty($conf->global->CRON_DISABLE_KEY_CHANGE)) $disabled=' disabled="disabled"'; print ''; -if (empty($conf->global->CRON_DISABLE_KEY_CHANGE)) +if (empty($conf->global->CRON_DISABLE_KEY_CHANGE)) { print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); } -else +else { - print (! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:''); - print ''; + print (! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:''); + print ''; } print ''; print ' '; diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 43f4162e9cb..e41e561da38 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -413,15 +413,19 @@ ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_s CREATE TABLE llx_inventory ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, +entity integer DEFAULT 0, +ref varchar(48), datec datetime DEFAULT NULL, tms timestamp, +fk_user_author integer, +fk_user_modif integer, +fk_user_valid integer, fk_warehouse integer DEFAULT 0, -entity integer DEFAULT 0, status integer DEFAULT 0, title varchar(255) NOT NULL, -date_inventory datetime DEFAULT NULL -) -ENGINE=InnoDB; +date_inventory datetime DEFAULT NULL, +import_key varchar(14) +)ENGINE=InnoDB; CREATE TABLE llx_inventorydet ( @@ -438,8 +442,9 @@ qty_regulated double DEFAULT NULL, pmp double DEFAULT 0, pa double DEFAULT 0, new_pmp double DEFAULT 0 -) -ENGINE=InnoDB; +)ENGINE=InnoDB; + +ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL; ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms); ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9d897396036..18be4cbd7c7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -544,8 +544,8 @@ Module2000Name=WYSIWYG editor Module2000Desc=Allow to edit some text area using an advanced editor (Based on CKEditor) Module2200Name=Dynamic Prices Module2200Desc=Enable the usage of math expressions for prices -Module2300Name=Cron -Module2300Desc=Scheduled job management +Module2300Name=Scheduled jobs +Module2300Desc=Scheduled jobs management (alias cron or chrono table) Module2400Name=Events/Agenda Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. Module2500Name=Electronic Content Management From aeba02fb2230df5a7750a1903bc1385c2ee43bd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Aug 2017 16:21:07 +0200 Subject: [PATCH 3/4] Fix bad table alignement --- htdocs/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index f76526d23ea..0f45cd1eb67 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -541,12 +541,11 @@ if ($showweather) $boxwork.=''; } -$boxwork.=''; - // Show dashboard $nbworkboardempty=0; if (! empty($valid_dashboardlines)) { + $boxwork.=''; foreach($valid_dashboardlines as $board) { if (empty($boad->nbtodo)) $nbworkboardempty++; @@ -581,11 +580,12 @@ if (! empty($valid_dashboardlines)) $boxwork .='
'; $boxwork .='
'; $boxwork .='
'; + $boxwork .=''; } else { $boxwork.=''; - $boxwork.=''; + $boxwork.=''; $boxwork.=$langs->trans("NoOpenedElementToProcess"); $boxwork.=''; $boxwork.=''; From ac3a270e170a8d3373a447b5e5e8bc0e080ce928 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Aug 2017 00:40:32 +0200 Subject: [PATCH 4/4] FIX Do not delete files into sym links Conflicts: htdocs/core/lib/files.lib.php --- htdocs/core/lib/files.lib.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 394b3e76778..c3d69c9e829 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -588,7 +588,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1) } /** - * Copy a dir to another dir. + * Copy a dir to another dir. This include recursive subdirectories. * * @param string $srcfile Source file (a directory) * @param string $destfile Destination file (a directory) @@ -632,7 +632,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep { if ($file!="." && $file!="..") { - if (is_dir($ossrcfile."/".$file)) + if (is_dir($ossrcfile."/".$file) && ! is_link($ossrcfile."/".$file)) { //var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists"); $tmpresult=dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement); @@ -999,7 +999,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } /** - * Remove a file or several files with a mask + * Remove a file or several files with a mask. + * This delete file physically but also database indexes. * * @param string $file File to delete or mask of files to delete * @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found @@ -1154,7 +1155,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$ if ($item != "." && $item != "..") { - if (is_dir(dol_osencode("$dir/$item"))) + if (is_dir(dol_osencode("$dir/$item")) && ! is_link(dol_osencode("$dir/$item"))) { $count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted); }