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

Commit

Permalink
Merge branch '2022.11' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Mar 17, 2022
2 parents 65847df + 8d39bab commit 08596c2
Show file tree
Hide file tree
Showing 20 changed files with 141 additions and 35 deletions.
12 changes: 6 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7740,7 +7740,7 @@ parameters:

-
message: "#^Call to an undefined method Tinebase_Controller_Abstract\\:\\:get\\(\\)\\.$#"
count: 2
count: 1
path: tine20/Tinebase/Frontend/Http.php

-
Expand Down Expand Up @@ -7788,11 +7788,6 @@ parameters:
count: 4
path: tine20/Tinebase/Frontend/Http.php

-
message: "#^Variable \\$node might not be defined\\.$#"
count: 1
path: tine20/Tinebase/Frontend/Http.php

-
message: "#^Variable \\$record might not be defined\\.$#"
count: 1
Expand Down Expand Up @@ -10238,6 +10233,11 @@ parameters:
count: 1
path: tine20/Tinebase/OpenId/Provider/User/Tine20.php

-
message: "#^Access to an undefined property Zend_Db_Adapter_Abstract\\:\\:\\$table_prefix\\.$#"
count: 1
path: tine20/Tinebase/Path/Backend/Sql.php

-
message: "#^Method Tinebase_Path_Backend_Sql\\:\\:delete\\(\\) should return int but return statement is missing\\.$#"
count: 1
Expand Down
4 changes: 1 addition & 3 deletions tests/tine20/HumanResources/Controller/ContractTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public function testUpdateContract()

/**
* some contract tests (more in jsontests)
*
* @group nogitlabci
*/
public function testContract($setDFComId = false)
{
Expand Down Expand Up @@ -181,7 +179,7 @@ public function testContract($setDFComId = false)
'account_id' => $account->getId(),
'employee_id' => $contract->employee_id,
'type' => 'vacation',
'status' => 'ACCEPTED',
HumanResources_Model_FreeTime::FLD_PROCESS_STATUS => HumanResources_Config::FREE_TIME_PROCESS_STATUS_ACCEPTED,
'firstday_date' => $refDate->toString()
);

Expand Down
2 changes: 2 additions & 0 deletions tests/tine20/Tinebase/Frontend/CliTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public function testPurgeDeletedRecordsAddressbook()
*/
public function testPurgeDeletedRecordsAllTables()
{
$this->_testNeedsTransaction();

$opts = $this->_getOpts();
if (Tinebase_Config::getInstance()->{Tinebase_Config::FILESYSTEM}->{Tinebase_Config::FILESYSTEM_MODLOGACTIVE}) {
$deletedFile = $this->_addAndDeleteFile();
Expand Down
2 changes: 1 addition & 1 deletion tine20/Felamimail/js/MessageFileAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ Ext.extend(Tine.Felamimail.MessageFileAction, Ext.Action, {
this.selectionHandler(item, e);
}
},
getEventData: (eventName) => {
getEventData: function(eventName) {
if (eventName === 'apply') {
const attachRecord = this.getForm().findField('attachRecord').selectedRecord;
return {
Expand Down
4 changes: 3 additions & 1 deletion tine20/Sales/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ public function createUpdatePostalAddress($contact)
'postalcode' => $contact->adr_one_postalcode,
'locality' => $contact->adr_one_locality,
'countryname' => $contact->adr_one_countryname,
'prefix1' => $customer->related_record->name == $contact->n_fn ? '' : $contact->n_fn,
'prefix1' => $contact->org_name,
'prefix2' => $contact->org_unit,
'prefix3' => $customer->related_record->name == $contact->n_fn ? '' : $contact->n_fn,
'language' => $defaultLang,
));

Expand Down
5 changes: 3 additions & 2 deletions tine20/Sales/Controller/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ public function contactToCustomerAddress(Sales_Model_Address $address, Addressbo
$address->locality = $contact->adr_one_locality;
$address->region = $contact->adr_one_region;
$address->countryname = $contact->adr_one_countryname;
$address->prefix1 = $customer->name == $contact->n_fn ? '' : $contact->n_fn;
$address->prefix2 = $contact->org_name;
$address->prefix1 = $contact->org_name;
$address->prefix2 = $contact->org_unit;
$address->prefix3 = $customer->name == $contact->n_fn ? '' : $contact->n_fn;
$address->language = $language;

return Sales_Controller_Address::getInstance()->update($address);
Expand Down
14 changes: 11 additions & 3 deletions tine20/Sales/Model/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Sales_Model_Address extends Tinebase_Record_NewAbstract
public const FLD_NAME = 'name';
public const FLD_PREFIX1 = 'prefix1';
public const FLD_PREFIX2 = 'prefix2';
public const FLD_PREFIX3 = 'prefix3';
public const FLD_EMAIL = 'email';
public const FLD_STREET = 'street';
public const FLD_POBOX = 'pobox';
Expand All @@ -56,7 +57,7 @@ class Sales_Model_Address extends Tinebase_Record_NewAbstract
* @var array
*/
protected static $_modelConfiguration = [
self::VERSION => 3,
self::VERSION => 4,
self::RECORD_NAME => 'Address', // ngettext('Address', 'Addresss', n)
self::RECORDS_NAME => 'Addresss', // gettext('GENDER_Address')
self::HAS_RELATIONS => true,
Expand Down Expand Up @@ -119,14 +120,21 @@ class Sales_Model_Address extends Tinebase_Record_NewAbstract
self::QUERY_FILTER => true,
],
self::FLD_PREFIX1 => [
self::LABEL => 'Prefix', //_('Prefix')
self::LABEL => 'Prefix 1', //_('Prefix 1')
self::NULLABLE => TRUE,
self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => true],
self::TYPE => self::TYPE_STRING,
self::QUERY_FILTER => TRUE
],
self::FLD_PREFIX2 => [
self::LABEL => 'Additional Prefix', //_('Additional Prefix')
self::LABEL => 'Prefix 2', //_('Prefix 2')
self::NULLABLE => TRUE,
self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => true],
self::TYPE => self::TYPE_STRING,
self::QUERY_FILTER => TRUE
],
self::FLD_PREFIX3 => [
self::LABEL => 'Prefix 3', //_('Prefix 3')
self::NULLABLE => TRUE,
self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => true],
self::TYPE => self::TYPE_STRING,
Expand Down
13 changes: 13 additions & 0 deletions tine20/Sales/Setup/Update/15.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Sales_Setup_Update_15 extends Setup_Update_Abstract
const RELEASE015_UPDATE009 = __CLASS__ . '::update009';
const RELEASE015_UPDATE010 = __CLASS__ . '::update010';
const RELEASE015_UPDATE011 = __CLASS__ . '::update011';
const RELEASE015_UPDATE012 = __CLASS__ . '::update012';

static protected $_allUpdates = [
// this needs to be executed before TB struct update! cause we move the table from sales to tb
Expand Down Expand Up @@ -71,6 +72,10 @@ class Sales_Setup_Update_15 extends Setup_Update_Abstract
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update009',
],
self::RELEASE015_UPDATE012 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update012',
],
],
self::PRIO_NORMAL_APP_UPDATE => [
self::RELEASE015_UPDATE000 => [
Expand Down Expand Up @@ -262,4 +267,12 @@ public function update011()
} catch (Tinebase_Exception_NotFound $tenf) {}
$this->addApplicationUpdate(Sales_Config::APP_NAME, '15.11', self::RELEASE015_UPDATE011);
}

public function update012()
{
Setup_SchemaTool::updateSchema([
Sales_Model_Address::class,
]);
$this->addApplicationUpdate(Sales_Config::APP_NAME, '15.12', self::RELEASE015_UPDATE012);
}
}
2 changes: 1 addition & 1 deletion tine20/Sales/Setup/setup.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<application>
<name>Sales</name>
<version>15.11</version>
<version>15.12</version>
<order>50</order>
<status>enabled</status>
<tables>
Expand Down
8 changes: 6 additions & 2 deletions tine20/Sales/js/AddressEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,15 @@ Tine.Sales.AddressEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
}], [{
columnWidth: 1,
name: 'prefix1',
fieldLabel: this.app.i18n._('Prefix')
fieldLabel: this.app.i18n._('Prefix 1')
}], [{
columnWidth: 1,
name: 'prefix2',
fieldLabel: this.app.i18n._('Additional Prefix')
fieldLabel: this.app.i18n._('Prefix 2')
}], [{
columnWidth: 1,
name: 'prefix3',
fieldLabel: this.app.i18n._('Prefix 3')
}], [{
name: 'street',
fieldLabel: this.app.i18n._('Street')
Expand Down
8 changes: 6 additions & 2 deletions tine20/Sales/js/CustomerEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,15 @@ Tine.Sales.CustomerEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
columnWidth: 1
}], [{
name: 'adr_prefix1',
fieldLabel: this.app.i18n._('Prefix'),
fieldLabel: this.app.i18n._('Prefix 1'),
columnWidth: 1
}], [{
name: 'adr_prefix2',
fieldLabel: this.app.i18n._('Additional Prefix'),
fieldLabel: this.app.i18n._('Prefix 2'),
columnWidth: 1
}], [{
name: 'adr_prefix3',
fieldLabel: this.app.i18n._('Prefix 3'),
columnWidth: 1
}, ], [{
name: 'adr_street',
Expand Down
9 changes: 6 additions & 3 deletions tine20/Sales/translations/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,17 @@ msgstr "Lieferantennummer"

#: Model/Supplier.php:163 Model/Address.php:150 js/SupplierEditDialog.js:301
#: js/AddressEditDialog.js:185 js/CustomerEditDialog.js:369
msgid "Prefix"
msgstr "Zusatz"
msgid "Prefix 1"
msgstr "Zusatz 1"

#: Model/Supplier.php:171 Model/Address.php:157 js/SupplierEditDialog.js:305
#: js/AddressEditDialog.js:188 js/CustomerEditDialog.js:373
msgid "Additional Prefix"
msgid "Prefix 2"
msgstr "Zusatz 2"

msgid "Prefix 3"
msgstr "Zusatz 3"

#: Model/Supplier.php:195 Model/Address.php:108 js/SupplierEditDialog.js:272
#: js/AddressEditDialog.js:166 js/CustomerEditDialog.js:340
msgid "Street"
Expand Down
2 changes: 2 additions & 0 deletions tine20/Tinebase/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,8 @@ public function rebuildPaths()
}
}

Tinebase_Path_Backend_Sql::optimizePathsTable();

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions tine20/Tinebase/Frontend/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ public function purgeDeletedRecords(Zend_Console_Getopt $_opts)

echo "\nCleaning files...";
$this->clearDeletedFiles();

echo "\nOptimizing path table...";
Tinebase_Path_Backend_Sql::optimizePathsTable();
}

echo "\n\n";
Expand Down
17 changes: 11 additions & 6 deletions tine20/Tinebase/Frontend/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,28 @@ protected function _getFilesToWatch($_fileType, $apps = array())
$filesToWatch = array();

foreach ($orderedApplications as $application) {
if (! empty($apps) && $apps[0] != 'all' && ! in_array($application, $apps)) continue;
switch($_fileType) {
if (! empty($apps) && $apps[0] != 'all' && ! in_array($application, $apps)) {
continue;
}
switch ($_fileType) {
case 'js':
$filesToWatch[] = "{$application}/js/{$application}";
break;
case 'lang':
$fileName = "{$application}/js/{$application}-lang-" . Tinebase_Core::getLocale() . (TINE20_BUILDTYPE == 'DEBUG' ? '-debug' : null) . '.js';
$fileName = "{$application}/js/{$application}-lang-" . Tinebase_Core::getLocale()
. (TINE20_BUILDTYPE == 'DEBUG' ? '-debug' : null) . '.js';
$lang = Tinebase_Core::getLocale();
$customPath = Tinebase_Config::getInstance()->translations;
$basePath = is_readable("$customPath/$lang/$fileName") ? "$customPath/$lang" : '.';
$basePath = ! empty($customPath) && is_readable("$customPath/$lang/$fileName")
? "$customPath/$lang"
: '.';

$langFile = "{$basePath}/{$application}/js/{$application}-lang-" . Tinebase_Core::getLocale() . (TINE20_BUILDTYPE == 'DEBUG' ? '-debug' : null) . '.js';
$langFile = "{$basePath}/{$application}/js/{$application}-lang-" . Tinebase_Core::getLocale()
. (TINE20_BUILDTYPE == 'DEBUG' ? '-debug' : null) . '.js';
$filesToWatch[] = $langFile;
break;
default:
throw new Exception('no such fileType');
break;
}
}

Expand Down
10 changes: 9 additions & 1 deletion tine20/Tinebase/Model/MunicipalityKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Tinebase_Model_MunicipalityKey extends Tinebase_Record_NewAbstract
public const FLD_REISEGEBIET = 'reisegebiet';
public const FLD_GRAD_DER_VERSTAEDTERUNG = 'gradDerVerstaedterung';
public const FLD_GEBIETSSTAND = 'gebietsstand';
public const FLD_BEVOELKERUNGSSTAND = 'bevoelkerungsstand';

public const MODEL_NAME_PART = 'MunicipalityKey';
public const TABLE_NAME = 'municipalitykeys';
Expand All @@ -49,7 +50,7 @@ class Tinebase_Model_MunicipalityKey extends Tinebase_Record_NewAbstract
* @var array
*/
protected static $_modelConfiguration = [
self::VERSION => 2,
self::VERSION => 3,
self::MODLOG_ACTIVE => true,
self::IS_DEPENDENT => true,

Expand Down Expand Up @@ -267,6 +268,13 @@ class Tinebase_Model_MunicipalityKey extends Tinebase_Record_NewAbstract
self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => true],
self::INPUT_FILTERS => [Zend_Filter_Empty::class => null],
],
self::FLD_BEVOELKERUNGSSTAND => [
self::TYPE => self::TYPE_DATE,
self::LABEL => 'Bevölkerungsstand', // _('Bevölkerungsstand')
self::NULLABLE => true,
self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => true],
self::INPUT_FILTERS => [Zend_Filter_Empty::class => null],
],
]
];

Expand Down
8 changes: 8 additions & 0 deletions tine20/Tinebase/Path/Backend/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,4 +642,12 @@ protected function _addToModelStore(Tinebase_Model_Path $_record, $_replace = fa
static::$_shadowPathMapping[$shadow_path] = $id;
static::$_idToShadowPath[$id] = $shadow_path;
}

public static function optimizePathsTable()
{
Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Optimizing path table ...');
$db = Tinebase_Core::getDb();
$stmt = $db->query('OPTIMIZE TABLE ' . $db->table_prefix . 'path;');
$stmt->closeCursor();
}
}
40 changes: 39 additions & 1 deletion tine20/Tinebase/Setup/Update/15.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Tinebase_Setup_Update_15 extends Setup_Update_Abstract
const RELEASE015_UPDATE004 = __CLASS__ . '::update004';
const RELEASE015_UPDATE005 = __CLASS__ . '::update005';
const RELEASE015_UPDATE006 = __CLASS__ . '::update006';
const RELEASE015_UPDATE007 = __CLASS__ . '::update007';
const RELEASE015_UPDATE008 = __CLASS__ . '::update008';

static protected $_allUpdates = [
self::PRIO_TINEBASE_STRUCTURE => [
Expand Down Expand Up @@ -48,13 +50,20 @@ class Tinebase_Setup_Update_15 extends Setup_Update_Abstract
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update006',
],
self::RELEASE015_UPDATE008 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update008',
],
],
self::PRIO_TINEBASE_UPDATE => [
self::RELEASE015_UPDATE000 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update000',
],

self::RELEASE015_UPDATE007 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update007',
],
],
];

Expand Down Expand Up @@ -125,4 +134,33 @@ public function update006()

$this->addApplicationUpdate(Tinebase_Config::APP_NAME, '15.6', self::RELEASE015_UPDATE006);
}

public function update007()
{
if ($this->getTableVersion('importexport_definition') < 14) {
$this->setTableVersion('importexport_definition', 14);
};
if ($this->getTableVersion('tags') == 14) {
$this->setTableVersion('tags', 10);
};
if (!$this->_backend->columnExists('filter', 'importexport_definition')) {
$this->_backend->addCol('importexport_definition', new Setup_Backend_Schema_Field_Xml(
'<field>
<name>filter</name>
<type>text</type>
<length>16000</length>
</field>'));
}
$this->setTableVersion('importexport_definition', 15);
$this->addApplicationUpdate('Tinebase', '15.7', self::RELEASE015_UPDATE007);
}

public function update008()
{
Setup_SchemaTool::updateSchema([
Tinebase_Model_MunicipalityKey::class,
]);

$this->addApplicationUpdate(Tinebase_Config::APP_NAME, '15.8', self::RELEASE015_UPDATE008);
}
}

0 comments on commit 08596c2

Please sign in to comment.