source: sandbox/expresso-solr/expressoMail1_2/index.php @ 8057

Revision 8057, 32.4 KB checked in by gustavo, 8 years ago (diff)

Ticket #000 - Commit contendo o expresso com solr funcionando corretamente

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2                /***************************************************************************
3                * Expresso Livre                                                           *
4                * http://www.expressolivre.org                                             *
5                * --------------------------------------------                             *
6                *  This program is free software; you can redistribute it and/or modify it *
7                *  under the terms of the GNU General Public License as published by the   *
8                *  Free Software Foundation; either version 2 of the License, or (at your  *
9                *  option) any later version.                                              *
10                \**************************************************************************/
11               
12        $GLOBALS['phpgw_info']['flags'] = array(
13                'noheader' => False,
14                'nonavbar' => false,
15                'currentapp' => 'expressoMail1_2',
16                'enable_nextmatchs_class' => True
17        );
18        require_once('../header.inc.php');
19        $update_version = $GLOBALS['phpgw_info']['apps']['expressoMail1_2']['version'];
20        $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
21        echo "<script type='text/javascript'>var template = '".$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set']."';</script>";
22        echo '
23                <link rel="stylesheet" type="text/css" href="../prototype/plugins/freeow/style/freeow/freeow.css" >
24                <link rel="stylesheet" type="text/css" href="templates/default/main.css"></link>
25                <link rel="stylesheet" type="text/css" href="../phpgwapi/js/dftree/dftree.css"></link>
26                <link rel="Stylesheet" type="text/css" href="../prototype/plugins/jquery/jquery-ui.css" />
27                <link rel="stylesheet" type="text/css" href="../prototype/plugins/zebradialog/css/zebra_dialog.css"></link>
28                <link rel="stylesheet" href="../prototype/plugins/treeview/jquery.treeview.css" type="text/css" media="screen" />
29                <link rel="stylesheet" href="../prototype/modules/mail/css/followupflag.css" type="text/css" />
30                <link rel="stylesheet" href="../prototype/modules/attach_message/attach_message.css" type="text/css" />
31                <link rel="stylesheet" href="../prototype/plugins/jqgrid/themes/prognusone/jquery-ui-1.8.2.custom.css" type="text/css" />
32                <link rel="stylesheet" href="../prototype/plugins/jquery-picklist/jquery-picklist.css" type="text/css" />
33                <link rel="stylesheet" type="text/css" href="../prototype/plugins/contextmenu/jquery.contextMenu.css"></link>
34                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.css"></link>
35                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.print.css"></link>
36                <!-- <link rel="stylesheet" href="../prototype/modules/mail/css/label.css" type="text/css" /> -->
37               
38                <script src="js/modal/modal.js"></script>
39                <script type="text/javascript" src="../prototype/plugins/jquery/jquery.min.js"></script>
40                <script type="text/javascript" src="../prototype/plugins/jquery/jquery-ui.min.js"></script>
41                <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.contextMenu.js"></script>
42                <script src="../prototype/plugins/json2/json2.js" language="javascript"></script>
43                <script src="../prototype/plugins/jquery-picklist/jquery.ui.widget.min.js" language="javascript"></script>
44                <script src="../prototype/plugins/jquery-picklist/jquery-picklist.min.js" language="javascript"></script>
45                <script src="../prototype/plugins/ejs/ejs.js" language="javascript"></script>
46                <script src="../prototype/plugins/store/jquery.store.js" language="javascript"></script>
47                <script src="../prototype/plugins/farbtastic/farbtastic.js" language="javascript"></script>
48                <script src="../prototype/api/datalayer.js" language="javascript"></script>                                     
49                <script src="../prototype/api/rest.js" language="javascript"></script>                                 
50                <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script>
51                <script language="javascript">
52                        DataLayer.dispatchPath = "../prototype/";
53                        REST.dispatchPath = "../prototype/";
54                        REST.load("");
55                </script>                                       
56                <script src="../library/ckeditor/ckeditor.js" language="javascript" charset="utf-8"></script>
57                <script src="../library/ckeditor/adapters/jquery.js" language="javascript"></script>
58                <script src="../prototype/plugins/lazy/jquery.lazy.js" language="javascript"></script>
59                <script type="text/javascript" src="../prototype/plugins/zebradialog/javascript/zebra_dialog.js"></script>
60                <script src="js/rich_text_editor.js" type="text/javascript"></script>
61                <script src="js/base64.js" type="text/javascript"></script>
62                <script type="text/javascript" src="../prototype/plugins/treeview/jquery.treeview.js"></script>
63                <script type="text/javascript" src="../prototype/plugins/treeview/lib/jquery.cookie.js"></script>
64                <script type="text/javascript" src="../prototype/plugins/block/jquery.blockUI.js"></script>
65                <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script>         
66                <script src="../prototype/modules/mail/js/foldertree.js" type="text/javascript"></script>               
67                <script src="../prototype/modules/mail/js/label.js" type="text/javascript"></script>   
68                <script src="../prototype/modules/mail/js/followupflag.js" type="text/javascript"></script>
69                <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.min.js"></script>
70    ';
71        //---------------------------//
72        echo "<script src='js/globals.js?".$update_version."' type='text/javascript'></script>";
73        echo "<script src='js/sniff_browser.js?".$update_version."' type='text/javascript'></script>";
74        echo "<script src='js/QuickCatalogSearch.js' type='text/javascript'></script>";
75        //echo "<style type='text/css'>@import url(../phpgwapi/js/jscalendar/calendar-win2k-1.css);</style>";
76        //echo "<script src='../phpgwapi/js/jscalendar/calendar.js?".$update_version."' type='text/javascript'></script>";
77        //echo "<script src='../phpgwapi/js/jscalendar/calendar-setup.js?".$update_version."' type='text/javascript'></script>";
78        //echo "<script src='../phpgwapi/js/jscalendar/lang/calendar-br.js?".$update_version."' type='text/javascript'></script>";
79        echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script>
80                <script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>
81                <script type="text/javascript" src="../phpgwapi/js/x_tools/xtools.js?'.$update_version.'"></script>';   
82
83        /*
84         * TODO: implementar o controle como preferência do usuário
85         *
86         */
87        $jcarousel = false;
88        if ($jcarousel) {
89                //jcarousel
90                echo "\n".'<link rel="stylesheet" type="text/css" href="../library/jcarousel/skins/default/skin.css" />';
91                echo "\n".'<script src="../library/jcarousel/lib/jquery.jcarousel.min.js" type="text/javascript"></script>';
92                //fancybox
93                echo "\n".'<link rel="stylesheet" type="text/css" href="../library/fancybox/jquery.fancybox-1.3.4.css" />';             
94                echo "\n".'<script src="../library/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>';
95        }
96
97        echo "<div id='overlay' style='background-color: #AAAAAAA; opacity: .50; filter:Alpha(Opacity=50); height: 100%; width: 100%; position: absolute; top: 0; left: 0; visibility: hidden; z-index: 30000000000000000000000'></div>";
98        //Enable/Disable VoIP Service -> Voip Server Config
99        $voip_enabled = false;
100        $voip_groups = array();
101        if($GLOBALS['phpgw_info']['server']['voip_groups']) {
102                $emailVoip = false;
103                foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){
104                        $a_voip = explode(";",$voip_group);                     
105                        $voip_groups[] = $a_voip[1];
106                }
107                foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){                   
108                        if(array_search($group['account_name'],$voip_groups) !== FALSE){                 
109                                $voip_enabled = true;
110                                $emailVoip = $GLOBALS['phpgw_info']['server']['voip_email_redirect'];
111                                break;
112                        }
113                }
114        }
115        //Local messages
116        $_SESSION['phpgw_info']['server']['expressomail']['enable_local_messages'] = $current_config['enable_local_messages'];
117
118        // Get Data from ldap_manager and emailadmin.
119        $ldap_manager = CreateObject('contactcenter.bo_ldap_manager');
120        $boemailadmin   = CreateObject('emailadmin.bo');
121        $emailadmin_profile = $boemailadmin->getProfileList();
122    // Loading Admin Config Module
123    $c = CreateObject('phpgwapi.config','expressoMail1_2');
124    $c->read_repository();
125    $current_config = $c->config_data;
126   
127    // Loading Config Module
128    $conf = CreateObject('phpgwapi.config','phpgwapi');
129    $conf->read_repository();
130    $config = $conf->config_data;   
131
132    //Carrega Configuração global do expressoMail
133        $_SESSION['phpgw_info']['expresso']['expressoMail'] =  $current_config;
134   
135        $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
136        //$_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
137        $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server'];
138        $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null;
139        $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email'];
140        $_SESSION['phpgw_info']['server']['temp_dir'] = $GLOBALS['phpgw_info']['server']['temp_dir'];
141       
142        $preferences = $GLOBALS['phpgw']->preferences->read();
143        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_firefox_windows'] = $current_config['expressoMail_gears_firefox_windows'] ? $current_config['expressoMail_gears_firefox_windows'] : "";
144        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_firefox_linux'] = $current_config['expressoMail_gears_firefox_linux'] ? $current_config['expressoMail_gears_firefox_linux'] : "";
145        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_ie'] = $current_config['expressoMail_gears_ie'] ? $current_config['expressoMail_gears_ie'] : "";
146        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['enable_local_messages'];
147        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail'];
148        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] = $voip_enabled;
149        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect'] = $emailVoip;
150        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['outoffice'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['outoffice'];
151        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber'];
152        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache'];
153        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['expressoMail_ldap_identifier_recipient'] = $current_config['expressoMail_ldap_identifier_recipient'];
154        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_x_origin'] = $current_config['expressoMail_use_x_origin'];
155        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0";
156        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['notification_domains'] = $current_config['expressoMail_notification_domains'];
157        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['googlegears_url'] = $current_config['expressoMail_googlegears_url'];
158    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_assinar_criptografar'] = $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] ?  $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] : "0";
159    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] : "0";
160    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] : "0";
161    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] : "50";
162    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] : "4";
163    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['num_max_certs_to_cipher'] = $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] ?  $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] : "10";
164    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] : "0";
165        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] : "0";
166
167        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'] = $current_config['expressoMail_Max_attachment_size'] ? $current_config['expressoMail_Max_attachment_size']."M" : '';
168        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] : "0";
169        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['imap_max_folders'] = $current_config['expressoMail_imap_max_folders'];
170        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] : "50";
171        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['extended_info'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['extended_info']?$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['extended_info'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['extended_info']:'0';
172        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] : "0";
173        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] : "0";
174        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] : "0";
175        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] : 1;
176        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] : 0;
177        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['alert_message_attachment'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['alert_message_attachment'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['alert_message_attachment'] : 0;
178        //      ACL for block edit Personal Data.
179        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['enable_quickadd_telephonenumber'] = $current_config['expressoMail_enable_quickadd_telephonenumber'] == 'true' ? $current_config['expressoMail_enable_quickadd_telephonenumber'] : "";
180        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['enable_quickadd_telephonenumber']){
181                $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['blockpersonaldata'] = $GLOBALS['phpgw']->acl->check('blockpersonaldata',1,'preferences');               
182        }
183
184        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] : "0";
185       
186        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
187        $template->set_var("txt_loading",lang("Loading"));
188        $template->set_var("txt_clear_trash",lang("message(s) deleted from your trash folder."));
189    $template->set_var("new_message", lang("New Message"));
190        $template->set_var("lang_inbox", lang("Inbox"));
191    $template->set_var("refresh", lang("Refresh"));
192    $template->set_var("tools", lang("Tools"));
193        $template->set_var("lang_Open_Search_Window", lang("Open search window") . '...');
194        $template->set_var("lang_search_user", lang("Search user") . '...');
195        $template->set_var("upload_max_filesize",ini_get('upload_max_filesize'));
196        $template->set_var("msg_folder",$_GET['msgball']['folder']);
197        $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']);
198        $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']);
199        include_once dirname(__FILE__) . '/../header.inc.php';
200        require_once dirname(__FILE__) . '/../services/class.servicelocator.php';
201        $alternativeMailService = ServiceLocator::getService('ldap');
202        $AlternateEmailExpresso = Array();
203        $AlternateEmailExpresso = $alternativeMailService->getMailAlternateByUidNumber($_SESSION['phpgw_info']['expressomail']['user']['account_id']);
204        $template->set_var("user_email_alternative", implode(",", $AlternateEmailExpresso));   
205        $acc = CreateObject('phpgwapi.accounts');
206        $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn']));
207        $template->set_var("cyrus_delimiter",$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']);
208        $template->set_var("lang_contact_details", lang("Contact Details"));
209        $template->set_var("lang_catalog", lang("catalog"));
210        $template->set_var("lang_search", lang("search"));
211        $template->set_var("lang_page", lang("page"));
212        $template->set_var("lang_quick_search_users_dialog_title", lang("Quick Search Contacts"));
213        $template->set_var("lang_global_catalog", lang("Global Catalog"));
214        $template->set_var("lang_personal_catalog", lang("Personal Catalog"));
215        $template->set_var("lang_all_catalogs", lang("All Catalogs"));
216        // Fix problem with cyrus delimiter changes in preferences.
217        // Dots in names: enabled/disabled.
218        $save_in_folder = @preg_replace('/INBOX\//i', "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']);
219        $save_in_folder = @preg_replace('/INBOX./i', "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
220        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder;
221        // End Fix.
222
223        $template->set_file(Array('expressoMail' => 'index.tpl'));
224        $template->set_block('expressoMail','list');
225        $template->pfp('out','list');
226        $GLOBALS['phpgw']->common->phpgw_footer();
227   
228    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_enable_log_messages'] = $current_config['expressoMail_enable_log_messages'];
229       
230    // Begin Set Anti-Spam options.
231    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] = $current_config['expressoMail_command_for_ham'];
232    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam'];
233    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];   
234    echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\'
235           var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\'
236                  </script>';
237        // End Set Anti-Spam options.
238
239        // Begin Set Hidden Copy options.
240        $_SESSION['phpgw_info']['server']['expressomail']['allow_hidden_copy'] = $current_config['allow_hidden_copy'];
241        echo '<script> var allow_hidden_copy = \''.$current_config['allow_hidden_copy'].'\' </script>';
242        // End Set Hidden Copy options.
243       
244    // Set Imap Folder names options
245    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']   = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']     ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']             : lang("Trash");
246    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']  = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']       : lang("Drafts");
247    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']              : lang("Spam");
248    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']              : lang("Sent");
249
250    // gera paramero com tokens suportados ....
251    $var_tokens = '';
252    for($ii = 1; $ii < 11; $ii++)
253    {
254        if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
255            $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
256    }
257
258    if(!$var_tokens)
259    {
260        $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
261    }
262
263    echo '
264        <script> var special_folders = new Array(4);
265                special_folders[\'Trash\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";
266                special_folders[\'Drafts\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";
267                special_folders[\'Spam\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";
268                special_folders[\'Sent\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";
269        special_folders[\'Outbox\'] = "Outbox";
270                var trashfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";
271                var draftsfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";
272                var sentfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";
273                var spamfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";
274        var outboxfolder = "Outbox";
275
276                var token_param = "'.$var_tokens.'";
277                var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'";
278                var language = "'.$_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'].'";
279                var defaultCalendar = "'.  (isset($config['defaultCalendar']) ?  $config['defaultCalendar']  :  "calendar" )    .'";
280                $("#sideboxdragarea").hide();
281                $("#menu2Container").hide();
282    </script>
283
284        <!--<link rel="stylesheet" type="text/css" href="../prototype/modules/calendar/css/style.css" /> -->
285        <script type="text/javascript" src="../prototype/modules/filters/filters.js"></script>
286        ';
287
288    // End Set Imap Folder names options
289        //User info
290    echo "<script language='javascript'> var account_id = ".$GLOBALS['phpgw_info']['user']['account_id'].";var expresso_offline = false; var mail_archive_host = '127.0.0.1';</script>\n";
291       
292    //MAILARCHIVER-02
293    //todo: remover a linha abaixo e implementar a configuração
294    //$GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'] = true;
295        if ( $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'] == true ) {
296        $mail_archiver_host = '127.0.0.1';
297        //Check protocol in use (https or http)
298        if($_SERVER['HTTPS'] != 'on'){
299            $mail_archiver_protocol = "http";
300            $mail_archiver_port = "4333";
301        }
302        else{
303            $mail_archiver_protocol = "https";
304            $mail_archiver_port = "4334";
305        }   
306        //JS Variables (to add on jscripts variables, needed by dependence scripts following)
307        echo '<script type="text/javascript">var mail_archive_protocol="'.$mail_archiver_protocol.'"; var mail_archive_port="'.$mail_archiver_port.'";</script>'; 
308        //CXF custom js files, from MailArchiver ArcServUtil JS files repository, intended to be running already: CORS support and custom TRANSPORT object
309        echo '<script type="text/javascript" src="'.$mail_archiver_protocol.'://'.$mail_archiver_host.':'.$mail_archiver_port.'/arcservutil/cxf-addon-xdr-adapter.js"></script>';
310        echo '<script type="text/javascript" src="'.$mail_archiver_protocol.'://'.$mail_archiver_host.':'.$mail_archiver_port.'/arcservutil/cxf-addon-cors-request-object.js"></script>';
311        echo '<script type="text/javascript" src="'.$mail_archiver_protocol.'://'.$mail_archiver_host.':'.$mail_archiver_port.'/arcservutil/cxf-addon-cors-utils.js"></script>';
312        //CXF UTILS MAIN FILE
313        echo '<script type="text/javascript" src="'.$mail_archiver_protocol.'://'.$mail_archiver_host.':'.$mail_archiver_port.'/arcserv/ArchiveServices?js&nojsutils"></script>';   
314        //QueryConfig add on
315        echo '<script src="js/MAQueryConfig.js?'.$update_version.'"></script>';       
316        //Expresso serialized format add on
317        echo '<script src="js/MAExpressoPattern.js?'.$update_version.'"></script>';           
318        //echo $obj -> getFilesJs("js/mail_archiver.js," . $GLOBALS['phpgw_info']['flags']['update_version']);
319        echo '<script src="js/mail_archiver.js?'.$update_version.'"></script>';
320    }
321        //echo "<script language='javascript'> var account_id = ".$GLOBALS['phpgw_info']['user']['account_id'].";var expresso_offline = false;</script>";
322        $obj = createobject("expressoMail1_2.functions");
323        // setting timezone preference
324        $zones = $obj->getTimezones();
325        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));
326        // este arquivo deve ser carregado antes que
327        // os demais pois nele contem a função get_lang
328        // que é utilizada em diversas partes
329        echo $obj -> getFilesJs("js/common_functions.js",$update_version);
330        include("inc/load_lang.php");
331
332    // INCLUDE these JS Files:
333        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
334                echo "<script src='js/gears_init.js?".$update_version."'></script>";
335        echo '<script src="../phpgwapi/js/dftree/dftree.js?'.$update_version.'"></script>';
336   
337        $scripts = "js/abas.js," .
338                                "js/main.js," .
339                                "js/draw_api.js,";
340       
341        if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts'])
342        {
343                //echo $obj -> getFilesJs("js/shortcut.js", $update_version);
344                $scripts .= "js/shortcut.js,";
345        }
346        echo "<script> use_local_messages = ".$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']."</script>";         
347        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
348                $scripts .= "js/local_messages.js,";
349        $scripts .= "js/messages_controller.js," .
350                                "js/DropDownContacts.js," .
351                                "js/doiMenuData.js," .
352                                "js/connector.js";             
353        echo $obj -> getFilesJs($scripts, $update_version);
354        echo '
355                <script type="text/javascript">
356                        init();
357                </script>
358                <script type="text/javascript">connector.updateVersion = "'.$update_version.'";</script>';
359
360        // Get Preferences or redirect to preferences page.
361        $GLOBALS['phpgw']->preferences->read_repository();
362        //print_r($_SESSION['phpgw_info']['user']['preferences']['expressoMail']);
363        unset($_SESSION['phpgw_info']['expressomail']['user']['preferences']);
364        unset($_SESSION['phpgw_info']['expressomail']['user']['acl']);
365        unset($_SESSION['phpgw_info']['expressomail']['user']['apps']);
366        unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_users']);
367        unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_groups']);
368
369echo '
370        <link rel="stylesheet" type="text/css" href="../prototype/plugins/jquery.spinner/jquery.spinner.css"></link>
371        <link rel="stylesheet" type="text/css" href="../prototype/plugins/icalendar/jquery.icalendar.css"></link>
372        <link rel="stylesheet" type="text/css" href="../prototype/plugins/jquery.jrating/jRating.jquery.css"></link>
373        <link href="../prototype/modules/filters/filters.css" rel="stylesheet" type="text/css">
374        <link rel="stylesheet" href="../prototype/plugins/farbtastic/farbtastic.css" type="text/css" > 
375        <link rel="stylesheet" href="../prototype/plugins/fileupload/jquery.fileupload-ui.css" type="text/css" >               
376        <link rel="stylesheet" href="../prototype/plugins/jqgrid/css/ui.jqgrid.css" type="text/css" />
377        <link rel="Stylesheet" type="text/css" href="../prototype/plugins/timepicker/jquery-ui-timepicker-addon.css" />
378        <link rel="stylesheet" type="text/css" href="../prototype/modules/calendar/css/layout.css" />
379
380        <script type="text/javascript" src="../prototype/plugins/datejs/date-pt-BR.js"></script>
381        <script type="text/javascript" src="../prototype/plugins/datejs/sugarpak.js"></script>
382        <script type="text/javascript" src="../prototype/plugins/datejs/parser.js"></script>
383        <script type="text/javascript" src="../prototype/plugins/jq-raty/js/jquery.raty.min.js"></script>
384        <script type="text/javascript" src="../prototype/plugins/jquery.jrating/jRating.jquery.js"></script>           
385        <script type="text/javascript" src="../prototype/plugins/watermark/jquery.watermarkinput.js"></script>
386        <script type="text/javascript" src="../prototype/plugins/mask/jquery.maskedinput.js"></script>
387        <script type="text/javascript" src="../prototype/plugins/alphanumeric/jquery.alphanumeric.js"></script>
388        <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.fileupload.js"></script>
389        <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.iframe-transport.js"></script>
390        <script type="text/javascript" src="../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>   
391        <script type="text/javascript" src="../prototype/modules/calendar/js/timezone.js"></script>
392        <script type="text/javascript" src="../prototype/plugins/dateFormat/dateFormat.js"></script>
393        <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.date.js"></script>
394        <script type="text/javascript" src="../prototype/modules/calendar/js/desktop.notification.js"></script>
395        <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.codecs.js"></script>
396        <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.alarms.js"></script>
397        <script type="text/javascript" src="../prototype/modules/calendar/js/helpers.js"></script>
398        <script src="../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>
399        <script src="../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
400        <script src="../prototype/plugins/countdown/jquery.countdown.min.js" type="text/javascript"></script>
401        <script src="../prototype/plugins/countdown/jquery.countdown-pt-BR.js" type="text/javascript"></script>       
402        <script type="text/javascript" src="../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js"></script>
403        <script type="text/javascript" src="../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js"></script>
404        <script type="text/javascript" src="../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js"></script>
405    <script type="text/javascript">
406        User.moduleName = "expressoMail1_2";
407        </script>       
408';
409?>
410<!-----Expresso Mail - Version Updated:<?=$update_version?>-------->
Note: See TracBrowser for help on using the repository browser.