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 ********************************************************************************/
58 function Popup_Picker()
66 function _get_where_clause()
69 if(isset($_REQUEST['query']))
71 $where_clauses = array();
72 append_where_clause($where_clauses, "target_id", "campaign_log.target_id");
73 //append_where_clause($where_clauses, "last_name", "prospects.last_name");
75 $where = generate_where_statement($where_clauses);
78 $where .=" activity_type='targeted'";
88 function process_page()
93 global $app_list_strings;
94 global $currentModule;
95 global $sugar_version, $sugar_config;
100 $where = $this->_get_where_clause();
104 $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
105 $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
107 $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
108 $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
110 $button = "<form action='index.php' method='post' name='form' id='form'>\n";
111 //START:FOR MULTI-SELECT
113 if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
115 $button .= "<input type='button' name='button' class='button' onclick=\"send_back_selected('Prospects',document.MassUpdate,'mass[]','" .$app_strings['ERR_NOTHING_SELECTED']."');\" title='"
116 .$app_strings['LBL_SELECT_BUTTON_TITLE']."' value=' "
117 .$app_strings['LBL_SELECT_BUTTON_LABEL']." ' />\n";
119 //END:FOR MULTI-SELECT
120 if(!$hide_clear_button)
122 $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
123 .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value=' "
124 .$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
126 $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
127 .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
128 .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
129 .$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
130 $button .= "</form>\n";
132 $form = new XTemplate('modules/CampaignLog/Popup_picker.html');
133 $form->assign('MOD', $mod_strings);
134 $form->assign('APP', $app_strings);
135 $form->assign('THEME', $theme);
136 $form->assign('MODULE_NAME', $currentModule);
137 $form->assign('request_data', $request_data);
141 insert_popup_header($theme);
142 $output_html .= ob_get_contents();
145 //$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
147 $form->parse('main.SearchHeader');
148 $output_html .= $form->text('main.SearchHeader');
150 // Reset the sections that are already in the page so that they do not print again later.
151 $form->reset('main.SearchHeader');
153 // create the listview
154 $seed_bean = new CampaignLog();
155 $ListView = new ListView();
156 $ListView->show_export_button = false;
157 $ListView->process_for_popups = true;
158 $ListView->setXTemplate($form);
159 $ListView->multi_select_popup=$multi_select; //FOR MULTI-SELECT
160 if ($multi_select) $ListView->xTemplate->assign("TAG_TYPE","SPAN"); else $ListView->xTemplate->assign("TAG_TYPE","A");//FOR MULTI-SELECT
161 //$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']); //FOR MULTI-SELECT
162 //$ListView->setHeaderText($button); //FOR MULTI-SELECT
163 $ListView->setQuery($where, '', 'campaign_name1', 'CAMPAIGNLOG');
164 $ListView->setModStrings($mod_strings);
167 $output_html .= get_form_header($mod_strings['LBL_LIST_FORM_TITLE'], $button, false); //FOR MULTI-SELECT
168 $ListView->processListView($seed_bean, 'main', 'CAMPAIGNLOG');
169 $output_html .= ob_get_contents();
172 $output_html .= insert_popup_footer();
175 } // end of class Popup_Picker