Example #1
0
 function remove_layout($column_name)
 {
     $query = "\tSELECT dataset_layouts.id 'id', dataset_layouts.parent_id 'parent_id'\n\t\t\t\t\tFROM dataset_layouts\n\t\t\t\t\tLEFT JOIN data_sets ON data_sets.id = dataset_layouts.parent_id\n\t\t\t\t\tWHERE data_sets.query_id = '" . $this->id . "'\n\t\t\t\t\tAND dataset_layouts.parent_value='" . $column_name . "'\n\t\t\t\t\tAND data_sets.custom_layout='Enabled'\n\t\t\t\t\tAND data_sets.deleted = '0'\n\t\t\t\t\t";
     $result = $this->getSlaveDb()->query($query, true, "Error running query removing layout for column");
     $GLOBALS['log']->debug("check custom binding remove layout: result is " . print_r($result, true));
     //if($this->db->getRowCount($result) > 0){
     //data sets exists with this query and custom layout enabled
     while (($row = $this->getSlaveDb()->fetchByAssoc($result)) != null) {
         //First re-order the list_order_x
         $layout_object = new DataSet_Layout();
         $layout_object->retrieve($row['id']);
         $controller = new Controller();
         $controller->init($layout_object, "Delete");
         $controller->delete_adjust_order($row['parent_id']);
         //Second, remove the record for the layout
         $layout_object->mark_deleted($row['id']);
         //Third, remove the attribute records
         $query = "\tUPDATE dataset_attributes\n\t\t\t\t\t\t\tSET deleted=1\n\t\t\t\t\t\t\tWHERE parent_id='" . $row['id'] . "'\n\t\t\t\t\t\t\tAND deleted=0\n\t\t\t\t\t\t";
         $this->db->query($query, true, "Error deleting query_id from datasets: ");
         $GLOBALS['log']->debug("Error marking dataset_attributes deleted: " . $result);
         //end while
     }
     //end if rows exist
     //}
     //end function remove_layout
 }
Example #2
0
 /**
  * mark_deleted
  * This function handles the management of related workflow components when a workflow is deleted.  The
  * mark_deleted call is also run when the target module of an existing workflow is modified so that the
  * workflow may invalidate the related workflow alerts, actions, etc.
  *
  * @param string $id
  */
 function mark_deleted($id)
 {
     //Completely remove the trigger components////////////////////////
     $trigger_object_list = $this->get_linked_beans('triggers', 'WorkFlowTriggerShell');
     if (!empty($trigger_object_list)) {
         foreach ($trigger_object_list as $trigger_object) {
             //mark delete trigger components and sub expression components
             mark_delete_components($trigger_object->get_linked_beans('future_triggers', 'Expression'));
             mark_delete_components($trigger_object->get_linked_beans('past_triggers', 'Expression'));
             $trigger_object->mark_deleted($trigger_object->id);
             //end the foreach loop on trigger objects
         }
         //end if any alert objects exist
     }
     //Completely remove the trigger filter components////////////////////////
     $trigger_object_list = $this->get_linked_beans('trigger_filters', 'WorkFlowTriggerShell');
     if (!empty($trigger_object_list)) {
         foreach ($trigger_object_list as $trigger_object) {
             //mark delete trigger filter components and sub expression components
             mark_delete_components($trigger_object->get_linked_beans('expressions', 'Expression'));
             $trigger_object->mark_deleted($trigger_object->id);
             //end the foreach loop on trigger filter objects
         }
         //end if any alert objects exist
     }
     //Completely remove the alert components/////////////////////////
     $alert_object_list = $this->get_linked_beans('alerts', 'WorkFlowAlertShell');
     if (!empty($alert_object_list)) {
         foreach ($alert_object_list as $alert_object) {
             //mark delete alert components and sub expression components
             //Alert recipient Object///////
             $alert_object_list2 = $alert_object->get_linked_beans('alert_components', 'WorkFlowAlert');
             foreach ($alert_object_list2 as $alert_object2) {
                 mark_delete_components($alert_object2->get_linked_beans('expressions', 'Expression'));
                 mark_delete_components($alert_object2->get_linked_beans('rel1_alert_fil', 'Expression'));
                 mark_delete_components($alert_object2->get_linked_beans('rel2_alert_fil', 'Expression'));
                 $alert_object2->mark_deleted($alert_object2->id);
                 //end foreach alert_object2
             }
             //End Alert recipient Object/////
             $alert_object->mark_deleted($alert_object->id);
             //end the forloop on the alert objects
         }
         //end if any alert objects exist
     }
     //Completely remove the action components////////////////////////
     //mark delete actionshell components, action components and sub expression components
     $action_shell_list = $this->get_linked_beans('actions', 'WorkFlowActionShell');
     foreach ($action_shell_list as $action_shell_object) {
         //check for bridged child (invites for meetings/calls
         $action_shell_object->check_for_child_bridge(true);
         //mark delete actionshell sub components and actionshell
         mark_delete_components($action_shell_object->get_linked_beans('actions', 'WorkFlowAction'));
         mark_delete_components($action_shell_object->get_linked_beans('rel1_action_fil', 'Expression'));
         $action_shell_object->mark_deleted($action_shell_object->id);
     }
     if ($this->check_controller == true) {
         require_once 'include/controller/Controller.php';
         //Handle re-processing orders
         $controller = new Controller();
         $controller->init($this, "Delete");
         $controller->delete_adjust_order($this->base_module);
     }
     // Delete the schedules
     $this->deleteSchedules();
     //mark deleted the workflow object if delete_workflow_on_cascade is set to true
     if ($this->delete_workflow_on_cascade) {
         parent::mark_deleted($id);
     }
     $this->write_workflow();
     //end function mark_deleted
 }
Example #3
0
    }
    if (!isset($_POST['header'])) {
        $focus->header = '0';
    }
    if (!isset($_POST['use_prev_header'])) {
        $focus->use_prev_header = '0';
    }
    if (!isset($_POST['prespace_y'])) {
        $focus->prespace_y = '0';
    }
}
//If you are removing a data set from a report
if (!empty($_REQUEST['rem_dataset']) && $_REQUEST['rem_dataset'] == "Y") {
    //First Adjust list_order information accordingly
    $controller->init($focus, "Delete");
    $controller->delete_adjust_order($focus->report_id);
    //Now remove the report_id
    $focus->report_id = "";
}
$focus->save();
$return_id = $focus->id;
//Only handle it if there is a change or this is new and we need to enable
if ($handle_custom_layout == true) {
    if ($custom_layout == true) {
        if ($remove_layout == true) {
            $focus->disable_custom_layout();
        }
        $focus->enable_custom_layout();
    } else {
        $focus->disable_custom_layout();
    }