Example #1
0
 /**
  * returns the list of fields that can be exported
  *
  * @access public
  * return array
  */
 function &export($prefix = false)
 {
     if (!self::$_export) {
         self::$_export = array();
         $fields = self::fields();
         foreach ($fields as $name => $field) {
             if (CRM_Utils_Array::value('export', $field)) {
                 if ($prefix) {
                     self::$_export['ount_item'] =& $fields[$name];
                 } else {
                     self::$_export[$name] =& $fields[$name];
                 }
             }
         }
     }
     return self::$_export;
 }
Example #2
0
 /**
  * Function to delete workflow
  *
  * @param  wid int, Id of the workflow to be deleted.
  *
  * @access public
  * @static
  * @return true on success else false
  */
 static function del($wid)
 {
     $workflow = new CRM_Workflow_DAO_Workflow();
     $workflow->id = $wid;
     if ($workflow->find(TRUE)) {
         CRM_Utils_Hook::pre('delete', 'Workflow', $workflow->id, $workflow);
         $workflow->delete();
         $dsql = "DELETE FROM civicrm_workflow_detail WHERE workflow_id = {$wid}";
         $dao =& CRM_Core_DAO::executeQuery($dsql);
         CRM_Utils_Hook::post('delete', 'Workflow', $workflow->id, $workflow);
         return TRUE;
     }
     return FALSE;
 }