]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/views/view.classic.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Campaigns / views / view.classic.php
1 <?php
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 require_once('include/MVC/View/SugarView.php');
38 require_once('include/MVC/Controller/SugarController.php');
39
40 class CampaignsViewClassic extends SugarView
41 {       
42         function CampaignsViewClassic()
43         {
44                 parent::SugarView();
45                 $this->type = $this->action;
46         }       
47         
48         /**
49          * @see SugarView::display()
50          */
51         public function display()
52         {
53                 // Call SugarController::getActionFilename to handle case sensitive file names
54                 $file = SugarController::getActionFilename($this->action);
55                 if(file_exists('custom/modules/' . $this->module . '/'. $file . '.php')){
56                         $this->includeClassicFile('custom/modules/'. $this->module . '/'. $file . '.php');
57                         return true;
58                 }elseif(file_exists('modules/' . $this->module . '/'. $file . '.php')){
59                         $this->includeClassicFile('modules/'. $this->module . '/'. $file . '.php');
60                         return true;
61                 }
62                 return false;
63         }       
64         
65     /**
66          * @see SugarView::_getModuleTitleParams()
67          */
68         protected function _getModuleTitleParams($browserTitle = false)
69         {
70         $params = array();
71         $params[] = $this->_getModuleTitleListParam($browserTitle);
72         if (isset($this->action)){
73                 switch($_REQUEST['action']){
74                                 case 'WizardHome':
75                                         if(!empty($this->bean->id))
76                                         {
77                                                 $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->name."</a>";
78                                         }
79                                         $params[] = $GLOBALS['mod_strings']['LBL_CAMPAIGN_WIZARD'];
80                                         break;
81                                     case 'WebToLeadCreation':
82                                         $params[] = $GLOBALS['mod_strings']['LBL_LEAD_FORM_WIZARD'];
83                                         break;
84                                 case 'WizardNewsletter':
85                                         if(!empty($this->bean->id))
86                                         {
87                                                 $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$GLOBALS['mod_strings']['LBL_NEWSLETTER_TITLE']."</a>";
88                                         }
89                                         $params[] = $GLOBALS['mod_strings']['LBL_CREATE_NEWSLETTER'];
90                                         break;
91                                 case 'CampaignDiagnostic':
92                                         $params[] = $GLOBALS['mod_strings']['LBL_CAMPAIGN_DIAGNOSTICS'];
93                                         break;  
94                                 case 'WizardEmailSetup':
95                                         $params[] = $GLOBALS['mod_strings']['LBL_EMAIL_SETUP_WIZARD_TITLE'];
96                                         break;    
97                                 case 'TrackDetailView':
98                                         if(!empty($this->bean->id))
99                                         {
100                                                 $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->name."</a>";
101                                         }
102                                         $params[] = $GLOBALS['mod_strings']['LBL_LIST_TO_ACTIVITY'];
103                                         break;                                                                                                  
104                 }//switch
105         }//fi
106                 
107         return $params;
108     }
109 }