Example #1
0
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$va_user_list = $this->getVar('user_list');
?>
<script language="JavaScript" type="text/javascript">
/* <![CDATA[ */
	$(document).ready(function(){
		$('#caUserList').caFormatListTable();
	});
/* ]]> */
</script>
<div class="sectionBox">
<?php 
print caFormTag($this->request, 'ListUsers', 'caUserListForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
print caFormControlBox('<div class="list-filter">' . _t('Filter') . ': <input type="text" name="filter" value="" onkeyup="$(\'#caUserList\').caFilterTable(this.value); return false;" size="20"/></div>', '' . _t('Show %1 users', caHTMLSelect('userclass', $this->request->user->getFieldInfo('userclass', 'BOUNDS_CHOICE_LIST'), array('onchange' => 'jQuery("#caUserListForm").submit();'), array('value' => $this->getVar('userclass')))), caNavHeaderButton($this->request, __CA_NAV_BUTTON_ADD__, _t("New user"), 'administrate/access', 'Users', 'Edit', array('user_id' => 0)));
if (sizeof($va_user_list)) {
    ?>
	
		<a href='#' id='showTools' onclick='jQuery("#searchToolsBox").slideDown(250); jQuery("#showTools").hide(); return false;'><?php 
    print _t("Tools");
    ?>
 <img src="<?php 
    print $this->request->getThemeUrlPath();
    ?>
/graphics/arrows/arrow_right_gray.gif" width="6" height="7" border="0"></a>
<?php 
    print $this->render('user_tools_html.php');
}
?>
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_order = $this->getVar('t_order');
$vn_order_id = (int) $t_order->getPrimaryKey();
$vn_transaction_id = $this->getVar('transaction_id');
$va_errors = $this->getVar('errors');
$vn_max_field_width = 50;
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caClientAdditionalFeesForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'client/orders', 'OrderEditor', 'AdditionalFees', array('order_id' => $vn_order_id)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'client/orders', 'OrderEditor', 'Delete', array('order_id' => $vn_order_id)));
print caFormTag($this->request, 'SaveAdditionalFees', 'caClientAdditionalFeesForm', null, 'post', 'multipart/form-data', '_top', array());
?>
	<h1><?php 
print _t('Additional order fees');
?>
</h1>
	<div class="formContainerBg" style="padding-top:0px;">
		<table width="100%">
			<tr>
				<td>
					<h2><?php 
print _t('Fees');
?>
</h2>
					<div id='caOrderFeeFields'>
<?php 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$vo_result_context = $this->getVar('result_context');
$va_result_views_options = $this->getVar('result_views_options');
if (!$va_result_views_options) {
    $va_result_views_options = array();
}
?>
<div id="searchOptionsBox">
		<div class="bg">
<?php 
print caFormTag($this->request, 'Index', 'caSearchOptionsForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
//print "<div class='col'>";
print "<div class='unit'>";
print "<span>" . _t("Sort") . "</span>";
print "<select name='sort' style='width:120px;'>\n";
$vs_current_sort = $vo_result_context->getCurrentSort();
$vs_current_sort_direction = $vo_result_context->getCurrentSortDirection();
if (is_array($this->getVar("sorts")) && sizeof($this->getVar("sorts")) > 0) {
    foreach ($this->getVar("sorts") as $vs_sort => $vs_option) {
        print "<option value='" . $vs_sort . "'" . ($vs_current_sort == $vs_sort ? " SELECTED" : "") . ">" . $vs_option . "</option>";
    }
}
print "</select>\n";
print caHTMLSelect('direction', array('Ascending' => 'asc', 'Descending' => 'desc'), array(), array('value' => $vs_current_sort_direction));
$va_items_per_page = $this->getVar("items_per_page");
$vs_current_items_per_page = $vo_result_context->getItemsPerPage();
Example #4
0
        }
        if ($this->request->config->get('enable_bookmarks')) {
            print caNavLink($this->request, _t("My Bookmarks"), "", "", "Bookmarks", "Index");
        }
        print caNavLink($this->request, _t("Logout"), "", "", "LoginReg", "logout");
    } else {
        print caNavLink($this->request, _t("Login/Register"), "", "", "LoginReg", "form");
    }
}
# Locale selection
global $g_ui_locale;
$vs_base_url = $this->request->getRequestUrl();
$vs_base_url = substr($vs_base_url, 0, 1) == '/' ? $vs_base_url : '/' . $vs_base_url;
$vs_base_url = str_replace("/lang/[A-Za-z_]+", "", $vs_base_url);
if (is_array($va_ui_locales = $this->request->config->getList('ui_locales')) && sizeof($va_ui_locales) > 1) {
    print caFormTag($this->request, $this->request->getAction(), 'caLocaleSelectorForm', null, 'get', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
    $va_locale_options = array();
    foreach ($va_ui_locales as $vs_locale) {
        $va_parts = explode('_', $vs_locale);
        $vs_lang_name = Zend_Locale::getTranslation(strtolower($va_parts[0]), 'language', strtolower($va_parts[0]));
        $va_locale_options[$vs_lang_name] = $vs_locale;
    }
    print caHTMLSelect('lang', $va_locale_options, array('id' => 'caLocaleSelectorSelect', 'onchange' => 'window.location = \'' . caNavUrl($this->request, $this->request->getModulePath(), $this->request->getController(), $this->request->getAction(), array('lang' => '')) . '\' + jQuery(\'#caLocaleSelectorSelect\').val();'), array('value' => $g_ui_locale, 'dontConvertAttributeQuotesToEntities' => true));
    print "</form>\n";
}
?>
		
		</div><!-- end topbar -->
		<div id="pageArea">
			<div id="header">
<?php 
<?php

/* ----------------------------------------------------------------------
 * app/views/system/preferences_cataloguing_html.php : 
 * ----------------------------------------------------------------------
 * CollectiveAccess
 * Open-source collections management software
 * ----------------------------------------------------------------------
 *
 * Software by Whirl-i-Gig (http://www.whirl-i-gig.com)
 * Copyright 2012 Whirl-i-Gig
 *
 * For more information visit http://www.CollectiveAccess.org
 *
 * This program is free software; you may redistribute it and/or modify it under
 * the terms of the provided license as published by Whirl-i-Gig
 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_user = $this->getVar('t_user');
$vs_group = $this->getVar('group');
?>
 * ----------------------------------------------------------------------
 */
AssetLoadManager::register('datePickerUI');
$t_order = $this->getVar('t_order');
$o_client_services_config = $this->getVar('client_services_config');
$va_credit_card_types = $o_client_services_config->getAssoc('credit_card_types');
if (!is_array($va_payment_info = $t_order->getPaymentInfo())) {
    $va_payment_info = array();
}
$vn_order_id = (int) $t_order->getPrimaryKey();
$vn_transaction_id = $this->getVar('transaction_id');
$va_errors = $this->getVar('errors');
$vs_currency_symbol = $this->getVar('currency_symbol');
$vs_currency_input_format = "<div class='formLabel'>^LABEL<br/>{$vs_currency_symbol}^ELEMENT</div>";
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caClientOrderPaymentForm', array('preventDuplicateSubmits' => true)) . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'client/orders', 'OrderEditor', 'Payment', array('order_id' => $vn_order_id)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'client/orders', 'OrderEditor', 'Delete', array('order_id' => $vn_order_id)));
print caFormTag($this->request, 'SavePayment', 'caClientOrderPaymentForm', null, 'post', 'multipart/form-data', '_top', array());
?>
	<h1><?php 
print _t('Payment information');
?>
</h1>
<?php 
if ($t_order->paymentIsAllowed()) {
    print $t_order->htmlFormElement('payment_method', $vs_form_element_format, array('width' => $vn_width, 'field_errors' => $va_errors[$vs_f], 'choiceList' => $va_payment_types, 'id' => 'caPaymentMethod'));
    ?>
		<div style="margin-left: 20px; margin-bottom: 10px;">
<?php 
    if (is_array($va_errors['payment_info']) && sizeof($va_errors['payment_info'])) {
        ?>
	<div class='formLabelError'><?php 
        print join("; ", $va_errors['payment_info']);
Example #7
0
$vb_can_edit = $t_stop->isSaveable($this->request);
$vb_can_delete = $t_stop->isDeletable($this->request);
$vs_rel_table = $this->getVar('rel_table');
$vn_rel_type_id = $this->getVar('rel_type_id');
$vn_rel_id = $this->getVar('rel_id');
$t_ui = $this->getVar('t_ui');
$vs_context_id = $this->getVar('_context_id');
// used to restrict idno uniqueness checking to within the current list
if ($vb_can_edit) {
    $va_cancel_parameters = $vn_stop_id ? array('stop_id' => $vn_stop_id) : array('type_id' => $t_stop->getTypeID());
    print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'TourStopEditorForm') . ' ' . ($this->getVar('show_save_and_return') ? caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save and return"), 'TourStopEditorForm', array('isSaveAndReturn' => true)) : '') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'editor/tour_stops', 'TourStopEditor', 'Edit/' . $this->request->getActionExtra(), $va_cancel_parameters), '', intval($vn_stop_id) > 0 && $vb_can_delete ? caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'editor/tour_stops', 'TourStopEditor', 'Delete/' . $this->request->getActionExtra(), array('stop_id' => $vn_stop_id)) : '');
}
?>
	<div class="sectionBox">
<?php 
print caFormTag($this->request, 'Save/' . $this->request->getActionExtra() . '/stop_id/' . $vn_stop_id, 'TourStopEditorForm', null, 'POST', 'multipart/form-data');
$va_form_elements = $t_stop->getBundleFormHTMLForScreen($this->request->getActionExtra(), array('request' => $this->request, 'formName' => 'TourStopEditorForm', 'context_id' => $vs_context_id), $va_bundle_list);
print join("\n", $va_form_elements);
if ($vb_can_edit) {
    print $vs_control_box;
}
?>
			<input type='hidden' name='_context_id' value='<?php 
print $this->getVar('_context_id');
?>
'/>
			<input type='hidden' name='stop_id' value='<?php 
print $vn_stop_id;
?>
'/>
			<input type='hidden' name='above_id' value='<?php 
Example #8
0
            ?>
				<h2><?php 
            print _t('Vimeo integration is set up and ready to go!');
            ?>
</h2>
<?php 
            break;
        case 'request':
        default:
            ?>
				<div><?php 
            print _t("If you authorized our app on the Vimeo page, please enter the verification code here.");
            ?>
</div>
<?php 
            print caFormTag($this->request, 'verify', 'vimeo_verify_form', 'vimeo/Auth');
            print caHTMLTextInput('verify_code');
            print caFormSubmitButton($this->request, __CA_NAV_BUTTON_GO__, _t("Submit"), 'vimeo_verify_form');
            ?>
				</form>
				<div><?php 
            print _t('Here is the link to the Vimeo authorization page again: %1', '<a href="' . $this->getVar('authorize_link') . '" target="_blank">Vimeo</a>');
            ?>
</div>
<?php 
            break;
    }
} else {
    ?>
		<div><?php 
    print _t('You need to go to the Vimeo page and authorize our app to use your account.');
// List of values for items that failed on creation attempt
$va_default_values = $this->getVar('default_values');
// Default values for various item fields
$vb_loan_use_item_fee_and_tax = (bool) $this->getVar('loan_use_item_fee_and_tax');
$vb_loan_use_notes_and_restrictions = (bool) $this->getVar('loan_use_notes_and_restrictions');
$vb_loan_use_additional_fees = (bool) $this->getVar('loan_use_additional_fees');
$vs_currency_symbol = $this->getVar('currency_symbol');
$vs_currency_input_format = "<div class='formLabel'>^LABEL<br/>{$vs_currency_symbol}^ELEMENT</div>";
$vs_id_prefix = 'item_list';
$va_initial_values = $this->getVar('order_items');
$vn_max_field_width = 50;
?>
<div class="sectionBox">
<?php 
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Check-out"), 'caClientLibraryCheckoutForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'client/library', 'CheckOut', 'Index', array('order_id' => 0)), '', '');
print caFormTag($this->request, 'Save', 'caClientLibraryCheckoutForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'noTimestamp' => true));
?>
		<div class="formLabel">
			<?php 
print _t('Client name');
?>
:
			<input type="text" size="60" name="client_autocomplete" value="<?php 
print $t_order->getOrderTransactionUserName();
?>
" id="client_autocomplete" class="lookupBg"/>
			<input type="hidden" name="transaction_user_id" id="transaction_user_id" value="<?php 
print ($t_user = $t_order->getOrderTransactionUserInstance()) ? $t_user->getPrimaryKey() : '';
?>
"/>
		
Example #10
0
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$vs_id_prefix = 'caClientLibraryCheckin';
$t_order_item = new ca_commerce_order_items();
$va_initial_values = array();
?>
<div class="sectionBox">
<?php 
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Check-in"), 'caClientLibraryCheckinForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), 'client/library', 'CheckIn', 'Index', array()), '', '');
print caFormTag($this->request, 'Save', 'caClientLibraryCheckinForm', null, 'post', 'multipart/form-data', '_top', array());
?>
		<div class="formLabel">
			<?php 
print _t('Item') . ': ' . caHTMLTextInput('search', array('value' => '', 'width' => '300px', 'id' => 'caCheckInObjectSearch'));
?>
			<a href="#" id='caCheckInButton' class='button' id='caClientLibraryCustomerInfoMoreButton'><?php 
print _t('Find');
?>
 &rsaquo;</a>
		</div>
	
		<div id="<?php 
print $vs_id_prefix . '_item';
?>
">
// 			$va_views = $this->getVar("views");
// 			$vs_current_view = $vo_result_context->getCurrentView();
// 			print _t("Layout:")." <select name='view' onchange='this.form.submit();'>\n";
// 			if(is_array($va_views) && sizeof($va_views) > 0){
// 				foreach($va_views as $vs_view => $vs_name){
// 					print "<option value='".$vs_view."' ".(($vs_view == $vs_current_view) ? "SELECTED='1'" : "").">".$vs_name."</option>\n";
// 				}
// 			}
// 			print "</select>\n";
// 			print "</div>";
$va_search_history = $this->getVar('search_history');
$vs_cur_search = $vo_result_context->getSearchExpression();
if (is_array($va_search_history) && sizeof($va_search_history) > 0) {
    print "<div class='col'>";
    print _t("Search history:") . " ";
    print caFormTag($this->request, 'Index', 'caSearchHistoryForm');
    print "<select name='search' onchange='this.form.submit();'>\n";
    foreach (array_reverse($va_search_history) as $vs_search => $va_search_info) {
        $SELECTED = $vs_cur_search == $va_search_info['display'] ? 'SELECTED="1"' : '';
        $vs_display = strip_tags($va_search_info['display']);
        if (unicode_strlen($vs_display) > 15) {
            $vs_display = unicode_substr($vs_display, 0, 12) . '...';
        }
        print "<option value='" . htmlspecialchars($vs_search, ENT_QUOTES, 'UTF-8') . "' {$SELECTED}>" . $vs_display . " (" . $va_search_info['hits'] . ")</option>\n";
    }
    print "</select>\n";
    print "</form>\n";
    print "</div>";
}
print "</form>\n";
?>
Example #12
0
$t_collection = $this->getVar('t_subject');
$vn_collection_id = $this->getVar('subject_id');
$vn_above_id = $this->getVar('above_id');
$vb_can_edit = $t_collection->isSaveable($this->request);
$vb_can_delete = $t_collection->isDeletable($this->request);
$vs_rel_table = $this->getVar('rel_table');
$vn_rel_type_id = $this->getVar('rel_type_id');
$vn_rel_id = $this->getVar('rel_id');
if ($vb_can_edit) {
    $va_cancel_parameters = $vn_collection_id ? array('collection_id' => $vn_collection_id) : array('type_id' => $t_collection->getTypeID());
    print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'CollectionEditorForm') . ' ' . ($this->getVar('show_save_and_return') ? caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save and return"), 'CollectionEditorForm', array('isSaveAndReturn' => true)) : '') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'editor/collections', 'CollectionEditor', 'Edit/' . $this->request->getActionExtra(), $va_cancel_parameters), '', intval($vn_collection_id) > 0 && $vb_can_delete ? caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'editor/collections', 'CollectionEditor', 'Delete/' . $this->request->getActionExtra(), array('collection_id' => $vn_collection_id)) : '');
}
?>
	<div class="sectionBox">
<?php 
print caFormTag($this->request, 'Save/' . $this->request->getActionExtra() . '/collection_id/' . $vn_collection_id, 'CollectionEditorForm', null, 'POST', 'multipart/form-data');
$va_form_elements = $t_collection->getBundleFormHTMLForScreen($this->request->getActionExtra(), array('request' => $this->request, 'formName' => 'CollectionEditorForm'), $va_bundle_list);
print join("\n", $va_form_elements);
if ($vb_can_edit) {
    print $vs_control_box;
}
?>
			<input type='hidden' name='collection_id' value='<?php 
print $vn_collection_id;
?>
'/>
			<input type='hidden' name='above_id' value='<?php 
print $vn_above_id;
?>
'/>
			<input id='isSaveAndReturn' type='hidden' name='is_save_and_return' value='0'/>
Example #13
0
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_subject = $this->getVar('t_subject');
$vn_subject_id = $this->getVar('subject_id');
$t_ui = $this->getVar('t_ui');
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'InterfaceScreenEditorForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'administrate/setup/interface_screen_editor', 'InterfaceScreenEditor', 'Edit/' . $this->request->getActionExtra(), array('screen_id' => $vn_subject_id)), '', intval($vn_subject_id) > 0 ? caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'administrate/setup/interface_screen_editor', 'InterfaceScreenEditor', 'Delete/' . $this->request->getActionExtra(), array('screen_id' => $vn_subject_id)) : '');
?>
	<div class="sectionBox">
<?php 
print caFormTag($this->request, 'Save/' . $this->request->getActionExtra() . '/screen_id/' . $vn_subject_id, 'InterfaceScreenEditorForm', null, 'POST', 'multipart/form-data');
$va_form_elements = $t_subject->getBundleFormHTMLForScreen($this->request->getActionExtra(), array('request' => $this->request, 'formName' => 'InterfaceScreenEditorForm'));
print join("\n", $va_form_elements);
print $vs_control_box;
?>
			<input type='hidden' name='screen_id' value='<?php 
print $vn_subject_id;
?>
'/>
		</form>
	</div>

	<div class="editorBottomPadding"><!-- empty --></div>
Example #14
0
 /** 
  * 
  */
 public function advanced()
 {
     $o_config = caGetSearchConfig();
     $ps_function = strtolower($this->request->getActionExtra());
     if (!($va_search_info = caGetInfoForAdvancedSearchType($ps_function))) {
         // invalid advanced search type – throw error
         die("Invalid advanced search type");
     }
     $vs_class = $va_search_info['table'];
     $va_types = caGetOption('restrictToTypes', $va_search_info, array(), array('castTo' => 'array'));
     $this->opo_result_context = new ResultContext($this->request, $va_search_info['table'], $this->ops_find_type . '_advanced');
     $this->opo_result_context->setAsLastFind();
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Search %1", $va_search_info["displayName"]));
     $this->view->setVar('searchInfo', $va_search_info);
     $this->view->setVar('options', caGetOption('options', $va_search_info, array(), array('castTo' => 'array')));
     $va_default_form_values = $this->opo_result_context->getParameter("pawtucketAdvancedSearchFormContent_{$ps_function}");
     $va_default_form_booleans = $this->opo_result_context->getParameter("pawtucketAdvancedSearchFormBooleans_{$ps_function}");
     $va_tags = $this->view->getTagList($va_search_info['view']);
     $t_subject = $this->request->datamodel->getInstanceByTableName($va_search_info['table'], true);
     $va_form_elements = array();
     $vs_script = null;
     foreach ($va_tags as $vs_tag) {
         $va_parse = caParseTagOptions($vs_tag);
         $vs_tag_proc = $va_parse['tag'];
         $va_opts = $va_parse['options'];
         if (($vs_default_value = caGetOption('default', $va_opts, null)) || ($vs_default_value = caGetOption($vs_tag_proc, $va_default_form_values, null))) {
             $va_default_form_values[$vs_tag_proc] = $vs_default_value;
             unset($va_opts['default']);
         }
         $vs_tag_val = null;
         switch (strtolower($vs_tag_proc)) {
             case 'submit':
                 $this->view->setVar($vs_tag, "<a href='#' class='caAdvancedSearchFormSubmit'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Submit')) . "</a>");
                 break;
             case 'reset':
                 $this->view->setVar($vs_tag, "<a href='#' class='caAdvancedSearchFormReset'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Reset')) . "</a>");
                 $vs_script = "<script type='text/javascript'>\n\tjQuery('.caAdvancedSearchFormSubmit').bind('click', function() {\n\t\tjQuery('#caAdvancedSearch').submit();\n\t\treturn false;\n\t});\n\tjQuery('.caAdvancedSearchFormReset').bind('click', function() {\n\t\tjQuery('#caAdvancedSearch').find('input[type!=\"hidden\"],textarea').val('');\n\t\tjQuery('#caAdvancedSearch').find('select.caAdvancedSearchBoolean').val('AND');\n\t\tjQuery('#caAdvancedSearch').find('select').prop('selectedIndex', 0);\n\t\treturn false;\n\t});\n\tjQuery(document).ready(function() {\n\t\tvar f, defaultValues = " . json_encode($va_default_form_values) . ", defaultBooleans = " . json_encode($va_default_form_booleans) . ";\n\t\tfor (f in defaultValues) {\n\t\t\tvar f_proc = f + '[]';\n\t\t\tjQuery('input[name=\"' + f_proc+ '\"], textarea[name=\"' + f_proc+ '\"], select[name=\"' + f_proc+ '\"]').each(function(k, v) {\n\t\t\t\tif (defaultValues[f][k]) { jQuery(v).val(defaultValues[f][k]); } \n\t\t\t});\n\t\t}\n\t\tfor (f in defaultBooleans) {\n\t\t\tvar f_proc = f + '[]';\n\t\t\tjQuery('select[name=\"' + f_proc+ '\"].caAdvancedSearchBoolean').each(function(k, v) {\n\t\t\t\tif (defaultBooleans[f][k]) { jQuery(v).val(defaultBooleans[f][k]); }\n\t\t\t});\n\t\t}\n\t});\n</script>\n";
                 break;
             default:
                 if (preg_match("!^(.*):label\$!", $vs_tag_proc, $va_matches)) {
                     $this->view->setVar($vs_tag, $vs_tag_val = $t_subject->getDisplayLabel($va_matches[1]));
                 } elseif (preg_match("!^(.*):boolean\$!", $vs_tag_proc, $va_matches)) {
                     $this->view->setVar($vs_tag, caHTMLSelect($vs_tag_proc . '[]', array(_t('AND') => 'AND', _t('OR') => 'OR', 'AND NOT' => 'AND NOT'), array('class' => 'caAdvancedSearchBoolean')));
                 } else {
                     $va_opts['asArrayElement'] = true;
                     if (isset($va_opts['restrictToTypes']) && $va_opts['restrictToTypes'] && !is_array($va_opts['restrictToTypes'])) {
                         $va_opts['restrictToTypes'] = explode(";", $va_opts['restrictToTypes']);
                     }
                     if ($vs_tag_val = $t_subject->htmlFormElementForSearch($this->request, $vs_tag_proc, $va_opts)) {
                         $this->view->setVar($vs_tag, $vs_tag_val);
                     }
                     $va_tmp = explode('.', $vs_tag_proc);
                     if (($t_element = ca_metadata_elements::getInstance($va_tmp[1])) && $t_element->get('datatype') == 0) {
                         if (is_array($va_elements = $t_element->getElementsInSet())) {
                             foreach ($va_elements as $va_element) {
                                 if ($va_element['datatype'] > 0) {
                                     $va_form_elements[] = $va_tmp[0] . '.' . $va_tmp[1] . '.' . $va_element['element_code'];
                                 }
                             }
                         }
                         break;
                     }
                 }
                 if ($vs_tag_val) {
                     $va_form_elements[] = $vs_tag_proc;
                 }
                 break;
         }
     }
     $this->view->setVar("form", caFormTag($this->request, "{$ps_function}", 'caAdvancedSearch', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'submitOnReturn' => true)));
     $this->view->setVar("/form", $vs_script . caHTMLHiddenInput("_advancedFormName", array("value" => $ps_function)) . caHTMLHiddenInput("_formElements", array("value" => join(';', $va_form_elements))) . caHTMLHiddenInput("_advanced", array("value" => 1)) . "</form>");
     $this->render($va_search_info['view']);
 }
	</div>
	<div class='col-xs-1 col-sm-1 col-md-1 col-lg-1'>
		<div class="detailNavBgRight">
			{{{nextLink}}}
		</div><!-- end detailNavBgLeft -->
	</div><!-- end col -->
</div>

<div class="row">
	<div class="container">
<?php 
if ($this->request->user->hasUserRole("founders_new") || $this->request->user->hasUserRole("admin") || $this->request->user->hasUserRole("curatorial_all_new") || $this->request->user->hasUserRole("curatorial_basic_new") || $this->request->user->hasUserRole("archives_new") || $this->request->user->hasUserRole("library_new")) {
    // Export as PDF
    print "<div id='bViewButtons'>";
    print "<div class='reportTools'>";
    print caFormTag($this->request, 'view/pdf', 'caExportForm', ($this->request->getModulePath() ? $this->request->getModulePath() . '/' : '') . $this->request->getController() . '/' . $this->request->getAction() . '/' . $this->request->getActionExtra(), 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
    print "{$vs_export_format_select}" . caFormSubmitLink($this->request, _t('Download'), 'button', 'caExportForm') . "</form>\n";
    print "</div>";
    print "</div>";
}
if ($vs_lightbox_crumbs) {
    ?>
			<div class="detailLightboxCrumb"><?php 
    print $vs_lightbox_crumbs;
    ?>
</div>
<?php 
}
?>
			<div class="artworkTitle">
				<H4>{{{<unit relativeTo="ca_entities" delimiter="<br/>" restrictToRelationshipTypes="artist|creator"><l>^ca_entities.preferred_labels.name</l></unit>}}}</H4>
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
AssetLoadManager::register('datePickerUI');
$t_order = $this->getVar('t_order');
$vn_order_id = (int) $t_order->getPrimaryKey();
$vn_transaction_id = $this->getVar('transaction_id');
$va_errors = $this->getVar('errors');
$vs_currency_symbol = $this->getVar('currency_symbol');
$vs_currency_input_format = "<div class='formLabel'>^LABEL<br/>{$vs_currency_symbol}^ELEMENT</div>";
if ($t_order->requiresShipping()) {
    print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caClientOrderShippingForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'client/orders', 'OrderEditor', 'Shipping', array('order_id' => $vn_order_id)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'client/orders', 'OrderEditor', 'Delete', array('order_id' => $vn_order_id)));
}
print caFormTag($this->request, 'SaveShipping', 'caClientOrderShippingForm', null, 'post', 'multipart/form-data', '_top', array());
?>
	<h1><?php 
print _t('Shipping information');
?>
</h1>
<?php 
if ($t_order->requiresShipping()) {
    $va_shipping_fields = array("shipping_method", "shipping_cost", "handling_cost", "shipping_notes", "shipping_date", "shipped_on_date");
    foreach ($va_shipping_fields as $vs_f) {
        if ($vs_f == 'shipped_on_date' && !in_array($t_order->get('order_status'), array('PROCESSED', 'PROCESSED_AWAITING_DIGITIZATION', 'PROCESSED_AWAITING_MEDIA_ACCESS', 'COMPLETED'))) {
            continue;
        }
        // don't show shipped on field if order is not paid for
        $va_info = $t_order->getFieldInfo($vs_f);
        if (($vn_width = $va_info['DISPLAY_WIDTH']) > $vn_max_field_width) {
Example #17
0
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_instance = $this->getVar('t_instance');
$vb_can_edit = $t_instance->isSaveable($this->request);
$vb_can_delete = $t_instance->isDeletable($this->request);
?>
<div class="sectionBox">
<?php 
if ($vb_can_edit) {
    print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caAccessControlList') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), $this->request->getModulePath(), $this->request->getController(), 'Access/' . $this->request->getActionExtra(), array($t_instance->primaryKey() => $t_instance->getPrimaryKey())), '', '');
}
print caFormTag($this->request, 'SetAccess', 'caAccessControlList');
?>
	
	<div class='globalAccess'>
		<div class='title'><?php 
print _t('Global access');
?>
</div>
<?php 
$va_global_access = $t_instance->getACLWorldAccess(array('returnAsInitialValuesForBundle' => true));
$va_global_access_status = $va_global_access['access_display'];
print "<p>" . _t('All groups and users ') . " <b>";
print "<span class='accessName'>" . $va_global_access_status . "</span>";
print "</b> " . _t('this record, unless you create an exception') . "</p>";
?>
		<div id='editGlobalAccess'>
if (!$this->request->isAjax()) {
    if (sizeof($va_forms) > 1) {
        print "<div style='float: right;'><form action='#'>" . caHTMLSelect('form', $va_forms, array('onchange' => 'caLoadAdvancedSearchForm();', 'id' => 'caAdvancedSearchFormSelector'), array('value' => $vs_form)) . "</form></div>\n";
    }
    ?>
	<H1 class="results" style="margin-top:15px;"><?php 
    print _t("Advanced Search");
    ?>
</H1>
<?php 
}
if ($va_form_fields && is_array($va_form_fields) && sizeof($va_form_fields)) {
    ?>
		<div id="caAdvancedSearchForm">
			<?php 
    print caFormTag($this->request, 'Index', 'caAdvancedSearch', null, 'POST', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
    ?>



				<table border="0">
<?php 
    $vn_cnt = 0;
    if (($vn_max_cols = (int) $va_form_info['settings']['columns']) < 1) {
        $vn_max_cols = 3;
    }
    foreach ($va_form_fields as $vs_bundle => $va_bundle_info) {
        if (!$vn_cnt) {
            print "<tr valign='top'>";
        }
        ?>
Example #19
0
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$va_events_list = $this->getVar('events_list');
?>
<script language="JavaScript" type="text/javascript">
/* <![CDATA[ */
	$(document).ready(function(){
		$('#caEventList').caFormatListTable();
	});
/* ]]> */
</script>
<div class="sectionBox">
	<?php 
print caFormControlBox('<div class="list-filter">' . _t('Filter') . ': <input type="text" name="filter" value="" onkeyup="$(\'#caEventList\').caFilterTable(this.value); return false;" size="20"/></div>', '', _t('Date range') . ': ' . caFormTag($this->request, 'Index', 'eventsLogSearch') . caHTMLTextInput('search', array('size' => 25, 'value' => $this->getVar('events_list_search'))) . "</form>");
?>
	
	<table id="caEventList" class="listtable" width="100%" border="0" cellpadding="0" cellspacing="1">
		<thead>
			<tr>
				<th class="list-header-unsorted">
					<?php 
print _t('Date/time');
?>
				</th>
				<th class="list-header-unsorted">
					<?php 
print _t('Type');
?>
				</th>
Example #20
0
 * For more information visit http://www.CollectiveAccess.org
 *
 * This program is free software; you may redistribute it and/or modify it under
 * the terms of the provided license as published by Whirl-i-Gig
 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * This source code is free and modifiable under the terms of
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_locale = $this->getVar('t_locale');
$vn_locale_id = $this->getVar('locale_id');
?>
<div class="sectionBox">
<?php 
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'LocalesForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), 'administrate/setup', 'Locales', 'ListLocales', array('locale_id' => 0)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), 'administrate/setup', 'Locales', 'Delete', array('locale_id' => $vn_locale_id)));
print caFormTag($this->request, 'Save', 'LocalesForm');
foreach ($t_locale->getFormFields() as $vs_f => $va_locale_info) {
    print $t_locale->htmlFormElement($vs_f, null, array('field_errors' => $this->request->getActionErrors('field_' . $vs_f)));
}
?>
	</form>
</div>

<div class="editorBottomPadding"><!-- empty --></div>
Example #21
0
<div id="summary" style="clear: both;">
<?php 
if ($vs_display_select_html = $t_display->getBundleDisplaysAsHTMLSelect('display_id', array('onchange' => 'jQuery("#caSummaryDisplaySelectorForm").submit();', 'class' => 'searchFormSelector'), array('table' => $t_item->tableNum(), 'value' => $t_display->getPrimaryKey(), 'access' => __CA_BUNDLE_DISPLAY_READ_ACCESS__, 'user_id' => $this->request->getUserID(), 'restrictToTypes' => array($t_item->getTypeID())))) {
    ?>
	<div id="printButton">
		<a href="<?php 
    print caNavUrl($this->request, $this->request->getModulePath(), $this->request->getController(), "PrintSummary", array($t_item->PrimaryKey() => $t_item->getPrimaryKey()));
    ?>
">
		    <?php 
    print caNavIcon($this->request, __CA_NAV_BUTTON_PDF__);
    ?>
		</a>
    </div>
<?php 
    print caFormTag($this->request, 'Summary', 'caSummaryDisplaySelectorForm');
    ?>
			<div class='searchFormSelector' style='float: right;'>
<?php 
    print _t('Display') . ': ' . $vs_display_select_html;
    ?>
			</div>
			<input type="hidden" name="<?php 
    print $t_item->PrimaryKey();
    ?>
" value="<?php 
    print $vn_item_id;
    ?>
"/>
		</form>
<?php 
 *
 * ----------------------------------------------------------------------
 */
$t_transaction = $this->getVar('transaction');
$pn_communication_id = $this->getVar('communication_id');
?>
 	<div id="caClientCommunicationsReply">
 		<a href="#" class="button" style="float: right;" onclick="jQuery('#caClientCommunicationsMessageDisplay').load('<?php 
print caNavUrl($this->request, 'client/orders', 'Communications', 'ViewMessage', array('communication_id' => $pn_communication_id));
?>
');"><?php 
print _t('Cancel');
?>
 &rsaquo;</a>
<?php 
print caFormTag($this->request, 'SendReply', 'caClientCommunicationsReplyForm');
$t_comm = new ca_commerce_communications($pn_communication_id);
$vn_to_user_id = $t_comm->get('from_user_id');
if (!preg_match('!' . _t("Re:") . '!i', $vs_subject = $t_comm->get('subject'))) {
    $vs_subject = _t("Re:") . ' ' . $vs_subject;
}
$t_comm->clear();
$t_comm->set('subject', $vs_subject);
print "<div class='replyMessageHeader'><span class='replyMessageHeaderHeading'>" . _t('Date') . ':</span> ' . caGetLocalizedDateRange($t = time(), $t) . "</div>";
print "<div class='replyMessageHeader'><span class='replyMessageHeaderHeading'>" . _t('To') . ':</span> ' . caClientServicesGetSenderName(array('from_user_id' => $vn_to_user_id)) . "</div>";
foreach ($t_comm->getFormFields() as $vs_f => $va_info) {
    switch ($vs_f) {
        case 'subject':
        case 'message':
        case 'transaction_id':
            print $t_comm->htmlFormElement($vs_f) . "<br/>\n";
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_order = $this->getVar('t_order');
$vn_order_id = (int) $t_order->getPrimaryKey();
$vn_transaction_id = $this->getVar('transaction_id');
$va_errors = $this->getVar('errors');
$vn_max_field_width = 50;
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caClientOrderCustomerForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'client/orders', 'OrderEditor', 'CustomerInfo', array('order_id' => $vn_order_id)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), '', 'client/orders', 'OrderEditor', 'Delete', array('order_id' => $vn_order_id)));
print caFormTag($this->request, 'SaveCustomerInfo', 'caClientOrderCustomerForm', null, 'post', 'multipart/form-data', '_top', array());
if (!$vn_transaction_id) {
    ?>
	<h1><?php 
    print _t('User account to associate order with');
    ?>
</h1>
	<div class="formLabel">
		<?php 
    print _t('User account');
    ?>
:
		<input type="text" size="60" name="client_autocomplete" value="" id="client_autocomplete" class="lookupBg"/>
		<input type="hidden" name="transaction_user_id" id="transaction_user_id" value=""/>
	</div>
	
				},
				onCloseCallback: function() {
					jQuery("#topNavContainer").show(250);
				}
			});
		}
	});
</script>
<div id="caTypeChangePanel" class="caTypeChangePanel"> 
	<div class='dialogHeader'><?php 
print _t('Change %1 type', $t_item->getProperty('NAME_SINGULAR'));
?>
</div>
	<div id="caTypeChangePanelContentArea">
		<?php 
print caFormTag($this->request, 'ChangeType', 'caChangeTypeForm', null, $ps_method = 'post', 'multipart/form-data', '_top', array());
?>
			<p><?php 
print _t('<strong>Warning:</strong> changing the %1 type will cause information in all fields not applicable to the new type to be discarded. This action cannot be undone.', $t_item->getProperty('NAME_SINGULAR'));
?>
</p>
			<p><?php 
print _t('Change type from <em>%1</em> to %2', $t_item->getTypeName(), $t_item->getTypeListAsHTMLFormElement('new_type_id', array('id' => 'caChangeTypeFormTypeID'), array('childrenOfCurrentTypeOnly' => false, 'directChildrenOnly' => false, 'returnHierarchyLevels' => true, 'access' => __CA_BUNDLE_ACCESS_EDIT__)));
?>
</p>
	
<?php 
if ($vb_queue_enabled) {
    ?>
				<td class="caConfirmBatchExecutionPanelAlertControls">
<?php 
print "</select>\n ";
print caFormSubmitLink($this->request, _t('Search') . ' &rsaquo;', 'button', 'caSavedSearchesForm');
print "</form>\n";
?>
	</div>
</h3>
<?php 
if (sizeof($this->getVar("available_sets")) > 0) {
    ?>
	<h3 class="tools"><?php 
    print _t("Search by set");
    ?>
:
	<div>
<?php 
    print caFormTag($this->request, 'Index', 'caSearchSetsForm', 'find/SearchObjectRepresentations', 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
    print "<select name='search' class='searchSetSelect'>\n";
    foreach ($this->getVar("available_sets") as $vn_set_id => $va_set) {
        $vs_set_identifier = $va_set['set_code'] ? $va_set['set_code'] : $vn_set_id;
        $SELECTED = $vs_cur_search == "set:\"{$vs_set_identifier}\"" ? 'SELECTED="1"' : '';
        print "<option value='set:\"{$vs_set_identifier}\"' {$SELECTED}>" . $va_set["name"] . "</option>\n";
    }
    print "</select>\n ";
    print caFormSubmitLink($this->request, _t('Search') . ' &rsaquo;', 'button', 'caSearchSetsForm');
    print "</form>\n";
    ?>
	</div>
	</h3>
<?php 
}
if ($vo_result) {
Example #26
0
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_item = $this->getVar('t_subject');
$vn_item_id = $this->getVar('subject_id');
$vn_above_id = $this->getVar('above_id');
$t_ui = $this->getVar('t_ui');
$vs_context_id = $this->getVar('_context_id');
// used to restrict idno uniqueness checking to within the current list
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'ListItemEditorForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), 'administrate/setup/list_item_editor', 'ListItemEditor', 'Edit/' . $this->request->getActionExtra(), array('item_id' => $vn_item_id)), '', intval($vn_item_id) > 0 ? caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), 'administrate/setup/list_item_editor', 'ListItemEditor', 'Delete/' . $this->request->getActionExtra(), array('item_id' => $vn_item_id)) : '');
?>
	<div class="sectionBox">
<?php 
print caFormTag($this->request, 'Save/' . $this->request->getActionExtra() . '/item_id/' . $vn_item_id, 'ListItemEditorForm', null, 'POST', 'multipart/form-data');
$va_form_elements = $t_item->getBundleFormHTMLForScreen($this->request->getActionExtra(), array('request' => $this->request, 'formName' => 'ListItemEditorForm', 'context_id' => $vs_context_id), $va_bundle_list);
print join("\n", $va_form_elements);
print $vs_control_box;
?>
			<input type='hidden' name='_context_id' value='<?php 
print $this->getVar('_context_id');
?>
'/>
			<input type='hidden' name='item_id' value='<?php 
print $vn_item_id;
?>
'/>
			<input type='hidden' name='above_id' value='<?php 
print $vn_above_id;
?>
Example #27
0
/**
 * Generates standard-format inspector panels for editors
 *
 * @param View $po_view Inspector view object
 * @param array $pa_options Optional array of options. Supported options are:
 *		backText = a string to use as the "back" button text; default is "Results"
 *
 * @return string HTML implementing the inspector
 */
function caEditorInspector($po_view, $pa_options = null)
{
    require_once __CA_MODELS_DIR__ . '/ca_sets.php';
    require_once __CA_MODELS_DIR__ . '/ca_data_exporters.php';
    $t_item = $po_view->getVar('t_item');
    $vs_table_name = $t_item->tableName();
    if (($vs_priv_table_name = $vs_table_name) == 'ca_list_items') {
        $vs_priv_table_name = 'ca_lists';
    }
    $vn_item_id = $t_item->getPrimaryKey();
    $o_result_context = $po_view->getVar('result_context');
    $t_ui = $po_view->getVar('t_ui');
    $t_type = method_exists($t_item, "getTypeInstance") ? $t_item->getTypeInstance() : null;
    $vs_type_name = method_exists($t_item, "getTypeName") ? $t_item->getTypeName() : '';
    if (!$vs_type_name) {
        $vs_type_name = $t_item->getProperty('NAME_SINGULAR');
    }
    $va_reps = $po_view->getVar('representations');
    $o_dm = Datamodel::load();
    if ($t_item->isHierarchical()) {
        $va_ancestors = $po_view->getVar('ancestors');
        $vn_parent_id = $t_item->get($t_item->getProperty('HIERARCHY_PARENT_ID_FLD'));
    } else {
        $va_ancestors = array();
        $vn_parent_id = null;
    }
    // action extra to preserve currently open screen across next/previous links
    $vs_screen_extra = $po_view->getVar('screen') ? '/' . $po_view->getVar('screen') : '';
    if ($vs_type_name == "list item") {
        $vs_style = "style='height:auto;'";
    }
    if ($vn_item_id | $po_view->request->getAction() === 'Delete') {
        $vs_buf = '<h3 class="nextPrevious" ' . $vs_style . '>' . caEditorFindResultNavigation($po_view->request, $t_item, $o_result_context, $pa_options) . "</h3>\n";
    }
    $vs_color = null;
    if ($t_type) {
        $vs_color = trim($t_type->get('color'));
    }
    if (!$vs_color && $t_ui) {
        $vs_color = trim($t_ui->get('color'));
    }
    if (!$vs_color) {
        $vs_color = "FFFFFF";
    }
    $vs_buf .= "<h4><div id='caColorbox' style='border: 6px solid #{$vs_color};'>\n";
    $vs_icon = null;
    if ($t_type) {
        $vs_icon = $t_type->getMediaTag('icon', 'icon');
    }
    if (!$vs_icon && $t_ui) {
        $vs_icon = $t_ui->getMediaTag('icon', 'icon');
    }
    if ($vs_icon) {
        $vs_buf .= "<div id='inspectoricon' style='border-right: 6px solid #{$vs_color}; border-bottom: 6px solid #{$vs_color}; -moz-border-radius-bottomright: 8px; -webkit-border-bottom-right-radius: 8px;'>\n{$vs_icon}</div>\n";
    }
    if ($po_view->request->getAction() === 'Delete' && $po_view->request->getParameter('confirm', pInteger)) {
        $vs_buf .= "<strong>" . _t("Deleted %1", $vs_type_name) . "</strong>\n";
        $vs_buf .= "<br style='clear: both;'/></div></h4>\n";
    } else {
        if ($vn_item_id) {
            if (!$po_view->request->config->get("{$vs_priv_table_name}_inspector_disable_headline")) {
                if ($po_view->request->user->canDoAction("can_edit_" . $vs_priv_table_name) && sizeof($t_item->getTypeList()) > 1) {
                    $vs_buf .= "<strong>" . _t("Editing %1", $vs_type_name) . ": </strong>\n";
                } else {
                    $vs_buf .= "<strong>" . _t("Viewing %1", $vs_type_name) . ": </strong>\n";
                }
            }
            if ($t_item->hasField('is_deaccessioned') && $t_item->get('is_deaccessioned') && $t_item->get('deaccession_date', array('getDirectDate' => true)) <= caDateToHistoricTimestamp(_t('now'))) {
                // If currently deaccessioned then display deaccession message
                $vs_buf .= "<br/><div class='inspectorDeaccessioned'>" . _t('Deaccessioned %1', $t_item->get('deaccession_date')) . "</div>\n";
                if ($vs_deaccession_notes = $t_item->get('deaccession_notes')) {
                    TooltipManager::add(".inspectorDeaccessioned", $vs_deaccession_notes);
                }
            } else {
                if ($po_view->request->user->canDoAction('can_see_current_location_in_inspector_ca_objects')) {
                    if ($t_ui && method_exists($t_item, "getObjectHistory") && (is_array($va_placements = $t_ui->getPlacementsForBundle('ca_objects_history')) && sizeof($va_placements) > 0)) {
                        //
                        // Output current "location" of object in life cycle. Configuration is taken from a ca_objects_history bundle configured for the current editor
                        //
                        $va_placement = array_shift($va_placements);
                        $va_bundle_settings = $va_placement['settings'];
                        if (is_array($va_history = $t_item->getObjectHistory($va_bundle_settings, array('limit' => 1, 'currentOnly' => true))) && sizeof($va_history) > 0) {
                            $va_current_location = array_shift(array_shift($va_history));
                            if (!($vs_inspector_current_location_label = $po_view->request->config->get("ca_objects_inspector_current_location_label"))) {
                                $vs_inspector_current_location_label = _t('Current');
                            }
                            if ($va_current_location['display']) {
                                $vs_buf .= "<div class='inspectorCurrentLocation'><strong>" . $vs_inspector_current_location_label . ':</strong><br/>' . $va_current_location['display'] . "</div>";
                            }
                        }
                    } elseif (method_exists($t_item, "getLastLocationForDisplay")) {
                        // If no ca_objects_history bundle is configured then display the last storage location
                        if ($vs_current_location = $t_item->getLastLocationForDisplay("<ifdef code='ca_storage_locations.parent.preferred_labels'>^ca_storage_locations.parent.preferred_labels ➜ </ifdef>^ca_storage_locations.preferred_labels.name")) {
                            $vs_buf .= "<br/><div class='inspectorCurrentLocation'>" . _t('Location: %1', $vs_current_location) . "</div>\n";
                            $vs_full_location_hierarchy = $t_item->getLastLocationForDisplay("^ca_storage_locations.hierarchy.preferred_labels.name%delimiter=_➜_");
                            if ($vs_full_location_hierarchy !== $vs_current_location) {
                                TooltipManager::add(".inspectorCurrentLocation", $vs_full_location_hierarchy);
                            }
                        }
                    }
                }
            }
            //
            // Display flags; expressions for these are defined in app.conf in the <table_name>_inspector_display_flags directive
            //
            if (is_array($va_display_flags = $po_view->request->config->getAssoc("{$vs_table_name}_inspector_display_flags"))) {
                $va_display_flag_buf = array();
                foreach ($va_display_flags as $vs_exp => $vs_display_flag) {
                    $va_exp_vars = array();
                    foreach (ExpressionParser::getVariableList($vs_exp) as $vs_var_name) {
                        $va_exp_vars[$vs_var_name] = $t_item->get($vs_var_name, array('returnIdno' => true));
                    }
                    if (ExpressionParser::evaluate($vs_exp, $va_exp_vars)) {
                        $va_display_flag_buf[] = $t_item->getWithTemplate("{$vs_display_flag}");
                    }
                }
                if (sizeof($va_display_flag_buf) > 0) {
                    $vs_buf .= join("; ", $va_display_flag_buf);
                }
            }
            $vs_label = '';
            $vb_dont_use_labels_for_ca_objects = (bool) $t_item->getAppConfig()->get('ca_objects_dont_use_labels');
            if (!($vs_table_name === 'ca_objects' && $vb_dont_use_labels_for_ca_objects)) {
                if ($vs_get_spec = $po_view->request->config->get("{$vs_table_name}_inspector_display_title")) {
                    $vs_label = caProcessTemplateForIDs($vs_get_spec, $vs_table_name, array($t_item->getPrimaryKey()));
                } else {
                    $va_object_collection_collection_ancestors = $po_view->getVar('object_collection_collection_ancestors');
                    if ($t_item->tableName() == 'ca_objects' && $t_item->getAppConfig()->get('ca_objects_x_collections_hierarchy_enabled') && is_array($va_object_collection_collection_ancestors) && sizeof($va_object_collection_collection_ancestors)) {
                        $va_collection_links = array();
                        foreach ($va_object_collection_collection_ancestors as $va_collection_ancestor) {
                            $va_collection_links[] = caEditorLink($po_view->request, $va_collection_ancestor['label'], '', 'ca_collections', $va_collection_ancestor['collection_id']);
                        }
                        $vs_label .= join(" / ", $va_collection_links) . ' &gt; ';
                    }
                    if (method_exists($t_item, 'getLabelForDisplay')) {
                        $vn_parent_index = sizeof($va_ancestors) - 1;
                        if ($vn_parent_id && ($vs_table_name != 'ca_places' || $vn_parent_index > 0)) {
                            $va_parent = $va_ancestors[$vn_parent_index];
                            $vs_disp_fld = $t_item->getLabelDisplayField();
                            if ($va_parent['NODE'][$vs_disp_fld] && ($vs_editor_link = caEditorLink($po_view->request, $va_parent['NODE'][$vs_disp_fld], '', $vs_table_name, $va_parent['NODE'][$t_item->primaryKey()]))) {
                                $vs_label .= $vs_editor_link . ' &gt; ' . $t_item->getLabelForDisplay();
                            } else {
                                $vs_label .= ($va_parent['NODE'][$vs_disp_fld] ? $va_parent['NODE'][$vs_disp_fld] . ' &gt; ' : '') . $t_item->getLabelForDisplay();
                            }
                        } else {
                            $vs_label .= $t_item->getLabelForDisplay();
                            if ($vs_table_name === 'ca_editor_uis' && in_array($po_view->request->getAction(), array('EditScreen', 'DeleteScreen', 'SaveScreen'))) {
                                $t_screen = new ca_editor_ui_screens($po_view->request->getParameter('screen_id', pInteger));
                                if (!($vs_screen_name = $t_screen->getLabelForDisplay())) {
                                    $vs_screen_name = _t('new screen');
                                }
                                $vs_label .= " &gt; " . $vs_screen_name;
                            }
                        }
                    } else {
                        $vs_label .= $t_item->get('name');
                    }
                }
            }
            $vb_show_idno = (bool) ($vs_idno = $t_item->get($t_item->getProperty('ID_NUMBERING_ID_FIELD')));
            if (!$vs_label) {
                switch ($vs_table_name) {
                    case 'ca_commerce_orders':
                        if ($t_item->get('order_type') == 'L') {
                            if ($vs_org = $t_item->get('billing_organization')) {
                                $vs_label = _t('%5 #%4 on %1 to %2 (%3)', caGetLocalizedDate($t_item->get('created_on', array('getDirectDate' => true)), array('dateFormat' => 'delimited', 'timeOmit' => true)), $t_item->get('billing_fname') . ' ' . $t_item->get('billing_lname'), $vs_org, $t_item->getOrderNumber(), caUcFirstUTF8Safe($t_item->getProperty('NAME_SINGULAR')));
                            } else {
                                $vs_label = _t('%4 #%3 on %1 to %2', caGetLocalizedDate($t_item->get('created_on', array('getDirectDate' => true)), array('dateFormat' => 'delimited', 'timeOmit' => true)), $t_item->get('billing_fname') . ' ' . $t_item->get('billing_lname'), $t_item->getOrderNumber(), caUcFirstUTF8Safe($t_item->getProperty('NAME_SINGULAR')));
                            }
                        } else {
                            if ($vs_org = $t_item->get('billing_organization')) {
                                $vs_label = _t('%5 #%4 on %1 from %2 (%3)', caGetLocalizedDate($t_item->get('created_on', array('getDirectDate' => true)), array('dateFormat' => 'delimited', 'timeOmit' => true)), $t_item->get('billing_fname') . ' ' . $t_item->get('billing_lname'), $vs_org, $t_item->getOrderNumber(), caUcFirstUTF8Safe($t_item->getProperty('NAME_SINGULAR')));
                            } else {
                                $vs_label = _t('%4 #%3 on %1 from %2', caGetLocalizedDate($t_item->get('created_on', array('getDirectDate' => true)), array('dateFormat' => 'delimited', 'timeOmit' => true)), $t_item->get('billing_fname') . ' ' . $t_item->get('billing_lname'), $t_item->getOrderNumber(), caUcFirstUTF8Safe($t_item->getProperty('NAME_SINGULAR')));
                            }
                        }
                        break;
                    default:
                        if ($vs_table_name === 'ca_objects' && $vb_dont_use_labels_for_ca_objects) {
                            $vs_label = $vs_idno;
                            $vb_show_idno = false;
                        } else {
                            $vs_label = '[' . _t('BLANK') . ']';
                        }
                        break;
                }
            }
            $vs_buf .= "<div class='recordTitle {$vs_table_name}' style='width:190px; overflow:hidden;'>{$vs_label}" . ($vb_show_idno ? "<a title='{$vs_idno}'>" . ($vs_idno ? " ({$vs_idno})" : '') : "") . "</a></div>";
            if ($vs_table_name === 'ca_object_lots' && $t_item->getPrimaryKey()) {
                $vs_buf .= "<div id='inspectorLotMediaDownload'><strong>" . (($vn_num_objects = $t_item->numObjects()) == 1 ? _t('Lot contains %1 object', $vn_num_objects) : _t('Lot contains %1 objects', $vn_num_objects)) . "</strong>\n";
            }
            if ($po_view->request->config->get("include_custom_inspector")) {
                if (file_exists($po_view->request->getViewsDirectoryPath() . "/bundles/inspector_info.php")) {
                    $vo_inspector_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
                    $vo_inspector_view->setVar('t_item', $t_item);
                    $vs_buf .= $vo_inspector_view->render('inspector_info.php');
                }
            }
        } else {
            $vs_parent_name = '';
            if ($vn_parent_id = $po_view->request->getParameter('parent_id', pInteger)) {
                $t_parent = clone $t_item;
                $t_parent->load($vn_parent_id);
                $vs_parent_name = $t_parent->getLabelForDisplay();
            }
            $vs_buf .= "<div class='creatingNew'>" . _t("Creating new %1", $vs_type_name) . " " . ($vs_parent_name ? _t("%1 &gt; New %2", $vs_parent_name, $vs_type_name) : '') . "</div>\n";
            $vs_buf .= "<br/>\n";
        }
        // -------------------------------------------------------------------------------------
        if ($t_item->getPrimaryKey()) {
            if (sizeof($va_reps) > 0) {
                $va_imgs = array();
                $vs_buf .= "<div id='inspectorMedia'>";
                $vn_r = $vn_primary_index = 0;
                foreach ($va_reps as $va_rep) {
                    if (!($va_rep['info']['preview170']['WIDTH'] && $va_rep['info']['preview170']['HEIGHT'])) {
                        continue;
                    }
                    if ($vb_is_primary = isset($va_rep['is_primary']) && (bool) $va_rep['is_primary']) {
                        $vn_primary_index = $vn_r;
                    }
                    $va_imgs[] = "{url:'" . $va_rep['urls']['preview170'] . "', width: " . $va_rep['info']['preview170']['WIDTH'] . ", height: " . $va_rep['info']['preview170']['HEIGHT'] . ", link: '#', onclick:  'caMediaPanel.showPanel(\\'" . caNavUrl($po_view->request, '*', '*', 'GetMediaOverlay', array($t_item->primaryKey() => $vn_item_id, 'representation_id' => $va_rep['representation_id'])) . "\\')'}";
                    $vn_r++;
                }
                if (sizeof($va_reps) > 1) {
                    $vs_buf .= "\n\t\t\t\t\t<div class='leftScroll'>\n\t\t\t\t\t\t<a href='#' onclick='inspectorInfoRepScroller.scrollToPreviousImage(); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_SCROLL_LT__) . "</a>\n\t\t\t\t\t</div>\n\t\t";
                }
                if (sizeof($va_imgs) > 0) {
                    $vs_buf .= "\n\t\t\t\t<div id='inspectorInfoRepScrollingViewer' style='position: relative;'>\n\t\t\t\t\t<div id='inspectorInfoRepScrollingViewerContainer'>\n\t\t\t\t\t\t<div id='inspectorInfoRepScrollingViewerImageContainer'></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t";
                    if (sizeof($va_reps) > 1) {
                        $vs_buf .= "\n\t\t\t\t\t<div class='rightScroll'>\n\t\t\t\t\t\t<a href='#' onclick='inspectorInfoRepScroller.scrollToNextImage(); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_SCROLL_RT__) . "</a>\n\t\t\t\t\t</div>\n\t\t";
                    }
                    TooltipManager::add(".leftScroll", _t('Previous'));
                    TooltipManager::add(".rightScroll", _t('Next'));
                    $vs_buf .= "<script type='text/javascript'>";
                    $vs_buf .= "\n\t\t\t\t\tvar inspectorInfoRepScroller = caUI.initImageScroller([" . join(",", $va_imgs) . "], 'inspectorInfoRepScrollingViewerImageContainer', {\n\t\t\t\t\t\t\tcontainerWidth: 170, containerHeight: 170,\n\t\t\t\t\t\t\timageCounterID: 'inspectorInfoRepScrollingViewerCounter',\n\t\t\t\t\t\t\tscrollingImageClass: 'inspectorInfoRepScrollerImage',\n\t\t\t\t\t\t\tscrollingImagePrefixID: 'inspectorInfoRep',\n\t\t\t\t\t\t\tinitialIndex: {$vn_primary_index}\n\t\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>";
                }
                $vs_buf .= "</div>\n";
                if ($vs_get_spec = $po_view->request->config->get("{$vs_table_name}_inspector_display_below_media")) {
                    $vs_buf .= caProcessTemplateForIDs($vs_get_spec, $vs_table_name, array($t_item->getPrimaryKey()));
                }
            }
            $vs_buf .= "<div id='toolIcons'>";
            if ($vn_item_id) {
                # --- watch this link
                $vs_watch = "";
                if (in_array($vs_table_name, array('ca_objects', 'ca_object_lots', 'ca_entities', 'ca_places', 'ca_occurrences', 'ca_collections', 'ca_storage_locations'))) {
                    require_once __CA_MODELS_DIR__ . '/ca_watch_list.php';
                    $t_watch_list = new ca_watch_list();
                    $vs_watch = "<div class='watchThis'><a href='#' title='" . _t('Add/remove item to/from watch list.') . "' onclick='caToggleItemWatch(); return false;' id='caWatchItemButton'>" . caNavIcon($po_view->request, $t_watch_list->isItemWatched($vn_item_id, $t_item->tableNum(), $po_view->request->user->get("user_id")) ? __CA_NAV_BUTTON_UNWATCH__ : __CA_NAV_BUTTON_WATCH__) . "</a></div>";
                    $vs_buf .= "\n<script type='text/javascript'>\n\t\tfunction caToggleItemWatch() {\n\t\t\tvar url = '" . caNavUrl($po_view->request, $po_view->request->getModulePath(), $po_view->request->getController(), 'toggleWatch', array($t_item->primaryKey() => $vn_item_id)) . "';\n\t\t\t\n\t\t\tjQuery.getJSON(url, {}, function(data, status) {\n\t\t\t\tif (data['status'] == 'ok') {\n\t\t\t\t\tjQuery('#caWatchItemButton').html((data['state'] == 'watched') ? '" . addslashes(caNavIcon($po_view->request, __CA_NAV_BUTTON_UNWATCH__)) . "' : '" . addslashes(caNavIcon($po_view->request, __CA_NAV_BUTTON_WATCH__)) . "');\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Error toggling watch status for item: ' + data['errors']);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t</script>\n";
                }
                $vs_buf .= "{$vs_watch}\n";
                TooltipManager::add("#caWatchItemButton", _t('Watch/Unwatch this record'));
                if ($po_view->request->user->canDoAction("can_change_type_{$vs_table_name}")) {
                    $vs_buf .= "<div id='inspectorChangeType'><div id='inspectorChangeTypeButton'><a href='#' onclick='caTypeChangePanel.showPanel(); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_CHANGE__ . " Change Type", array('title' => _t('Change type'))) . "</a></div></div>\n";
                    $vo_change_type_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
                    $vo_change_type_view->setVar('t_item', $t_item);
                    FooterManager::add($vo_change_type_view->render("change_type_html.php"));
                    TooltipManager::add("#inspectorChangeType", _t('Change Record Type'));
                }
                if ($t_item->getPrimaryKey() && $po_view->request->config->get($vs_table_name . '_show_add_child_control_in_inspector')) {
                    $vb_show_add_child_control = true;
                    if (is_array($va_restrict_add_child_control_to_types = $po_view->request->config->getList($vs_table_name . '_restrict_child_control_in_inspector_to_types')) && sizeof($va_restrict_add_child_control_to_types)) {
                        $t_type_instance = $t_item->getTypeInstance();
                        if (!in_array($t_type_instance->get('idno'), $va_restrict_add_child_control_to_types) && !in_array($t_type_instance->getPrimaryKey(), $va_restrict_add_child_control_to_types)) {
                            $vb_show_add_child_control = false;
                        }
                    }
                    if ($vb_show_add_child_control) {
                        if ((bool) $po_view->request->config->get($vs_table_name . '_enforce_strict_type_hierarchy')) {
                            // strict menu
                            $vs_type_list = $t_item->getTypeListAsHTMLFormElement('type_id', array('style' => 'width: 90px; font-size: 9px;'), array('childrenOfCurrentTypeOnly' => true, 'directChildrenOnly' => $po_view->request->config->get($vs_table_name . '_enforce_strict_type_hierarchy') == '~' ? false : true, 'returnHierarchyLevels' => true, 'access' => __CA_BUNDLE_ACCESS_EDIT__));
                        } else {
                            // all types
                            $vs_type_list = $t_item->getTypeListAsHTMLFormElement('type_id', array('style' => 'width: 90px; font-size: 9px;'), array('access' => __CA_BUNDLE_ACCESS_EDIT__));
                        }
                        if ($vs_type_list) {
                            $vs_buf .= "<div id='inspectorCreateChild'><div id='inspectorCreateChildButton'><a href='#' onclick='caCreateChildPanel.showPanel(); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_CHILD__, array('title' => _t('Create Child Record'))) . "</a></div></div>\n";
                            $vo_create_child_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
                            $vo_create_child_view->setVar('t_item', $t_item);
                            $vo_create_child_view->setVar('type_list', $vs_type_list);
                            FooterManager::add($vo_create_child_view->render("create_child_html.php"));
                            TooltipManager::add("#inspectorCreateChildButton", _t('Create a child record under this one'));
                        }
                    }
                }
            }
            if ($po_view->request->user->canDoAction('can_duplicate_' . $vs_table_name) && $t_item->getPrimaryKey()) {
                $vs_buf .= '<div id="caDuplicateItemButton">';
                $vs_buf .= caFormTag($po_view->request, 'Edit', 'DuplicateItemForm', $po_view->request->getModulePath() . '/' . $po_view->request->getController(), 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'noTimestamp' => true));
                $vs_buf .= caFormSubmitLink($po_view->request, caNavIcon($po_view->request, __CA_NAV_BUTTON_DUPLICATE__), '', 'DuplicateItemForm');
                $vs_buf .= caHTMLHiddenInput($t_item->primaryKey(), array('value' => $t_item->getPrimaryKey()));
                $vs_buf .= caHTMLHiddenInput('mode', array('value' => 'dupe'));
                $vs_buf .= "</form>";
                $vs_buf .= "</div>";
                TooltipManager::add("#caDuplicateItemButton", _t('Duplicate this %1', mb_strtolower($vs_type_name, 'UTF-8')));
            }
            //
            // Download media in lot ($vn_num_objects is only set for object lots)
            if ($vn_num_objects > 0) {
                $vs_buf .= "<div id='inspectorLotMediaDownloadButton'>" . caNavLink($po_view->request, caNavIcon($po_view->request, __CA_NAV_BUTTON_DOWNLOAD__), "button", $po_view->request->getModulePath(), $po_view->request->getController(), 'getLotMedia', array('lot_id' => $t_item->getPrimaryKey(), 'download' => 1), array()) . "</div>\n";
                TooltipManager::add('#inspectorLotMediaDownloadButton', _t("Download all media associated with objects in this lot"));
            }
            //
            // Download media in set
            if ($vs_table_name == 'ca_sets' && sizeof($t_item->getItemRowIDs()) > 0) {
                $vs_buf .= "<div id='inspectorSetMediaDownloadButton'>" . caNavLink($po_view->request, caNavIcon($po_view->request, __CA_NAV_BUTTON_DOWNLOAD__), "button", $po_view->request->getModulePath(), $po_view->request->getController(), 'getSetMedia', array('set_id' => $t_item->getPrimaryKey(), 'download' => 1), array()) . "</div>\n";
                TooltipManager::add('#inspectorSetMediaDownloadButton', _t("Download all media associated with records in this set"));
            }
            $vs_more_info = '';
            // list of sets in which item is a member
            $t_set = new ca_sets();
            if (is_array($va_sets = caExtractValuesByUserLocale($t_set->getSetsForItem($t_item->tableNum(), $t_item->getPrimaryKey(), array('user_id' => $po_view->request->getUserID(), 'access' => __CA_SET_READ_ACCESS__)))) && sizeof($va_sets)) {
                $va_links = array();
                foreach ($va_sets as $vn_set_id => $va_set) {
                    $va_links[] = "<a href='" . caEditorUrl($po_view->request, 'ca_sets', $vn_set_id) . "'>" . $va_set['name'] . "</a>";
                }
                $vs_more_info .= "<div><strong>" . (sizeof($va_links) == 1 ? _t("In set") : _t("In sets")) . "</strong> " . join(", ", $va_links) . "</div>\n";
            }
            // export options
            if ($vn_item_id && ($vs_select = $po_view->getVar('available_mappings_as_html_select'))) {
                $vs_more_info .= "<div class='inspectorExportControls'>" . caFormTag($po_view->request, 'exportItem', 'caExportForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
                $vs_more_info .= $vs_select;
                $vs_more_info .= caHTMLHiddenInput($t_item->primaryKey(), array('value' => $t_item->getPrimaryKey()));
                $vs_more_info .= caHTMLHiddenInput('download', array('value' => 1));
                $vs_more_info .= caFormSubmitLink($po_view->request, 'Export &rsaquo;', 'button', 'caExportForm');
                $vs_more_info .= "</form></div>";
            }
            $va_creation = $t_item->getCreationTimestamp();
            $va_last_change = $t_item->getLastChangeTimestamp();
            if ($va_creation['timestamp'] || $va_last_change['timestamp']) {
                $vs_more_info .= "<div class='inspectorChangeDateList'>";
                if ($va_creation['timestamp']) {
                    if (!trim($vs_name = $va_creation['fname'] . ' ' . $va_creation['lname'])) {
                        $vs_name = null;
                    }
                    $vs_interval = ($vn_t = time() - $va_creation['timestamp']) == 0 ? _t('Just now') : _t('%1 ago', caFormatInterval($vn_t, 2));
                    $vs_more_info .= "<div class='inspectorChangeDateListLine'  id='caInspectorCreationDate'>" . ($vs_name ? _t('<strong>Created</strong><br/>%1 by %2', $vs_interval, $vs_name) : _t('<strong>Created</strong><br/>%1', $vs_interval)) . "</div>";
                    TooltipManager::add("#caInspectorCreationDate", "<h2>" . _t('Created on') . "</h2>" . _t('Created on %1', caGetLocalizedDate($va_creation['timestamp'], array('dateFormat' => 'delimited'))));
                }
                if ($va_last_change['timestamp'] && $va_creation['timestamp'] != $va_last_change['timestamp']) {
                    if (!trim($vs_name = $va_last_change['fname'] . ' ' . $va_last_change['lname'])) {
                        $vs_name = null;
                    }
                    $vs_interval = ($vn_t = time() - $va_last_change['timestamp']) == 0 ? _t('Just now') : _t('%1 ago', caFormatInterval($vn_t, 2));
                    $vs_more_info .= "<div class='inspectorChangeDateListLine' id='caInspectorChangeDate'>" . ($vs_name ? _t('<strong>Last changed</strong><br/>%1 by %2', $vs_interval, $vs_name) : _t('<strong>Last changed</strong><br/>%1', $vs_interval)) . "</div>";
                    TooltipManager::add("#caInspectorChangeDate", "<h2>" . _t('Last changed on') . "</h2>" . _t('Last changed on %1', caGetLocalizedDate($va_last_change['timestamp'], array('dateFormat' => 'delimited'))));
                }
                if (method_exists($t_item, 'getMetadataDictionaryRuleViolations') && is_array($va_violations = $t_item->getMetadataDictionaryRuleViolations()) && ($vn_num_violations = sizeof($va_violations)) > 0) {
                    $va_violation_messages = array();
                    foreach ($va_violations as $vn_violation_id => $va_violation) {
                        $vs_label = $t_item->getDisplayLabel($va_violation['bundle_name']);
                        $va_violation_messages[] = "<li><em><u>{$vs_label}</u></em> " . $va_violation['violationMessage'] . "</li>";
                    }
                    $vs_more_info .= "<div id='caInspectorViolationsList'>" . ($vs_num_violations_display = "<img src='" . $po_view->request->getThemeUrlPath() . "/graphics/icons/warning_small.gif' border='0'/> " . ($vn_num_violations > 1 ? _t('%1 problems require attention', $vn_num_violations) : _t('%1 problem requires attention', $vn_num_violations))) . "</div>\n";
                    TooltipManager::add("#caInspectorViolationsList", "<h2>{$vs_num_violations_display}</h2><ol>" . join("\n", $va_violation_messages)) . "</ol>\n";
                }
                $vs_more_info .= "</div>\n";
            }
            if ($vs_get_spec = $po_view->request->config->get("{$vs_table_name}_inspector_display_more_info")) {
                $vs_more_info .= caProcessTemplateForIDs($vs_get_spec, $vs_table_name, array($t_item->getPrimaryKey()));
            }
            if ($vs_more_info) {
                $vs_buf .= "<div class='button info'><a href='#' id='inspectorMoreInfo'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_INFO2__) . "</a></div>\n\t\t\t<div id='inspectorInfo' >";
                $vs_buf .= $vs_more_info . "</div>\n";
                TooltipManager::add("#inspectorMoreInfo", _t('See more information about this record'));
            }
            $vs_buf .= "</div><!--End tooIcons-->";
        }
        // -------------------------------------------------------------------------------------
        //
        // Item-specific information
        //
        //
        // Output info for related items
        //
        if (!$t_item->getPrimaryKey()) {
            // only applies to new records
            $vs_rel_table = $po_view->request->getParameter('rel_table', pString);
            $vn_rel_type_id = $po_view->request->getParameter('rel_type_id', pString);
            $vn_rel_id = $po_view->request->getParameter('rel_id', pInteger);
            if ($vs_rel_table && $po_view->request->datamodel->tableExists($vs_rel_table) && $vn_rel_type_id && $vn_rel_id) {
                $t_rel = $po_view->request->datamodel->getTableInstance($vs_rel_table);
                if ($t_rel && $t_rel->load($vn_rel_id)) {
                    $vs_buf .= '<strong>' . _t("Will be related to %1", $t_rel->getTypeName()) . '</strong>: ' . $t_rel->getLabelForDisplay();
                }
            }
        }
        //
        // Output lot info for ca_objects
        //
        $vb_is_currently_part_of_lot = true;
        if (!($vn_lot_id = $t_item->get('lot_id'))) {
            $vn_lot_id = $po_view->request->getParameter('lot_id', pInteger);
            $vb_is_currently_part_of_lot = false;
        }
        if ($vs_table_name === 'ca_objects' && $vn_lot_id) {
            require_once __CA_MODELS_DIR__ . '/ca_object_lots.php';
            $va_lot_lots = caGetTypeListForUser('ca_object_lots', array('access' => __CA_BUNDLE_ACCESS_READONLY__));
            $t_lot = new ca_object_lots($vn_lot_id);
            if ($t_lot->get('deleted') == 0 && in_array($t_lot->get('type_id'), $va_lot_lots)) {
                if (!($vs_lot_displayname = $t_lot->get('idno_stub'))) {
                    if (!($vs_lot_displayname = $t_lot->getLabelForDisplay())) {
                        $vs_lot_displayname = "Lot {$vn_lot_id}";
                    }
                }
                if ($vs_lot_displayname) {
                    if (!($vs_part_of_lot_msg = $po_view->request->config->get("ca_objects_inspector_part_of_lot_msg"))) {
                        $vs_part_of_lot_msg = _t('Part of lot');
                    }
                    if (!($vs_will_be_part_of_lot_msg = $po_view->request->config->get("ca_objects_inspector_will_be_part_of_lot_msg"))) {
                        $vs_will_be_part_of_lot_msg = _t('Will be part of lot');
                    }
                    $vs_buf .= "<strong>" . ($vb_is_currently_part_of_lot ? $vs_part_of_lot_msg : $vs_will_be_part_of_lot_msg) . "</strong>: " . caNavLink($po_view->request, $vs_lot_displayname, '', 'editor/object_lots', 'ObjectLotEditor', 'Edit', array('lot_id' => $vn_lot_id));
                }
            }
        }
        $va_object_container_types = $po_view->request->config->getList('ca_objects_container_types');
        $va_object_component_types = $po_view->request->config->getList('ca_objects_component_types');
        $vb_can_add_component = $vs_table_name === 'ca_objects' && $t_item->getPrimaryKey() && $po_view->request->user->canDoAction('can_create_ca_objects') && $t_item->canTakeComponents();
        if (method_exists($t_item, 'getComponentCount')) {
            if ($vn_component_count = $t_item->getComponentCount()) {
                if ($t_ui && ($vs_component_list_screen = $t_ui->getScreenWithBundle("ca_objects_components_list", $po_view->request)) && $vs_component_list_screen !== $po_view->request->getActionExtra()) {
                    $vs_component_count_link = caNavLink($po_view->request, $vn_component_count == 1 ? _t('%1 component', $vn_component_count) : _t('%1 components', $vn_component_count), '', '*', '*', $po_view->request->getAction() . '/' . $vs_component_list_screen, array($t_item->primaryKey() => $t_item->getPrimaryKey()));
                } else {
                    $vs_component_count_link = $vn_component_count == 1 ? _t('%1 component', $vn_component_count) : _t('%1 components', $vn_component_count);
                }
                $vs_buf .= "<br/><strong>" . _t('Has') . ":</strong> {$vs_component_count_link}";
            }
        }
        if ($vb_can_add_component) {
            $vs_buf .= ' <a href="#" onclick=\'caObjectComponentPanel.showPanel("' . caNavUrl($po_view->request, '*', 'ObjectComponent', 'Form', array('parent_id' => $t_item->getPrimaryKey())) . '"); return false;\')>' . caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__) . '</a>';
            $vo_change_type_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
            $vo_change_type_view->setVar('t_item', $t_item);
            FooterManager::add($vo_change_type_view->render("create_component_html.php"));
        }
        //
        // Output lot info for ca_object_lots
        //
        if ($vs_table_name === 'ca_object_lots' && $t_item->getPrimaryKey()) {
            $va_component_types = $po_view->request->config->getList('ca_objects_component_types');
            if (is_array($va_component_types) && sizeof($va_component_types)) {
                $vs_buf .= "<strong>" . (($vn_num_objects = $t_item->numObjects(null, array('return' => 'objects'))) == 1 ? _t('Lot contains %1 object', $vn_num_objects) : _t('Lot contains %1 objects', $vn_num_objects)) . "</strong>\n";
                $vs_buf .= "<strong>" . (($vn_num_components = $t_item->numObjects(null, array('return' => 'components'))) == 1 ? _t('Lot contains %1 component', $vn_num_components) : _t('Lot contains %1 components', $vn_num_components)) . "</strong>\n";
            } else {
                $vs_buf .= "<strong>" . (($vn_num_objects = $t_item->numObjects()) == 1 ? _t('Lot contains %1 object', $vn_num_objects) : _t('Lot contains %1 objects', $vn_num_objects)) . "</strong>\n";
            }
            if ((bool) $po_view->request->config->get('allow_automated_renumbering_of_objects_in_a_lot') && ($va_nonconforming_objects = $t_item->getObjectsWithNonConformingIdnos())) {
                $vs_buf .= '<br/><br/><em>' . (($vn_c = sizeof($va_nonconforming_objects)) == 1 ? _t('There is %1 object with non-conforming numbering', $vn_c) : _t('There are %1 objects with non-conforming numbering', $vn_c)) . "</em>\n";
                $vs_buf .= "<a href='#' onclick='jQuery(\"#inspectorNonConformingNumberList\").toggle(250); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__);
                $vs_buf .= "<div id='inspectorNonConformingNumberList' class='inspectorNonConformingNumberList'><div class='inspectorNonConformingNumberListScroll'><ol>\n";
                foreach ($va_nonconforming_objects as $vn_object_id => $va_object_info) {
                    $vs_buf .= '<li>' . caEditorLink($po_view->request, $va_object_info['idno'], '', 'ca_objects', $vn_object_id) . "</li>\n";
                }
                $vs_buf .= "</ol></div>";
                $vs_buf .= caNavLink($po_view->request, _t('Re-number objects') . ' &rsaquo;', 'button', $po_view->request->getModulePath(), $po_view->request->getController(), 'renumberObjects', array('lot_id' => $t_item->getPrimaryKey()));
                $vs_buf .= "</div>\n";
            }
            require_once __CA_MODELS_DIR__ . '/ca_objects.php';
            $t_object = new ca_objects();
            $vs_buf .= "<div class='inspectorLotObjectTypeControls'><form action='#' id='caAddObjectToLotForm'>";
            if ((bool) $po_view->request->config->get('ca_objects_enforce_strict_type_hierarchy')) {
                // strict menu
                $vs_buf .= _t('Add new %1 to lot', $t_object->getTypeListAsHTMLFormElement('type_id', array('id' => 'caAddObjectToLotForm_type_id'), array('childrenOfCurrentTypeOnly' => true, 'directChildrenOnly' => $po_view->request->config->get('ca_objects_enforce_strict_type_hierarchy') == '~' ? false : true, 'returnHierarchyLevels' => true, 'access' => __CA_BUNDLE_ACCESS_EDIT__)));
            } else {
                // all types
                $vs_buf .= _t('Add new %1 to lot', $t_object->getTypeListAsHTMLFormElement('type_id', array('id' => 'caAddObjectToLotForm_type_id'), array('access' => __CA_BUNDLE_ACCESS_EDIT__)));
            }
            $vs_buf .= " <a href='#' onclick='caAddObjectToLotForm()'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__) . '</a>';
            $vs_buf .= "</form></div>\n";
            $vs_buf .= "<script type='text/javascript'>\n\tfunction caAddObjectToLotForm() { \n\t\twindow.location='" . caEditorUrl($po_view->request, 'ca_objects', 0, false, array('lot_id' => $t_item->getPrimaryKey(), 'rel' => 1, 'type_id' => '')) . "' + jQuery('#caAddObjectToLotForm_type_id').val();\n\t}\n\tjQuery(document).ready(function() {\n\t\tjQuery('#objectLotsNonConformingNumberList').hide();\n\t});\n</script>\n";
        }
        if ($vs_table_name === 'ca_objects') {
            //
            // Output loan info for ca_objects
            //
            if ($po_view->request->user->canDoAction('can_manage_clients') && ($va_loan_details = $t_item->isOnLoan())) {
                $vs_buf .= "<div>" . caNavLink($po_view->request, _t('On loan to %1', $va_loan_details['billing_fname'] . ' ' . $va_loan_details['billing_lname']), 'inspectorOnLoan', 'client/library', 'OrderEditor', 'Edit', array('order_id' => $va_loan_details['order_id'])) . "</div>";
            }
            //
            // Output checkout info for ca_objects
            //
            if ((bool) $po_view->request->config->get('enable_client_services') && ((bool) $po_view->request->config->get('enable_client_services_sales') || (bool) $po_view->request->config->get('enable_client_services_library')) && $t_item->canBeCheckedOut() && ($va_checkout_status = $t_item->getCheckoutStatus(array('returnAsArray' => true)))) {
                $vs_buf .= "<div class='inspectorCheckedOut'>" . $va_checkout_status['status_display'];
                if ($va_checkout_status['user_name']) {
                    $vs_buf .= _t("; checked out by %1", $va_checkout_status['user_name']);
                }
                $vs_buf .= "</div>";
            }
        }
        //
        // Output related objects for ca_object_representations
        //
        if ($vs_table_name === 'ca_object_representations') {
            foreach (array('ca_objects', 'ca_object_lots', 'ca_entities', 'ca_places', 'ca_occurrences', 'ca_collections', 'ca_storage_locations', 'ca_loans', 'ca_movements') as $vs_rel_table) {
                if (sizeof($va_objects = $t_item->getRelatedItems($vs_rel_table))) {
                    $vs_buf .= "<div><strong>" . _t("Related %1", $o_dm->getTableProperty($vs_rel_table, 'NAME_PLURAL')) . "</strong>: <br/>\n";
                    $vs_screen = '';
                    if ($t_ui = ca_editor_uis::loadDefaultUI($vs_rel_table, $po_view->request, null)) {
                        $vs_screen = $t_ui->getScreenWithBundle('ca_object_representations', $po_view->request);
                    }
                    foreach ($va_objects as $vn_rel_id => $va_rel_info) {
                        if ($vs_label = array_shift($va_rel_info['labels'])) {
                            $vs_buf .= caEditorLink($po_view->request, '&larr; ' . $vs_label . ' (' . $va_rel_info['idno'] . ')', '', $vs_rel_table, $va_rel_info[$o_dm->getTablePrimaryKeyName($vs_rel_table)], array(), array(), array('action' => 'Edit' . ($vs_screen ? "/{$vs_screen}" : ""))) . "<br/>\n";
                        }
                    }
                    $vs_buf .= "</div>\n";
                }
            }
        }
        //
        // Output related object reprsentation for ca_representation_annotation
        //
        if ($vs_table_name === 'ca_representation_annotations') {
            if ($vn_representation_id = $t_item->get('representation_id')) {
                $vs_buf .= "<div><strong>" . _t("Applied to representation") . "</strong>: <br/>\n";
                $t_rep = new ca_object_representations($vn_representation_id);
                $vs_buf .= caNavLink($po_view->request, '&larr; ' . $t_rep->getLabelForDisplay(), '', 'editor/object_representations', 'ObjectRepresentationEditor', 'Edit/' . $po_view->getVar('representation_editor_screen'), array('representation_id' => $vn_representation_id)) . '<br/>';
                $vs_buf .= "</div>\n";
            }
        }
        //
        // Output extra useful info for sets
        //
        if ($vs_table_name === 'ca_sets') {
            $vn_set_item_count = $t_item->getItemCount(array('user_id' => $po_view->request->getUserID()));
            if ($vn_set_item_count > 0 && $po_view->request->user->canDoAction('can_batch_edit_' . $o_dm->getTableName($t_item->get('table_num')))) {
                $vs_buf .= caNavButton($po_view->request, __CA_NAV_BUTTON_BATCH_EDIT__, _t('Batch edit'), 'editorBatchSetEditorLink', 'batch', 'Editor', 'Edit', array('set_id' => $t_item->getPrimaryKey()), array(), array('icon_position' => __CA_NAV_BUTTON_ICON_POS_LEFT__, 'no_background' => true, 'dont_show_content' => true));
            }
            $vs_buf .= "<div><strong>" . _t("Number of items") . "</strong>: {$vn_set_item_count}<br/>\n";
            if ($t_item->getPrimaryKey()) {
                $vn_set_table_num = $t_item->get('table_num');
                $vs_set_table_name = $o_dm->getTableName($vn_set_table_num);
                $vs_buf .= "<strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_set_table_num) . "<br/>\n";
                $vs_buf .= "</div>\n";
            } else {
                if ($vn_set_table_num = $po_view->request->getParameter('table_num', pInteger)) {
                    $vs_buf .= "<div><strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_set_table_num) . "<br/>\n";
                    $vs_buf .= "</div>\n";
                }
            }
            $t_user = new ca_users(($vn_user_id = $t_item->get('user_id')) ? $vn_user_id : $po_view->request->getUserID());
            if ($t_user->getPrimaryKey()) {
                $vs_buf .= "<div><strong>" . _t('Owner') . "</strong>: " . $t_user->get('fname') . ' ' . $t_user->get('lname') . "</div>\n";
            }
            if ($po_view->request->user->canDoAction('can_export_' . $vs_set_table_name) && $t_item->getPrimaryKey() && sizeof(ca_data_exporters::getExporters($vn_set_table_num)) > 0) {
                $vs_buf .= '<div style="border-top: 1px solid #aaaaaa; margin-top: 5px; font-size: 10px; text-align: right;" id="caExportItemButton">';
                $vs_buf .= _t('Export this set of records') . "&nbsp; ";
                $vs_buf .= "<a class='button' onclick='jQuery(\"#exporterFormList\").show();' style='text-align:right;' href='#'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__) . "</a>";
                $vs_buf .= caFormTag($po_view->request, 'ExportData', 'caExportForm', 'manage/MetadataExport', 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
                $vs_buf .= "<div id='exporterFormList'>";
                $vs_buf .= ca_data_exporters::getExporterListAsHTMLFormElement('exporter_id', $vn_set_table_num, array('id' => 'caExporterList'), array('width' => '135px'));
                $vs_buf .= caHTMLHiddenInput('set_id', array('value' => $t_item->getPrimaryKey()));
                $vs_buf .= caFormSubmitLink($po_view->request, _t('Export') . " &rsaquo;", "button", "caExportForm");
                $vs_buf .= "</div>\n";
                $vs_buf .= "</form>";
                $vs_buf .= "</div>";
                $vs_buf .= "<script type='text/javascript'>";
                $vs_buf .= "jQuery(document).ready(function() {";
                $vs_buf .= "jQuery(\"#exporterFormList\").hide();";
                $vs_buf .= "});";
                $vs_buf .= "</script>";
            }
        }
        //
        // Output extra useful info for set items
        //
        if ($vs_table_name === 'ca_set_items') {
            AssetLoadManager::register("panel");
            $t_set = new ca_sets();
            if ($t_set->load($vn_set_id = $t_item->get('set_id'))) {
                $vs_buf .= "<div><strong>" . _t("Part of set") . "</strong>: " . caEditorLink($po_view->request, $t_set->getLabelForDisplay(), '', 'ca_sets', $vn_set_id) . "<br/>\n";
                $t_content_instance = $t_item->getAppDatamodel()->getInstanceByTableNum($vn_item_table_num = $t_item->get('table_num'));
                if ($t_content_instance->load($vn_row_id = $t_item->get('row_id'))) {
                    $vs_label = $t_content_instance->getLabelForDisplay();
                    if ($vs_id_fld = $t_content_instance->getProperty('ID_NUMBERING_ID_FIELD')) {
                        $vs_label .= " (" . $t_content_instance->get($vs_id_fld) . ")";
                    }
                    $vs_buf .= "<strong>" . _t("Is %1", caGetTableDisplayName($vn_item_table_num, false) . "</strong>: " . caEditorLink($po_view->request, $vs_label, '', $vn_item_table_num, $vn_row_id)) . "<br/>\n";
                }
                $vs_buf .= "</div>\n";
            }
        }
        //
        // Output extra useful info for lists
        //
        if ($vs_table_name === 'ca_lists' && $t_item->getPrimaryKey()) {
            $vs_buf .= "<strong>" . _t("Number of items") . "</strong>: " . $t_item->numItemsInList() . "<br/>\n";
            $t_list_item = new ca_list_items();
            $t_list_item->load(array('list_id' => $t_item->getPrimaryKey(), 'parent_id' => null));
            $vs_type_list = $t_list_item->getTypeListAsHTMLFormElement('type_id', array('style' => 'width: 90px; font-size: 9px;'), array('access' => __CA_BUNDLE_ACCESS_EDIT__));
            if ($vs_type_list) {
                $vs_buf .= '<div style="border-top: 1px solid #aaaaaa; margin-top: 5px; font-size: 10px;">';
                $vs_buf .= caFormTag($po_view->request, 'Edit', 'NewChildForm', 'administrate/setup/list_item_editor/ListItemEditor', 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
                $vs_buf .= _t('Add a %1 to this list', $vs_type_list) . caHTMLHiddenInput($t_list_item->primaryKey(), array('value' => '0')) . caHTMLHiddenInput('parent_id', array('value' => $t_list_item->getPrimaryKey()));
                $vs_buf .= caFormSubmitLink($po_view->request, caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__), '', 'NewChildForm');
                $vs_buf .= "</form></div>\n";
            }
        }
        //
        // Output containing list for list items
        //
        if ($vs_table_name === 'ca_list_items') {
            if ($t_list = $po_view->getVar('t_list')) {
                $vn_list_id = $t_list->getPrimaryKey();
                $vs_buf .= "<strong>" . _t("Part of") . "</strong>: " . caEditorLink($po_view->request, $t_list->getLabelForDisplay(), '', 'ca_lists', $vn_list_id) . "<br/>\n";
                if ($t_item->get('is_default')) {
                    $vs_buf .= "<strong>" . _t("Is default for list") . "</strong><br/>\n";
                }
            }
        }
        //
        // Output containing relationship type name for relationship types
        //
        if ($vs_table_name === 'ca_relationship_types') {
            if (!($t_rel_instance = $t_item->getAppDatamodel()->getInstanceByTableNum($t_item->get('table_num'), true))) {
                if ($vn_parent_id = $po_view->request->getParameter('parent_id', pInteger)) {
                    $t_rel_type = new ca_relationship_types($vn_parent_id);
                    $t_rel_instance = $t_item->getAppDatamodel()->getInstanceByTableNum($t_rel_type->get('table_num'), true);
                }
            }
            if ($t_rel_instance) {
                $vs_buf .= "<div><strong>" . _t("Is a") . "</strong>: " . $t_rel_instance->getProperty('NAME_SINGULAR') . "<br/></div>\n";
            }
        }
        //
        // Output extra useful info for metadata elements
        //
        if ($vs_table_name === 'ca_metadata_elements' && $t_item->getPrimaryKey()) {
            $vs_buf .= "<div><strong>" . _t("Element code") . "</strong>: " . $t_item->get('element_code') . "<br/></div>\n";
            if (sizeof($va_uis = $t_item->getUIs()) > 0) {
                $vs_buf .= "<div><strong>" . _t("Referenced by user interfaces") . "</strong>:<br/>\n";
                foreach ($va_uis as $vn_ui_id => $va_ui_info) {
                    $vs_buf .= caNavLink($po_view->request, $va_ui_info['name'], '', 'administrate/setup/interface_screen_editor', 'InterfaceScreenEditor', 'Edit', array('ui_id' => $vn_ui_id, 'screen_id' => $va_ui_info['screen_id']));
                    $vs_buf .= " (" . $o_dm->getTableProperty($va_ui_info['editor_type'], 'NAME_PLURAL') . ")<br/>\n";
                }
                $vs_buf .= "</div>\n";
            }
        }
        //
        // Output related objects for ca_editor_uis and ca_editor_ui_screens
        //
        if ($vs_table_name === 'ca_editor_uis') {
            $vs_buf .= "<div><strong>" . _t("Number of screens") . "</strong>: " . (int) $t_item->getScreenCount() . "\n";
            if ($t_item->getPrimaryKey()) {
                $vs_buf .= "<div><strong>" . _t("Edits") . "</strong>: " . caGetTableDisplayName($t_item->get('editor_type')) . "<br/>\n";
            } else {
                $vs_buf .= "<div><strong>" . _t("Edits") . "</strong>: " . caGetTableDisplayName($po_view->request->getParameter('editor_type', pInteger)) . "<br/>\n";
            }
            $vs_buf .= "</div>\n";
        }
        //
        // Output related objects for ca_editor_uis and ca_editor_ui_screens
        //
        if ($vs_table_name === 'ca_editor_ui_screens') {
            $t_ui = new ca_editor_uis($vn_ui_id = $t_item->get('ui_id'));
            $vs_buf .= "<div><strong>" . _t("Part of") . "</strong>: " . caNavLink($po_view->request, $t_ui->getLabelForDisplay(), '', 'administrate/setup/interface_editor', 'InterfaceEditor', 'Edit', array('ui_id' => $vn_ui_id)) . "\n";
            $vs_buf .= "</div>\n";
        }
        //
        // Output extra useful info for bundle displays
        //
        if ($vs_table_name === 'ca_bundle_displays') {
            $vs_buf .= "<div><strong>" . _t("Number of placements") . "</strong>: " . $t_item->getPlacementCount(array('user_id' => $po_view->request->getUserID())) . "<br/>\n";
            if ($t_item->getPrimaryKey()) {
                $vn_content_table_num = $t_item->get('table_num');
                $vs_buf .= "<strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "\n";
                $vs_buf .= "</div>\n";
            } else {
                if ($vn_content_table_num = $po_view->request->getParameter('table_num', pInteger)) {
                    $vs_buf .= "<div><strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "\n";
                    $vs_buf .= "</div>\n";
                }
            }
            $t_user = new ca_users(($vn_user_id = $t_item->get('user_id')) ? $vn_user_id : $po_view->request->getUserID());
            if ($t_user->getPrimaryKey()) {
                $vs_buf .= "<div><strong>" . _t('Owner') . "</strong>: " . $t_user->get('fname') . ' ' . $t_user->get('lname') . "</div>\n";
            }
        }
        //
        // Output extra useful info for search forms
        //
        if ($vs_table_name === 'ca_search_forms') {
            $vs_buf .= "<div><strong>" . _t("Number of placements") . "</strong>: " . $t_item->getPlacementCount(array('user_id' => $po_view->request->getUserID())) . "<br/>\n";
            if ($t_item->getPrimaryKey()) {
                $vn_content_table_num = $t_item->get('table_num');
                $vs_buf .= "<strong>" . _t("Searches for") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "\n";
                $vs_buf .= "</div>\n";
            } else {
                if ($vn_content_table_num = $po_view->request->getParameter('table_num', pInteger)) {
                    $vs_buf .= "<strong>" . _t("Searches for") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "\n";
                    $vs_buf .= "</div>\n";
                }
            }
            $t_user = new ca_users(($vn_user_id = $t_item->get('user_id')) ? $vn_user_id : $po_view->request->getUserID());
            if ($t_user->getPrimaryKey()) {
                $vs_buf .= "<div><strong>" . _t('Owner') . "</strong>: " . $t_user->get('fname') . ' ' . $t_user->get('lname') . "</div>\n";
            }
        }
        //
        // Output extra useful info for tours
        //
        if ($vs_table_name === 'ca_tours' && $t_item->getPrimaryKey()) {
            $vs_buf .= "<br/><strong>" . _t("Number of stops") . "</strong>: " . $t_item->getStopCount() . "<br/>\n";
        }
        //
        // Output containing tour for tour stops
        //
        if ($vs_table_name === 'ca_tour_stops') {
            $t_tour = new ca_tours($vn_tour_id = $t_item->get('tour_id'));
            $vs_buf .= "<strong>" . _t("Part of") . "</strong>: " . caEditorLink($po_view->request, $t_tour->getLabelForDisplay(), '', 'ca_tours', $vn_tour_id) . "<br/>\n";
        }
        //
        // Output extra useful info for bundle mappings
        //
        if ($vs_table_name === 'ca_bundle_mappings') {
            if ($t_item->getPrimaryKey()) {
                $vn_content_table_num = $t_item->get('table_num');
                $vs_buf .= "<br/><strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "<br/>\n";
                $vs_buf .= "<strong>" . _t("Type") . "</strong>: " . $t_item->getChoiceListValue('direction', $t_item->get('direction')) . "<br/>\n";
                $vs_buf .= "<strong>" . _t("Target format") . "</strong>: " . $t_item->get('target') . "<br/>\n";
                $va_stats = $t_item->getMappingStatistics();
                $vs_buf .= "<div><strong>" . _t("Number of groups") . "</strong>: " . $va_stats['groupCount'] . "<br/>\n";
                $vs_buf .= "<strong>" . _t("Number of rules") . "</strong>: " . $va_stats['ruleCount'] . "<br/>\n";
                $vs_buf .= "</div>\n";
            } else {
                if ($vn_content_table_num = $po_view->request->getParameter('table_num', pInteger)) {
                    $vs_buf .= "<div><strong>" . _t("Type of content") . "</strong>: " . caGetTableDisplayName($vn_content_table_num) . "<br/>\n";
                    $vs_buf .= "<strong>" . _t("Type") . "</strong>: " . $t_item->getChoiceListValue('direction', $po_view->request->getParameter('direction', pString)) . "<br/>\n";
                    $vs_buf .= "<strong>" . _t("Target format") . "</strong>: " . $po_view->request->getParameter('target', pString) . "<br/>\n";
                    $vs_buf .= "<div><strong>" . _t("Number of groups") . "</strong>: 0<br/>\n";
                    $vs_buf .= "<strong>" . _t("Number of rules") . "</strong>: 0</div>\n";
                    $vs_buf .= "</div>\n";
                }
            }
        }
        //
        // Output extra useful info for client services/commerce orders
        //
        if ($vs_table_name === 'ca_commerce_orders') {
            $o_client_services_config = Configuration::load($po_view->request->config->get('client_services_config'));
            $va_order_totals = $t_item->getOrderTotals();
            if ($va_order_totals['fee'] + $va_order_totals['tax'] + $va_order_totals['shipping'] + $va_order_totals['handling'] + $va_order_totals['additional_order_fees'] + $va_order_totals['additional_item_fees'] != 0) {
                $vs_currency_symbol = $o_client_services_config->get('currency_symbol');
                $vs_buf .= "<table style='margin-left: 10px;'>";
                $vs_buf .= "<tr><td><strong>" . _t("Items") . '</strong></td><td>' . $vs_currency_symbol . sprintf("%4.2f", $va_order_totals['fee']) . " (" . (int) $va_order_totals['items'] . ")</td></tr>\n";
                $vs_buf .= "<tr><td><strong>" . _t("S+H") . '</strong></td><td>' . $vs_currency_symbol . sprintf("%4.2f", $va_order_totals['shipping'] + $va_order_totals['handling']) . "</td></tr>\n";
                $vs_buf .= "<tr><td><strong>" . _t("Tax") . '</strong></td><td>' . $vs_currency_symbol . sprintf("%4.2f", $va_order_totals['tax']) . "</td></tr>\n";
                $vs_buf .= "<tr><td><strong>" . _t("Addtl fees") . '</strong></td><td>' . $vs_currency_symbol . sprintf("%4.2f", $va_order_totals['additional_order_fees'] + $va_order_totals['additional_item_fees']) . "</td></tr>\n";
                $vs_buf .= "<tr><td><strong>" . _t("Total") . '</strong></td><td>' . $vs_currency_symbol . sprintf("%4.2f", $va_order_totals['fee'] + $va_order_totals['tax'] + $va_order_totals['shipping'] + $va_order_totals['handling'] + $va_order_totals['additional_order_fees'] + $va_order_totals['additional_item_fees']) . "</td></tr>\n";
                $vs_buf .= "</table>";
                $vs_buf .= "<strong>" . $t_item->getFieldInfo('payment_status', 'LABEL') . "</strong>: " . $t_item->getChoiceListValue('payment_status', $t_item->get('payment_status')) . "<br/>\n";
            }
            $vs_buf .= "<br/><strong>" . $t_item->getFieldInfo('order_status', 'LABEL') . "</strong>: " . $t_item->getChoiceListValue('order_status', $t_item->get('order_status')) . "<br/>\n";
            if ($vs_shipping_date = $t_item->get('shipping_date', array('dateFormat' => 'delimited', 'timeOmit' => true))) {
                $vs_buf .= "<strong>" . $t_item->getFieldInfo('shipping_date', 'LABEL') . "</strong>: " . $vs_shipping_date;
                if ($vs_shipped_on_date = $t_item->get('shipped_on_date', array('dateFormat' => 'delimited'))) {
                    $vs_buf .= " (" . _t('shipped %1', $vs_shipped_on_date) . ")";
                } else {
                    $vs_buf .= " (" . _t('not shipped') . ")";
                }
                $vs_buf .= "<br/>\n";
            }
            if (($vn_shipping_method = $t_item->get('shipping_method')) && $t_item->getChoiceListValue('shipping_method', $vn_shipping_method) != 'None') {
                $vs_buf .= "<strong>" . $t_item->getFieldInfo('shipping_method', 'LABEL') . "</strong>: " . $t_item->getChoiceListValue('shipping_method', $vn_shipping_method) . "<br/>\n";
            }
        }
        //
        // Output configurable additional info from config, if set
        //
        if ($vs_additional_info = $po_view->request->config->get("{$vs_table_name}_inspector_additional_info")) {
            if (is_array($vs_additional_info)) {
                $vs_buf .= "<br/>";
                foreach ($vs_additional_info as $vs_info) {
                    $vs_buf .= caProcessTemplateForIDs($vs_info, $vs_table_name, array($t_item->getPrimaryKey()), array('requireLinkTags' => true)) . "<br/>\n";
                }
            } else {
                $vs_buf .= "<br/>" . caProcessTemplateForIDs($vs_additional_info, $vs_table_name, array($t_item->getPrimaryKey()), array('requireLinkTags' => true)) . "<br/>\n";
            }
        }
        // -------------------------------------------------------------------------------------
        // Export
        if ($t_item->getPrimaryKey() && $po_view->request->config->get($vs_table_name . '_show_add_child_control_in_inspector')) {
            $vb_show_add_child_control = true;
            if (is_array($va_restrict_add_child_control_to_types = $po_view->request->config->getList($vs_table_name . '_restrict_child_control_in_inspector_to_types')) && sizeof($va_restrict_add_child_control_to_types)) {
                $t_type_instance = $t_item->getTypeInstance();
                if (!in_array($t_type_instance->get('idno'), $va_restrict_add_child_control_to_types) && !in_array($t_type_instance->getPrimaryKey(), $va_restrict_add_child_control_to_types)) {
                    $vb_show_add_child_control = false;
                }
            }
        }
        if ($po_view->request->user->canDoAction('can_export_' . $vs_table_name) && $t_item->getPrimaryKey() && sizeof(ca_data_exporters::getExporters($t_item->tableNum())) > 0) {
            $vs_buf .= '<div style="border-top: 1px solid #aaaaaa; margin-top: 5px; font-size: 10px; text-align: right;" id="caExportItemButton">';
            $vs_buf .= _t('Export this %1', mb_strtolower($vs_type_name, 'UTF-8')) . " ";
            $vs_buf .= "<a class='button' onclick='jQuery(\"#exporterFormList\").show();' style='text-align:right;' href='#'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_ADD__) . "</a>";
            $vs_buf .= caFormTag($po_view->request, 'ExportSingleData', 'caExportForm', 'manage/MetadataExport', 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
            $vs_buf .= "<div id='exporterFormList'>";
            $vs_buf .= ca_data_exporters::getExporterListAsHTMLFormElement('exporter_id', $t_item->tableNum(), array('id' => 'caExporterList'), array('width' => '120px'));
            $vs_buf .= caHTMLHiddenInput('item_id', array('value' => $t_item->getPrimaryKey()));
            $vs_buf .= caFormSubmitLink($po_view->request, _t('Export') . " &rsaquo;", "button", "caExportForm");
            $vs_buf .= "</div>\n";
            $vs_buf .= "</form>";
            $vs_buf .= "</div>";
            $vs_buf .= "<script type='text/javascript'>";
            $vs_buf .= "jQuery(document).ready(function() {";
            $vs_buf .= "jQuery(\"#exporterFormList\").hide();";
            $vs_buf .= "});";
            $vs_buf .= "</script>";
        }
        $vs_buf .= "</div></h4>\n";
        $vs_buf .= "<script type='text/javascript'>\n\t\t\tvar inspectorCookieJar = jQuery.cookieJar('caCookieJar');";
        if ($t_item->getPrimaryKey()) {
            if ($vs_more_info) {
                $vs_buf .= "\t\t\t\n\t\t\tif (inspectorCookieJar.get('inspectorMoreInfoIsOpen') == undefined) {\t\t// default is to have info open\n\t\t\t\tinspectorCookieJar.set('inspectorMoreInfoIsOpen', 1);\n\t\t\t}\n\t\t\tif (inspectorCookieJar.get('inspectorMoreInfoIsOpen') == 1) {\n\t\t\t\tjQuery('#inspectorInfo').toggle(0);\n\t\t\t\tjQuery('#inspectorMoreInfo').html('" . addslashes(caNavIcon($po_view->request, __CA_NAV_BUTTON_COLLAPSE__)) . "');\n\t\t\t}\n\t\t\n\t\t\tjQuery('#inspectorMoreInfo').click(function() {\n\t\t\t\tjQuery('#inspectorInfo').slideToggle(350, function() { \n\t\t\t\t\tinspectorCookieJar.set('inspectorMoreInfoIsOpen', (this.style.display == 'block') ? 1 : 0); \n\t\t\t\t\tjQuery('#inspectorMoreInfo').html((this.style.display == 'block') ? '" . addslashes(caNavIcon($po_view->request, __CA_NAV_BUTTON_COLLAPSE__)) . "' : '" . addslashes(caNavIcon($po_view->request, __CA_NAV_BUTTON_INFO2__)) . "');\n\t\t\t\t\tcaResizeSideNav();\n\t\t\t\t}); \n\t\t\t\treturn false;\n\t\t\t});\n\t\t";
            }
            if (sizeof($va_reps)) {
                $vs_buf .= "\n\t\tif (inspectorCookieJar.get('inspectorShowMediaIsOpen') == undefined) {\t\t// default is to have media open\n\t\t\tinspectorCookieJar.set('inspectorShowMediaIsOpen', 1);\n\t\t}\n\t\t\n\t\tif (inspectorCookieJar.get('inspectorShowMediaIsOpen') == 1) {\n\t\t\tjQuery('#inspectorMedia').toggle();\n\t\t}\n\t\n\t\tjQuery('#caColorbox').on('click', function(e) {\n\t\t\tif (e.altKey) {\n\t\t\t\tjQuery('#inspectorMedia').slideToggle(200, function() { \n\t\t\t\t\tinspectorCookieJar.set('inspectorShowMediaIsOpen', (this.style.display == 'block') ? 1 : 0); \n\t\t\t\t\t\tcaResizeSideNav();\n\t\t\t\t}); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\t\t\t\t";
            }
        }
        $vs_buf .= "</script>\n";
    }
    $o_app_plugin_manager = new ApplicationPluginManager();
    $va_hookAppend = $o_app_plugin_manager->hookAppendToEditorInspector(array("t_item" => $t_item));
    if (is_string($va_hookAppend["caEditorInspectorAppend"])) {
        $vs_buf .= $va_hookAppend["caEditorInspectorAppend"];
    }
    return $vs_buf;
}
Example #28
0
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_object = $this->getVar('t_subject');
$vn_object_id = $this->getVar('subject_id');
$vn_above_id = $this->getVar('above_id');
$vb_can_edit = $t_object->isSaveable($this->request);
$vb_can_delete = $t_object->isDeletable($this->request);
if ($vb_can_edit) {
    print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'ObjectEditorForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), 'editor/objects', 'ObjectEditor', 'Edit/' . $this->request->getActionExtra(), array('object_id' => $vn_object_id)), '', intval($vn_object_id) > 0 && $vb_can_delete ? caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), 'editor/objects', 'ObjectEditor', 'Delete/' . $this->request->getActionExtra(), array('object_id' => $vn_object_id)) : '');
}
?>
	<div class="sectionBox">
<?php 
print caFormTag($this->request, 'Save/' . $this->request->getActionExtra() . '/object_id/' . $vn_object_id, 'ObjectEditorForm', null, 'POST', 'multipart/form-data');
$va_bundle_list = array();
$va_form_elements = $t_object->getBundleFormHTMLForScreen($this->request->getActionExtra(), array('request' => $this->request, 'formName' => 'ObjectEditorForm', 'forceHidden' => array('lot_id')), $va_bundle_list);
print join("\n", $va_form_elements);
if ($vb_can_edit) {
    print $vs_control_box;
}
?>
			<input type='hidden' name='object_id' value='<?php 
print $vn_object_id;
?>
'/>
			<input type='hidden' name='collection_id' value='<?php 
print $this->request->getParameter('collection_id', pInteger);
?>
'/>
print $vs_control_box = caFormControlBox(($vb_importers_available ? caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Import"), 'caWorldCatResultsForm') : '') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', '*', '*', 'Index'), '', '');
?>
 <form action="#" id="caWorldCatSearchForm">
 	<div class="formLabel">
 		<?php 
print _t('Find in WorldCat') . ': ' . caHTMLTextInput("term", array('value' => '', 'id' => 'caWorldCatTerm'), array('width' => '250px'));
?>
 		<a href="#" id="caWorldCatTermLookup" class="button"><?php 
print _t('Go');
?>
 &rsaquo;</a>
 	</div>
 </form>
 
<?php 
print caFormTag($this->request, 'Run', 'caWorldCatResultsForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'noTimestamp' => true));
?>
	<div class="<?php 
print $vb_importers_available ? 'formLabel' : 'formLabelError';
?>
">
<?php 
if ($vb_importers_available) {
    print _t('Import using') . ': ' . $this->getVar('importer_list_select');
} else {
    print _t('You must load at least one WorldCat mapping before you can import');
}
?>
 	</div>
 	
 	<div class="caWorldCatResultsPagination">
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * This source code is free and modifiable under the terms of
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_importer = $this->getVar('t_importer');
$va_last_settings = $this->getVar('last_settings');
print $vs_control_box = caFormControlBox(caJSButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Execute data import"), 'caBatchMetadataImportFormButton', array('onclick' => 'caShowConfirmBatchExecutionPanel(); return false;')) . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), '', 'batch', 'MetadataImport', 'Index', array()), '', '');
?>
<div class="sectionBox">
<?php 
print caFormTag($this->request, 'ImportData/' . $this->request->getActionExtra(), 'caBatchMetadataImportForm', null, 'POST', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'noTimestamp' => true));
?>
		<div class='bundleLabel'>
			<span class="formLabelText"><?php 
print _t('Importer');
?>
</span> 
			<div class="bundleContainer">
				<div class="caLabelList" >
					<p>
<?php 
print ca_data_importers::getImporterListAsHTMLFormElement('importer_id', null, array('id' => 'caImporterList', 'onchange' => 'caSetBatchMetadataImportFormState(true);'), array('value' => $t_importer->getPrimaryKey()));
?>
					</p>
				</div>
			</div>