@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.

at recaptime-dev/main 60 lines 1.8 kB view raw
1<?php 2 3// Populate the newish `hasWorkboard` column for projects with workboard. 4// Set the default menu item to "Workboard" for projects which used to have 5// that default. 6 7$project_table = new PhabricatorProject(); 8$conn_w = $project_table->establishConnection('w'); 9 10$panel_table = id(new PhabricatorProfileMenuItemConfiguration()); 11$panel_conn = $panel_table->establishConnection('w'); 12 13foreach (new LiskMigrationIterator($project_table) as $project) { 14 $columns = queryfx_all( 15 $conn_w, 16 'SELECT * FROM %T WHERE projectPHID = %s', 17 id(new PhabricatorProjectColumn())->getTableName(), 18 $project->getPHID()); 19 20 // This project has no columns, so we don't need to change anything. 21 if (!$columns) { 22 continue; 23 } 24 25 // This project has columns, so set its workboard flag. 26 queryfx( 27 $conn_w, 28 'UPDATE %T SET hasWorkboard = 1 WHERE id = %d', 29 $project->getTableName(), 30 $project->getID()); 31 32 // Try to set the default menu item to "Workboard". 33 $config = queryfx_all( 34 $panel_conn, 35 'SELECT * FROM %T WHERE profilePHID = %s', 36 $panel_table->getTableName(), 37 $project->getPHID()); 38 39 // There are already some settings, so don't touch them. 40 if ($config) { 41 continue; 42 } 43 44 queryfx( 45 $panel_conn, 46 'INSERT INTO %T 47 (phid, profilePHID, panelKey, builtinKey, visibility, panelProperties, 48 panelOrder, dateCreated, dateModified) 49 VALUES (%s, %s, %s, %s, %s, %s, %d, %d, %d)', 50 $panel_table->getTableName(), 51 $panel_table->generatePHID(), 52 $project->getPHID(), 53 PhabricatorProjectWorkboardProfileMenuItem::MENUITEMKEY, 54 PhabricatorProject::ITEM_WORKBOARD, 55 PhabricatorProfileMenuItemConfiguration::VISIBILITY_DEFAULT, 56 '{}', 57 2, 58 PhabricatorTime::getNow(), 59 PhabricatorTime::getNow()); 60}