]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Meetings/SubPanelViewInvitees.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Meetings / SubPanelViewInvitees.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
46
47
48
49 global $currentModule;
50
51 global $mod_strings;
52 global $app_strings;
53
54 global $theme;
55 global $focus;
56 global $action;
57 global $locale;
58
59
60
61 // focus_list is the means of passing data to a SubPanelView.
62 global $focus_list;
63
64 $button  = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
65 $button .= "<input type='hidden' name='module' value='Contacts'>\n";
66 if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
67 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
68 $button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
69 $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
70 $button .= "<input type='hidden' name='action'>\n";
71 $button .= "<tr><td>&nbsp;</td>";
72 if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
73 else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."'  type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
74 $button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."'  type='button' class='button' value='".$app_strings['LBL_SELECT_USER_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
75 $button .= "</tr></form></table>\n";
76
77 // Stick the form header out there.
78 echo get_form_header($mod_strings['LBL_INVITEE'], $button, false);
79 $xtpl=new XTemplate ('modules/Meetings/SubPanelViewInvitees.html');
80 $xtpl->assign("MOD", $mod_strings);
81 $xtpl->assign("APP", $app_strings);
82 $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
83 $xtpl->assign("MEETING_ID", $focus->id);
84
85 $oddRow = true;
86 foreach($focus_users_list as $user)
87 {
88         $user_fields = array(
89                 'USER_NAME' => $user->user_name,
90                 'FULL_NAME' => $locale->getLocaleFormattedName($user->first_name, $user->last_name),
91                 'ID' => $user->id,
92                 'EMAIL' => $user->email1,
93                 'PHONE_WORK' => $user->phone_work
94         );
95
96         $xtpl->assign("USER", $user_fields);
97
98         if($oddRow)
99     {
100         //todo move to themes
101                 $xtpl->assign("ROW_COLOR", 'oddListRow');
102     }
103     else
104     {
105         //todo move to themes
106                 $xtpl->assign("ROW_COLOR", 'evenListRow');
107     }
108     $oddRow = !$oddRow;
109
110         $xtpl->parse("users.row");
111 // Put the rows in.
112 }
113
114 $xtpl->parse("users");
115 $xtpl->out("users");
116
117 $oddRow = true;
118 foreach($focus_contacts_list as $contact)
119 {
120         $contact_fields = array(
121                 'FIRST_NAME' => $contact->first_name,
122                 'LAST_NAME' => $contact->last_name,
123                 'ACCOUNT_NAME' => $contact->account_name,
124                 'ID' => $contact->id,
125                 'EMAIL' => $contact->email1,
126                 'PHONE_WORK' => $contact->phone_work
127         );
128
129         $xtpl->assign("CONTACT", $contact_fields);
130
131         if($oddRow)
132     {
133         //todo move to themes
134                 $xtpl->assign("ROW_COLOR", 'oddListRow');
135     }
136     else
137     {
138         //todo move to themes
139                 $xtpl->assign("ROW_COLOR", 'evenListRow');
140     }
141     $oddRow = !$oddRow;
142
143         $xtpl->parse("contacts.row");
144 // Put the rows in.
145 }
146
147 $xtpl->parse("contacts");
148 $xtpl->out("contacts");
149
150 ?>