a2cfff4929bbb88a4c30998cbca5ca0dd6be5d56
[mailer.git] / inc / modules / member / what-support.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 02/29/2004 *
4  * ================                             Last change: 04/23/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-support.php                                 *
8  * -------------------------------------------------------------------- *
9  * Short description : Contact support                                  *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Support kontaktieren                             *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
23  * This program is free software; you can redistribute it and/or modify *
24  * it under the terms of the GNU General Public License as published by *
25  * the Free Software Foundation; either version 2 of the License, or    *
26  * (at your option) any later version.                                  *
27  *                                                                      *
28  * This program is distributed in the hope that it will be useful,      *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
31  * GNU General Public License for more details.                         *
32  *                                                                      *
33  * You should have received a copy of the GNU General Public License    *
34  * along with this program; if not, write to the Free Software          *
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
41         die();
42 }  elseif (!isMember()) {
43         redirectToIndexMemberOnlyModule();
44 }
45
46 // Add description as navigation point
47 addMenuDescription('member', __FILE__);
48
49 if ((!isExtensionActive('support')) && (!isAdmin())) {
50         loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('support'));
51         return;
52 } // END - if
53
54 if ((!isFormSent()) || (!isPostRequestElementSet(('qsummary')))) {
55         // Output form
56         loadTemplate('member_support_form');
57 } else {
58         // Load mail template based on your member's decision
59         if (getExtensionVersion('admins') >= '0.4.1') {
60                 $a_tpl = 'admin_support-' . postRequestElement('qsummary');
61         } else {
62                 $message_a = loadEmailTemplate('admin_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId());
63         }
64         $message_m = loadEmailTemplate('member_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId());
65
66         // Select right subject
67         switch (postRequestElement('qsummary')) {
68                 case 'ordr':
69                         $subj_a = getMessage('SUPPORT_SUBJ_ADMIN_ORDER');
70                         $subj_m = getMessage('SUPPORT_SUBJ_MEMBER_ORDER');
71                         break;
72
73                 case 'reflink':
74                         $subj_a = getMessage('SUPPORT_SUBJ_ADMIN_REFLINK');
75                         $subj_m = getMessage('SUPPORT_SUBJ_MEMBER_REFLINK');
76                         break;
77
78                 case 'unconfirmed':
79                         $subj_a = getMessage('SUPPORT_SUBJ_ADMIN_UNCONFIRMED');
80                         $subj_m = getMessage('SUPPORT_SUBJ_MEMBER_UNCONFIRMED');
81                         break;
82         } // END - switch
83
84         // Send mail to admin
85         sendAdminNotification($subj_a, $a_tpl, array('text' => postRequestElement('qdetails')), getUserId());
86
87         // Send mail to user
88         sendEmail(getUserId(), $subj_m, $message_m);
89
90         // Drop a message in the admin's area
91         createNewTask($subj_a, postRequestElement('qsummary') . ' : ' . postRequestElement('qdetails'), 'SUPPORT_MEMBER', getUserId());
92
93         // Form sent
94         loadTemplate('member_support_contcted');
95 }
96
97 // [EOF]
98 ?>