Commit d99b5350 authored by Ana Rute Mendes's avatar Ana Rute Mendes 🌈

CCU: add customer form and serial field to validation

parent 80609ed5
......@@ -401,7 +401,7 @@ final class ManiphestTransactionEditor
// Shipping request and its status was changed to "resolved" (Closed)
// and it's not a preview
if (!$this->getIsNewObject() && !$this->getIsPreview()) {
if ($object->getSubtype() == 'purchasing') {
if (in_array($object->getSubtype(), array('purchasing', 'customer'))) {
try {
$asset_transactions = $snipe_api->createAssetItem($new_status, $object, $xactions);
} catch (Exception $e) {
......@@ -579,7 +579,7 @@ final class ManiphestTransactionEditor
// 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 (in_array($subtype, array('purchasing', 'event'))) {
if (in_array($subtype, array('purchasing', 'customer', 'event'))) {
if ($approver == null && $purchasing_project !== null) {
$p_proj = id(new PhabricatorProjectQuery())
->setViewer($this->getActor())
......
......@@ -250,6 +250,11 @@ function fetch_and_hide_extra_assets_elements(index, unique_items) {
asset["asset_currency_parent"] = document.getElementsByName(
"std:maniphest:purchasing:currency" + index
)[0].parentNode.parentNode;
if (document.getElementsByName("std:maniphest:purchasing:serial" + index).length > 0) {
asset["asset_serial_parent"] = document.getElementsByName(
"std:maniphest:purchasing:serial" + index
)[0].parentNode.parentNode;
};
Object.keys(asset).forEach((i) => asset[i].classList.add("asset_property"));
......
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