]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/ListView/ListViewGeneric.tpl
Release 6.4.0
[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-2011 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 {if $overlib}
46 <script type='text/javascript' src='cache/include/javascript/sugar_grp_overlib.js'></script>
47 <div id='overDiv' style='position:absolute; visibility:hidden; z-index:1000;'></div>
48 {/if}
49
50 {$multiSelectData}
51
52 <table cellpadding='0' cellspacing='0' width='100%' border='0' class='list view'>
53 {include file='include/ListView/ListViewPagination.tpl'}
54 <tr height='20'>
55                 {if $prerow}
56                         <td width='1%' class="selectCol td_alt">
57                                 <div>
58                                 <input title="{sugar_translate label='LBL_SELECT_ALL_TITLE'}" type='checkbox' class='checkbox' name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, "mass[]", this.checked);' />
59                                 {$selectLink}
60                                 </div>
61                         </td>
62                 {/if}
63                 {if !empty($quickViewLinks)}
64                 <td class='td_alt' width='1%' style="padding: 0px;">&nbsp;</td>
65                 {/if}
66                 {counter start=0 name="colCounter" print=false assign="colCounter"}
67                 {foreach from=$displayColumns key=colHeader item=params}
68                         <th scope='col' width='{$params.width}%'>
69                                 <div style='white-space: normal;'width='100%' align='{$params.align|default:'left'}'>
70                 {if $params.sortable|default:true}
71                     {if $params.url_sort}
72                         <a href='{$pageData.urls.orderBy}{$params.orderBy|default:$colHeader|lower}' class='listViewThLinkS1'>
73                     {else}
74                         {if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
75                             <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'>
76                         {else}
77                             <a href='javascript:sListView.order_checks("ASC", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")' class='listViewThLinkS1'>
78                         {/if}
79                     {/if}
80                     {sugar_translate label=$params.label module=$pageData.bean.moduleDir}
81                                         &nbsp;&nbsp;
82                                         {if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
83                                                 {if $pageData.ordering.sortOrder == 'ASC'}
84                                                         {capture assign="imageName"}arrow_down.{$arrowExt}{/capture}
85                             {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_DESC'}{/capture}
86                                                         {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
87                                                 {else}
88                                                         {capture assign="imageName"}arrow_up.{$arrowExt}{/capture}
89                             {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_ASC'}{/capture}
90                                                         {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
91                                                 {/if}
92                                         {else}
93                                                 {capture assign="imageName"}arrow.{$arrowExt}{/capture}
94                         {capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT'}{/capture}
95                                                 {sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
96                                         {/if}
97                     </a>
98                                 {else}
99                     {if !isset($params.noHeader) || $params.noHeader == false} 
100                                           {sugar_translate label=$params.label module=$pageData.bean.moduleDir}
101                     {/if}
102                                 {/if}
103                                 </div>
104                         </th>
105                         {counter name="colCounter"}
106                 {/foreach}
107                 <td class='td_alt' nowrap="nowrap" width='1%'>&nbsp;</td>
108         </tr>
109                 
110         {counter start=$pageData.offsets.current print=false assign="offset" name="offset"}     
111         {foreach name=rowIteration from=$data key=id item=rowData}
112             {counter name="offset" print=false}
113         {assign var='scope_row' value=true}
114
115                 {if $smarty.foreach.rowIteration.iteration is odd}
116                         {assign var='_rowColor' value=$rowColor[0]}
117                 {else}
118                         {assign var='_rowColor' value=$rowColor[1]}
119                 {/if}
120                 <tr height='20' class='{$_rowColor}S1'>
121                         {if $prerow}
122                         <td width='1%' class='nowrap'>
123                          {if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
124                                         <input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
125                          {else}
126                     <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}'>
127                          {/if}
128                         </td>
129                         {/if}
130                         {if !empty($quickViewLinks)}
131             {capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}{/capture}
132             {capture assign=action}{if $act}{$act}{else}EditView{/if}{/capture}
133                         <td width='2%' nowrap>
134                 {if $pageData.rowAccess[$id].edit}
135                 <a title='{$editLinkString}' id="edit-{$rowData.ID}"
136 href="index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$rowData.ID}"
137                 >
138                     {capture name='tmp1' assign='alt_edit'}{sugar_translate label="LNK_EDIT"}{/capture}
139                     {sugar_getimage name="edit_inline.gif" attr='border="0" ' alt="$alt_edit"}</a>
140                 {/if}
141             </td>
142
143                         {/if}
144                         {counter start=0 name="colCounter" print=false assign="colCounter"}
145                         {foreach from=$displayColumns key=col item=params}
146                             {strip}
147                                 <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}">
148                                         {if $col == 'NAME' || $params.bold}<b>{/if}
149                                     {if $params.link && !$params.customCode}
150 {capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.moduleDir}{/if}{/capture}
151 {capture assign=action}{if $act}{$act}{else}DetailView{/if}{/capture}
152 {capture assign=record}{$rowData[$params.id]|default:$rowData.ID}{/capture}
153 {capture assign=url}index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$record}{/capture}
154                         <{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN} href="{sugar_ajax_url url=$url}">
155                                         {/if}
156                                         {if $params.customCode} 
157                                                 {sugar_evalcolumn_old var=$params.customCode rowData=$rowData}
158                                         {else}  
159                        {sugar_field parentFieldArray=$rowData vardef=$params displayType=ListView field=$col}
160                        
161                                         {/if}
162                                         {if empty($rowData.$col) && empty($params.customCode)}&nbsp;{/if}
163                                         {if $params.link && !$params.customCode}
164                                                 </{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN}>
165                     {/if}
166                     {if $col == 'NAME' || $params.bold}</b>{/if}
167                                 </td>
168                                 {/strip}
169                 {assign var='scope_row' value=false}
170                                 {counter name="colCounter"}
171                         {/foreach}
172                         <td align='right'>{$pageData.additionalDetails.$id}</td>
173                 </tr>
174         {foreachelse}
175         <tr height='20' class='{$rowColor[0]}S1'>
176             <td colspan="{$colCount}">
177                 <em>{$APP.LBL_NO_DATA}</em>
178             </td>
179         </tr> 
180         {/foreach}
181 {include file='include/ListView/ListViewPagination.tpl'}
182 </table>
183 {if $contextMenus}
184 <script type="text/javascript">
185 {$contextMenuScript}
186 {literal}
187 function lvg_nav(m,id,act,offset,t){
188     if(t.href.search(/#/) < 0){return;}
189     else{
190         if(act=='pte'){
191             act='ProjectTemplatesEditView';
192         }
193         else if(act=='d'){
194             act='DetailView';
195         }else if( act =='ReportsWizard'){
196             act = 'ReportsWizard';
197         }else{
198             act='EditView';
199         }
200     {/literal}
201         url = 'index.php?module='+m+'&offset=' + offset + '&stamp={$pageData.stamp}&return_module='+m+'&action='+act+'&record='+id;
202         t.href=url;
203     {literal}
204     }
205 }{/literal}
206 {literal}
207     function lvg_dtails(id){{/literal}
208         return SUGAR.util.getAdditionalDetails( '{$pageData.bean.moduleDir|default:$params.module}',id, 'adspan_'+id);{literal}}{/literal}
209 </script>
210 {/if}