function getLinkToOffering($focus, $name, $value, $view) { if (empty($focus->offeringid)) { return "-"; } $id = $focus->offeringid; $module = 'oqc_Offering'; $offering = new oqc_Offering(); if ($offering->retrieve($id, true, true)) { //2.2RC1 do not show link if it is deleted $name = $offering->name; return "<a href='index.php?module={$module}&action=DetailView&record={$id}'>{$name}</a>"; } else { // TODO handle exception return "-"; } }
function oqc_get_previousContractId($offering) { $previousContractId = ''; if (!empty($offering->contractid)) { return $offering->contractid; } if (empty($offering->previousrevision)) { return ''; //$contract->previousrevision = ''; } else { $old_offering = new oqc_Offering(); $old_offering->retrieve($offering->previousrevision); if (!empty($old_offering->contractid)) { $previousContractId = $old_offering->contractid; //$contract->previousrevision = $old_offering->contractid; } else { $previousContractId = oqc_get_previousContractId($old_offering); } } return $previousContractId; //$contract->nextrevisions = ''; }