]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailTemplates/PopupDocumentsCampaignTemplate.php
Release 6.5.0
[Github/sugarcrm.git] / modules / EmailTemplates / PopupDocumentsCampaignTemplate.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
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  * Description:  TODO: To be written.
41  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
42  * All Rights Reserved.
43  * Contributor(s): ______________________________________..
44  ********************************************************************************/
45 require_once('modules/Documents/Popup_picker.php');
46 $popup = new Popup_Picker();
47
48 global $theme;
49 global $current_mod_strings;
50 global $app_strings;
51 global $currentModule;
52 global $sugar_version, $sugar_config;
53 global $app_list_strings;
54
55 $current_mod_strings = return_module_language($current_language, 'Documents');
56 $output_html = '';
57 $where = '';
58
59 $where = $popup->_get_where_clause();
60
61
62
63 $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
64 $document_name = empty($_REQUEST['document_name']) ? '' : $_REQUEST['document_name'];
65 $category_id = empty($_REQUEST['category_id']) ? '' : $_REQUEST['category_id'];
66 $subcategory_id = empty($_REQUEST['subcategory_id']) ? '' : $_REQUEST['subcategory_id'];
67 $template_type = empty($_REQUEST['template_type']) ? '' : $_REQUEST['template_type'];
68 $is_template = empty($_REQUEST['is_template']) ? '' : $_REQUEST['is_template'];
69 $document_revision_id = empty($_REQUEST['document_revision_id']) ? '' : $_REQUEST['document_revision_id'];
70
71
72 $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
73 $button  = "<form action='index.php' method='post' name='form' id='form'>\n";
74 if(!$hide_clear_button)
75 {
76         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
77                 .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
78                 .$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
79 }
80 $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
81         .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
82         .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
83         .$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
84 $button .= "</form>\n";
85
86
87 $form = new XTemplate('modules/EmailTemplates/PopupDocumentsCampaignTemplate.html');
88 $form->assign('MOD', $current_mod_strings);
89 $form->assign('APP', $app_strings);
90 $form->assign('THEME', $theme);
91 $form->assign('MODULE_NAME', $currentModule);
92 $form->assign('NAME', $name);
93 $form->assign('DOCUMENT_NAME', $document_name);
94 $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
95 $form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
96
97 $form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_category_dom'], $category_id));
98 $form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_subcategory_dom'], $subcategory_id));
99 $form->assign("IS_TEMPLATE_OPTIONS", get_select_options_with_id($app_list_strings['checkbox_dom'], $is_template));
100 $form->assign("TEMPLATE_TYPE_OPTIONS", get_select_options_with_id($app_list_strings['document_template_type_dom'], $template_type));
101
102
103 ob_start();
104 insert_popup_header($theme);
105 $output_html .= ob_get_contents();
106 ob_end_clean();
107
108 $output_html .= get_form_header($current_mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
109
110 $form->parse('main.SearchHeader');
111 $output_html .= $form->text('main.SearchHeader');
112
113 // Reset the sections that are already in the page so that they do not print again later.
114 $form->reset('main.SearchHeader');
115
116 // create the listview
117 $seed_bean = new Document();
118 $ListView = new ListView();
119 $ListView->show_export_button = false;
120 $ListView->process_for_popups = true;
121 $ListView->setXTemplate($form);
122 $ListView->setHeaderTitle($current_mod_strings['LBL_LIST_FORM_TITLE']);
123 $ListView->setHeaderText($button);
124 $ListView->setQuery($where, '', 'document_name', 'DOCUMENT');
125 $ListView->setModStrings($current_mod_strings);
126
127 ob_start();
128 $ListView->processListView($seed_bean, 'main', 'DOCUMENT');
129 $output_html .= ob_get_contents();
130 ob_end_clean();
131                 
132 $output_html .= insert_popup_footer();
133
134
135 echo $output_html;
136
137
138
139
140
141
142
143
144
145
146 ?>