Skip to content

Commit

Permalink
Merge branch 'pu/ps/demodata2' into '2024.11'
Browse files Browse the repository at this point in the history
tweak(Tinebase+Timetracker/DemoData): improve demo data creation

See merge request tine20/tine20!6657
  • Loading branch information
pschuele committed Feb 27, 2025
2 parents 1196741 + b226769 commit f1c76d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tine20/Timetracker/Setup/DemoData.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ public static function hasBeenRun()
$c = Timetracker_Controller_Timeaccount::getInstance();

$f = new Timetracker_Model_TimeaccountFilter(array(
array('field' => 'description', 'operator' => 'equals', 'value' => 'Created By Tine 2.0 DemoData'),
array('field' => 'description', 'operator' => 'contains', 'value' => 'tine DEMO DATA'),
), 'AND');
$count = $c->search($f)->count();

return ($c->search($f)->count() > 9) ? true : false;
return ($count > 9);
}

/**
Expand Down Expand Up @@ -244,7 +245,7 @@ protected function _createSharedTimeaccounts()
'status' => 'billed',
'cleared_at' => $this->_clearedDate,
'budget' => NULL,
'description' => 'Created By Tine 2.0 DEMO DATA'
'description' => 'Created By tine DEMO DATA'
));

if (($costcenter->name == 'Marketing') || ($costcenter->name == $developmentString)) {
Expand Down
3 changes: 1 addition & 2 deletions tine20/Tinebase/Frontend/Cli/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,8 @@ protected function _createImportDemoData()
] : [];
$importer = new Tinebase_Setup_DemoData_Import($model, $options);
try {
echo 'Importing Demo Data for ' . $model . "\n";
$importer->importDemodata();
echo 'Csv Demo Data was created successfully' . "\n";
echo 'Imported CSV Demo Data for ' . $model . "\n";
} catch (Tinebase_Exception_NotFound $tenf) {
// model has no import files
}
Expand Down

0 comments on commit f1c76d3

Please sign in to comment.