Index: /trunk/mobile/setup/phpgw_pt-br.lang
===================================================================
--- /trunk/mobile/setup/phpgw_pt-br.lang (revision 611)
+++ /trunk/mobile/setup/phpgw_pt-br.lang (revision 691)
@@ -1,4 +1,6 @@
Calendar mobile pt-br Agenda
contact center mobile pt-br Endereços
+download attachs mobile pt-br Deseja baixar anexos em e-mails?
+Download mobile pt-br Baixar
E-mail mobile pt-br Caixa de Entrada
From mobile pt-br De
@@ -56,2 +58,5 @@
alarm mobile pt-br Alarme
To Delegate mobile pt-br Delegar
+What is the maximum number of messages per page? mobile pt-br Qual o número máximo de mensagens por página?
+Option mobile pt-br Opção
+Value mobile pt-br Valor
Index: /trunk/mobile/setup/setup.inc.php
===================================================================
--- /trunk/mobile/setup/setup.inc.php (revision 686)
+++ /trunk/mobile/setup/setup.inc.php (revision 691)
@@ -30,5 +30,5 @@
/* The hooks this app includes, needed for hooks registration */
//$setup_info['mobile']['hooks'][] = 'admin';
- //$setup_info['mobile']['hooks'][] = 'preferences';
+ $setup_info['mobile']['hooks'][] = 'preferences';
//$setup_info['mobile']['hooks'][] = 'config_validate';
Index: /trunk/mobile/inc/hook_preferences.inc.php
===================================================================
--- /trunk/mobile/inc/hook_preferences.inc.php (revision 691)
+++ /trunk/mobile/inc/hook_preferences.inc.php (revision 691)
@@ -0,0 +1,26 @@
+ *
+ * sponsored by Thyamad - http://www.thyamad.com
+ * ------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU General Public License as published by the *
+ * Free Software Foundation; either version 2 of the License, or (at your *
+ * option) any later version. *
+ \***************************************************************************/
+
+{
+// Only Modify the $file and $title variables.....
+ $title = $appname;
+ $file = Array(
+ 'Preferences' => $GLOBALS['phpgw']->link('/index.php','menuaction=mobile.ui_preferences.index'),
+ //'Grant Access' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app='.$appname),
+ //'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname . '&cats_level=True&global_cats=True')
+ );
+//Do not modify below this line
+ display_section($appname,$title,$file);
+}
+?>
Index: /trunk/mobile/inc/class.ui_preferences.inc.php
===================================================================
--- /trunk/mobile/inc/class.ui_preferences.inc.php (revision 691)
+++ /trunk/mobile/inc/class.ui_preferences.inc.php (revision 691)
@@ -0,0 +1,90 @@
+ *
+ * sponsored by Thyamad - http://www.thyamad.com
+ * ------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU General Public License as published by the *
+ * Free Software Foundation; either version 2 of the License, or (at your *
+ * option) any later version. *
+ \***************************************************************************/
+
+
+ class ui_preferences
+ {
+ var $public_functions = array(
+ 'index' => true,
+ 'set_preferences' => true,
+ );
+
+ function index()
+ {
+ $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Preferences').' - '.lang('Mobile');
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+
+ $GLOBALS['phpgw']->template->set_file(array('pref' => 'preferences.tpl'));
+
+ /* Get Saved Preferences */
+ $prefs = $GLOBALS['phpgw']->preferences->read();
+
+ if($prefs['mobile']['download_attach']==1)
+ $GLOBALS['phpgw']->template->set_var('download_attach_option_Yes_selected', 'selected');
+ else
+ $GLOBALS['phpgw']->template->set_var('download_attach_option_No_selected', 'selected');
+
+ $max_page = isset($prefs['mobile']['max_message_per_page'])?
+ $prefs['mobile']['max_message_per_page']:10;
+
+ $max_page = "max_message_per_page_".$max_page."_selected";
+
+
+ $GLOBALS['phpgw']->template->set_var($max_page,"selected");
+
+ /* Translate the fields */
+ $this->translate('pref');
+
+ $GLOBALS['phpgw']->template->set_var('form_action', $GLOBALS['phpgw']->link('/index.php', 'menuaction=mobile.ui_preferences.set_preferences'));
+
+ $GLOBALS['phpgw']->template->pparse('out', 'pref');
+ }
+
+ function translate($handle)
+ {
+ $vars = $GLOBALS['phpgw']->template->get_undefined($handle);
+ foreach($vars as $name => $value)
+ {
+ if (ereg('^lang_', $name) !== false)
+ {
+ $GLOBALS['phpgw']->template->set_var($name, lang(str_replace('_',' ',substr($name, 5))));
+ }
+ else {
+ $GLOBALS['phpgw']->template->set_var($name, " ");
+ }
+ }
+ }
+
+ function set_preferences()
+ {
+ if ($_POST['save'])
+ {
+ $GLOBALS['phpgw']->preferences->read();
+
+ if($_POST['download_attach']==0)
+ $GLOBALS['phpgw']->preferences->delete('mobile', 'download_attach');
+ else
+ $GLOBALS['phpgw']->preferences->add('mobile', 'download_attach', '1');
+
+ $GLOBALS['phpgw']->preferences->add('mobile', 'max_message_per_page', $_POST['max_message_per_page']);
+
+ $GLOBALS['phpgw']->preferences->save_repository();
+ }
+
+ header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
+ }
+
+ }
+?>
Index: /trunk/mobile/inc/class.ui_mobilemail.inc.php
===================================================================
--- /trunk/mobile/inc/class.ui_mobilemail.inc.php (revision 623)
+++ /trunk/mobile/inc/class.ui_mobilemail.inc.php (revision 691)
@@ -44,6 +44,7 @@
function ui_mobilemail()
{
-
+
$this-> load_session();
+
// Recupera atributos da classe gravados na sessão
$folders = $GLOBALS['phpgw']->session->appsession('mobilemail.folders','mobile');
@@ -191,5 +192,19 @@
if (!empty($msg['attachments']) && !empty($msg['attachments']['names']))
{
- $p->set_var('attachment_message', lang('This message have attachment(s)'));
+ $attachs = "
".lang("This message has the follow attachments:")."
";
+ foreach($msg['attachments'] as $key => $attach) {
+ if(is_array($attach)) {
+ $attachs.=$attach['name']." ";
+ if($GLOBALS['phpgw_info']['user']['preferences']['mobile']['download_attach']==1)
+ $attachs.="".
+ lang('Download')."
";
+ else
+ $attachs.="
";
+ }
+ $p->set_var('attachment_message', $attachs);
+ }
+ //$p->set_var('attachment_message', lang('This message have attachment(s)'));
}
else
@@ -262,5 +277,7 @@
$_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam'];
$_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];
- echo '';
+
+ echo '';
+
// End Set Anti-Spam options.
@@ -270,5 +287,7 @@
$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] : "Spam";
$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] : "Sent";
+
include("../expressoMail1_2/inc/load_lang.php");
+
}
@@ -365,5 +384,7 @@
{
- $this->messages_per_page = 10; //TODO: Pegar esse valor de preferences
+ $this->messages_per_page =
+ isset($GLOBALS['phpgw_info']['user']['preferences']['mobile']['max_message_per_page'])?
+ $GLOBALS['phpgw_info']['user']['preferences']['mobile']['max_message_per_page']:10;
// var $pages;
// var $actual_page;
Index: /trunk/mobile/templates/default/preferences.tpl
===================================================================
--- /trunk/mobile/templates/default/preferences.tpl (revision 691)
+++ /trunk/mobile/templates/default/preferences.tpl (revision 691)
@@ -0,0 +1,37 @@
+