Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #75 from bwoodhead/6.x

Created a move to trash option
  • Loading branch information...
commit b1aef2c285021781fc404489fe4d1705405f6699 2 parents e000586 + 67007c8
Ben Woodhead authored February 14, 2012
28  api/fedora_item.inc
@@ -635,6 +635,28 @@ class Fedora_Item {
635 635
 
636 636
     return FALSE;
637 637
   }
  638
+  
  639
+  /**
  640
+   * Set the object to a deleted state
  641
+   */
  642
+  function move_to_trash($log_message = 'Flagged deleted using Islandora API.')
  643
+  {
  644
+    // Loop through the datastreams and mark them deleted
  645
+    foreach($this->get_datastreams_list_as_array() as $dsid) 
  646
+    {
  647
+      $this->set_datastream_state($dsid, 'D');
  648
+    }
  649
+    
  650
+    // Create a message to mark the object deleted
  651
+    $params = array(
  652
+      'pid' => $this->pid,
  653
+      'state' => 'D',
  654
+      'logMessage' => $logMessage
  655
+    );
  656
+
  657
+    // Send message to mark the object deleted
  658
+    return self::soap_call('modifyObject', $params, $quiet);
  659
+  }
638 660
 
639 661
   /**
640 662
    * Removes this object form the repository.
@@ -643,12 +665,18 @@ class Fedora_Item {
643 665
    * @return type 
644 666
    */
645 667
   function purge($log_message = 'Purged using Islandora API.', $force = FALSE) {
  668
+    
  669
+    // Flag the object to be deleted first
  670
+    $this->move_to_trash($log_message);
  671
+    
  672
+    // Create the delete message
646 673
     $params = array(
647 674
       'pid' => $this->pid,
648 675
       'logMessage' => $log_message,
649 676
       'force' => $force
650 677
     );
651 678
 
  679
+    // Delete the object
652 680
     return $this->soap_call('purgeObject', $params);
653 681
   }
654 682
 
1  fedora_repository.module
@@ -1011,6 +1011,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
1011 1011
       );
1012 1012
     }
1013 1013
   }
  1014
+  
1014 1015
 // Add a 'manage object' tab for all objects, where detailed list of content is shown.
1015 1016
   $obj = new FedoraObjectDetailedContent($pid);
1016 1017
   $object_details = $obj->showFieldSets();
2  formClass.inc
@@ -581,6 +581,8 @@ class formClass {
581 581
     if (!$this->canShowIngestForm($collection_pid)) {
582 582
       return FALSE;
583 583
     }
  584
+    
  585
+    drupal_set_title($collection_label);
584 586
     if (module_exists('islandora_content_model_forms')) {
585 587
       module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm');
586 588
       try {

0 notes on commit b1aef2c

Please sign in to comment.
Something went wrong with that request. Please try again.