]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Documents/Popup_picker.html
Release 6.2.0
[Github/sugarcrm.git] / modules / Documents / Popup_picker.html
1 <!--
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 -->
38
39 <!-- BEGIN: main -->
40 <!-- BEGIN: SearchHeader -->
41 <table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
42 <tr>
43 <td>
44 <form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
45 <table width="100%" border="0" cellspacing="0" cellpadding="0">
46
47 <tr>
48 <td scope="row" nowrap="nowrap">{MOD.LBL_DOC_NAME}</td>
49 <td  nowrap="nowrap"><input type="text" name="document_name"  size="10" value="{DOCUMENT_NAME}"/></td>
50 <td scope="row" nowrap="nowrap">{MOD.LBL_DET_IS_TEMPLATE}</td>
51 <td  nowrap="nowrap"><select name="is_template"  >{IS_TEMPLATE_OPTIONS}</select></td>
52 </tr>
53 <tr>
54 <td scope="row" nowrap="nowrap">{MOD.LBL_DET_TEMPLATE_TYPE}</td>
55 <td  nowrap="nowrap"><select name="template_type"  >{TEMPLATE_TYPE_OPTIONS}</select></td>
56 <td scope="row" nowrap="nowrap">{MOD.LBL_CATEGORY_VALUE}</td>
57 <td  nowrap="nowrap"><select name="category_id"  >{CATEGORY_OPTIONS}</select></td>
58 </tr>
59 <tr>
60 <td scope="row" nowrap="nowrap">{MOD.LBL_SUBCATEGORY_VALUE}</td>
61 <td  nowrap="nowrap"><select name="subcategory_id"  >{SUB_CATEGORY_OPTIONS}</select></td>
62 <td align="right" colspan=2>
63 <input type="hidden" name="module" value="{MODULE_NAME}" />
64 <input type="hidden" name="action" value="Popup" />
65 <input type="hidden" name="query" value="true" />
66 <input type="hidden" name="func_name" value="" />
67 <input type="hidden" name="request_data" value="{request_data}" />
68 <input type="hidden" name="populate_parent" value="false" />
69 <input type="hidden" name="record_id" value="" />
70 <input type="submit" name="button" class="button"
71         title="{APP.LBL_SEARCH_BUTTON_TITLE}"
72         accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
73         value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
74 </td>
75 </tr>
76 </table>
77 </form>
78 </td>
79 </tr>
80 </table>
81 <!-- BEGIN: TreeView -->
82 <script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
83 <script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
84 <script type='text/javascript' src='include/javascript/yui/connection.js'></script>
85 {SITEURL}
86 {TREEHEADER}
87 {SET_RETURN_JS}
88 <script type="text/javascript">
89 <!--
90 /* initialize the popup request from the parent */
91
92 if(typeof window.document.forms['popup_query_form'] != 'undefined' && window.document.forms['popup_query_form'].request_data.value == "")
93 {
94         window.document.forms['popup_query_form'].request_data.value
95                 = JSON.stringify(window.opener.get_popup_request_data());
96 }
97 -->
98 </script>
99 <script>
100 function select_document(treeid) {
101         var node=YAHOO.namespace(treeid).selectednode;
102         send_back('Documents',node.data.id);
103 }
104
105 function populate_parent_search(treeid) {
106         var node=YAHOO.namespace(treeid).selectednode;
107                 
108         if (node.depth==1) {
109                 new_subcategory_id=node.data.id;
110                 if (new_subcategory_id == 'null') new_subcategory_id='';
111                 new_category_id=node.parent.data.id;
112                 if (new_category_id == 'null') new_category_id='';
113         } else {
114                 new_category_id=node.data.id;
115                 if (new_category_id == 'null') new_category_id='';
116                 new_subcategory_id='';  
117         }
118
119         if(!window.opener.document.getElementById('Documentsadvanced_searchSearchForm')) {
120                 window.opener.location = 'index.php?searchFormTab=advanced_search&module=Documents&action=index&query=true&category_id_advanced' +'='+escape(new_category_id)+'&subcategory_id_advanced='+escape(new_subcategory_id);
121         } else {
122                 var searchTab = (window.opener.document.getElementById('Documentsadvanced_searchSearchForm').style.display == '') ? 'advanced' : 'basic';
123                 window.opener.location = 'index.php?searchFormTab='+searchTab+'_search&module=Documents&action=index&query=true&category_id_'+searchTab+'='+escape(new_category_id)+'&subcategory_id_'+searchTab+'='+escape(new_subcategory_id);
124         }
125         window.close();
126 }
127
128 function populate_search(treeid) {
129         var node=YAHOO.namespace(treeid).selectednode;
130
131         if (node.depth==1) {
132                 new_subcategory_id=node.data.id;
133                 if (new_subcategory_id == 'null') new_subcategory_id='';
134                 new_category_id=node.parent.data.id;
135                 if (new_category_id == 'null') new_category_id='';
136         } else {
137                 new_category_id=node.data.id;
138                 if (new_category_id == 'null') new_category_id='';
139                 new_subcategory_id='';  
140         }
141
142
143         document.popup_query_form.subcategory_id.value=new_subcategory_id;
144         document.popup_query_form.category_id.value=new_category_id;
145         
146         document.popup_query_form.submit();
147 }
148 </script>
149
150 <table cellpadding="0" cellspacing="0" style="border-left:1px solid; border-right:1px solid; border-bottom:1px solid" width="100%" class="edit view">
151
152 <tr>
153         <td width="100%" valign="top" style="border-right: 1px">
154                 <div id="doctree">
155                         {TREEINSTANCE}
156                 </div>
157         </td>
158 </tr>
159 </table>
160 <!-- END: TreeView -->
161
162
163
164 <!-- END: SearchHeader -->
165 <table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
166 <!-- BEGIN: list_nav_row -->
167 {PAGINATION}
168 <!-- END: list_nav_row -->
169 <tr height="20" >
170 <td scope="col" width="33%"  nowrap="nowrap"><a href="{ORDER_BY}document_name" class="listViewThLinkS1">{MOD.LBL_LIST_DOCUMENT}{arrow_start}{name_arrow}{arrow_end}</a></td>
171 <td scope="col" width="33%"  nowrap="nowrap">{MOD.LBL_LIST_REVISION}</td>
172 <td scope="col" width="34%"  nowrap="nowrap">{MOD.LBL_LIST_STATUS}</td>
173 </tr>
174 <!-- BEGIN: row -->
175 <tr height="20" class="{ROW_COLOR}S1">
176 <td scope="row" valign="top"><a href="#" onclick="send_back('Documents','{DOCUMENT.ID}');" >{DOCUMENT.DOCUMENT_NAME}</a></td>
177 <td valign="top">{DOCUMENT.LATEST_REVISION}</td>
178 <td valign="top">{DOCUMENT.STATUS_ID}</td>
179 </tr>
180
181 <!-- END: row -->
182 </table>
183 {ASSOCIATED_JAVASCRIPT_DATA}
184 <!-- END: main -->