function undoChange() { if ($this->hasError()) { $this->sendError(); } if ($this->isApplied()) { global $adb; $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE `task` like '%Update Contact Assigned To%'", array()); if ($result and $adb->num_rows($result) > 0) { $this->sendMsg('<span style="font-size:large;weight:bold;">Workflows that use this task exist!! Please eliminate them before undoing this change.</span>'); } else { $emm = new VTEntityMethodManager($adb); $emm->removeEntityMethod("Accounts", "Update Contact Assigned To"); $this->markUndone(false); $this->sendMsg('Changeset ' . get_class($this) . ' undone!'); } } else { $this->sendMsg('Changeset ' . get_class($this) . ' not applied, it cannot be undone!'); } $this->finishExecution(); }