Ejemplo n.º 1
0
 /**
  * 
  *
  * @param array $pa_options Array of options passed through to _initView 
  */
 public function ChangeType($pa_options = null)
 {
     list($vn_subject_id, $t_subject) = $this->_initView($pa_options);
     if (!$this->_checkAccess($t_subject)) {
         return false;
     }
     if ($this->request->user->canDoAction("can_change_type_" . $t_subject->tableName())) {
         if (method_exists($t_subject, "changeType")) {
             $this->opo_app_plugin_manager->hookBeforeSaveItem(array('id' => $vn_subject_id, 'table_num' => $t_subject->tableNum(), 'table_name' => $t_subject->tableName(), 'instance' => $t_subject, 'is_insert' => false));
             if (!$t_subject->changeType($vn_new_type_id = $this->request->getParameter('type_id', pInteger))) {
                 // post error
                 $this->notification->addNotification(_t('Could not set type to <em>%1</em>: %2', caGetListItemForDisplay($t_subject->getTypeListCode(), $vn_new_type_id), join("; ", $t_subject->getErrors())), __NOTIFICATION_TYPE_ERROR__);
             } else {
                 $this->notification->addNotification(_t('Set type to <em>%1</em>', $t_subject->getTypeName()), __NOTIFICATION_TYPE_INFO__);
             }
             $this->opo_app_plugin_manager->hookSaveItem(array('id' => $vn_subject_id, 'table_num' => $t_subject->tableNum(), 'table_name' => $t_subject->tableName(), 'instance' => $t_subject, 'is_insert' => false));
         }
     } else {
         $this->notification->addNotification(_t('Cannot change type'), __NOTIFICATION_TYPE_ERROR__);
     }
     $this->Edit();
 }
Ejemplo n.º 2
0
    if ($t_item->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('artist')))) {
        print $t_item->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('artist'))) . "<br/>";
    }
    print "<em>" . $t_item->get('ca_objects.preferred_labels') . "</em> (" . $t_item->get('ca_objects.idno') . ")<br/><br/>";
    $vn_movement_type_id = caGetListItemID('movement_types', 'movement');
    $vn_condition_type_id = caGetListItemID('movement_types', 'condition');
    $vs_movement_for_display = caGetListItemForDisplay('movement_types', 'movement');
    $vs_condition_for_display = caGetListItemForDisplay('movement_types', 'condition');
    print "<strong>Launch new</strong>:<br/>";
    print caEditorLink($this->request, "&nbsp;&nbsp;{$vs_movement_for_display}", '', 'ca_movements', null, array('type_id' => $vn_movement_type_id, 'rel' => 1, 'rel_table' => 'ca_objects', 'rel_type_id' => 'part', 'rel_id' => $t_item->getPrimaryKey()));
    print "</br >";
    print caEditorLink($this->request, "&nbsp;&nbsp;{$vs_condition_for_display}", '', 'ca_movements', null, array('type_id' => $vn_condition_type_id, 'rel' => 1, 'rel_table' => 'ca_objects', 'rel_type_id' => 'part', 'rel_id' => $t_item->getPrimaryKey()));
}
/**
 * UMMA additions to exhibit inspector
 */
if ($t_item->tableName() === 'ca_occurrences' && $t_item->get('type_id') == caGetListItemID('occurrence_types', 'exhibition')) {
    $vn_loan_object_type_id = caGetListItemID('loan_types', 'loan_object');
    $vs_loan_object_for_display = caGetListItemForDisplay('loan_types', 'loan_object');
    print caEditorLink($this->request, "Launch new {$vs_loan_object_for_display}", '', 'ca_loans', null, array('type_id' => $vn_loan_object_type_id, 'rel' => 1, 'rel_table' => 'ca_occurrences', 'rel_type_id' => 'related', 'rel_id' => $t_item->getPrimaryKey()));
}
/**
 * UMMA additions to loan inspector
 */
if ($t_item->tableName() === 'ca_loans' && $t_item->get('type_id') == caGetListItemID('loan_types', 'loan_in')) {
    $vn_loan_object_type_id = caGetListItemID('loan_types', 'loan_object');
    $vs_loan_object_for_display = caGetListItemForDisplay('loan_types', 'loan_object');
    print caEditorLink($this->request, "Launch new {$vs_loan_object_for_display}", '', 'ca_loans', null, array('type_id' => $vn_loan_object_type_id, 'rel' => 1, 'rel_table' => 'ca_loans', 'rel_type_id' => 'related', 'rel_id' => $t_item->getPrimaryKey()));
}
?>
	</div>