function isApplied()
 {
     $done = parent::isApplied();
     if (!$done) {
         global $adb;
         $result = $adb->pquery("SELECT * FROM com_vtiger_workflow_tasktypes where tasktypename='CBRelateSales'", array());
         $done = ($result and $adb->num_rows($result) == 1);
     }
     return $done;
 }
 function isApplied()
 {
     $done = parent::isApplied();
     if (!$done) {
         global $adb;
         $result = $adb->pquery("SELECT * FROM com_vtiger_workflowtasks_entitymethod where module_name = 'Accounts' and method_name= 'Update Contact Assigned To'", array());
         $done = ($result and $adb->num_rows($result) == 1);
     }
     return $done;
 }
 function isApplied()
 {
     $done = parent::isApplied();
     if (!$done) {
         global $adb;
         $result = $adb->pquery("SELECT * FROM com_vtiger_workflowtasks_entitymethod where module_name = 'PurchaseOrder' and method_name= 'UpdateInventory'", array());
         $done = ($result and $adb->num_rows($result) == 1);
     }
     return $done;
 }
 function isApplied()
 {
     if (parent::isApplied()) {
         return true;
     }
     global $adb;
     $emfld = $adb->query_result($adb->query("SELECT count(*) FROM vtiger_reportfolder WHERE FOLDERNAME='Email Reports'"), 0, 0);
     if ($emfld > 0) {
         return true;
     }
     $emrpt = $adb->query_result($adb->query("SELECT count(*) FROM vtiger_report WHERE REPORTNAME in ('Contacts Email Report','Accounts Email Report','Leads Email Report','Vendors Email Report')"), 0, 0);
     if ($emrpt > 0) {
         return true;
     }
     return false;
 }