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.
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.
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
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
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.
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.
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 ********************************************************************************/
38 /*********************************************************************************
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();
49 global $current_mod_strings;
51 global $currentModule;
52 global $sugar_version, $sugar_config;
53 global $app_list_strings;
55 $current_mod_strings = return_module_language($current_language, 'Documents');
59 $where = $popup->_get_where_clause();
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'];
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)
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";
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";
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);
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));
104 insert_popup_header($theme);
105 $output_html .= ob_get_contents();
108 $output_html .= get_form_header($current_mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
110 $form->parse('main.SearchHeader');
111 $output_html .= $form->text('main.SearchHeader');
113 // Reset the sections that are already in the page so that they do not print again later.
114 $form->reset('main.SearchHeader');
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);
128 $ListView->processListView($seed_bean, 'main', 'DOCUMENT');
129 $output_html .= ob_get_contents();
132 $output_html .= insert_popup_footer();