本文整理汇总了PHP中caGetLocalizedDate函数的典型用法代码示例。如果您正苦于以下问题:PHP caGetLocalizedDate函数的具体用法?PHP caGetLocalizedDate怎么用?PHP caGetLocalizedDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caGetLocalizedDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Export
public function Export()
{
set_time_limit(3600);
$vs_xml = ConfigurationExporter::exportConfigurationAsXML($this->request->config->get('app_name'), _t('Profile created on %1 by %2', caGetLocalizedDate(), $this->request->user->get('fname') . ' ' . $this->request->user->get('lname')), 'base', '');
$this->view->setVar('profile', $vs_xml);
$this->view->setVar('profile_file_name', $this->request->config->get('app_name') . '_config.xml');
$this->render('export_configuration_binary.php');
return;
}
示例2: _t
print "<div class='unit'><h2>" . _t("Related Collection") . (sizeof($va_collections) > 1 ? "s" : "") . "</h2>";
foreach ($va_collections as $va_collection_info) {
print "<div>" . $o_purifier->purify($va_collection_info['label']) . " (" . $o_purifier->purify($va_collection_info['relationship_typename']) . ")</div>";
}
print "</div><!-- end unit -->";
}
# --- lots
$va_object_lots = $t_item->get("ca_object_lots", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_object_lots) > 0) {
print "<div class='unit'><h2>" . _t("Related Lot") . (sizeof($va_object_lots) > 1 ? "s" : "") . "</h2>";
foreach ($va_object_lots as $va_object_lot_info) {
print "<div>" . $o_purifier->purify($va_object_lot_info['label']) . " (" . $o_purifier->purify($va_object_lot_info['relationship_typename']) . ")</div>";
}
print "</div><!-- end unit -->";
}
# --- vocabulary terms
$va_terms = $t_item->get("ca_list_items", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_terms) > 0) {
print "<div class='unit'><h2>" . _t("Subject") . (sizeof($va_terms) > 1 ? "s" : "") . "</h2>";
foreach ($va_terms as $va_term_info) {
print "<div>" . $o_purifier->purify($va_term_info['label']) . "</div>";
}
print "</div><!-- end unit -->";
}
print "<div class='notes'><b>Downloaded:</b> " . caGetLocalizedDate(null, array('dateFormat' => 'delimited')) . "</unit>";
?>
</BODY>
</HTML>
示例3: nextRow
/**
*
*
* @param string $ps_source
* @param array $pa_options
* @return bool
*/
public function nextRow()
{
if (!$this->opo_rows) {
return false;
}
while (true) {
if ($this->opn_current_row > 0) {
$this->opo_rows->next();
}
$this->opn_current_row++;
if (!$this->opo_rows->valid()) {
return false;
}
if ($o_row = $this->opo_rows->current()) {
$this->opa_row_buf = array(null);
$o_cells = $o_row->getCellIterator();
$o_cells->setIterateOnlyExistingCells(false);
$va_row = array();
$vb_val_was_set = false;
$vn_col = 0;
$vn_last_col_set = null;
foreach ($o_cells as $o_cell) {
if (PHPExcel_Shared_Date::isDateTime($o_cell)) {
if (!($vs_val = caGetLocalizedDate(PHPExcel_Shared_Date::ExcelToPHP(trim((string) $o_cell->getValue()))))) {
if (!($vs_val = trim(PHPExcel_Style_NumberFormat::toFormattedString((string) $o_cell->getValue(), 'YYYY-MM-DD')))) {
$vs_val = trim((string) $o_cell->getValue());
}
}
$this->opa_row_buf[] = $vs_val;
} else {
$this->opa_row_buf[] = $vs_val = trim((string) $o_cell->getValue());
}
if (strlen($vs_val) > 0) {
$vb_val_was_set = true;
$vn_last_col_set = $vn_col;
}
$vn_col++;
if ($vn_col > 255) {
break;
}
// max 255 columns; some Excel files have *thousands* of "phantom" columns
}
//if (!$vb_val_was_set) {
//return $this->nextRow();
// continue;
//} // skip completely blank rows
return $o_row;
}
}
return false;
}
示例4: importMetadata
/**
* @param array $pa_options
* progressCallback =
* reportCallback =
* sendMail =
* log = log directory path
* logLevel = KLogger loglevel. Default is "INFO"
*/
public static function importMetadata($po_request, $ps_source, $ps_importer, $ps_input_format, $pa_options = null)
{
$va_errors = $va_noticed = array();
$vn_start_time = time();
$o_config = Configuration::load();
if (!ca_data_importers::mappingExists($ps_importer)) {
$va_errors['general'] = array('idno' => "*", 'label' => "*", 'errors' => array(_t('Importer %1 does not exist', $ps_importer)), 'status' => 'ERROR');
return false;
}
$vs_log_dir = isset($pa_options['log']) ? $pa_options['log'] : null;
$vn_log_level = KLogger::INFO;
switch ($vs_log_level = isset($pa_options['logLevel']) ? $pa_options['logLevel'] : "INFO") {
case 'DEBUG':
$vn_log_level = KLogger::DEBUG;
break;
case 'NOTICE':
$vn_log_level = KLogger::NOTICE;
break;
case 'WARN':
$vn_log_level = KLogger::WARN;
break;
case 'ERR':
$vn_log_level = KLogger::ERR;
break;
case 'CRIT':
$vn_log_level = KLogger::CRIT;
break;
case 'ALERT':
$vn_log_level = KLogger::ALERT;
break;
default:
case 'INFO':
$vn_log_level = KLogger::INFO;
break;
}
if (!ca_data_importers::importDataFromSource($ps_source, $ps_importer, array('logDirectory' => $o_config->get('batch_metadata_import_log_directory'), 'request' => $po_request, 'format' => $ps_input_format, 'showCLIProgressBar' => false, 'useNcurses' => false, 'progressCallback' => isset($pa_options['progressCallback']) ? $pa_options['progressCallback'] : null, 'reportCallback' => isset($pa_options['reportCallback']) ? $pa_options['reportCallback'] : null, 'logDirectory' => $vs_log_dir, 'logLevel' => $vn_log_level))) {
$va_errors['general'] = array('idno' => "*", 'label' => "*", 'errors' => array(_t("Could not import source %1", $vs_data_source)), 'status' => 'ERROR');
return false;
} else {
$va_notices['general'] = array('idno' => "*", 'label' => "*", 'errors' => array(_t("Imported data from source %1", $vs_data_source)), 'status' => 'SUCCESS');
//return true;
}
$vn_elapsed_time = time() - $vn_start_time;
if (isset($pa_options['sendMail']) && $pa_options['sendMail']) {
if ($vs_email = trim($po_request->user->get('email'))) {
caSendMessageUsingView($po_request, array($vs_email => $po_request->user->get('fname') . ' ' . $po_request->user->get('lname')), __CA_ADMIN_EMAIL__, _t('[%1] Batch metadata import completed', $po_request->config->get('app_display_name')), 'batch_metadata_import_completed.tpl', array('notices' => $va_notices, 'errors' => $va_errors, 'numErrors' => sizeof($va_errors), 'numProcessed' => sizeof($va_notices), 'subjectNameSingular' => _t('row'), 'subjectNamePlural' => _t('rows'), 'startedOn' => $vs_started_on, 'completedOn' => caGetLocalizedDate(time()), 'elapsedTime' => caFormatInterval($vn_elapsed_time)));
}
}
if (isset($pa_options['sendSMS']) && $pa_options['sendSMS']) {
SMS::send($po_request->getUserID(), _t("[%1] Metadata import processing for begun at %2 is complete", $po_request->config->get('app_display_name'), $vs_started_on));
}
return array('errors' => $va_errors, 'notices' => $va_notices, 'processing_time' => caFormatInterval($vn_elapsed_time));
}
示例5: caEditorInspector
//.........这里部分代码省略.........
$vs_label .= join(" / ", $va_collection_links) . ' > ';
}
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 . ' > ' . $t_item->getLabelForDisplay();
} else {
$vs_label .= ($va_parent['NODE'][$vs_disp_fld] ? $va_parent['NODE'][$vs_disp_fld] . ' > ' : '') . $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 .= " > " . $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');
}
}
示例6: caClientServicesFormatMessagePawtucket
/**
* Formats communication for display in message window in Pawtucket
*
* @param RequestHTTP $po_request
* @param array $pa_data
* @param array $pa_options
* viewContentDivID =
* replyButton =
*
* @return string
*/
function caClientServicesFormatMessagePawtucket($po_request, $pa_data, $pa_options = null)
{
$vs_buf = "<div class='caClientCommunicationsMessage'>";
if (isset($pa_options['replyButton']) && $pa_options['replyButton']) {
$vs_buf .= "<div id='reply'>" . $pa_options['replyButton'] . "</div>";
}
$vs_buf .= "<div class='caClientCommunicationsMessageFrom'><span class='caClientCommunicationsMessageHeading'>" . _t('From') . ":</span> " . caClientServicesGetSenderName($pa_data) . "</div>";
$vs_buf .= "<div class='caClientCommunicationsMessageDate'><span class='caClientCommunicationsMessageHeading'>" . _t("Date") . ": </span>" . caGetLocalizedDate($pa_data['created_on'], array('dateFormat' => 'delimited')) . "</div>";
$vs_buf .= "<div class='caClientCommunicationsMessageSubject'><span class='caClientCommunicationsMessageHeading'>" . _t('Subject') . ":</span> " . $pa_data['subject'] . "</div>";
$vs_buf .= "<div class='caClientCommunicationsMessageText'>" . nl2br($pa_data['message']) . "</div>";
$vs_buf .= "</div>\n";
return $vs_buf;
}
示例7: caGetLocalizedDate
<?php
$vn_start = 0;
?>
<page backtop="50px">
<?php
if ($this->request->config->get('report_header_enabled')) {
?>
<page_header>
<div id='pageHeader'>
<?php
if (file_exists($this->request->getThemeDirectoryPath() . "/graphics/logos/" . $this->request->config->get('report_img'))) {
print '<img src="' . $this->request->getThemeDirectoryPath() . '/graphics/logos/' . $this->request->config->get('report_img') . '"/>';
}
if ($this->request->config->get('report_show_timestamp')) {
print "<span class='headerText'>" . caGetLocalizedDate(null, array('dateFormat' => 'delimited')) . "</span>";
}
if ($this->request->config->get('report_show_number_results')) {
print "<span class='headerText'>" . ($vn_num_items == 1 ? _t('%1 item', $vn_num_items) : _t('%1 items', $vn_num_items)) . "</span>";
}
if ($this->request->config->get('report_show_search_term')) {
print "<span class='headerText'>" . $this->getVar('criteria_summary_truncated') . "</span>";
}
print "<span class='pagingText'>" . _t("Page [%1]/[%2]", "[page_cu]", "[page_nb]") . "</span>";
?>
</div>
</page_header>
<table class="listtable" width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<?php
示例8: foreach
</tr>
<?php
}
foreach ($va_orders as $vn_id => $va_order) {
?>
<tr class='caClientOrderHistoryRow'>
<td><?php
print caNavLink($this->request, $va_order['order_number'], '', 'client/orders', 'OrderEditor', 'Edit', array('order_id' => $va_order['order_id']));
?>
</td>
<td><?php
print $va_order['billing_fname'] . ' ' . $va_order['billing_lname'] . " (" . $va_order['billing_email'] . ")";
?>
</td>
<td><?php
print caGetLocalizedDate($va_order['created_on']);
?>
</td>
<td><?php
print $va_order['fee'];
?>
</td>
<td><?php
print $va_order['order_status'];
?>
</td>
</tr>
<?php
}
}
}
示例9: Get
/**
*
*/
public function Get()
{
$ps_query = $this->request->getParameter('term', pString);
$o_search = new ObjectSearch();
$qr_res = $o_search->search($ps_query);
$va_object_ids = array();
while ($qr_res->nextHit()) {
$va_object_ids[$qr_res->get('object_id')] = false;
}
if (sizeof($va_object_ids)) {
// get checked out items
$o_db = new Db();
$qr_checked_out_items = $o_db->query("\n\t\t\t\t\tSELECT DISTINCT i.object_id, i.loan_due_date\n\t\t\t\t\tFROM ca_commerce_order_items i\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ti.loan_return_date IS NULL and i.loan_checkout_date > 0 AND i.object_id IN (?)\n\t\t\t\t", array(array_keys($va_object_ids)));
while ($qr_checked_out_items->nextRow()) {
$va_object_ids[$qr_checked_out_items->get('object_id')] = $qr_checked_out_items->get('loan_due_date');
}
$t_object = new ca_objects();
$qr_res = $t_object->makeSearchResult('ca_objects', array_keys($va_object_ids));
$va_items = caProcessRelationshipLookupLabel($qr_res, $t_object, array());
foreach ($va_items as $vn_object_id => $va_object) {
if ((int) $va_object_ids[$vn_object_id] > 0) {
$vs_due_date_for_display = caGetLocalizedDate($va_object_ids[$vn_object_id], array('format' => 'delimited', 'timeOmit' => true));
$va_items[$vn_object_id]['label'] .= ' [<em>' . _t('on loan through %1', $vs_due_date_for_display) . '</em>]';
$va_items[$vn_object_id]['due_date'] = $va_object_ids[$vn_object_id];
$va_items[$vn_object_id]['due_date_display'] = $vs_due_date_for_display;
}
}
}
if (!is_array($va_items)) {
$va_items = array();
}
if (!sizeof($va_items)) {
// nothing found
$va_items[0] = array('label' => _t('No matches found'), 'type_id' => null, 'object_id' => 0);
}
$this->view->setVar('object_list', $va_items);
$this->view->setVar('object_id_list', $va_object_ids);
return $this->render('ajax_object_list_html.php');
}
示例10: getLoanReturnDates
/**
*
*/
public function getLoanReturnDates()
{
if (!($vn_order_id = $this->getPrimaryKey())) {
return null;
}
$o_db = $this->getDb();
$qr_res = $o_db->query("\n\t\t\tSELECT min(loan_return_date) mindate, max(loan_return_date) maxdate\n\t\t\tFROM ca_commerce_order_items\n\t\t\tWHERE order_id = ?\n\t\t", (int) $vn_order_id);
if ($qr_res->nextRow()) {
$vn_min = $qr_res->get('mindate');
$vn_max = $qr_res->get('maxdate');
if (!$vn_min) {
$vn_min = $vn_max;
}
if (!$vn_max) {
$vn_max = $vn_min;
}
if (!$vn_min || !$vn_max) {
return null;
}
return array('min' => caGetLocalizedDate($vn_min, array('dateFormat' => 'delimited')), 'max' => caGetLocalizedDate($vn_max, array('dateFormat' => 'delimited')), 'min_raw' => $vn_min, 'max_raw' => $vn_max, 'range' => caGetLocalizedDateRange($vn_min, $vn_max, array('timeOmit' => true)));
}
return null;
}
示例11: sprintf
break;
case 'order_status':
$vs_display_value = $t_order->getChoiceListValue('order_status', $va_order[$vs_column_code]);
$vs_size_attr = ' width="70"';
break;
case 'total':
$vs_display_value = $vs_currency_symbol . sprintf("%4.2f", $va_order['order_total']);
$vs_size_attr = ' width="70"';
break;
case 'shipping':
$vs_display_value = _t('Method: %1', $va_order['shipping_method']) . "<br/><br/>\n";
if ($va_order['shipping_date']) {
$vs_display_value .= _t('Ship date: %1', caGetLocalizedDate($va_order['shipping_date'], array('timeOmit' => true, 'dateFormat' => 'delimited'))) . "<br/><br/>\n";
}
if ($va_order['shipped_on_date']) {
$vs_display_value .= _t('Shipped on: %1', caGetLocalizedDate($va_order['shipped_on_date'], array('timeOmit' => true, 'dateFormat' => 'delimited'))) . "<br/><br/>\n";
}
$vs_size_attr = ' width="90"';
break;
default:
$vs_display_value = $va_order[$vs_column_code];
$vs_size_attr = ' width="70"';
break;
}
print "<td{$vs_size_attr}>" . (strlen($vs_display_value) > 1200 ? strip_tags(substr($vs_display_value, 0, 1197)) . "..." : $vs_display_value) . "</td>";
$vn_count++;
if ($vn_count >= $vn_start + 8) {
break;
}
}
?>
示例12: nextRow
/**
*
*
* @param string $ps_source
* @param array $pa_options
* @return bool
*/
public function nextRow()
{
if (!$this->opo_rows) {
return false;
}
if ($this->opn_current_row > 0) {
$this->opo_rows->next();
}
$this->opn_current_row++;
if (!$this->opo_rows->valid()) {
return false;
}
if ($o_row = $this->opo_rows->current()) {
$this->opa_row_buf = array(null);
$o_cells = $o_row->getCellIterator();
$o_cells->setIterateOnlyExistingCells(false);
$va_row = array();
$vb_val_was_set = false;
$vn_col = 0;
$vn_last_col_set = null;
foreach ($o_cells as $o_cell) {
if (PHPExcel_Shared_Date::isDateTime($o_cell)) {
if (!($vs_val = caGetLocalizedDate(PHPExcel_Shared_Date::ExcelToPHP(trim((string) $o_cell->getValue()))))) {
$vs_val = trim((string) $o_cell->getValue());
}
$this->opa_row_buf[] = $vs_val;
} else {
$this->opa_row_buf[] = $vs_val = trim((string) $o_cell->getValue());
}
if ($vs_val) {
$vb_val_was_set = true;
$vn_last_col_set = $vn_col;
}
$vn_col++;
}
if (!$vb_val_was_set) {
return $this->nextRow();
}
// skip completely blank rows
//$this->opa_row_buf = array_slice($this->opa_row_buf, 0, $vn_last_col_set);
return $o_row;
}
return false;
}
示例13: importMetadata
/**
* Import metadata using a mapping
*
* @param RequestHTTP $po_request The current request
* @param string $ps_source A path to a file or directory of files to import
* @param string $ps_importer The code of the importer (mapping) to use
* @param string $ps_input_format The format of the source data
* @param array $pa_options
* progressCallback =
* reportCallback =
* sendMail =
* dryRun =
* importAllDatasets =
* log = log directory path
* logLevel = KLogger constant for minimum log level to record. Default is KLogger::INFO. Constants are, in descending order of shrillness:
* KLogger::EMERG = Emergency messages (system is unusable)
* KLogger::ALERT = Alert messages (action must be taken immediately)
* KLogger::CRIT = Critical conditions
* KLogger::ERR = Error conditions
* KLogger::WARN = Warnings
* KLogger::NOTICE = Notices (normal but significant conditions)
* KLogger::INFO = Informational messages
* KLogger::DEBUG = Debugging messages
*/
public static function importMetadata($po_request, $ps_source, $ps_importer, $ps_input_format, $pa_options = null)
{
$va_errors = $va_noticed = array();
$vn_start_time = time();
$o_config = Configuration::load();
if (!ca_data_importers::mappingExists($ps_importer)) {
$va_errors['general'] = array('idno' => "*", 'label' => "*", 'errors' => array(_t('Importer %1 does not exist', $ps_importer)), 'status' => 'ERROR');
return false;
}
$vs_log_dir = caGetOption('log', $pa_options, null);
$vs_log_level = caGetOption('logLevel', $pa_options, "INFO");
$vb_import_all_datasets = caGetOption('importAllDatasets', $pa_options, false);
$vb_dry_run = caGetOption('dryRun', $pa_options, false);
$vn_log_level = BatchProcessor::_logLevelStringToNumber($vs_log_level);
if (!isURL($ps_source) && is_dir($ps_source)) {
$va_sources = caGetDirectoryContentsAsList($ps_source, true, false, false, false);
} else {
$va_sources = array($ps_source);
}
$vn_file_num = 0;
foreach ($va_sources as $vs_source) {
$vn_file_num++;
if (!ca_data_importers::importDataFromSource($vs_source, $ps_importer, array('fileNumber' => $vn_file_num, 'numberOfFiles' => sizeof($va_sources), 'logDirectory' => $o_config->get('batch_metadata_import_log_directory'), 'request' => $po_request, 'format' => $ps_input_format, 'showCLIProgressBar' => false, 'useNcurses' => false, 'progressCallback' => isset($pa_options['progressCallback']) ? $pa_options['progressCallback'] : null, 'reportCallback' => isset($pa_options['reportCallback']) ? $pa_options['reportCallback'] : null, 'logDirectory' => $vs_log_dir, 'logLevel' => $vn_log_level, 'dryRun' => $vb_dry_run, 'importAllDatasets' => $vb_import_all_datasets))) {
$va_errors['general'][] = array('idno' => "*", 'label' => "*", 'errors' => array(_t("Could not import source %1", $ps_source)), 'status' => 'ERROR');
return false;
} else {
$va_notices['general'][] = array('idno' => "*", 'label' => "*", 'errors' => array(_t("Imported data from source %1", $ps_source)), 'status' => 'SUCCESS');
//return true;
}
}
$vn_elapsed_time = time() - $vn_start_time;
if (isset($pa_options['sendMail']) && $pa_options['sendMail']) {
if ($vs_email = trim($po_request->user->get('email'))) {
caSendMessageUsingView($po_request, array($vs_email => $po_request->user->get('fname') . ' ' . $po_request->user->get('lname')), __CA_ADMIN_EMAIL__, _t('[%1] Batch metadata import completed', $po_request->config->get('app_display_name')), 'batch_metadata_import_completed.tpl', array('notices' => $va_notices, 'errors' => $va_errors, 'numErrors' => sizeof($va_errors), 'numProcessed' => sizeof($va_notices), 'subjectNameSingular' => _t('row'), 'subjectNamePlural' => _t('rows'), 'startedOn' => caGetLocalizedDate($vn_start_time), 'completedOn' => caGetLocalizedDate(time()), 'elapsedTime' => caFormatInterval($vn_elapsed_time)));
}
}
if (isset($pa_options['sendSMS']) && $pa_options['sendSMS']) {
SMS::send($po_request->getUserID(), _t("[%1] Metadata import processing for begun at %2 is complete", $po_request->config->get('app_display_name'), caGetLocalizedDate($vn_start_time)));
}
return array('errors' => $va_errors, 'notices' => $va_notices, 'processing_time' => caFormatInterval($vn_elapsed_time));
}
示例14: _t
* @type fragment
*
* ----------------------------------------------------------------------
*/
$vo_result = $this->getVar('result');
$vn_num_items = (int) $vo_result->numHits();
if ($this->request->config->get('report_header_enabled')) {
$vs_footer = '<table class="footerText" style="width: 100%;"><tr>';
if ($this->request->config->get('report_show_search_term')) {
$vs_footer .= "<td class='footerText' style='font-family: \"Sans Light\"; font-size: 12px; text-align: center;'>" . $this->getVar('criteria_summary_truncated') . "</td>";
}
if ($this->request->config->get('report_show_number_results')) {
$vs_footer .= "<td class='footerText' style='font-family: \"Sans Light\"; font-size: 12px; text-align: center;'>" . ($vn_num_items == 1 ? _t('%1 item', $vn_num_items) : _t('%1 items', $vn_num_items)) . "</td>";
}
if ($this->request->config->get('report_show_timestamp')) {
$vs_footer .= "<td class='footerText' style='font-family: \"Sans Light\"; font-size: 12px; text-align: center;'>" . caGetLocalizedDate(null, array('dateFormat' => 'delimited')) . "</td>";
}
$vs_footer .= "</tr></table>";
switch ($this->getVar('PDFRenderer')) {
case 'domPDF':
?>
<div id='footer'>
<?php
print $vs_footer;
?>
</div>
<?php
break;
case 'PhantomJS':
?>
示例15: _p
_p('User');
?>
</th>
<th>
<?php
_p('IP');
?>
</th>
</tr>
</thead>
<tbody>
<?php
if (is_array($va_log) && sizeof($va_log) > 0) {
foreach ($va_log as $vn_i => $va_log_entry) {
print "<tr>";
print "<td>" . caGetLocalizedDate($va_log_entry['occurred_on']) . "</td>";
print "<td>" . $va_log_entry['fulfillment_method_display'] . "</td>";
print "<td>" . caEditorLink($this->request, $va_log_entry['item_label'], '', 'ca_objects', $va_log_entry['object_id']) . " (" . $va_log_entry['item_idno'] . ")" . "</td>";
print "<td>" . $va_log_entry['service_display'] . "</td>";
print "<td>" . (is_array($va_log_entry['fulfillment_details']['files']) ? sizeof($va_log_entry['fulfillment_details']['files']) : 0) . "</td>";
print "<td>" . $va_log_entry['fname'] . ' ' . $va_log_entry['lname'] . " (" . $va_log_entry['email'] . ")</td>";
print "<td>" . $va_log_entry['fulfillment_details']['ip_addr'] . "</td>";
print "</tr>";
}
} else {
print "<tr><td colspan='7' align='center'>" . _t('No fulfillment events') . "</td></tr>\n";
}
?>
</tbody>
</table>
<div class="editorBottomPadding"><!-- empty --></div>