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-2011 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 ********************************************************************************/
49 global $currentModule;
58 // focus_list is the means of passing data to a SubPanelView.
61 $button = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
62 $button .= "<input type='hidden' name='module' value='Contacts'>\n";
63 if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
64 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
65 $button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
66 $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
67 $button .= "<input type='hidden' name='action'>\n";
68 $button .= "<tr><td> </td>";
69 if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' 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";
70 else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' 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";
71 $button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_USER_BUTTON_KEY']."' 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";
72 $button .= "</tr></form></table>\n";
74 // Stick the form header out there.
75 echo get_form_header($mod_strings['LBL_INVITEE'], $button, false);
76 $xtpl=new XTemplate ('modules/Emails/SubPanelViewRecipients.html');
77 $xtpl->assign("MOD", $mod_strings);
78 $xtpl->assign("APP", $app_strings);
79 $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
80 $xtpl->assign("EMAIL_ID", $focus->id);
81 $xtpl->assign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_REMOVE']));
82 $xtpl->assign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"', null,null,'.gif',$app_strings['LNK_EDIT']));
84 foreach($focus_users_list as $user)
87 'USER_NAME' => $user->user_name,
88 'FULL_NAME' => $user->first_name." ".$user->last_name,
90 'EMAIL' => $user->email1,
91 'PHONE_WORK' => $user->phone_work
94 $xtpl->assign("USER", $user_fields);
99 $xtpl->assign("ROW_COLOR", 'oddListRow');
103 //todo move to themes
104 $xtpl->assign("ROW_COLOR", 'evenListRow');
108 $xtpl->parse("users.row");
112 $xtpl->parse("users");
116 print count($focus_contacts_list);
118 foreach($focus_contacts_list as $contact)
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
129 $xtpl->assign("CONTACT", $contact_fields);
133 //todo move to themes
134 $xtpl->assign("ROW_COLOR", 'oddListRow');
138 //todo move to themes
139 $xtpl->assign("ROW_COLOR", 'evenListRow');
143 $xtpl->parse("contacts.row");
147 $xtpl->parse("contacts");
148 $xtpl->out("contacts");