Browse code

Always set nc_sent to 1 for new or copied news

Benjamin Roth authored on06/04/2023 16:02:34
Showing1 changed files
... ...
@@ -30,6 +30,7 @@ $GLOBALS['TL_DCA']['tl_news']['fields']['nc_sent'] = array
30 30
 (
31 31
   'exclude'                 => true,
32 32
   'inputType'               => 'checkbox',
33
+  'default'                 => 1,
33 34
   'eval'                    => array('doNotCopy'=>true),
34 35
   'sql'                     => "char(1) NOT NULL default '1'"
35 36
 );
Browse code

Updates

Benjamin Roth authored on22/03/2023 10:08:48
Showing1 changed files
... ...
@@ -30,9 +30,8 @@ $GLOBALS['TL_DCA']['tl_news']['fields']['nc_sent'] = array
30 30
 (
31 31
   'exclude'                 => true,
32 32
   'inputType'               => 'checkbox',
33
-  'default'                 => 1,
34 33
   'eval'                    => array('doNotCopy'=>true),
35
-  'sql'                     => "char(1) NOT NULL default ''"
34
+  'sql'                     => "char(1) NOT NULL default '1'"
36 35
 );
37 36
 
38 37
 $GLOBALS['TL_DCA']['tl_news']['fields']['nc_testmail'] = array
Browse code

Initial commit

Benjamin Roth authored on14/03/2023 16:28:03
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+<?php
2
+
3
+/*
4
+ * This file is part of newsmailer bundle for Contao.
5
+ *
6
+ * (c) Benjamin Roth
7
+ *
8
+ * @license LGPL-3.0-or-later
9
+ */
10
+
11
+use Contao\CoreBundle\DataContainer\PaletteManipulator;
12
+
13
+/**
14
+ * Palettes
15
+ */
16
+
17
+//$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace(array('{publish_legend}','{publish_legend:hide}'),array('{nc_legend:hide},nc_sent,nc_testmail;{publish_legend}','{nc_legend:hide},nc_sent,nc_testmail;{publish_legend:hide}'),$GLOBALS['TL_DCA']['tl_news']['palettes']['default']);
18
+PaletteManipulator::create()
19
+    ->addLegend('nc_legend','publish_legend',PaletteManipulator::POSITION_BEFORE)
20
+    ->addField('nc_sent','nc_legend', PaletteManipulator::POSITION_APPEND)
21
+    ->addField('nc_testmail','nc_legend', PaletteManipulator::POSITION_APPEND)
22
+    ->applyToPalette('default','tl_news')
23
+;
24
+
25
+/**
26
+ * Fields
27
+ */
28
+
29
+$GLOBALS['TL_DCA']['tl_news']['fields']['nc_sent'] = array
30
+(
31
+  'exclude'                 => true,
32
+  'inputType'               => 'checkbox',
33
+  'default'                 => 1,
34
+  'eval'                    => array('doNotCopy'=>true),
35
+  'sql'                     => "char(1) NOT NULL default ''"
36
+);
37
+
38
+$GLOBALS['TL_DCA']['tl_news']['fields']['nc_testmail'] = array
39
+(
40
+  'exclude'                 => true,
41
+  'inputType'               => 'checkbox',
42
+  'eval'                    => array('doNotSaveEmpty'=>true),
43
+);