Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #75 from bwoodhead/6.x

Created a move to trash option
  • Loading branch information...
commit b1aef2c285021781fc404489fe4d1705405f6699 2 parents e000586 + 67007c8
@bwoodhead bwoodhead authored
Showing with 31 additions and 0 deletions.
  1. +28 −0 api/fedora_item.inc
  2. +1 −0  fedora_repository.module
  3. +2 −0  formClass.inc
View
28 api/fedora_item.inc
@@ -635,6 +635,28 @@ class Fedora_Item {
return FALSE;
}
+
+ /**
+ * Set the object to a deleted state
+ */
+ function move_to_trash($log_message = 'Flagged deleted using Islandora API.')
+ {
+ // Loop through the datastreams and mark them deleted
+ foreach($this->get_datastreams_list_as_array() as $dsid)
+ {
+ $this->set_datastream_state($dsid, 'D');
+ }
+
+ // Create a message to mark the object deleted
+ $params = array(
+ 'pid' => $this->pid,
+ 'state' => 'D',
+ 'logMessage' => $logMessage
+ );
+
+ // Send message to mark the object deleted
+ return self::soap_call('modifyObject', $params, $quiet);
+ }
/**
* Removes this object form the repository.
@@ -643,12 +665,18 @@ class Fedora_Item {
* @return type
*/
function purge($log_message = 'Purged using Islandora API.', $force = FALSE) {
+
+ // Flag the object to be deleted first
+ $this->move_to_trash($log_message);
+
+ // Create the delete message
$params = array(
'pid' => $this->pid,
'logMessage' => $log_message,
'force' => $force
);
+ // Delete the object
return $this->soap_call('purgeObject', $params);
}
View
1  fedora_repository.module
@@ -1011,6 +1011,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
);
}
}
+
// Add a 'manage object' tab for all objects, where detailed list of content is shown.
$obj = new FedoraObjectDetailedContent($pid);
$object_details = $obj->showFieldSets();
View
2  formClass.inc
@@ -581,6 +581,8 @@ class formClass {
if (!$this->canShowIngestForm($collection_pid)) {
return FALSE;
}
+
+ drupal_set_title($collection_label);
if (module_exists('islandora_content_model_forms')) {
module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm');
try {
Please sign in to comment.
Something went wrong with that request. Please try again.