From 08b395e127c007a39a829a4258d36846a3833fbd Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Wed, 22 Sep 2021 08:43:30 +0200 Subject: [PATCH 1/3] another set of cleanup for action buttons --- htdocs/admin/debugbar.php | 2 +- htdocs/admin/expensereport_rules.php | 2 +- htdocs/bookmarks/card.php | 5 +---- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/compta/prelevement/line.php | 2 +- htdocs/core/class/html.formfile.class.php | 4 ++-- htdocs/core/class/html.formmail.class.php | 5 ++--- htdocs/fichinter/card.php | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 19a440520b1..3e878b9398b 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -90,7 +90,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 0b12f8d3741..802cc939caa 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -319,7 +319,7 @@ foreach ($rules as $rule) { echo ''.img_edit().' '; echo ''.img_delete().''; } else { - echo ' '; + echo ' '; echo ''.$langs->trans("Cancel").''; } echo ''; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 839ce4c3f86..d725a659e08 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -186,10 +186,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
'; - print '   '; - print ''; - print '
'; + print $form->buttonsSaveCancel("CreateBookmark"); print ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index dbfbc84b69f..2ed56683c02 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -749,7 +749,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
'; + print $form->buttonsSaveCancel("CreateMailing", ''); print ''; } else { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 97c6735221f..3283957f8a2 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -424,7 +424,7 @@ if ($object->fetch($id) >= 0) { print '
'; if ($allowaddtarget) { - print ''; + print ''; } else { print ''; //print $langs->trans("MailNoChangePossible"); diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 5aa7344eea5..bea351ac46c 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -222,7 +222,7 @@ if ($id) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DEBUGBAR_LOGS_LINES_NUMBER").'

'; //Confirm Button - print '
'; + print '
'; print ''; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 591fb5ed2d1..ca7e939fb6f 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2033,8 +2033,8 @@ class FormFile print ''.dol_print_date(dol_now(), "dayhour", "tzuser").''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else { print ''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 04d4ad34e89..823e90fcac3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -956,15 +956,14 @@ class FormMail extends Form $out .= ''."\n"; if ($this->withform == 1 || $this->withform == -1) { - $out .= '
'; - $out .= 'trans("SendMail").'"'; // Add a javascript test to avoid to forget to submit file before sending email if ($this->withfile == 2 && $conf->use_javascript_ajax) { $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\''.dol_escape_js($langs->trans("FileWasNotUploaded")).'\'); return false; } else { return true; }"'; } $out .= ' />'; if ($this->withcancel) { - $out .= '     '; $out .= ''; } $out .= '
'."\n"; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9bf43a60378..31f42c9b0fa 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1146,7 +1146,7 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; + $morehtmlref .= ''; $morehtmlref .= ''; } else { $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); From 977db0a2ba6b233475e3fe234aa8e3f54a805ff7 Mon Sep 17 00:00:00 2001 From: Ilias Patsiaouras Date: Thu, 23 Sep 2021 11:38:50 +0200 Subject: [PATCH 2/3] add MO to the list of possible object to link --- htdocs/core/class/html.form.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9bcbf08f71a..bc025cfcef0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7846,6 +7846,11 @@ class Form if (empty($conf->expedition->enabled)) { continue; // Do not show if module disabled } + } elseif ($objecttype == 'mo') { + $tplpath = 'mrp/mo'; + if (empty($conf->mrp->enabled)) { + continue; // Do not show if module disabled + } } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; } elseif ($objecttype == 'order_supplier') { @@ -7949,6 +7954,7 @@ class Form 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), + 'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMo', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."mrp_mo as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')'), 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')') ); } From d357715538f860d312765a1ebc753cb6f561e939 Mon Sep 17 00:00:00 2001 From: DevIntact Date: Thu, 23 Sep 2021 14:54:38 +0200 Subject: [PATCH 3/3] Translation of event title for incoming email Event title for incoming email is not translated while collected by cronjob. i.e : ActionAC_EMAIL_IN --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 737d2134ccc..1e92e1aba4b 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -966,7 +966,7 @@ class EmailCollector extends CommonObject dol_syslog("EmailCollector::doCollectOneCollector start for id=".$this->id, LOG_DEBUG); - $langs->loadLangs(array("project", "companies", "mails", "errors", "ticket", "agenda")); + $langs->loadLangs(array("project", "companies", "mails", "errors", "ticket", "agenda", "commercial")); $error = 0; $this->output = '';