]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/ListView/ListViewGeneric.tpl
Release 6.5.3
[Github/sugarcrm.git] / include / ListView / ListViewGeneric.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6  * 
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.
13  * 
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
17  * details.
18  * 
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
22  * 02110-1301 USA.
23  * 
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.
26  * 
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.
30  * 
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  ********************************************************************************/
37
38
39
40
41 *}
42
43 <script type='text/javascript' src='{sugar_getjspath file='include/javascript/popup_helper.js'}'></script>
44
45
46 <script>
47 {literal}
48         $(document).ready(function(){
49             $("ul.clickMenu").each(function(index, node){
50                         $(node).sugarActionMenu();
51                 });
52
53         $('.selectActionsDisabled').children().each(function(index) {
54             $(this).attr('onclick','').unbind('click');
55         });
56         
57         var selectedTopValue = $("#selectCountTop").attr("value");
58         if(typeof(selectedTopValue) != "undefined" && selectedTopValue != "0"){
59                 sugarListView.prototype.toggleSelected();
60         }
61         });
62 {/literal}      
63 </script>
64 {assign var="currentModule" value = $pageData.bean.moduleDir}
65 {assign var="singularModule" value = $moduleListSingular.$currentModule}
66 {assign var="moduleName" value = $moduleList.$currentModule}
67 {assign var="hideTable" value=false}
68
69 {if count($data) == 0}
70         {assign var="hideTable" value=true}
71         <div class="list view listViewEmpty">
72     {if $displayEmptyDataMesssages}
73         {if strlen($query) == 0}
74                 {capture assign="createLink"}<a href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">{$APP.LBL_CREATE_BUTTON_LABEL}</a>{/capture}
75                 {capture assign="importLink"}<a href="?module=Import&action=Step1&import_module={$pageData.bean.moduleDir}&return_module={$pageData.bean.moduleDir}&return_action=index">{$APP.LBL_IMPORT}</a>{/capture}
76                 {capture assign="helpLink"}<a target="_blank" href='?module=Administration&action=SupportPortal&view=documentation&version={$sugar_info.sugar_version}&edition={$sugar_info.sugar_flavor}&lang=&help_module={$currentModule}&help_action=&key='>{$APP.LBL_CLICK_HERE}</a>{/capture}
77                 <p class="msg">
78                     {$APP.MSG_EMPTY_LIST_VIEW_NO_RESULTS|replace:"<item2>":$createLink|replace:"<item3>":$importLink}
79                 </p>
80                 <p class="submsg">
81                     {$APP.MSG_EMPTY_LIST_VIEW_NO_RESULTS_SUBMSG|replace:"<item1>":$moduleName|replace:"<item4>":$helpLink}
82                 </p>
83         {elseif $query == "-advanced_search"}
84             <p class="msg">
85                 {$APP.MSG_LIST_VIEW_NO_RESULTS_BASIC}
86             </p>
87         {else}
88             <p class="msg">
89                 {capture assign="quotedQuery"}"{$query}"{/capture}
90                 {$APP.MSG_LIST_VIEW_NO_RESULTS|replace:"<item1>":$quotedQuery}
91             </p>
92             <p class = "submsg">
93                 <a href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">
94                     {$APP.MSG_LIST_VIEW_NO_RESULTS_SUBMSG|replace:"<item1>":$quotedQuery|replace:"<item2>":$singularModule}
95                 </a>
96
97             </p>
98         {/if}
99     {else}
100         <p class="msg">
101             {$APP.LBL_NO_DATA}
102         </p>
103         {/if}
104         </div>
105 {/if}
106 {$multiSelectData}
107
108 {if $hideTable == false}
109         <table cellpadding='0' cellspacing='0' width='100%' border='0' class='list view'>
110     {assign var="link_select_id" value="selectLinkTop"}
111     {assign var="link_action_id" value="actionLinkTop"}
112     {assign var="actionsLink" value=$actionsLinkTop}
113     {assign var="selectLink" value=$selectLinkTop}
114     {assign var="action_menu_location" value="top"}
115         {include file='include/ListView/ListViewPagination.tpl'}
116         <tr height='20'>
117                         {if $prerow}
118                                 <td width='1%' class="td_alt">
119                                         &nbsp;
120                                 </td>
121                         {/if}
122                         {if !empty($quickViewLinks)}
123                         <td class='td_alt' width='1%' style="padding: 0px;">&nbsp;</td>
124                         {/if}
125                         {counter start=0 name="colCounter" print=false assign="colCounter"}
126                         {foreach from=$displayColumns key=colHeader item=params}
127                                 <th scope='col' width='{$params.width}%'>
128                                         <div style='white-space: normal;'width='100%' align='{$params.align|default:'left'}'>
129                         {if $params.sortable|default:true}
130                             {if $params.url_sort}
131                                 <a href='{$pageData.urls.orderBy}{$params.orderBy|default:$colHeader|lower}' class='listViewThLinkS1'>
132                             {else}
133                                 {if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
134                                     <a href='javascript:sListView.order_checks("{$pageData.ordering.sortOrder|default:ASCerror}", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")' class='listViewThLinkS1'>
135                                 {else}
136                                     <a href='javascript:sListView.order_checks("ASC", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")' class='listViewThLinkS1'>
137                                 {/if}
138                             {/if}
139                             {sugar_translate label=$params.label module=$pageData.bean.moduleDir}
140                                                 &nbsp;&nbsp;
141                                                 {if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
142                                                         {if $pageData.ordering.sortOrder == 'ASC'}
143                                                                 {capture assign="imageName"}arrow_down.{$arrowExt}{/capture}
144                                     {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_DESC'}{/capture}
145                                                                 {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
146                                                         {else}
147                                                                 {capture assign="imageName"}arrow_up.{$arrowExt}{/capture}
148                                     {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_ASC'}{/capture}
149                                                                 {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
150                                                         {/if}
151                                                 {else}
152                                                         {capture assign="imageName"}arrow.{$arrowExt}{/capture}
153                                 {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT'}{/capture}
154                                                         {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
155                                                 {/if}
156                             </a>
157                                         {else}
158                             {if !isset($params.noHeader) || $params.noHeader == false} 
159                                                   {sugar_translate label=$params.label module=$pageData.bean.moduleDir}
160                             {/if}
161                                         {/if}
162                                         </div>
163                                 </th>
164                                 {counter name="colCounter"}
165                         {/foreach}
166                         <td class='td_alt' nowrap="nowrap" width='1%'>&nbsp;</td>
167                 </tr>
168                         
169                 {counter start=$pageData.offsets.current print=false assign="offset" name="offset"}     
170                 {foreach name=rowIteration from=$data key=id item=rowData}
171                     {counter name="offset" print=false}
172                 {assign var='scope_row' value=true}
173         
174                         {if $smarty.foreach.rowIteration.iteration is odd}
175                                 {assign var='_rowColor' value=$rowColor[0]}
176                         {else}
177                                 {assign var='_rowColor' value=$rowColor[1]}
178                         {/if}
179                         <tr height='20' class='{$_rowColor}S1'>
180                                 {if $prerow}
181                                 <td width='1%' class='nowrap'>
182                                  {if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
183                                                 <input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
184                                  {else}
185                             <input title="{sugar_translate label='LBL_SELECT_THIS_ROW_TITLE'}" onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='{$rowData.ID}'>
186                                  {/if}
187                                 </td>
188                                 {/if}
189                                 {if !empty($quickViewLinks)}
190                     {capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}{/capture}
191                     {capture assign=action}{if $act}{$act}{else}EditView{/if}{/capture}
192                                 <td width='2%' nowrap>
193                         {if $pageData.rowAccess[$id].edit}
194                         <a title='{$editLinkString}' id="edit-{$rowData.ID}"
195         href="index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$rowData.ID}"
196                         >
197                             {capture name='tmp1' assign='alt_edit'}{sugar_translate label="LNK_EDIT"}{/capture}
198                             {sugar_getimage name="edit_inline.gif" attr='border="0" ' alt="$alt_edit"}</a>
199                         {/if}
200                     </td>
201         
202                                 {/if}
203                                 {counter start=0 name="colCounter" print=false assign="colCounter"}
204                                 {foreach from=$displayColumns key=col item=params}
205                                     {strip}
206                                         <td {if $scope_row} scope='row' {/if} align='{$params.align|default:'left'}' valign="top" class="{if ($params.type == 'teamset')}nowrap{/if}{if preg_match('/PHONE/', $col)} phone{/if}">
207                                                 {if $col == 'NAME' || $params.bold}<b>{/if}
208                                             {if $params.link && !$params.customCode}
209         {capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.moduleDir}{/if}{/capture}
210         {capture assign=action}{if $act}{$act}{else}DetailView{/if}{/capture}
211         {capture assign=record}{$rowData[$params.id]|default:$rowData.ID}{/capture}
212         {capture assign=url}index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$record}{/capture}
213                                 <{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN} href="{sugar_ajax_url url=$url}">
214                                                 {/if}
215                                                 {if $params.customCode} 
216                                                         {sugar_evalcolumn_old var=$params.customCode rowData=$rowData}
217                                                 {else}  
218                                {sugar_field parentFieldArray=$rowData vardef=$params displayType=ListView field=$col}
219                                
220                                                 {/if}
221                                                 {if empty($rowData.$col) && empty($params.customCode)}&nbsp;{/if}
222                                                 {if $params.link && !$params.customCode}
223                                                         </{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN}>
224                             {/if}
225                             {if $col == 'NAME' || $params.bold}</b>{/if}
226                                         </td>
227                                         {/strip}
228                         {assign var='scope_row' value=false}
229                                         {counter name="colCounter"}
230                                 {/foreach}
231                                 <td align='right'>{$pageData.additionalDetails.$id}</td>
232                         </tr>
233                 {foreachelse}
234                 <tr height='20' class='{$rowColor[0]}S1'>
235                     <td colspan="{$colCount}">
236                         <em>{$APP.LBL_NO_DATA}</em>
237                     </td>
238                 </tr> 
239                 {/foreach}
240     {assign var="link_select_id" value="selectLinkBottom"}
241     {assign var="link_action_id" value="actionLinkBottom"}
242     {assign var="selectLink" value=$selectLinkBottom}
243     {assign var="actionsLink" value=$actionsLinkBottom}
244     {assign var="action_menu_location" value="bottom"}
245     {include file='include/ListView/ListViewPagination.tpl'}
246         </table>
247 {/if}
248 {if $contextMenus}
249 <script type="text/javascript">
250 {$contextMenuScript}
251 {literal}
252 function lvg_nav(m,id,act,offset,t){
253     if(t.href.search(/#/) < 0){return;}
254     else{
255         if(act=='pte'){
256             act='ProjectTemplatesEditView';
257         }
258         else if(act=='d'){
259             act='DetailView';
260         }else if( act =='ReportsWizard'){
261             act = 'ReportsWizard';
262         }else{
263             act='EditView';
264         }
265     {/literal}
266         url = 'index.php?module='+m+'&offset=' + offset + '&stamp={$pageData.stamp}&return_module='+m+'&action='+act+'&record='+id;
267         t.href=url;
268     {literal}
269     }
270 }{/literal}
271 {literal}
272     function lvg_dtails(id){{/literal}
273         return SUGAR.util.getAdditionalDetails( '{$pageData.bean.moduleDir|default:$params.module}',id, 'adspan_'+id);{literal}}{/literal}
274 </script>
275 {/if}