コード例 #1
0
 public function Index()
 {
     $this->view->setVar('order_items', is_array($va_items = $this->opt_order->getItems()) ? $va_items : array());
     //
     // Set default dates for order items
     //
     $t_order_item = new ca_commerce_order_items();
     $t_order_item->set('loan_checkout_date', time(), array('SET_DIRECT_DATE' => true));
     if (($vn_loan_period_in_days = $this->opo_client_services_config->get('default_library_loan_period')) <= 0) {
         $vn_loan_period_in_days = 7;
     }
     $t_order_item->set('loan_due_date', time() + $vn_loan_period_in_days * 24 * 60 * 60, array('SET_DIRECT_DATE' => true));
     $va_default_values = array('loan_checkout_date' => $t_order_item->get('loan_checkout_date', array('dateFormat' => 'delimited', 'timeOmit' => true)), 'loan_due_date' => $t_order_item->get('loan_due_date', array('dateFormat' => 'delimited', 'timeOmit' => true)));
     $this->view->setVar('t_order_item', $t_order_item);
     //$this->view->setVar('default_item_prices', $va_default_prices);
     //
     // Additional fees
     //
     $this->view->setVar('additional_fees', $t_order_item->getAdditionalFeesHTMLFormBundle($this->request, array('config' => $this->opo_client_services_config, 'currency_symbol' => $this->opo_client_services_config->get('currency_symbol'), 'type' => 'L')));
     $this->view->setVar('additional_fees_for_new_items', $t_order_item->getAdditionalFeesHTMLFormBundle($this->request, array('config' => $this->opo_client_services_config, 'currency_symbol' => $this->opo_client_services_config->get('currency_symbol'), 'use_defaults' => true, 'type' => 'L')));
     $this->view->setVar('additional_fee_codes', $va_additional_fee_codes = $this->opo_client_services_config->getAssoc('additional_loan_fees'));
     foreach ($va_additional_fee_codes as $vs_code => $va_info) {
         $va_default_values['ADDITIONAL_FEE_' . $vs_code] = $va_info['default_cost'];
     }
     $this->view->setVar('default_values', $va_default_values);
     //
     // Functional options
     //
     $this->view->setVar('loan_use_item_fee_and_tax', (bool) $this->opo_client_services_config->get('loan_use_item_fee_and_tax'));
     $this->view->setVar('loan_use_notes_and_restrictions', (bool) $this->opo_client_services_config->get('loan_use_notes_and_restrictions'));
     $this->view->setVar('loan_use_additional_fees', (bool) $this->opo_client_services_config->get('loan_use_additional_fees'));
     $this->render('checkout_html.php');
 }
コード例 #2
0
ファイル: displayHelpers.php プロジェクト: kai-iak/providence
/**
 * Return rendered HTML for media viewer for both re
 *
 * @param RequestHTTP $po_request
 * @param array $pa_options
 * @param array $pa_additional_display_options
 * @return string HTML output
 */
function caGetMediaViewerHTMLBundle($po_request, $pa_options = null, $pa_additional_display_options = null)
{
    $va_access_values = isset($pa_options['access']) && is_array($pa_options['access']) ? $pa_options['access'] : array();
    $vs_display_type = isset($pa_options['display']) && $pa_options['display'] ? $pa_options['display'] : 'media_overlay';
    $vs_container_dom_id = isset($pa_options['containerID']) && $pa_options['containerID'] ? $pa_options['containerID'] : null;
    $t_subject = isset($pa_options['t_subject']) && $pa_options['t_subject'] ? $pa_options['t_subject'] : null;
    $t_rep = isset($pa_options['t_representation']) && $pa_options['t_representation'] ? $pa_options['t_representation'] : null;
    $vn_representation_id = $t_rep ? $t_rep->getPrimaryKey() : null;
    $t_attr_val = isset($pa_options['t_attribute_value']) && $pa_options['t_attribute_value'] ? $pa_options['t_attribute_value'] : null;
    $vn_value_id = $t_attr_val ? $t_attr_val->getPrimaryKey() : null;
    $vn_item_id = isset($pa_options['item_id']) && $pa_options['item_id'] ? $pa_options['item_id'] : null;
    $vn_order_item_id = isset($pa_options['order_item_id']) && $pa_options['order_item_id'] ? $pa_options['order_item_id'] : null;
    $vb_media_editor = isset($pa_options['mediaEditor']) && $pa_options['mediaEditor'] ? true : false;
    $vb_no_controls = isset($pa_options['noControls']) && $pa_options['noControls'] ? true : false;
    $vn_item_id = isset($pa_options['item_id']) && $pa_options['item_id'] ? $pa_options['item_id'] : null;
    $vn_subject_id = $t_subject ? $t_subject->getPrimaryKey() : null;
    if (!$vn_value_id && !$vn_representation_id) {
        $t_rep->load($t_subject->getPrimaryRepresentationID(array('checkAccess' => $va_access_values)));
    }
    $o_view = new View($po_request, $po_request->getViewsDirectoryPath() . '/bundles/');
    $t_set_item = new ca_set_items();
    if ($vn_item_id) {
        $t_set_item->load($vn_item_id);
    }
    $t_order_item = new ca_commerce_order_items();
    if ($vn_order_item_id) {
        $t_order_item->load($vn_order_item_id);
    }
    $o_view->setVar('containerID', $vs_container_dom_id);
    $o_view->setVar('t_subject', $t_subject);
    $o_view->setVar('t_representation', $t_rep);
    if ($vn_representation_id && (!sizeof($va_access_values) || in_array($t_rep->get('access'), $va_access_values))) {
        // check rep access
        $va_rep_display_info = caGetMediaDisplayInfo($vs_display_type, $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
        $va_rep_display_info['poster_frame_url'] = $t_rep->getMediaUrl('media', $va_rep_display_info['poster_frame_version']);
        $o_view->setVar('num_multifiles', $t_rep->numFiles());
        if (isset($pa_options['use_book_viewer'])) {
            $va_rep_display_info['use_book_viewer'] = (bool) $pa_options['use_book_viewer'];
        }
        $o_view->setVar('display_type', $vs_display_type);
        if (is_array($pa_additional_display_options)) {
            $va_rep_display_info = array_merge($va_rep_display_info, $pa_additional_display_options);
        }
        $o_view->setVar('display_options', $va_rep_display_info);
        $o_view->setVar('representation_id', $vn_representation_id);
        $o_view->setVar('versions', $va_versions = $t_rep->getMediaVersions('media'));
        $t_media = new Media();
        $o_view->setVar('version_type', $t_media->getMimetypeTypename($t_rep->getMediaInfo('media', 'original', 'MIMETYPE')));
        if ($vn_subject_id) {
            $o_view->setVar('reps', $va_reps = $t_subject->getRepresentations(array('icon'), null, array("return_with_access" => $va_access_values)));
            $vn_next_rep = $vn_prev_rep = null;
            $va_rep_list = array_values($va_reps);
            foreach ($va_rep_list as $vn_i => $va_rep) {
                if ($va_rep['representation_id'] == $vn_representation_id) {
                    if (isset($va_rep_list[$vn_i - 1])) {
                        $vn_prev_rep = $va_rep_list[$vn_i - 1]['representation_id'];
                    }
                    if (isset($va_rep_list[$vn_i + 1])) {
                        $vn_next_rep = $va_rep_list[$vn_i + 1]['representation_id'];
                    }
                    $o_view->setVar('representation_index', $vn_i + 1);
                }
            }
            $o_view->setVar('previous_representation_id', $vn_prev_rep);
            $o_view->setVar('next_representation_id', $vn_next_rep);
        }
        $ps_version = $po_request->getParameter('version', pString);
        if (!in_array($ps_version, $va_versions)) {
            if (!($ps_version = $va_rep_display_info['display_version'])) {
                $ps_version = null;
            }
        }
        $o_view->setVar('version', $ps_version);
        $o_view->setVar('version_info', $t_rep->getMediaInfo('media', $ps_version));
        $o_view->setVar('t_set_item', $t_set_item);
        $o_view->setVar('t_order_item', $t_order_item);
        $o_view->setVar('use_media_editor', $vb_media_editor);
        $o_view->setVar('noControls', $vb_no_controls);
    } else {
        //$t_attr = new ca_attributes($t_attr_val->get('attribute_id'));
        $t_attr_val->useBlobAsMediaField(true);
        $va_rep_display_info = caGetMediaDisplayInfo($vs_display_type, $t_attr_val->getMediaInfo('value_blob', 'INPUT', 'MIMETYPE'));
        $va_rep_display_info['poster_frame_url'] = $t_attr_val->getMediaUrl('value_blob', $va_rep_display_info['poster_frame_version']);
        $o_view->setVar('num_multifiles', $t_attr_val->numFiles());
        if (isset($pa_options['use_book_viewer'])) {
            $va_rep_display_info['use_book_viewer'] = (bool) $pa_options['use_book_viewer'];
        }
        $o_view->setVar('display_type', $vs_display_type);
        if (is_array($pa_additional_display_options)) {
            $va_rep_display_info = array_merge($va_rep_display_info, $pa_additional_display_options);
        }
        $o_view->setVar('display_options', $va_rep_display_info);
        $o_view->setVar('representation_id', $vn_representation_id);
        $o_view->setVar('t_attribute_value', $t_attr_val);
        $o_view->setVar('versions', $va_versions = $t_attr_val->getMediaVersions('value_blob'));
        $t_media = new Media();
        $o_view->setVar('version_type', $t_media->getMimetypeTypename($t_attr_val->getMediaInfo('value_blob', 'original', 'MIMETYPE')));
        $o_view->setVar('reps', array());
        $ps_version = $po_request->getParameter('version', pString);
        if (!in_array($ps_version, $va_versions)) {
            if (!($ps_version = $va_rep_display_info['display_version'])) {
                $ps_version = null;
            }
        }
        $o_view->setVar('version', $ps_version);
        $o_view->setVar('version_info', $t_attr_val->getMediaInfo('value_blob', $ps_version));
        $o_view->setVar('t_subject', $t_subject);
        $o_view->setVar('t_set_item', $t_set_item);
        $o_view->setVar('t_order_item', $t_order_item);
        $o_view->setVar('use_media_editor', $vb_media_editor);
        $o_view->setVar('noControls', $vb_no_controls);
    }
    return $o_view->render('representation_viewer_html.php');
}
コード例 #3
0
ファイル: displayHelpers.php プロジェクト: ffarago/pawtucket2
/**
 * 
 *
 * @param RequestHTTP $po_request
 * @param array $pa_options
 * @param array $pa_additional_display_options
 * @return string HTML output
 */
function caRepresentationViewerHTMLBundleForSearchResult($po_data, $po_request, $pa_options = null, $pa_additional_display_options = null)
{
    $ps_version = $po_request->getParameter('version', pString);
    $va_access_values = isset($pa_options['access']) && is_array($pa_options['access']) ? $pa_options['access'] : array();
    $vs_display_type = isset($pa_options['display']) && $pa_options['display'] ? $pa_options['display'] : 'media_overlay';
    $vs_container_dom_id = isset($pa_options['containerID']) && $pa_options['containerID'] ? $pa_options['containerID'] : null;
    $vn_object_id = isset($pa_options['object_id']) && $pa_options['object_id'] ? $pa_options['object_id'] : null;
    $vn_item_id = isset($pa_options['item_id']) && $pa_options['item_id'] ? $pa_options['item_id'] : null;
    $vn_order_item_id = isset($pa_options['order_item_id']) && $pa_options['order_item_id'] ? $pa_options['order_item_id'] : null;
    $vb_media_editor = isset($pa_options['mediaEditor']) && $pa_options['mediaEditor'] ? true : false;
    $vb_no_controls = isset($pa_options['noControls']) && $pa_options['noControls'] ? true : false;
    $vn_item_id = isset($pa_options['item_id']) && $pa_options['item_id'] ? $pa_options['item_id'] : null;
    $t_object = new ca_objects($vn_object_id);
    //if (!$t_object->getPrimaryKey()) { return false; }
    if (!$po_data->getPrimaryKey() && $t_object->getPrimaryKey() && method_exists($po_data, 'load')) {
        $po_data->load($t_object->getPrimaryRepresentationID(array('checkAccess' => $va_access_values)));
    }
    $t_set_item = new ca_set_items();
    if ($vn_item_id) {
        $t_set_item->load($vn_item_id);
    }
    $t_order_item = new ca_commerce_order_items();
    if ($vn_order_item_id) {
        $t_order_item->load($vn_order_item_id);
    }
    $o_view = new View($po_request, $po_request->getViewsDirectoryPath() . '/bundles/');
    $o_view->setVar('t_object', $t_object);
    $o_view->setVar('t_set_item', $t_set_item);
    $o_view->setVar('t_order_item', $t_order_item);
    $o_view->setVar('use_media_editor', $vb_media_editor);
    $o_view->setVar('noControls', $vb_no_controls);
    $va_rep_display_info = array();
    if (isset($pa_options['use_book_viewer'])) {
        $va_rep_display_info['use_book_viewer'] = (bool) $pa_options['use_book_viewer'];
    }
    if ($t_object->getPrimaryKey()) {
        $o_view->setVar('reps', $va_reps = $t_object->getRepresentations(array('icon'), null, array("return_with_access" => $va_access_values)));
    }
    $t_media = new Media();
    $va_buf = array();
    while ($po_data->nextHit()) {
        if (method_exists($po_data, 'numFiles')) {
            $o_view->setVar('num_multifiles', $po_data->numFiles());
        }
        $o_view->setVar('t_object_representation', $po_data);
        if (($vn_representation_id = $po_data->getPrimaryKey()) && (!sizeof($va_access_values) || in_array($po_data->get('access'), $va_access_values))) {
            // check rep access
            $va_rep_display_info = caGetMediaDisplayInfo($vs_display_type, $vs_mimetype = $po_data->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
            $va_rep_display_info['poster_frame_url'] = $po_data->getMediaUrl('media', $va_rep_display_info['poster_frame_version']);
            $va_additional_display_options = array();
            if (is_array($pa_additional_display_options) && isset($pa_additional_display_options[$vs_mimetype]) && is_array($pa_additional_display_options[$vs_mimetype])) {
                $va_additional_display_options = $pa_additional_display_options[$vs_mimetype];
            }
            $o_view->setVar('display_options', caGetMediaDisplayInfo('detail', $vs_mimetype));
            $o_view->setVar('display_type', $vs_display_type);
            $o_view->setVar('representation_id', $vn_representation_id);
            $o_view->setVar('t_object_representation', $po_data);
            $o_view->setVar('versions', $va_versions = $po_data->getMediaVersions('media'));
            $o_view->setVar('containerID', $vs_container_dom_id . $vn_representation_id);
            $o_view->setVar('version_type', $t_media->getMimetypeTypename($po_data->getMediaInfo('media', 'original', 'MIMETYPE')));
            if ($t_object->getPrimaryKey()) {
                $vn_next_rep = $vn_prev_rep = null;
                $va_rep_list = array_values($va_reps);
                foreach ($va_rep_list as $vn_i => $va_rep) {
                    if ($va_rep['representation_id'] == $vn_representation_id) {
                        if (isset($va_rep_list[$vn_i - 1])) {
                            $vn_prev_rep = $va_rep_list[$vn_i - 1]['representation_id'];
                        }
                        if (isset($va_rep_list[$vn_i + 1])) {
                            $vn_next_rep = $va_rep_list[$vn_i + 1]['representation_id'];
                        }
                        $o_view->setVar('representation_index', $vn_i + 1);
                    }
                }
                $o_view->setVar('previous_representation_id', $vn_prev_rep);
                $o_view->setVar('next_representation_id', $vn_next_rep);
            }
            if (!in_array($ps_version, $va_versions)) {
                if (!($ps_version = $va_rep_display_info['display_version'])) {
                    $ps_version = null;
                }
            }
            $o_view->setVar('version_info', $po_data->getMediaInfo('media', $ps_version));
            $o_view->setVar('version', $ps_version);
        }
        $va_buf[$vn_representation_id] = $o_view->render('representation_viewer_html.php');
    }
    return $va_buf;
}
コード例 #4
0
ファイル: ca_objects.php プロジェクト: guaykuru/pawtucket
 /**
  *
  */
 public function isOnLoan()
 {
     if (!$this->getPrimaryKey()) {
         return null;
     }
     $t_order = new ca_commerce_orders();
     if (is_array($va_orders = $t_order->getOrders(array('object_id' => $this->getPrimaryKey(), 'type' => 'L'))) && sizeof($va_orders)) {
         $va_order = array_shift($va_orders);
         $t_order_item = new ca_commerce_order_items();
         if ($t_order_item->load(array('order_id' => $va_order['order_id'], 'object_id' => $this->getPrimaryKey()))) {
             if (!$t_order_item->get('loan_return_date', array('GET_DIRECT_DATE' => true))) {
                 return array('loan_checkout_date' => $t_order_item->get('loan_checkout_date'), 'loan_checkout_date_raw' => $t_order_item->get('loan_checkout_date', array('GET_DIRECT_DATE' => true)), 'loan_due_date' => $t_order_item->get('loan_due_date'), 'loan_due_date_raw' => $t_order_item->get('loan_due_date', array('GET_DIRECT_DATE' => true)), 'client' => $va_order['billing_fname'] . ' ' . $va_order['billing_lname'] . " (" . $va_order['billing_email'] . ")", 'billing_fname' => $va_order['billing_fname'], 'billing_lname' => $va_order['billing_lname'], 'billing_email' => $va_order['billing_email'], 'order_id' => $va_order['order_id']);
             }
         }
     }
     return false;
 }
コード例 #5
0
ファイル: checkin_html.php プロジェクト: guaykuru/pawtucket
 * 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
 *
 * ----------------------------------------------------------------------
 */
$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>
コード例 #6
0
            $va_item_object_ids = array();
            foreach ($va_items as $va_item) {
                $va_item_object_ids[] = $va_item['object_id'];
            }
            ?>
				<div>
					<?php 
            print "<b>" . _t("Total cost") . ":</b> " . $vs_currency_symbol . $t_order->getOrderTotals(array('sumOnly' => true));
            ?>
					<?php 
            print " (" . ($vn_num_items == 1 ? _t('%1 item', $vn_num_items) : _t('%1 items', $vn_num_items)) . ")";
            ?>
				</div>
<?php 
            $vn_i = 0;
            $t_commerce_item = new ca_commerce_order_items();
            foreach ($va_items as $va_item) {
                $vn_i++;
                ?>
					<div class="caClientOrderCustomerFormItem"<?php 
                print $vn_i % 2 ? "" : " style='margin-left:18px;'";
                ?>
>
						<div class="caClientOrderCustomerFormItemImage"><?php 
                print "<a href='#' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, 'Detail', 'Object', 'GetRepresentationInfo', array('object_id' => $va_item['object_id'], 'order_item_id' => $va_item['item_id'])) . "\"); return false;' >" . $va_item['thumbnail_tag'] . "</a>\n";
                ?>
</div>
						<div class="caClientOrderCustomerFormItemSummary">
<?php 
                $t_commerce_item->load($va_item["item_id"]);
                if ($vb_can_download_item = $t_commerce_item->userCanDownloadItem()) {
コード例 #7
0
 public function ItemList()
 {
     if (!$this->opt_order->getPrimaryKey()) {
         $this->Edit();
         return;
     }
     $va_items = $this->opt_order->getItems();
     foreach ($va_items as $vn_item_id => $va_item) {
         $va_items[$vn_item_id]['loan_checkout_date'] = $va_items[$vn_item_id]['loan_checkout_date'] ? caGetLocalizedDate($va_items[$vn_item_id]['loan_checkout_date'], array('dateFormat' => 'delimited')) : '';
         $va_items[$vn_item_id]['loan_due_date'] = $va_items[$vn_item_id]['loan_due_date'] ? caGetLocalizedDate($va_items[$vn_item_id]['loan_due_date'], array('dateFormat' => 'delimited')) : '';
         $va_items[$vn_item_id]['loan_return_date'] = $va_items[$vn_item_id]['loan_return_date'] ? caGetLocalizedDate($va_items[$vn_item_id]['loan_return_date'], array('dateFormat' => 'delimited')) : '';
     }
     $this->view->setVar('order_items', $va_items);
     $va_service_groups = $this->opo_client_services_config->getAssoc('service_groups');
     $va_default_prices = array();
     foreach ($va_service_groups as $vs_group => $va_group_info) {
         foreach ($va_group_info['services'] as $vs_service => $va_service_info) {
             $va_default_prices[$vs_service] = $va_service_info;
         }
     }
     $this->view->setVar('default_item_prices', $va_default_prices);
     if (($vn_loan_period_in_days = $this->opo_client_services_config->get('default_library_loan_period')) <= 0) {
         $vn_loan_period_in_days = 7;
     }
     $t_order_item = new ca_commerce_order_items();
     $t_order_item->set('loan_checkout_date', time(), array('SET_DIRECT_DATE' => true));
     $t_order_item->set('loan_due_date', time() + $vn_loan_period_in_days * 24 * 60 * 60, array('SET_DIRECT_DATE' => true));
     $va_default_values = array('loan_checkout_date' => $t_order_item->get('loan_checkout_date', array('dateFormat' => 'delimited', 'timeOmit' => true)), 'loan_due_date' => $t_order_item->get('loan_due_date', array('dateFormat' => 'delimited', 'timeOmit' => true)));
     $this->view->setVar('t_order_item', $t_order_item);
     $this->view->setVar('additional_fees', $t_order_item->getAdditionalFeesHTMLFormBundle($this->request, array('config' => $this->opo_client_services_config, 'currency_symbol' => $this->opo_client_services_config->get('currency_symbol'), 'type' => 'L')));
     $this->view->setVar('additional_fees_for_new_items', $t_order_item->getAdditionalFeesHTMLFormBundle($this->request, array('config' => $this->opo_client_services_config, 'currency_symbol' => $this->opo_client_services_config->get('currency_symbol'), 'type' => 'L')));
     $this->view->setVar('additional_fee_codes', $va_additional_fee_codes = $this->opo_client_services_config->getAssoc('additional_loan_fees'));
     foreach ($va_additional_fee_codes as $vs_code => $va_info) {
         $va_default_values['ADDITIONAL_FEE_' . $vs_code] = $va_info['default_cost'];
     }
     $this->view->setVar('default_values', $va_default_values);
     $this->render('order_item_list_html.php');
 }
コード例 #8
0
 public function Save()
 {
     $vn_checkin_count = 0;
     foreach ($_REQUEST as $vs_k => $vs_v) {
         if (preg_match('!^caClientLibraryCheckin_item_id_([\\d]+)$!', $vs_k, $va_matches)) {
             if (isset($_REQUEST['caClientLibraryCheckin_' . $va_matches[1] . '_delete'])) {
                 continue;
             }
             $vn_item_id = $va_matches[1];
             $t_order_item = new ca_commerce_order_items($vn_item_id);
             if ($t_order_item->getPrimaryKey()) {
                 $t_order_item->setMode(ACCESS_WRITE);
                 $t_order_item->set('loan_return_date', time(), array('SET_DIRECT_DATE' => true));
                 $t_order_item->set('notes', $this->request->getParameter('caClientLibraryCheckin_notes_' . $vn_item_id, pString));
                 $t_order_item->update();
                 if ($t_order_item->numErrors()) {
                     $this->notification->addNotification(_t('Could not check in item %1: %2', $vn_item_id, join("; ", $t_order_item->getErrors())), __NOTIFICATION_TYPE_ERROR__);
                     continue;
                 }
                 $vn_checkin_count++;
             }
         }
     }
     $this->notification->addNotification($vn_checkin_count == 1 ? _t('Checked in %1 item', $vn_checkin_count) : _t('Checked in %1 items', $vn_checkin_count), __NOTIFICATION_TYPE_INFO__);
     $this->Index();
 }
コード例 #9
0
 /**
  * Returns a list of fulfillment events for the currently loaded order
  *
  * @param array $pa_options An array of options (none supported yet)
  * @return array A list of arrays, each containing information about a specific fulfillment event. The list is ordered by date/time starting with the oldest event.
  */
 public function getFulfillmentLog($pa_options = null)
 {
     if (!($vn_order_id = $this->getPrimaryKey())) {
         return null;
     }
     $o_db = $this->getDb();
     $qr_res = $o_db->query("\n\t\t\tSELECT e.*, i.*, o.idno item_idno\n\t\t\tFROM ca_commerce_fulfillment_events e \n\t\t\tINNER JOIN ca_commerce_order_items AS i ON i.item_id = e.item_id\n\t\t\tINNER JOIN ca_objects AS o ON o.object_id = i.object_id\n\t\t\tWHERE \n\t\t\t\te.order_id = ?\n\t\t\tORDER BY e.occurred_on\n\t\t", (int) $vn_order_id);
     $t_object = new ca_objects();
     $va_labels = $t_object->getPreferredDisplayLabelsForIDs($qr_res->getAllFieldValues("object_id"));
     $t_item = new ca_commerce_order_items();
     $va_events = array();
     $qr_res->seek(0);
     $va_user_cache = array();
     while ($qr_res->nextRow()) {
         $va_row = $qr_res->getRow();
         $va_row['fulfillment_details'] = caUnserializeForDatabase($va_row['fulfillment_details']);
         $va_row['item_label'] = $va_labels[$va_row['object_id']];
         $va_row['fulfillment_method_display'] = $t_item->getChoiceListValue('fullfillment_method', $va_row['fullfillment_method']);
         $va_row['service_display'] = $t_item->getChoiceListValue('service', $va_row['service']);
         if ($vn_user_id = (int) $va_row['fulfillment_details']['user_id']) {
             if (!isset($va_user_cache[$vn_user_id])) {
                 $t_user = new ca_users($vn_user_id);
                 if ($t_user->getPrimaryKey()) {
                     $va_user_cache[$vn_user_id] = array('fname' => $t_user->get('fname'), 'lname' => $t_user->get('lname'), 'email' => $t_user->get('email'));
                 } else {
                     $va_user_cache[$vn_user_id] = null;
                 }
             }
             if (is_array($va_user_cache[$vn_user_id])) {
                 $va_row = array_merge($va_row, $va_user_cache[$vn_user_id]);
             }
         }
         $va_events[] = $va_row;
     }
     return $va_events;
 }
コード例 #10
0
 * 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_order = $this->getVar('t_order');
$t_item = new ca_commerce_order_items();
$t_order->set('order_type', 'L');
$vn_order_id = (int) $t_order->getPrimaryKey();
$t_transaction = $this->getVar('t_transaction');
$vn_transaction_id = $this->getVar('transaction_id');
$vs_currency_symbol = $this->getVar('currency_symbol');
$va_errors = $this->getVar('errors');
$vn_max_field_width = 50;
$va_items = $t_order->getItems();
$va_order_totals = $t_order->getOrderTotals();
$va_item_counts_by_fulfillment_method = $t_order->getFulfillmentItemCounts();
print caFormTag($this->request, 'SaveOrderOverview', 'caClientOrderOverviewForm', null, 'post', 'multipart/form-data', '_top', array());
$va_users_other_orders = $t_order->getOrders(array('user_id' => $vn_client_user_id = $t_order->getOrderTransactionUserID(), 'type' => 'L', 'is_outstanding' => true, 'exclude' => array($vn_order_id)));
?>
<h1><?php 
print _t('Order Overview');
コード例 #11
0
 * 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_order = new ca_commerce_orders();
$t_item = new ca_commerce_order_items();
$va_order_list = $this->getVar('order_list');
$vn_num_orders = sizeof($va_order_list);
$va_filter_options = $this->getVar('filter_options');
$vs_currency_symbol = $this->getVar('currency_symbol');
$va_display_list = array('order_number' => _t('Order #'), 'created_on' => _t('Created'), 'client' => _t('Client'), 'summary' => _t('Summary'), 'order_status' => _t('Status'), 'total' => _t('Total'), 'shipping' => _t('Shipping'));
?>
<style type="text/css">
<!--
/* commentaire dans un css */
table, td { border: 1px solid #000000; color: #000000; text-wrap: normal; width: 135px; height: 120px; padding: 5px; font-size: 11px;}
td.odd   { color: #00AA00; }
.displayHeader { background-color: #EEEEEE; padding: 5px; border: 1px solid #999999; font-size: 12px; }
#pageHeader { background-color: #<?php 
print $this->request->config->get('report_color');
?>
コード例 #12
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_order = $this->getVar('t_order');
$va_items = $this->getVar('items');
$vn_num_items = sizeof($va_items);
$t_item = new ca_commerce_order_items();
$va_items = $this->getVar('items');
$va_display_list = array('name' => _t('Item name'), 'idno' => _t('ID'), 'service' => _t('Service'), 'fullfillment_method' => _t('Fulfillment'), 'fee' => _t('Fee'), 'notes' => _t('Notes'), 'thumbnail_tag' => _t('Image'));
?>
<style type="text/css">
<!--
/* commentaire dans un css */
table, td { border: 1px solid #000000; color: #000000; text-wrap: normal; width: 135px; height: 120px; padding: 5px; font-size: 11px;}
td.odd   { color: #00AA00; }
.displayHeader { background-color: #EEEEEE; padding: 5px; border: 1px solid #999999; font-size: 12px; }
#pageHeader { background-color: #<?php 
print $this->request->config->get('report_color');
?>
; margin: 0px 5px 10px 5px; padding: 3px 5px 2px 10px; width: 100%; height: 45px; }
.headerText { color: #<?php 
print $this->request->config->get('report_text_color') ? $this->request->config->get('report_text_color') : "FFFFFF";
コード例 #13
0
 /**
  *
  */
 public function GetSelectedRepresentationCount()
 {
     $pn_item_id = $this->request->getParameter('item_id', pInteger);
     $t_order_item = new ca_commerce_order_items($pn_item_id);
     $t_order = new ca_commerce_orders($t_order_item->get('order_id'));
     $vn_num_reps_selected = $t_order_item->getSelectedRepresentationCount();
     $vn_num_reps = $t_order_item->getRepresentationCount();
     $vs_msg = $vn_num_reps == 1 ? _t("%1/%2 page selected", $vn_num_reps_selected, $vn_num_reps) : _t("%1/%2 pages selected", $vn_num_reps_selected, $vn_num_reps);
     $this->response->addContent($vs_msg);
 }
コード例 #14
0
ファイル: sets_html.php プロジェクト: guaykuru/pawtucket
                ?>
						<br/><br/><div class="error">
<?php 
                print _t('There are no items in this gallery. When viewing an image record in the Digital Library, click the "Save images to gallery for purchase" link underneath an image to add it to one of your image galleries.<br/><br/>If you desire to purchase materials that you cannot find in the digital library, please use the message box on the right side of the screen for assistance from the R&R Associate.');
                ?>
						</div>
<?php 
            }
        }
    }
    ?>
	<div id="setItems" class="setItems">
		<ul id="setItemList" class="setItemList">
<?php 
    if (is_array($va_items) && sizeof($va_items) > 0) {
        $t_order_item = new ca_commerce_order_items();
        $t_order_objects = new ca_objects();
        foreach ($va_items as $vn_item_id => $va_item) {
            $vs_title = "";
            $va_title = array();
            ?>
				<li class='setItem' id='setItem<?php 
            print $vn_item_id;
            ?>
'>
					<div id='setItemContainer<?php 
            print $vn_item_id;
            ?>
' class='imagecontainer'>
						<div class='remove'><a href='#' class='setDeleteButton' id='setItemDelete<?php 
            print $vn_item_id;
コード例 #15
0
 /**
  *
  */
 public function Download()
 {
     $pn_item_id = $this->request->getParameter('item_id', pInteger);
     $t_item = new ca_commerce_order_items($pn_item_id);
     $t_order = new ca_commerce_orders($t_item->get('order_id'));
     $t_transaction = new ca_commerce_transactions($t_order->get('transaction_id'));
     $o_media = new Media();
     if ($t_item->getPrimaryKey() && $t_order->getPrimaryKey()) {
         // Is the order paid for...
         if (!in_array($t_order->get('order_status'), array('PROCESSED', 'PROCESSED_AWAITING_DIGITIZATION', 'COMPLETED'))) {
             $this->notification->addNotification(_t("This order must be processed before you can download items"), __NOTIFICATION_TYPE_ERROR__);
             $this->Index();
             return;
         }
         // ... and accessible by this user?
         if ($t_transaction->get('user_id') != $this->request->getUserID()) {
             $this->notification->addNotification(_t("You may not download this item"), __NOTIFICATION_TYPE_ERROR__);
             $this->Index();
             return;
         }
         // Is this item downloadable?
         if ($t_item->get('fullfillment_method') != 'DOWNLOAD') {
             $this->notification->addNotification(_t("This item cannot be downloaded"), __NOTIFICATION_TYPE_ERROR__);
             $this->Index();
             return;
         }
         // Which reps, and what versions?
         $t_object = new ca_objects($t_item->get('object_id'));
         $va_services_list = array();
         if (is_array($va_service_groups = $this->opo_client_services_config->getAssoc("service_groups"))) {
             foreach ($va_service_groups as $vs_group => $va_services_in_group) {
                 foreach ($va_services_in_group['services'] as $vs_service => $va_service_info) {
                     $va_services_list[$vs_service] = $va_service_info;
                 }
             }
         }
         if (!($vs_version = $va_services_list[$t_item->get('service')]['download_version'])) {
             $vs_version = 'small';
         }
         $va_reps = $t_object->getRepresentations(array($vs_version));
         $va_reps_to_download = $t_item->getRepresentationIDs();
         $o_zip = new ZipFile();
         $va_files = array();
         $vn_size = 0;
         foreach ($va_reps as $va_rep) {
             if (!isset($va_reps_to_download[$va_rep['representation_id']]) || !$va_reps_to_download[$va_rep['representation_id']]) {
                 continue;
             }
             $va_tmp = explode('.', $va_rep['paths'][$vs_version]);
             $vs_ext = array_pop($va_tmp);
             if ($va_rep['original_filename']) {
                 $va_tmp2 = explode(".", $va_rep['original_filename']);
                 if (sizeof($va_tmp2) > 1) {
                     array_pop($va_tmp2);
                 }
                 $vs_filename = join(".", $va_tmp2) . ".{$vs_ext}";
             } else {
                 $vs_filename = $t_object->get('idno') . "_" . $va_rep['representation_id'] . ".{$vs_ext}";
             }
             $vn_size += $va_files[$va_rep['paths'][$vs_version]] = filesize($va_rep['paths'][$vs_version]);
             $o_zip->addFile($va_rep['paths'][$vs_version], $vs_filename, 0, array('compression' => 0));
         }
         $this->view->setVar('zip', $o_zip);
         $this->view->setVar('version_download_name', date('dmY', $t_order->get('created_on', array('GET_DIRECT_DATE' => true))) . '-' . $t_order->getPrimaryKey());
         // Log fulfillment
         $t_item->logFulfillmentEvent('DOWNLOAD', array('ip_addr' => $_SERVER['REMOTE_ADDR'], 'user_id' => $this->request->getUserID(), 'datetime' => time(), 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'files' => $va_files, 'size' => $vn_size, 'representation_ids' => $va_reps_to_download));
         return $this->render('Account/download_binary.php');
     }
     $this->notification->addNotification(_t("You may not download this"), __NOTIFICATION_TYPE_ERROR__);
     $this->Index();
     return;
 }
コード例 #16
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_order = $this->getVar('t_order');
$vn_order_id = (int) $t_order->getPrimaryKey();
$vn_transaction_id = $this->getVar('transaction_id');
$va_errors = $this->getVar('errors');
$t_order_item = new ca_commerce_order_items();
$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');
$va_additional_fee_template_codes = array();
if (is_array($va_additional_fee_codes = $this->getVar('additional_fee_codes'))) {
    foreach ($va_additional_fee_codes as $vs_code => $va_info) {
        $va_additional_fee_template_codes[] = "'ADDITIONAL_FEE_{$vs_code}'";
    }
}
print $vs_control_box = caFormControlBox(caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t("Save"), 'caClientOrderItemListForm') . ' ' . caNavButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t("Cancel"), 'client', 'OrderEditor', 'Shipping', array('order_id' => $vn_order_id)), '', caNavButton($this->request, __CA_NAV_BUTTON_DELETE__, _t("Delete"), 'client', 'OrderEditor', 'Delete', array('order_id' => $vn_order_id)));
print caFormTag($this->request, 'SaveItemList', 'caClientOrderItemListForm', null, 'post', 'multipart/form-data', '_top', array());
?>
<h1><?php 
print _t('Items Ordered');