Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F804045
D202.id490.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 9:04 AM
Size
7 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 9:04 AM (4 h, 45 m)
Engine
blob
Format
Raw Data
Handle
576759
Attached To
D202: INP-1532 Allow specifying scheduled time for Promo Blocks
D202.id490.diff
View Options
Index: core/admin_templates/promo_blocks/promo_block_edit.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_edit.tpl
+++ core/admin_templates/promo_blocks/promo_block_edit.tpl
@@ -98,61 +98,8 @@
<inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="CategoryId" title="la_fld_Category" style="width: 400px;" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="ExternalLink"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="promo-block" field="OpenInNewWindow"/>
-
- <inp2:m_RenderElement design="form_row" caption_render_as="date_field_caption_element" prefix="promo-block" field="ScheduleFromDate" title="la_fld_ScheduleDate" to_field="ScheduleToDate">
- <td class="control-cell">
- <inp2:m_Phrase label="la_From"/>
- <input type="text" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date"/>" value="<inp2:{$prefix}_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
- <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$field}"/>"
- style="cursor: pointer; margin-right: 5px"
- title="Date selector"
- />
-
- <script type="text/javascript">
- Calendar.setup({
- inputField : "<inp2:{$prefix}_InputName field="{$field}_date"/>",
- ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$field}_date" input_format="1"/>"),
- button : "cal_img_<inp2:{$prefix}_InputName field="{$field}"/>",
- align : "br",
- singleClick : true,
- showsTime : true,
- weekNumbers : false,
- firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
- onUpdate : function(cal) {
- runOnChange('<inp2:$prefix_InputName field="{$field}_date"/>');
- }
- });
- </script>
- <input type="hidden" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time" input_format="1"/>" value="">
-
-
- <inp2:m_Phrase label="la_To"/>
- <input type="text" name="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" value="<inp2:{$prefix}_Field field="{$to_field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
- <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>"
- style="cursor: pointer; margin-right: 5px"
- title="Date selector"
- />
-
- <script type="text/javascript">
- Calendar.setup({
- inputField : "<inp2:{$prefix}_InputName field="{$to_field}_date"/>",
- ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1"/>"),
- button : "cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>",
- align : "br",
- singleClick : true,
- showsTime : true,
- weekNumbers : false,
- firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
- onUpdate : function(cal) {
- runOnChange('<inp2:$prefix_InputName field="{$to_field}_date"/>');
- }
- });
- </script>
- <input type="hidden" name="<inp2:{$prefix}_InputName field="{$to_field}_time"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_time" input_format="1"/>" value="">
-
- </td>
- </inp2:m_RenderElement>
-
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="promo-block" field="ScheduleFromDate"/>
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="promo-block" field="ScheduleToDate"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="promo-block" field="Sticky"/>
<inp2:m_ifnot check="promo-block_IsNewItem">
Index: core/install/english.lang
===================================================================
--- core/install/english.lang
+++ core/install/english.lang
@@ -658,7 +658,8 @@
<PHRASE Label="la_fld_RunSchedule" Module="Core" Type="1" Column="UnVuIFNjaGVkdWxl">UnVuIFNjaGVkdWxl</PHRASE>
<PHRASE Label="la_fld_RunTime" Module="Core" Type="1" Column="UnVuIFRpbWU=">UnVuIFRpbWU=</PHRASE>
<PHRASE Label="la_fld_SameAsThumb" Module="Core" Type="1">U2FtZSBBcyBUaHVtYg==</PHRASE>
- <PHRASE Label="la_fld_ScheduleDate" Module="Core" Type="1">U2NoZWR1bGUgRGF0ZQ==</PHRASE>
+ <PHRASE Label="la_fld_ScheduleFromDate" Module="Core" Type="1" Column="U2NoZWR1bGUgRnJvbQ==">U2NoZWR1bGUgRnJvbQ==</PHRASE>
+ <PHRASE Label="la_fld_ScheduleToDate" Module="Core" Type="1" Column="U2NoZWR1bGUgVG8=">U2NoZWR1bGUgVG8=</PHRASE>
<PHRASE Label="la_fld_SearchTerm" Module="Core" Type="1" Column="U2VhcmNoIFRlcm0=">U2VhcmNoIFRlcm0=</PHRASE>
<PHRASE Label="la_fld_Sender" Module="Core" Type="1" Column="U2VuZGVy">U2VuZGVy</PHRASE>
<PHRASE Label="la_fld_SenderAddress" Module="Core" Type="1">U2VuZGVyJ3MgQWRkcmVzcw==</PHRASE>
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql
+++ core/install/upgrades.sql
@@ -3039,3 +3039,6 @@
ADD INDEX (`Status`);
INSERT INTO SystemSettings VALUES(DEFAULT, 'SessionLogRotationInterval', '2629800', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_SessionLogRotationInterval', 'select', '', '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2629800=la_opt_OneMonth||7889400=la_opt_ThreeMonths||31557600=la_opt_OneYear||63115200=la_opt_TwoYears||94672800=la_opt_ThreeYears||157788000=la_opt_FiveYears||-1=la_opt_EmailLogKeepForever', 65.05, 0, 1, NULL);
+
+UPDATE PromoBlocks SET ScheduleToDate = ScheduleToDate + 86399 WHERE DATE_FORMAT(FROM_UNIXTIME(ScheduleTodate), "%H%i") = "0000";
+DELETE FROM LanguageLabels WHERE PhraseKey = "LA_FLD_SCHEDULEDATE";
Index: core/units/promo_blocks/promo_block_eh.php
===================================================================
--- core/units/promo_blocks/promo_block_eh.php
+++ core/units/promo_blocks/promo_block_eh.php
@@ -197,8 +197,9 @@
$object = $event->getObject();
/* @var $object kDBItem */
- $date_from = $object->GetDBField('ScheduleFromDate_date');
- $date_to = $object->GetDBField('ScheduleToDate_date');
+ $object->UpdateFormattersMasterFields();
+ $date_from = $object->GetDBField('ScheduleFromDate');
+ $date_to = $object->GetDBField('ScheduleToDate');
if ( $date_from && $date_to && $date_from >= $date_to ) {
$object->SetError('ScheduleFromDate_date', 'wrong_date_interval');
Index: core/units/promo_blocks/promo_blocks_config.php
===================================================================
--- core/units/promo_blocks/promo_blocks_config.php
+++ core/units/promo_blocks/promo_blocks_config.php
@@ -104,13 +104,13 @@
),
'ScheduleFromDate' => Array (
'type' => 'int',
- 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '',
+ 'formatter' => 'kDateFormatter', 'picker_default' => 'midnight',
'error_msgs' => Array ('wrong_date_interval' => '!la_ToDateMustBeGreaterThanFromDate!'),
'default' => null,
),
'ScheduleToDate' => Array (
'type' => 'int',
- 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '',
+ 'formatter' => 'kDateFormatter', 'picker_default' => 'midnight +1 day -1 second',
'error_field' => 'ScheduleFromDate',
'default' => null,
),
@@ -144,4 +144,4 @@
),
),
),
-);
\ No newline at end of file
+);
Event Timeline
Log In to Comment