Commit c9aa295d authored by Ana Rute Mendes's avatar Ana Rute Mendes ✌🏼

LOCAL:Maniphest:Apply approver rule to event type

Replicate the logic to auto-fill approver for `event` subtype.

Until now event and purchasing forms used the same template but
they were split in two - `purchasing` and `event` - after the
Snipe-IT integration that applied major changes in the purchasing
request form.
parent 5ece8e93
......@@ -473,6 +473,15 @@ final class ManiphestTransactionEditor
}
break;
case 'std:maniphest:event:project':
foreach ($xaction->getRequiredHandlePHIDs() as $p) {
if (!empty($p)) {
$purchasing_project = $p;
break;
}
}
break;
case 'std:maniphest:sysadmin:confidential-request':
if ($xaction->getNewValue() != $xaction->getOldValue()) {
$changed_confidentiality = true;
......@@ -540,11 +549,11 @@ final class ManiphestTransactionEditor
}
}
// CCU: If this is a purchasing type, then try to assign the task to the
// assignee, if empty. It's not overlay pleasant code, since we need
// CCU: If this is a purchasing or event type, then try to assign the task to
// the assignee, if empty. It's not overlay pleasant code, since we need
// to iterate the transactions, rather than interrogate an object.
if ($this->getIsNewObject() && !$any_assign) {
if ($subtype == 'purchasing') {
if (in_array($subtype, array('purchasing', 'event'))) {
if ($approver == null && $purchasing_project !== null) {
$p_proj = id(new PhabricatorProjectQuery())
->setViewer($this->getActor())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment