2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 /*********************************************************************************
5 * SugarCRM Community Edition is a customer relationship management program developed by
6 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
40 require_once('include/MVC/View/views/view.list.php');
41 require_once('modules/EAPM/EAPM.php');
42 class MeetingsViewListbytype extends ViewList {
43 var $options = array('show_header' => false, 'show_title' => false, 'show_subpanels' => false, 'show_search' => true, 'show_footer' => false, 'show_javascript' => false, 'view_print' => false,);
45 function MeetingsViewListbytype() {
49 function listViewProcess(){
50 if (!$eapmBean = EAPM::getLoginInfo('LotusLive', true) ) {
51 $smarty = new Sugar_Smarty();
52 echo $smarty->fetch('include/externalAPI/LotusLive/LotusLiveSignup.'.$GLOBALS['current_language'].'.tpl');
56 $apiName = 'LotusLive';
57 $api = ExternalAPIFactory::loadAPI($apiName,true);
58 $api->loadEAPM($eapmBean);
60 $quickCheck = $api->quickCheckLogin();
61 if ( ! $quickCheck['success'] ) {
62 $errorMessage = string_format(translate('LBL_ERR_FAILED_QUICKCHECK','EAPM'), array('LotusLive'));
63 $errorMessage .= '<form method="POST" target="_EAPM_CHECK" action="index.php">';
64 $errorMessage .= '<input type="hidden" name="module" value="EAPM">';
65 $errorMessage .= '<input type="hidden" name="action" value="Save">';
66 $errorMessage .= '<input type="hidden" name="record" value="'.$eapmBean->id.'">';
67 $errorMessage .= '<input type="hidden" name="active" value="1">';
68 $errorMessage .= '<input type="hidden" name="closeWhenDone" value="1">';
69 $errorMessage .= '<input type="hidden" name="refreshParentWindow" value="1">';
71 $errorMessage .= '<br><input type="submit" value="'.$GLOBALS['app_strings']['LBL_EMAIL_OK'].'"> ';
72 $errorMessage .= '<input type="button" onclick="lastLoadedMenu=undefined;DCMenu.closeOverlay();return false;" value="'.$GLOBALS['app_strings']['LBL_CANCEL_BUTTON_LABEL'].'">';
73 $errorMessage .= '</form>';
78 $this->processSearchForm();
79 $this->params['orderBy'] = 'meetings.date_start';
80 $this->params['overrideOrder'] = true;
81 $this->lv->searchColumns = $this->searchForm->searchColumns;
82 $this->lv->show_action_dropdown = false;
83 $this->lv->multiSelect = false;
85 unset($this->searchForm->searchdefs['layout']['advanced_search']);
91 if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
92 $this->lv->ss->assign("SEARCH",false);
93 if ( !isset($_REQUEST['name_basic']) ) {
94 $_REQUEST['name_basic'] = '';
96 $this->lv->ss->assign('DCSEARCH',$_REQUEST['name_basic']);
97 $this->lv->setup($this->seed, 'include/ListView/ListViewDCMenu.tpl', $this->where, $this->params);
98 $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
99 echo $this->lv->display();
103 function listViewPrepare() {
104 $oldRequest = $_REQUEST;
105 parent::listViewPrepare();
106 $_REQUEST = $oldRequest;
109 function processSearchForm(){
110 // $type = 'LotusLiveDirect';
114 $two_hours_ago = $GLOBALS['db']->convert($GLOBALS['db']->quoted($timedate->asDb($timedate->getNow()->get("-2 hours"))), 'datetime');
116 $where = " meetings.type = '$type' AND meetings.status != 'Held' AND meetings.status != 'Not Held' AND meetings.date_start > {$two_hours_ago} AND ( meetings.assigned_user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' OR exists ( SELECT id FROM meetings_users WHERE meeting_id = meetings.id AND user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' AND deleted = 0 ) ) ";
118 if ( isset($_REQUEST['name_basic']) ) {
119 $name_search = trim($_REQUEST['name_basic']);
120 if ( ! empty($name_search) ) {
121 $where .= " AND meetings.name LIKE '".$GLOBALS['db']->quote($name_search)."%' ";
125 $this->where = $where;