From 524f171168d8747cad3e2b18ecf9f220251286f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Mar 2019 12:12:16 +0100 Subject: [PATCH 1/3] FIX old export models was not visible --- htdocs/core/class/html.formother.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8ca0b988fda..ccb6edeb2ee 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -63,8 +63,8 @@ class FormOther * @param string $selected Id modele pre-selectionne * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches - * @param int $useempty Affiche valeur vide dans liste - * @param int $fk_user Utilisateur créant le modèle + * @param int $useempty Show an empty value in list + * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) * @return void */ function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) @@ -73,7 +73,7 @@ class FormOther $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; - if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user; + if (!empty($fk_user)) $sql.=" AND fk_user IN (0, ".$fk_user.")"; // An export model $sql.= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) From 1787b319322181ed6ae8bb0153cc60591ce62750 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Mar 2019 12:18:28 +0100 Subject: [PATCH 2/3] FIX setup of module export --- htdocs/admin/export.php | 30 ++++++++++++++++-------------- htdocs/langs/en_US/admin.lang | 5 +++-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index c4ad077296a..936c6e2f135 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -51,37 +51,37 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; * View */ +$form=new Form($db); + $page_name = "ExportSetup"; llxHeader('', $langs->trans($page_name)); // Subheader -$linkback = '' - . $langs->trans("BackToModuleList") . ''; +$linkback = '' . $langs->trans("BackToModuleList") . ''; + print_fiche_titre($langs->trans($page_name), $linkback); -// Configuration header +//$head = export_admin_prepare_head(); +$h=0; +$head = array(); +$head[$h][0] = DOL_URL_ROOT.'/admin/export.php'; +$head[$h][1] = $langs->trans("Setup"); +$head[$h][2] = 'setup'; +$h++; -dol_fiche_head( - $head, - 'settings', - $langs->trans("ExportsArea"), - 0, - "exports" -); +dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "exports"); -// Setup page goes here -$form=new Form($db); print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; print ''."\n"; // Example with a yes / no select print ''; -print ''; +print ''; print ''; print ''; print '
'.$langs->trans("ExportModel").''.$langs->trans("Parameters").' 
'.$langs->trans("set_EXPORTS_SHARE_MODELS").''.$langs->trans("EXPORTS_SHARE_MODELS").' '; print '
'; @@ -93,6 +93,8 @@ print '
'; +dol_fiche_end(); + // End of page llxFooter(); $db->close(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b50e25f50d4..7083ed1114e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1846,7 +1846,6 @@ FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree OperationParamDesc=Define values to use for action, or how to extract values. For example:
VALUE:abc
REGEX:SUBJECT:([^\s]*)
REGEX:BODY:My company name is\s([^\s]*) -##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). DisabledResourceLinkUser=Disable feature to link a resource to users @@ -1856,4 +1855,6 @@ OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or use application from a text browser like lynx or links. -ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. \ No newline at end of file +ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. +EXPORTS_SHARE_MODELS=Export models are share with everybody +ExportSetup=Setup of module Export \ No newline at end of file From e5f54bd14c003a3c33ff6711c3a420b273d0dd22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Mar 2019 12:35:44 +0100 Subject: [PATCH 3/3] FIX Remane of project --- htdocs/projet/class/project.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a704c7d641e..e63cbe80fee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -338,7 +338,7 @@ class Project extends CommonObject if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $res=dol_move($olddir, $newdir); + $res=@rename($olddir, $newdir); if (! $res) { $langs->load("errors"); @@ -723,10 +723,10 @@ class Project extends CommonObject return -1; } } - + /** * Delete tasks with no children first, then task with children recursively - * + * * @param User $user User * @return int <0 if KO, 1 if OK */ @@ -754,7 +754,7 @@ class Project extends CommonObject { if (count($this->lines)) $this->deleteTasks($this->lines); } - + return 1; }