]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/Smarty/plugins/modifier.default_date_value.php
Release 6.5.0
[Github/sugarcrm.git] / include / Smarty / plugins / modifier.default_date_value.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
7 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
8
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
10
11 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
12
13 r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system 
14
15 r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
16
17 r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
18
19 r42807 - 2008-12-29 11:16:59 -0800 (Mon, 29 Dec 2008) - dwong - Branch from trunk/sugarcrm r42806 to branches/tokyo/sugarcrm
20
21 r36834 - 2008-06-18 13:12:25 -0700 (Wed, 18 Jun 2008) - jmertic - Bug 22982: Remove hardcoding of the default database date and time formats, instead using TimeDate::$dbDayFormat, TimeDate::$dbTimeFormat, and TimeDate::get_db_date_time_format() as appropriate.
22 Touched:
23 - dceCreateReportData.php
24 - modules/SchedulersJobs/SchedulersJobOLD.php
25 - modules/SchedulersJobs/SchedulersJob.php
26 - modules/Tasks/MyTasks.php
27 - modules/Tasks/Task.php
28 - modules/Forecasts/ForecastUtils.php
29 - modules/ModuleBuilder/MB/MBPackage.php
30 - modules/Documents/GetLatestRevision.php
31 - modules/Campaigns/QueueCampaign.php
32 - modules/Campaigns/WebToLeadCapture.php
33 - modules/Campaigns/utils.php
34 - modules/Campaigns/RoiDetailView.php
35 - modules/Campaigns/PopupCampaignRoi.php
36 - modules/Campaigns/TrackDetailView.php
37 - modules/Activities/OpenListView.php
38 - modules/UpgradeWizard/uw_utils.php
39 - modules/Emails/EmailUI.php
40 - modules/Emails/Save.php
41 - modules/DCEClients/client_utils.php
42 - modules/DCEClients/instanceImport.php
43 - modules/DCEClients/processAction.php
44 - modules/KBDocuments/Save.php
45 - modules/KBDocuments/SearchUtils.php
46 - modules/EmailMan/EmailMan.php
47 - modules/EmailMan/EmailManDelivery.php
48 - modules/Charts/Dashlets/MyForecastingChartDashlet/MyForecastingChartDashlet.php
49 - modules/Charts/Dashlets/MyModulesUsedChartDashlet/MyModulesUsedChartDashlet.php
50 - modules/Charts/Dashlets/MyTeamModulesUsedChartDashlet/MyTeamModulesUsedChartDashlet.php
51 - modules/Charts/code/Chart_lead_source_by_outcome.php
52 - modules/Charts/code/Chart_pipeline_by_lead_source.php
53 - modules/Charts/PredefinedChart.php
54 - modules/ProjectTask/ProjectTask.php
55 - modules/ProjectTask/MyProjectTasks.php
56 - modules/ProductBundles/ProductBundle.php
57 - modules/Reports/schedule/save_schedule.php
58 - modules/Reports/schedule/ReportSchedule.php
59 - modules/Schedulers/JobThread.php
60 - modules/Schedulers/SchedulerDaemon.php
61 - modules/Schedulers/_AddJobsHere.php
62 - modules/Schedulers/Scheduler.php
63 - modules/Users/reassignUserRecords.php
64 - modules/Users/Logout.php
65 - modules/ACLRoles/ACLRole.php
66 - modules/Meetings/MeetingsQuickCreate.php
67 - modules/Meetings/Meeting.php
68 - modules/Sync/syncconnect.php
69 - modules/Administration/CreateImportAction.php
70 - modules/Administration/RebuildRelationship.php
71 - modules/Administration/SessionManager.php
72 - modules/Administration/DstFix.php
73 - modules/Administration/RebuildExtensions.php
74 - modules/Administration/System.php
75 - modules/Administration/updater_utils.php
76 - modules/Administration/UpgradeWizard_commit.php
77 - modules/Calls/CallFormBase.php
78 - modules/Calls/Call.php
79 - modules/Calls/CallsQuickCreate.php
80 - modules/MailMerge/Step1.php
81 - modules/Queues/Seed.php
82 - modules/Queues/Queue.php
83 - modules/Calendar/Calendar.php
84 - modules/Calendar/index.php
85 - modules/Calendar/templates/templates_calendar.php
86 - modules/DCEReports/DCESalesReport.php
87 - modules/DCEReports/controller.php
88 - modules/DynamicFields/templates/Fields/TemplateDate.php
89 - modules/Quotes/layouts/Invoice.php
90 - modules/Quotes/layouts/Standard.php
91 - modules/Quotes/QuoteFormBase.php
92 - modules/Quotes/EmailPDF.php
93 - modules/Contracts/Save.php
94 - modules/DCEInstances/DCEInstance.php
95 - modules/InboundEmail/InboundEmail.php
96 - modules/Project/Export.php
97 - modules/Project/ResourceReport.php
98 - modules/Project/Convert.php
99 - modules/Project/EditGridView.php
100 - modules/Project/Dashboard.php
101 - modules/WorkFlow/WorkFlowSchedule.php
102 - modules/TeamNotices/DisplayNotices.php
103 - modules/TeamNotices/DefaultNotices.php
104 - modules/TeamNotices/EditView.php
105 - modules/TeamNotices/Dashlets/TeamNoticesDashlet/TeamNoticesDashlet.php
106 - modules/DCEActions/dceActionUtils.php
107 - modules/ProspectLists/Duplicate.php
108 - modules/Trackers/TrackerReporter.php
109 - modules/Trackers/populateSeedData.php
110 - data/Link.php
111 - data/SugarBean.php
112 - test/modules/Teams_test.php
113 - test/modules/Trackers/Tracker_Reports_Usage_test.php
114 - test/test_utilities/SugarTest_UserUtilities.php
115 - include/workflow/action_utils.php
116 - include/generic/SugarWidgets/SugarWidgetFielddatetime.php
117 - include/generic/SugarWidgets/SugarWidgetFielddate.php
118 - include/generic/DeleteRelationship.php
119 - include/Smarty/plugins/modifier.default_date_value.php
120 - include/SugarEmailAddress/SugarEmailAddress.php
121 - include/database/DBManager.php
122 - include/database/DBHelper.php
123 - include/javascript/jsAlerts.php
124 - include/CurrencyService/CurrencyService.php
125 - include/MVC/View/SugarView.php
126 - include/MVC/SugarApplication.php
127 - include/ListView/ListViewData.php
128 - soap/SoapSync.php
129 - soap/SoapPortalUsers.php
130 - install/populateSeedData.php
131 - install/seed_data/dceSeedData.php
132 - examples/SoapTestDCE.php
133 - examples/SoapTestPortal.php
134 - examples/SoapFullTest.php
135 - examples/SoapPortalFullTest.php
136
137 r29406 - 2007-11-08 16:36:28 -0800 (Thu, 08 Nov 2007) - bsoufflet - Bug 17690 : [RC] No license and/or entry point check in the files
138
139 r27703 - 2007-10-05 14:59:07 -0700 (Fri, 05 Oct 2007) - clee - Fix for 16206
140 Updated the date SugarField to support default_value formats via using the Smarty default_date_value modifier. Also updated Studio support for the date field to display a default_value dropdown list.
141 Touched:
142 include/SugarFields/Fields/Datetime/EditView.tpl
143 modules/DynamicFields/templates/FieldViewer.php
144 modules/DynamicFields/templates/Fields/Forms/date.php
145 modules/DynamicFields/templates/Fields/Forms/date.tpl
146 Added:
147 include/Smarty/plugins/modifier.default_date_value.php
148
149
150 */
151
152
153 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
154 /*********************************************************************************
155  * SugarCRM Community Edition is a customer relationship management program developed by
156  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
157  * 
158  * This program is free software; you can redistribute it and/or modify it under
159  * the terms of the GNU Affero General Public License version 3 as published by the
160  * Free Software Foundation with the addition of the following permission added
161  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
162  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
163  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
164  * 
165  * This program is distributed in the hope that it will be useful, but WITHOUT
166  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
167  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
168  * details.
169  * 
170  * You should have received a copy of the GNU Affero General Public License along with
171  * this program; if not, see http://www.gnu.org/licenses or write to the Free
172  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
173  * 02110-1301 USA.
174  * 
175  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
176  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
177  * 
178  * The interactive user interfaces in modified source and object code versions
179  * of this program must display Appropriate Legal Notices, as required under
180  * Section 5 of the GNU Affero General Public License version 3.
181  * 
182  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
183  * these Appropriate Legal Notices must retain the display of the "Powered by
184  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
185  * technical reasons, the Appropriate Legal Notices must display the words
186  * "Powered by SugarCRM".
187  ********************************************************************************/
188
189 /**
190  * Smarty plugin
191  * @package Smarty
192  * @subpackage plugins
193  */
194
195
196 /**
197  * Smarty modifier to return default date value
198  *
199  * Type:     modifier<br>
200  * Name:     default_date_value<br>
201  * Purpose:  Utility to return a default date value given the field's default value settings
202  * @author   Collin Lee <clee at sugarcrm dot com>
203  * @param defaultValue The date field's default value setting
204  * @return String representing date value
205  */
206 function smarty_modifier_default_date_value($defaultValue) {
207         global $timedate;
208         require_once('modules/DynamicFields/templates/Fields/TemplateDate.php');
209         $td = new TemplateDate();
210         return $timedate->asUser(new SugarDateTime($td->dateStrings[$defaultValue]));
211 }