@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Export task point values as double, not int

Summary:
See <https://discourse.phabricator-community.org/t/maniphest-non-integer-point-values-in-csv-export/1443>.

We currently export the Maniphest "points" field as an integer, but allow it to accept decimal values (e.g. "6.25").

Also fix a bug where we wouldn't roll over from "..., X, Y, Z, AA, AB, ..." correctly for Excel column names if sheet had more than 26 columns.

Test Plan:
- Set a task point value to 6.25.
- Exported to text, JSON, XLS.
- Saw 6.25 represented accurately in exports.
- Exported an excel sheet with 27+ columns.
- Manually printed the first 200 column names to check that the algorithm looks correct.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19434

+33 -2
+2
src/__phutil_library_map__.php
··· 2882 2882 'PhabricatorDocumentRef' => 'applications/files/document/PhabricatorDocumentRef.php', 2883 2883 'PhabricatorDocumentRenderingEngine' => 'applications/files/document/render/PhabricatorDocumentRenderingEngine.php', 2884 2884 'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php', 2885 + 'PhabricatorDoubleExportField' => 'infrastructure/export/field/PhabricatorDoubleExportField.php', 2885 2886 'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php', 2886 2887 'PhabricatorDraftDAO' => 'applications/draft/storage/PhabricatorDraftDAO.php', 2887 2888 'PhabricatorDraftEngine' => 'applications/transactions/draft/PhabricatorDraftEngine.php', ··· 8540 8541 'PhabricatorDocumentRef' => 'Phobject', 8541 8542 'PhabricatorDocumentRenderingEngine' => 'Phobject', 8542 8543 'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication', 8544 + 'PhabricatorDoubleExportField' => 'PhabricatorExportField', 8543 8545 'PhabricatorDraft' => 'PhabricatorDraftDAO', 8544 8546 'PhabricatorDraftDAO' => 'PhabricatorLiskDAO', 8545 8547 'PhabricatorDraftEngine' => 'Phobject',
+1 -1
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 516 516 ); 517 517 518 518 if (ManiphestTaskPoints::getIsEnabled()) { 519 - $fields[] = id(new PhabricatorIntExportField()) 519 + $fields[] = id(new PhabricatorDoubleExportField()) 520 520 ->setKey('points') 521 521 ->setLabel('Points'); 522 522 }
+25
src/infrastructure/export/field/PhabricatorDoubleExportField.php
··· 1 + <?php 2 + 3 + final class PhabricatorDoubleExportField 4 + extends PhabricatorExportField { 5 + 6 + public function getNaturalValue($value) { 7 + if ($value === null) { 8 + return $value; 9 + } 10 + 11 + return (double)$value; 12 + } 13 + 14 + /** 15 + * @phutil-external-symbol class PHPExcel_Cell_DataType 16 + */ 17 + public function formatPHPExcelCell($cell, $style) { 18 + $cell->setDataType(PHPExcel_Cell_DataType::TYPE_NUMERIC); 19 + } 20 + 21 + public function getCharacterWidth() { 22 + return 8; 23 + } 24 + 25 + }
+5 -1
src/infrastructure/export/format/PhabricatorExcelExportFormat.php
··· 155 155 return $this->sheet; 156 156 } 157 157 158 + 159 + /** 160 + * @phutil-external-symbol class PHPExcel_Cell 161 + */ 158 162 private function getCellName($col, $row = null) { 159 - $col_name = chr(ord('A') + $col); 163 + $col_name = PHPExcel_Cell::stringFromColumnIndex($col); 160 164 161 165 if ($row === null) { 162 166 return $col_name;