3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2012 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%" colspan='4'>
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()">
65 <td scope="row" align="right" valign="top" nowrap>{$mod.LBL_ENABLE_MODULE_LIST}:</td>
66 <td colspan="4" width="95%">
67 <table id="sugarfeed_modulelist" cellspacing=3 border=0>
68 {foreach name=feedModuleList from=$module_list key=i item=entry}
69 {if ($i % 2)==0}<tr>{/if}
70 <td scope="row" align="right">{$entry.label}:</td>
72 <input type="hidden" name="modules[module_{$entry.module}]" value="0">
73 <input type="checkbox" id="modules[module_{$entry.module}]" name="modules[module_{$entry.module}]" value="1" {if $entry.enabled==1}CHECKED{/if}>
75 {if ($i % 2)==1}</tr>{/if}
80 <td scope="row" align="right" nowrap>{$mod.LBL_ENABLE_USER_FEED}:</td>
81 <td align="left" width="25%">
82 <input type="hidden" id="modules[module_UserFeed]" name="modules[module_UserFeed]" value="0">
83 <input type="checkbox" id="modules[module_UserFeed]" name="modules[module_UserFeed]" value="1" {if $user_feed_enabled==1}CHECKED{/if}>
85 <td colspan="3" width="70%"> </td>
91 <script type="text/javascript">
92 var SugarFeedCheckboxList = new Object();
93 SugarFeedCheckboxList['module_UserFeed'] = 'modules[module_UserFeed]';
94 {foreach name=feedModuleList from=$module_list key=i item=entry}
95 SugarFeedCheckboxList['{$i}'] = 'modules[module_{$entry.module}]';
98 addToValidate('AdminSettings', 'tracker_prune_interval', 'int', true, "{$mod.LBL_TRACKER_PRUNE_RANGE}");
99 addToValidateRange('AdminSettings', 'tracker_prune_interval', 'range', true, '{$mod.LBL_TRACKER_PRUNE_RANGE}', 1, 180);
100 function SugarFeedDisableCheckboxes(is_init) {
101 var setDisabled = false;
103 if ( document.getElementsByName('feed_enable')[1].checked == true ) {
105 if ( is_init != true ) {
106 document.getElementsByName('modules[module_UserFeed]')[1].checked = true;
113 for ( var i in SugarFeedCheckboxList ) {
114 currElem = document.getElementsByName(SugarFeedCheckboxList[i])[1];
115 if ( typeof(currElem) != 'object' ) { continue; }
116 if ( currElem.type == 'checkbox' ) {
117 currElem.disabled = setDisabled;
118 currElem.readonly = setDisabled;
122 SugarFeedDisableCheckboxes(true);