From: <ral...@us...> - 2014-04-01 16:25:35
|
Author: ralfbecker Date: Tue Apr 1 18:25:27 2014 New Revision: 46462 URL: http://svn.stylite.de/viewvc/egroupware?rev=46462&view=rev Log: database update to add junk folder and other not yet in UI available new fields Modified: trunk/emailadmin/inc/class.emailadmin_wizard.inc.php trunk/emailadmin/setup/setup.inc.php trunk/emailadmin/setup/tables_current.inc.php trunk/emailadmin/setup/tables_update.inc.php trunk/emailadmin/templates/default/account.xet trunk/emailadmin/templates/default/app.css trunk/emailadmin/templates/default/wizard.folder.xet trunk/emailadmin/templates/default/wizard.sieve.xet trunk/emailadmin/templates/default/wizard.smtp.xet trunk/emailadmin/templates/default/wizard.xet Modified: trunk/emailadmin/inc/class.emailadmin_wizard.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/inc/class.emailadmin_wizard.inc.php?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/inc/class.emailadmin_wizard.inc.php (original) +++ trunk/emailadmin/inc/class.emailadmin_wizard.inc.php Tue Apr 1 18:25:27 2014 @@ -354,7 +354,7 @@ //_debug_array($content); $sel_options['acc_folder_sent'] = $sel_options['acc_folder_trash'] = $sel_options['acc_folder_draft'] = $sel_options['acc_folder_template'] = - self::mailboxes($imap, $content); + $sel_options['acc_folder_junk'] = self::mailboxes($imap, $content); } catch(Exception $e) { $content['msg'] = $e->getMessage(); @@ -397,6 +397,7 @@ 'acc_folder_trash' => array('\\trash', 'trash'), 'acc_folder_draft' => array('\\drafts', 'drafts'), 'acc_folder_template' => array('', 'templates'), + 'acc_folder_junk' => array('\\junk', 'junk', 'spam'), ) as $name => $common_names) { // first check special-use attributes @@ -886,6 +887,7 @@ if (isset($content['button'])) { + $msg_type = 'success'; list($button) = each($content['button']); unset($content['button']); switch($button) @@ -952,13 +954,15 @@ else { $msg = lang('Permission denied!'); + $msg_type = 'error'; } } catch (Exception $e) { $msg = lang('Error saving account!')."\n".$e->getMessage(); $button = 'apply'; - } - egw_framework::refresh_opener($msg, 'emailadmin', $content['acc_id']); + $msg_type = 'error'; + } + egw_framework::refresh_opener($msg, 'emailadmin', $content['acc_id'], null, null, null, null, $msg_type); if ($button == 'save') egw_framework::window_close(); break; @@ -966,6 +970,7 @@ if (!emailadmin_account::check_access(EGW_ACL_DELETE, $content)) { $msg = lang('Permission denied!'); + $msg_type = 'error'; } elseif (emailadmin_account::delete($content['acc_id']) > 0) { @@ -978,7 +983,7 @@ } } } - $content['msg'] = $msg ? $msg : $_GET['msg']; + egw_framework::message($msg ? $msg : (string)$_GET['msg'], $msg_type); // disable delete button for new, not yet saved entries and if no delete rights $readonlys['button[delete]'] = empty($content['acc_id']) || @@ -1000,7 +1005,7 @@ if ($this->is_admin && (empty($content['acc_imap_username']) || empty($content['acc_imap_hostname']))) { // cant connection to imap --> allow free entries in taglists - foreach(array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template') as $folder) + foreach(array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template', 'acc_folder_junk') as $folder) { $tpl->setElementAttribute($folder, 'allowFreeEntries', true); } @@ -1010,7 +1015,7 @@ try { $sel_options['acc_folder_sent'] = $sel_options['acc_folder_trash'] = $sel_options['acc_folder_draft'] = $sel_options['acc_folder_template'] = - self::mailboxes(self::imap_client ($content)); + $sel_options['acc_folder_junk'] = self::mailboxes(self::imap_client ($content)); } // call wizard, if we have a connection error: Horde_Imap_Client_Exception catch(Horde_Imap_Client_Exception $e) { @@ -1021,7 +1026,7 @@ return $this->add($content, $e->getMessage()); } // we already been in wizard, wont get better, let admin try fixing it - $content['msg'] = $e->getMessage(); + egw_framework::message($e->getMessage(), 'error'); // cant connection to imap --> allow free entries in taglists foreach(array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template') as $folder) { Modified: trunk/emailadmin/setup/setup.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/setup/setup.inc.php?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/setup/setup.inc.php (original) +++ trunk/emailadmin/setup/setup.inc.php Tue Apr 1 18:25:27 2014 @@ -1,9 +1,10 @@ <?php /** - * eGroupware EMailAdmin - Setup + * EGroupware EMailAdmin - Setup * * @link http://www.egroupware.org * @author Klaus Leithoff <kl...@st...> + * @author Ralf Becker <rb...@st...> * @package emailadmin * @subpackage setup * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License @@ -12,7 +13,7 @@ $setup_info['emailadmin']['name'] = 'emailadmin'; $setup_info['emailadmin']['title'] = 'EMailAdmin'; -$setup_info['emailadmin']['version'] = '1.9.015'; +$setup_info['emailadmin']['version'] = '1.9.018'; $setup_info['emailadmin']['app_order'] = 10; $setup_info['emailadmin']['enable'] = 2; $setup_info['emailadmin']['index'] = 'emailadmin.emailadmin_ui.listProfiles'; @@ -34,6 +35,7 @@ $setup_info['emailadmin']['tables'][] = 'egw_ea_credentials'; $setup_info['emailadmin']['tables'][] = 'egw_ea_identities'; $setup_info['emailadmin']['tables'][] = 'egw_ea_valid'; +$setup_info['emailadmin']['tables'][] = 'egw_ea_notifications'; /* The hooks this app includes, needed for hooks registration */ #$setup_info['emailadmin']['hooks'][] = 'preferences'; Modified: trunk/emailadmin/setup/tables_current.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/setup/tables_current.inc.php?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/setup/tables_current.inc.php (original) +++ trunk/emailadmin/setup/tables_current.inc.php Tue Apr 1 18:25:27 2014 @@ -5,6 +5,7 @@ * @link http://www.egroupware.org * @author Lars Kneschke * @author Klaus Leithoff <kl...@st...> + * @author Ralf Becker <rb...@st...> * @package emailadmin * @subpackage setup * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License @@ -99,7 +100,10 @@ 'acc_sieve_ssl' => array('type' => 'int','precision' => '1','default' => '1','comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'), 'acc_modified' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), 'acc_modifier' => array('type' => 'int','meta' => 'user','precision' => '4'), - 'acc_smtp_auth_session' => array('type' => 'bool','comment' => '0=no, 1=yes, use username/pw from current user') + 'acc_smtp_auth_session' => array('type' => 'bool','comment' => '0=no, 1=yes, use username/pw from current user'), + 'acc_folder_junk' => array('type' => 'varchar','precision' => '128','comment' => 'junk folder'), + 'acc_imap_default_quota' => array('type' => 'int','precision' => '4','comment' => 'default quota, if no user specific one set'), + 'acc_imap_timeout' => array('type' => 'int','precision' => '2','comment' => 'timeout for imap connection') ), 'pk' => array('acc_id'), 'fk' => array(), @@ -129,7 +133,8 @@ 'ident_email' => array('type' => 'varchar','precision' => '128','comment' => 'email address'), 'ident_org' => array('type' => 'varchar','precision' => '128','comment' => 'organisation'), 'ident_signature' => array('type' => 'text','comment' => 'signature text'), - 'account_id' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False,'default' => '0','comment' => '0=all users of give mail account') + 'account_id' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False,'default' => '0','comment' => '0=all users of give mail account'), + 'ident_name' => array('type' => 'varchar','precision' => '128','comment' => 'name of identity to display') ), 'pk' => array('ident_id'), 'fk' => array(), @@ -145,5 +150,17 @@ 'fk' => array(), 'ix' => array(array('acc_id','account_id'),array('account_id','acc_id')), 'uc' => array() + ), + 'egw_ea_notifications' => array( + 'fd' => array( + 'notif_id' => array('type' => 'auto','nullable' => False), + 'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'mail account'), + 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'user account'), + 'notif_folder' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'folder name') + ), + 'pk' => array('notif_id'), + 'fk' => array(), + 'ix' => array(array('account_id','acc_id')), + 'uc' => array() ) ); Modified: trunk/emailadmin/setup/tables_update.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/setup/tables_update.inc.php?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/setup/tables_update.inc.php (original) +++ trunk/emailadmin/setup/tables_update.inc.php Tue Apr 1 18:25:27 2014 @@ -5,6 +5,7 @@ * @link http://www.egroupware.org * @author Lars Kneschke * @author Klaus Leithoff <kl...@st...> + * @author Ralf Becker <rb...@st...> * @package emailadmin * @subpackage setup * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License @@ -787,3 +788,56 @@ } return $GLOBALS['setup_info']['emailadmin']['currentver'] = '1.9.015'; } + +function emailadmin_upgrade1_9_015() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_folder_junk',array( + 'type' => 'varchar', + 'precision' => '128', + 'comment' => 'junk folder' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_imap_default_quota',array( + 'type' => 'int', + 'precision' => '4', + 'comment' => 'default quota, if no user specific one set' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_imap_timeout',array( + 'type' => 'int', + 'precision' => '2', + 'comment' => 'timeout for imap connection' + )); + + return $GLOBALS['setup_info']['emailadmin']['currentver'] = '1.9.016'; +} + + +function emailadmin_upgrade1_9_016() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_identities','ident_name',array( + 'type' => 'varchar', + 'precision' => '128', + 'comment' => 'name of identity to display' + )); + + return $GLOBALS['setup_info']['emailadmin']['currentver'] = '1.9.017'; +} + + +function emailadmin_upgrade1_9_017() +{ + $GLOBALS['egw_setup']->oProc->CreateTable('egw_ea_notifications',array( + 'fd' => array( + 'notif_id' => array('type' => 'auto','nullable' => False), + 'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'mail account'), + 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'user account'), + 'notif_folder' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'folder name') + ), + 'pk' => array('notif_id'), + 'fk' => array(), + 'ix' => array(array('account_id','acc_id')), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['emailadmin']['currentver'] = '1.9.018'; +} + Modified: trunk/emailadmin/templates/default/account.xet URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/account.xet?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/account.xet (original) +++ trunk/emailadmin/templates/default/account.xet Tue Apr 1 18:25:27 2014 @@ -139,9 +139,9 @@ <description for="acc_folder_template" value="Templates folder"/> <taglist id="acc_folder_template" empty_label="Select one ..." maxSelection="1" autocomplete_url=""/> </row> - <row height="100"> - <description/> - <description/> + <row> + <description for="acc_folder_junk" value="Junk folder"/> + <taglist id="acc_folder_junk" empty_label="Select one ..." maxSelection="1" autocomplete_url=""/> </row> </rows> </grid> @@ -272,27 +272,20 @@ <column/> </columns> <rows> - <row> - <description id="msg" span="all" class="message"/> - <description/> - <description/> - <description/> - <description/> - </row> - <row disabled="!@accounts"> + <row disabled="!@accounts" class="dialogHeader"> <description for="acc_id" value="Mail account"/> <menulist span="all"> <menupopup id="acc_id" onchange="app.emailadmin.change_account"/> </menulist> </row> - <row height="30" class="dialog-header"> + <row class="dialogHeader"> <description for="acc_name" value="Name of account"/> <hbox span="all"> <textbox id="acc_name" needed="1" size="80"/> <description align="right" id="acc_id" class="emailadmin_diagnostic"/> </hbox> </row> - <row class="emailadmin_no_user dialog-header" height="30"> + <row class="emailadmin_no_user dialogHeader2"> <description for="account_id" value="Valid for"/> <hbox> <menulist> @@ -324,7 +317,7 @@ </row> </rows> </grid> - <hbox class="dialog-footer-toolbar"> + <hbox class="dialogFooterToolbar"> <button label="Save" id="button[save]"/> <button label="Apply" id="button[apply]" /> <button statustext="Use wizard to detect or verify configuration" label="Wizard" id="button[wizard]" image="magicwand" background_image="1"/> Modified: trunk/emailadmin/templates/default/app.css URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/app.css?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/app.css (original) +++ trunk/emailadmin/templates/default/app.css Tue Apr 1 18:25:27 2014 @@ -24,7 +24,6 @@ .emailadmin_header { font-weight: bold; font-size: 150%; - padding-bottom: 20px; } #emailadmin-account_tabs { padding-top: 10px; Modified: trunk/emailadmin/templates/default/wizard.folder.xet URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/wizard.folder.xet?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/wizard.folder.xet (original) +++ trunk/emailadmin/templates/default/wizard.folder.xet Tue Apr 1 18:25:27 2014 @@ -8,11 +8,7 @@ <column/> </columns> <rows> - <row> - <description id="msg" span="all" class="message"/> - <description/> - </row> - <row class="dialog-header"> + <row class="dialogHeader"> <description value="Step 2: Folder" span="all" class="emailadmin_header"/> <description/> </row> @@ -40,7 +36,13 @@ <menupopup id="acc_folder_template" options="Select one ..."/> </menulist> </row> - <row class="dialog-footer-toolbar"> + <row> + <description value="Junk folder" for="acc_folder_junk"/> + <menulist> + <menupopup id="acc_folder_junk" options="Select one ..."/> + </menulist> + </row> + <row class="dialogFooterToolbar"> <hbox span="all"> <button label="Continue" id="button[continue]" image="continue" background_image="1"/> <button label="Back" id="button[back]" image="back" background_image="1"/> Modified: trunk/emailadmin/templates/default/wizard.sieve.xet URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/wizard.sieve.xet?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/wizard.sieve.xet (original) +++ trunk/emailadmin/templates/default/wizard.sieve.xet Tue Apr 1 18:25:27 2014 @@ -8,11 +8,7 @@ <column/> </columns> <rows> - <row> - <description id="msg" span="all" class="message"/> - <description/> - </row> - <row class="dialog-header"> + <row class="dialogHeader"> <description value="Step 3: Sieve - server side mail filtering" span="all" class="emailadmin_header"/> <description/> </row> @@ -35,7 +31,7 @@ <textbox type="integer" label="Port" id="acc_sieve_port" onchange="app.emailadmin.wizard_sieve_onchange" class="emailadmin_port"/> </hbox> </row> - <row class="dialog-footer-toolbar"> + <row class="dialogFooterToolbar"> <hbox span="all"> <button label="Continue" id="button[continue]" onclick="app.emailadmin.wizard_detect" image="continue" background_image="1"/> <button label="Back" id="button[back]" image="back" background_image="1"/> Modified: trunk/emailadmin/templates/default/wizard.smtp.xet URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/wizard.smtp.xet?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/wizard.smtp.xet (original) +++ trunk/emailadmin/templates/default/wizard.smtp.xet Tue Apr 1 18:25:27 2014 @@ -8,11 +8,7 @@ <column/> </columns> <rows> - <row> - <description id="msg" span="all" class="message"/> - <description/> - </row> - <row class="dialog-header"> + <row class="dialogHeader"> <description value="Step 4: SMTP - outgoing mail" span="all" class="emailadmin_header"/> <description/> </row> @@ -37,7 +33,7 @@ <textbox type="integer" label="Port" id="acc_smtp_port" class="emailadmin_port"/> </hbox> </row> - <row class="dialog-footer-toolbar"> + <row class="dialogFooterToolbar"> <hbox span="all"> <button label="Continue" id="button[continue]" onclick="app.emailadmin.wizard_detect" image="continue" background_image="1"/> <button label="Back" id="button[back]" image="back" background_image="1"/> Modified: trunk/emailadmin/templates/default/wizard.xet URL: http://svn.stylite.de/viewvc/egroupware/trunk/emailadmin/templates/default/wizard.xet?rev=46462&r1=46461&r2=46462&view=diff ============================================================================== --- trunk/emailadmin/templates/default/wizard.xet (original) +++ trunk/emailadmin/templates/default/wizard.xet Tue Apr 1 18:25:27 2014 @@ -8,11 +8,7 @@ <column/> </columns> <rows> - <row> - <description id="msg" span="all" class="message"/> - <description/> - </row> - <row class="dialog-header"> + <row class="dialogHeader"> <description value="Step 1: IMAP - incoming mail" span="all" class="emailadmin_header"/> <description/> </row> @@ -41,7 +37,7 @@ <textbox type="integer" label="Port" id="acc_imap_port" class="emailadmin_port"/> </hbox> </row> - <row class="dialog-footer-toolbar"> + <row class="dialogFooterToolbar"> <hbox span="all"> <button label="Continue" id="button[continue]" onclick="app.emailadmin.wizard_detect" image="continue" background_image="1"/> <button label="Manual entry" id="button[manual]" onclick="app.emailadmin.wizard_manual" image="manual" background_image="1"/> |