mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-07 20:38:32 +01:00
Fix a couple of minor Nuance / transaction publisher issues
Summary: I got a couple of tasks stuck in my local queue a while ago when touching Nuance, fix a couple minor issues to clean them up. Test Plan: Ran tasks in queue, got clean results. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D13532
This commit is contained in:
parent
9623f9b5cf
commit
5ce433074c
3 changed files with 39 additions and 22 deletions
|
@ -4663,6 +4663,7 @@ phutil_register_library_map(array(
|
||||||
'NuanceItem' => array(
|
'NuanceItem' => array(
|
||||||
'NuanceDAO',
|
'NuanceDAO',
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
|
'PhabricatorApplicationTransactionInterface',
|
||||||
),
|
),
|
||||||
'NuanceItemEditController' => 'NuanceController',
|
'NuanceItemEditController' => 'NuanceController',
|
||||||
'NuanceItemEditor' => 'PhabricatorApplicationTransactionEditor',
|
'NuanceItemEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
|
|
|
@ -16,41 +16,32 @@ final class NuanceRequestorQuery
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadPage() {
|
public function newObject() {
|
||||||
$table = new NuanceRequestor();
|
return new NuanceRequestor();
|
||||||
$conn_r = $table->establishConnection('r');
|
|
||||||
|
|
||||||
$data = queryfx_all(
|
|
||||||
$conn_r,
|
|
||||||
'SELECT FROM %T %Q %Q %Q',
|
|
||||||
$table->getTableName(),
|
|
||||||
$this->buildWhereClause($conn_r),
|
|
||||||
$this->buildOrderClause($conn_r),
|
|
||||||
$this->buildLimitClause($conn_r));
|
|
||||||
|
|
||||||
return $table->loadAllFromArray($data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
|
protected function loadPage() {
|
||||||
$where = array();
|
return $this->loadStandardPage($this->newObject());
|
||||||
|
}
|
||||||
|
|
||||||
$where[] = $this->buildPagingClause($conn_r);
|
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||||||
|
$where = parent::buildWhereClauseParts($conn);
|
||||||
|
|
||||||
if ($this->ids) {
|
if ($this->ids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn,
|
||||||
'id IN (%Ld)',
|
'id IN (%Ld)',
|
||||||
$this->ids);
|
$this->ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->phids) {
|
if ($this->phids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn,
|
||||||
'phid IN (%Ls)',
|
'phid IN (%Ls)',
|
||||||
$this->phids);
|
$this->phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->formatWhereClause($where);
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
final class NuanceItem
|
final class NuanceItem
|
||||||
extends NuanceDAO
|
extends NuanceDAO
|
||||||
implements PhabricatorPolicyInterface {
|
implements
|
||||||
|
PhabricatorPolicyInterface,
|
||||||
|
PhabricatorApplicationTransactionInterface {
|
||||||
|
|
||||||
const STATUS_OPEN = 0;
|
const STATUS_OPEN = 0;
|
||||||
const STATUS_ASSIGNED = 10;
|
const STATUS_ASSIGNED = 10;
|
||||||
|
@ -143,4 +145,27 @@ final class NuanceItem
|
||||||
'dateNuanced' => $this->getDateNuanced(),
|
'dateNuanced' => $this->getDateNuanced(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
public function getApplicationTransactionEditor() {
|
||||||
|
return new NuanceItemEditor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApplicationTransactionObject() {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApplicationTransactionTemplate() {
|
||||||
|
return new NuanceItemTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function willRenderTimeline(
|
||||||
|
PhabricatorApplicationTransactionView $timeline,
|
||||||
|
AphrontRequest $request) {
|
||||||
|
return $timeline;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue