3 /*********************************************************************************
4 * SugarCRM is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
41 <form name="AdminSettings" method="POST">
42 <input type="hidden" name="action" value="AdminSettings">
43 <input type="hidden" name="module" value="SugarFeed">
44 <input type="hidden" name="process" value="">
46 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="actionsContainer">
48 <td width="100%" colspan="2">
49 <input type="button" onclick="document.AdminSettings.process.value='true'; if(check_form('AdminSettings')) {ldelim} document.AdminSettings.submit(); {rdelim}" class="button primary" title="{$app.LBL_SAVE_BUTTON_TITLE}" accessKey="{$app.LBL_SAVE_BUTTON_KEY}" value="{$app.LBL_SAVE_BUTTON_LABEL}">
50 <input type="button" onclick="document.AdminSettings.process.value='false'; document.AdminSettings.submit();" class="button" title="{$app.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$app.LBL_CANCEL_BUTTON_KEY}" value="{$app.LBL_CANCEL_BUTTON_LABEL}">
51 <input type="button" onclick="document.AdminSettings.process.value='deleteRecords'; if(confirm('{$mod.LBL_CONFIRM_DELETE_RECORDS}')) document.AdminSettings.submit();" class="button" title="{$mod.LBL_FLUSH_RECORDS}" value="{$mod.LBL_FLUSH_RECORDS}">
56 <table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
58 <td scope="row" align="right" nowrap>{$mod.LBL_ENABLE_FEED}:</td>
59 <td align="left" width="25%">
60 <input type="hidden" id="feed_enable_hidden" name="feed_enable" value="0">
61 <input type="checkbox" id="feed_enable" name="feed_enable" value="1" {$enabled_checkbox} onClick="SugarFeedDisableCheckboxes()">
63 <td colspan="3" width="70%"> </td>
66 <td scope="row" align="right" valign="top" nowrap>{$mod.LBL_ENABLE_MODULE_LIST}:</td>
67 <td colspan="4" width="95%">
68 <table id="sugarfeed_modulelist" cellspacing=3 border=0>
69 {foreach name=feedModuleList from=$module_list key=i item=entry}
70 {if ($i % 2)==0}<tr>{/if}
71 <td scope="row" align="right">{$entry.label}:</td>
73 <input type="hidden" name="modules[module_{$entry.module}]" value="0">
74 <input type="checkbox" id="modules[module_{$entry.module}]" name="modules[module_{$entry.module}]" value="1" {if $entry.enabled==1}CHECKED{/if}>
76 {if ($i % 2)==1}</tr>{/if}
81 <td scope="row" align="right" nowrap>{$mod.LBL_ENABLE_USER_FEED}:</td>
82 <td align="left" width="25%">
83 <input type="hidden" id="modules[module_UserFeed]" name="modules[module_UserFeed]" value="0">
84 <input type="checkbox" id="modules[module_UserFeed]" name="modules[module_UserFeed]" value="1" {if $user_feed_enabled==1}CHECKED{/if}>
86 <td colspan="3" width="70%"> </td>
92 <script type="text/javascript">
93 var SugarFeedCheckboxList = new Object();
94 SugarFeedCheckboxList['module_UserFeed'] = 'modules[module_UserFeed]';
95 {foreach name=feedModuleList from=$module_list key=i item=entry}
96 SugarFeedCheckboxList['{$i}'] = 'modules[module_{$entry.module}]';
99 addToValidate('AdminSettings', 'tracker_prune_interval', 'int', true, "{$mod.LBL_TRACKER_PRUNE_RANGE}");
100 addToValidateRange('AdminSettings', 'tracker_prune_interval', 'range', true, '{$mod.LBL_TRACKER_PRUNE_RANGE}', 1, 180);
101 function SugarFeedDisableCheckboxes(is_init) {
102 var setDisabled = false;
104 if ( document.getElementsByName('feed_enable')[1].checked == true ) {
106 if ( is_init != true ) {
107 document.getElementsByName('modules[module_UserFeed]')[1].checked = true;
114 for ( var i in SugarFeedCheckboxList ) {
115 currElem = document.getElementsByName(SugarFeedCheckboxList[i])[1];
116 if ( typeof(currElem) != 'object' ) { continue; }
117 if ( currElem.type == 'checkbox' ) {
118 currElem.disabled = setDisabled;
119 currElem.readonly = setDisabled;
123 SugarFeedDisableCheckboxes(true);