Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Merge branch '2016.11-develop' into 2017.02
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Feb 14, 2017
2 parents 0820abd + bbdd9b8 commit 9bf910a
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 151 deletions.
2 changes: 1 addition & 1 deletion tests/tine20/Felamimail/Frontend/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @package Felamimail
* @license http://www.gnu.org/licenses/agpl.html
* @copyright Copyright (c) 2009-2016 Metaways Infosystems GmbH (http://www.metaways.de)
* @copyright Copyright (c) 2009-2017 Metaways Infosystems GmbH (http://www.metaways.de)
* @author Philipp Schüle <p.schuele@metaways.de>
*/

Expand Down
8 changes: 1 addition & 7 deletions tine20/Addressbook/Controller/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,13 +729,7 @@ protected function _setGeoDataForAddress($_address, Addressbook_Model_Contact $_
*/
protected function _getNominatimService()
{
$proxyConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::INTERNET_PROXY);
if (!empty($proxyConfig)) {
$proxyConfig['adapter'] = 'Zend_Http_Client_Adapter_Proxy';
$httpClient = new Zend_Http_Client(/* url */ null, $proxyConfig);
} else {
$httpClient = null;
}
$httpClient = Tinebase_Core::getHttpClient();
$nominatim = new Zend_Service_Nominatim(/* url */ null, $httpClient);
return $nominatim;
}
Expand Down
23 changes: 20 additions & 3 deletions tine20/ExampleApplication/Model/ExampleRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage Model
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
* @author Philipp Schüle <p.schuele@metaways.de>
* @copyright Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
* @copyright Copyright (c) 2007-2017 Metaways Infosystems GmbH (http://www.metaways.de)
*
*/

Expand All @@ -33,6 +33,7 @@ class ExampleApplication_Model_ExampleRecord extends Tinebase_Record_Abstract
* @var array
*/
protected static $_modelConfiguration = array(
'version' => 1,
'recordName' => 'example record', // _('example record') ngettext('example record', 'example records', n)
'recordsName' => 'example records', // _('example records')
'containerProperty' => 'container_id',
Expand All @@ -53,12 +54,25 @@ class ExampleApplication_Model_ExampleRecord extends Tinebase_Record_Abstract
'appName' => 'ExampleApplication',
'modelName' => 'ExampleRecord',

'table' => array(
'name' => 'example_application_record',
'options' => array('collate' => 'utf8_general_ci'),
'indexes' => array(
'container_id' => array(
'columns' => array('container_id')
)
),
),

'export' => array(
'supportedFormats' => array('csv'),
),

'fields' => array(
'name' => array(
'type' => 'string',
'length' => 255,
'nullable' => false,
'validators' => array(Zend_Filter_Input::ALLOW_EMPTY => false, 'presence' => 'required'),
'label' => 'Name', // _('Name')
'queryFilter' => TRUE
Expand All @@ -67,13 +81,16 @@ class ExampleApplication_Model_ExampleRecord extends Tinebase_Record_Abstract
'validators' => array(Zend_Filter_Input::ALLOW_EMPTY => TRUE),
'label' => 'Status', // _('Status')
'type' => 'keyfield',
'name' => 'exampleStatus'
'nullable' => false,
'name' => 'exampleStatus',
'default' => 'IN-PROCESS'
),
'reason' => array(
'reason' => array(Zend_Filter_Input::ALLOW_EMPTY => TRUE),
'label' => 'Reason', // _('Reason')
'type' => 'keyfield',
'name' => 'exampleReason'
'name' => 'exampleReason',
'nullable' => true
),
'number_str' => array(
'validators' => array(Zend_Filter_Input::ALLOW_EMPTY => TRUE),
Expand Down
110 changes: 0 additions & 110 deletions tine20/ExampleApplication/Setup/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,114 +5,4 @@
<version>0.1</version>
<order>60</order>
<status>enabled</status>
<!-- TODO switch to doctrine config -->
<tables>
<table>
<name>example_application_record</name>
<version>1</version>
<declaration>
<field>
<name>id</name>
<type>text</type>
<length>40</length>
<notnull>true</notnull>
</field>
<field>
<name>container_id</name>
<type>integer</type>
<notnull>false</notnull>
</field>
<field>
<name>name</name>
<type>text</type>
<length>255</length>
<notnull>true</notnull>
</field>
<!-- keyfield 'status' -->
<field>
<name>status</name>
<type>text</type>
<length>40</length>
<default>IN-PROCESS</default>
<notnull>true</notnull>
</field>
<!-- keyfield 'reason' -->
<field>
<name>reason</name>
<type>text</type>
<length>40</length>
</field>
<!-- autoincrement 'number' -->
<field>
<name>number</name>
<type>text</type>
<length>40</length>
</field>
<!-- add more fields here -->
<!-- defaults for tine system -->
<field>
<name>created_by</name>
<type>text</type>
<length>40</length>
</field>
<field>
<name>creation_time</name>
<type>datetime</type>
</field>
<field>
<name>last_modified_by</name>
<type>text</type>
<length>40</length>
</field>
<field>
<name>last_modified_time</name>
<type>datetime</type>
</field>
<field>
<name>is_deleted</name>
<type>boolean</type>
<default>false</default>
</field>
<field>
<name>deleted_by</name>
<type>text</type>
<length>40</length>
</field>
<field>
<name>deleted_time</name>
<type>datetime</type>
</field>
<field>
<name>seq</name>
<type>integer</type>
<notnull>true</notnull>
<default>0</default>
</field>
<field>
<name>number_str</name>
<type>text</type>
<length>255</length>
<notnull>false</notnull>
</field>
<field>
<name>number_int</name>
<type>integer</type>
<notnull>false</notnull>
</field>
<index>
<name>id</name>
<primary>true</primary>
<field>
<name>id</name>
</field>
</index>
<index>
<name>container_id</name>
<field>
<name>container_id</name>
</field>
</index>
</declaration>
</table>
</tables>
</application>
28 changes: 16 additions & 12 deletions tine20/Felamimail/Controller/Cache/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function updateCache($_folder, $_time = 10, $_updateFlagFactor = 10)

$this->_availableUpdateTime = $_time;

try {
try {
$this->_expungeCacheFolder($folder, $imap);
} catch (Felamimail_Exception_IMAPFolderNotFound $feifnf) {
return $folder;
Expand Down Expand Up @@ -321,18 +321,22 @@ protected function _expungeCacheFolder(Felamimail_Model_Folder $_folder, Felamim
try {
$_imap->expunge(Felamimail_Model_Folder::encodeFolderName($_folder->globalname));
} catch (Zend_Mail_Storage_Exception $zmse) {
Tinebase_Exception::log($zmse);

if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' Marking folder as not selectable: ' . print_r($_folder->toArray(), true));

// mark folder as not selectable + finish cache update
$_folder->is_selectable = 0;
if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
. ' ' . $zmse);

$_folder->cache_status = Felamimail_Model_Folder::CACHE_STATUS_COMPLETE;
$_folder = Felamimail_Controller_Folder::getInstance()->update($_folder);

// @todo check if folder is really deleted?
//Felamimail_Controller_Cache_Folder::getInstance()->delete($_folder->getId());
$_folder->is_selectable = 0;

if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
. ' Finish cache update and mark folder as not selectable: ' . print_r($_folder->toArray(), true));

if (! $_folder->has_children) {
if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
. ' Removing folder from database');
Felamimail_Controller_Cache_Folder::getInstance()->delete($_folder->getId());
} else {
$_folder = Felamimail_Controller_Folder::getInstance()->update($_folder);
}

throw new Felamimail_Exception_IMAPFolderNotFound('Folder not found / is not selectable: ' . $_folder->globalname);
}
Expand Down
7 changes: 6 additions & 1 deletion tine20/Felamimail/Frontend/ActiveSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,12 @@ protected function _getSyncrotonBody(Felamimail_Model_Message $entry, $options)
protected function _inspectGetCountOfChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState)
{
if (strpos($folder->serverId, $this->_fakePrefix) === false) {
Felamimail_Controller_Cache_Message::getInstance()->updateCache($folder->serverId, 10);
try {
Felamimail_Controller_Cache_Message::getInstance()->updateCache($folder->serverId, 10);
} catch (Tinebase_Exception_NotFound $tenf) {
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(
__METHOD__ . '::' . __LINE__ . " Could not update folder cache: " . $tenf);
}
}
}

Expand Down
18 changes: 18 additions & 0 deletions tine20/Tinebase/Backend/Sql/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1769,4 +1769,22 @@ public function _getInClassCacheIdentifier()

return get_class($this);
}

/**
* clear table
*
* @return integer
*/
public function clearTable()
{
$table = $this->getTablePrefix() . $this->getTableName();
if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
. ' Removing all records from table ' . $table);

$deletedRows = $this->_db->delete($table);
if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
. ' Removed ' . $deletedRows . ' rows.');

return $deletedRows;
}
}
23 changes: 23 additions & 0 deletions tine20/Tinebase/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1761,4 +1761,27 @@ public static function getTineUserAgent($submodule = '')
{
return 'Tine 2.0 ' . $submodule . '(version ' . TINE20_CODENAME . ' - ' . TINE20_PACKAGESTRING . ')';
}

/**
* get http client
*
* @param null $uri
* @param null $config
* @return Zend_Http_Client
*/
public static function getHttpClient($uri = null, $config = null)
{
$proxyConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::INTERNET_PROXY);
if (! empty($proxyConfig)) {
$proxyConfig['adapter'] = 'Zend_Http_Client_Adapter_Proxy';
if (is_array($config)) {
$config = array_merge($proxyConfig);
} else {
$config = $proxyConfig;
}
}
$httpClient = new Zend_Http_Client($uri, $config);

return $httpClient;
}
}
5 changes: 4 additions & 1 deletion tine20/Tinebase/Frontend/Http/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ protected function _downloadFileNode($node, $filesystemPath)
*
* @param string $filename
* @param string $contentType
* @param string $disposition
*/
protected function _prepareHeader($filename, $contentType, $disposition = 'attachment')
{
Expand All @@ -151,7 +152,9 @@ protected function _prepareHeader($filename, $contentType, $disposition = 'attac
// overwrite Pragma header from session
header("Pragma: cache");

header('Content-Disposition: ' . $disposition . '; filename="' . $filename . '"');
if ($disposition) {
header('Content-Disposition: ' . $disposition . '; filename="' . $filename . '"');
}
header("Content-Type: " . $contentType);
}

Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public static function getFileOrUriContents($filenameOrUrl)
{
if (strpos($filenameOrUrl, 'http') === 0) {
try {
$client = new Zend_Http_Client($filenameOrUrl);
$client = Tinebase_Core::getHttpClient($filenameOrUrl);
// 0011054: Problems with ScheduledImport of external ics calendars
// google shows a lot of trouble with gzip in Zend_Http_Response, so let's deny it
$client->setHeaders('Accept-encoding', 'identity');
Expand Down
3 changes: 2 additions & 1 deletion tine20/Tinebase/css/Tinebase.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ html, body {
background-image:url(../../images/oxygen/32x32/actions/view-refresh.png) !important;
}

.action_loadTutorial {
.action_loadTutorial,
.action_userManual {
background-image: url(../../images/help-icon.png) !important;
}

Expand Down
10 changes: 5 additions & 5 deletions tine20/Tinebase/js/MainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
if (! this.mainActions) {
this.mainActions = [
this.action_aboutTine,
this.action_loadTutorial,
this.action_userManual,
'-',
this.getUserActions(),
'-',
Expand Down Expand Up @@ -154,10 +154,10 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
iconCls: 'action_about'
});

this.action_loadTutorial = new Ext.Action({
this.action_userManual = new Ext.Action({
text: String.format(i18n._('Help')),
iconCls: 'action_loadTutorial',
handler: this.onLoadTutorial,
iconCls: 'action_userManual',
handler: this.onLoadUserManual,
scope: this
});

Expand Down Expand Up @@ -221,7 +221,7 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
/**
* open new window/tab to show help and tutorial
*/
onLoadTutorial: function() {
onLoadUserManual: function() {
window.open(Tine.helpUrl,'_blank');
},

Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/js/ux/form/ClearableComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Ext.ux.form.ClearableComboBox = Ext.extend(Ext.form.ComboBox, {
tag: 'span', cls: 'x-form-twin-triggers', style: 'padding-right:2px', // padding needed to prevent IE from clipping 2nd trigger button
cn: [
{tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger x-form-clear-trigger"},
{tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger"}
{tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass}
]
};
},
Expand Down
2 changes: 1 addition & 1 deletion tine20/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"url": "http://git.syncroton.org/Syncroton"
}],
"require": {
"zendframework/zendframework1": "1.12.20pl8 as 1.12.20",
"zendframework/zendframework1": "1.12.20pl10 as 1.12.20",
"tine20/composerapploader": "1.0.*",
"syncroton/syncroton": "dev-master#7a130976f93cce5035ec9a455f65b5b7134a7142",
"ezyang/htmlpurifier": "v4.6.0",
Expand Down

0 comments on commit 9bf910a

Please sign in to comment.