]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Emails/PopupDocuments.php
Release 6.1.4
[Github/sugarcrm.git] / modules / Emails / PopupDocuments.php
1 <?php
2 //_pp($_REQUEST);
3 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 /*********************************************************************************
5  * SugarCRM is a customer relationship management program developed by
6  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7  * 
8  * This program is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Affero General Public License version 3 as published by the
10  * Free Software Foundation with the addition of the following permission added
11  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
12  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
13  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14  * 
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
18  * details.
19  * 
20  * You should have received a copy of the GNU Affero General Public License along with
21  * this program; if not, see http://www.gnu.org/licenses or write to the Free
22  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23  * 02110-1301 USA.
24  * 
25  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
26  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27  * 
28  * The interactive user interfaces in modified source and object code versions
29  * of this program must display Appropriate Legal Notices, as required under
30  * Section 5 of the GNU Affero General Public License version 3.
31  * 
32  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
33  * these Appropriate Legal Notices must retain the display of the "Powered by
34  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
35  * technical reasons, the Appropriate Legal Notices must display the words
36  * "Powered by SugarCRM".
37  ********************************************************************************/
38
39 /*********************************************************************************
40
41  * Description:  TODO: To be written.
42  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
43  * All Rights Reserved.
44  * Contributor(s): ______________________________________..
45  ********************************************************************************/
46 require_once('modules/Documents/Popup_picker.php');
47 $popup = new Popup_Picker();
48
49 global $theme;
50 global $current_mod_strings;
51 global $app_strings;
52 global $currentModule;
53 global $sugar_version, $sugar_config;
54 global $app_list_strings;
55
56 $current_mod_strings = return_module_language($current_language, 'Documents');
57 $output_html = '';
58 $where = '';
59
60 $where = $popup->_get_where_clause();
61
62
63
64 $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
65 $document_name = empty($_REQUEST['document_name']) ? '' : $_REQUEST['document_name'];
66 $category_id = empty($_REQUEST['category_id']) ? '' : $_REQUEST['category_id'];
67 $subcategory_id = empty($_REQUEST['subcategory_id']) ? '' : $_REQUEST['subcategory_id'];
68 $template_type = empty($_REQUEST['template_type']) ? '' : $_REQUEST['template_type'];
69 $is_template = empty($_REQUEST['is_template']) ? '' : $_REQUEST['is_template'];
70 $document_revision_id = empty($_REQUEST['document_revision_id']) ? '' : $_REQUEST['document_revision_id'];
71
72 //$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
73
74 $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
75 $button  = "<form action='index.php' method='post' name='form' id='form'>\n";
76 if(!$hide_clear_button)
77 {
78         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
79                 .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
80                 .$app_strings['LBL_CLEAR_BUTTON_KEY']."' value='  "
81                 .$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
82 }
83 $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
84         .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
85         .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
86         .$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
87 $button .= "</form>\n";
88
89 $form = new XTemplate('modules/Emails/PopupDocuments.html');
90 $form->assign('MOD', $current_mod_strings);
91 $form->assign('APP', $app_strings);
92 $form->assign('THEME', $theme);
93 $form->assign('MODULE_NAME', $currentModule);
94 $form->assign('NAME', $name);
95 $form->assign('DOCUMENT_NAME', $document_name);
96 $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
97 $form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
98
99 //$form->assign('request_data', $request_data);
100 $form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_category_dom'], $category_id));
101 $form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_subcategory_dom'], $subcategory_id));
102 $form->assign("IS_TEMPLATE_OPTIONS", get_select_options_with_id($app_list_strings['checkbox_dom'], $is_template));
103 $form->assign("TEMPLATE_TYPE_OPTIONS", get_select_options_with_id($app_list_strings['document_template_type_dom'], $template_type));
104
105
106
107 ob_start();
108 insert_popup_header($theme);
109 $output_html .= ob_get_contents();
110 ob_end_clean();
111
112 $output_html .= get_form_header($current_mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
113
114 $form->parse('main.SearchHeader');
115 $output_html .= $form->text('main.SearchHeader');
116
117 // Reset the sections that are already in the page so that they do not print again later.
118 $form->reset('main.SearchHeader');
119
120 // create the listview
121 $seed_bean = new Document();
122 $ListView = new ListView();
123 $ListView->show_export_button = false;
124 $ListView->process_for_popups = true;
125 $ListView->setXTemplate($form);
126 $ListView->setHeaderTitle($current_mod_strings['LBL_LIST_FORM_TITLE']);
127 $ListView->setHeaderText($button);
128 $ListView->setQuery($where, '', 'document_name', 'DOCUMENT');
129 $ListView->setModStrings($current_mod_strings);
130
131 ob_start();
132 $ListView->processListView($seed_bean, 'main', 'DOCUMENT');
133 $output_html .= ob_get_contents();
134 ob_end_clean();
135                 
136 $output_html .= insert_popup_footer();
137
138
139 echo $output_html;
140
141
142
143
144
145
146
147
148
149
150 ?>