Skip to content

Commit

Permalink
Merge branch 'developer'
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-render committed Feb 6, 2020
2 parents 5c1cfb8 + ce6fcbb commit 624e3dd
Show file tree
Hide file tree
Showing 19 changed files with 3,013 additions and 351 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ robots.txt
koala-config.json
config.codekit3

# various minified
# various minified except the pdf viewer
# js min
lib/dedalo/**/*-min.js
!lib/dedalo/component_pdf/viewer/*-min.js

# js map
# js map except the pdf viewer
lib/dedalo/**/*-min.js.map
!lib/dedalo/component_pdf/viewer/*-min.js.map

# css min
lib/dedalo/**/*-min.css
Expand Down
9 changes: 6 additions & 3 deletions lib/dedalo/component_date/class.component_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -1177,23 +1177,26 @@ protected static function get_final_search_range_seconds($dd_date) {
}

# Date
# the calculation of the seconds for the end of the period always need to be seconds -1
# ex: year 2000 in seconds is: start = 64281600000 end = 64313740800 -1 or 64313740799
# because 64313740800 = 2001
if (isset($dd_date->day)) {

$dd_date_clone = clone($dd_date);
$dd_date_clone->day = $dd_date_clone->day+1;
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone);
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone)-1;

}elseif (isset($dd_date->month)) {

$dd_date_clone = clone($dd_date);
$dd_date_clone->month = $dd_date_clone->month+1;
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone);
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone)-1;

}elseif (isset($dd_date->year)) {

$dd_date_clone = clone($dd_date);
$dd_date_clone->year = $dd_date_clone->year+1;
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone);
$final_search_range_seconds = dd_date::convert_date_to_seconds($dd_date_clone)-1;

}

Expand Down
10 changes: 5 additions & 5 deletions lib/dedalo/component_image/js/render_component_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ var render_component_image = new function() {
const value = data.value
const quality = "1.5MB"
const url_object = value.filter(item => item.quality===quality)[0]
const url = (typeof url_object==="undefined") ? DEDALO_LIB_BASE_URL + "/themes/default/0.jpg" : url_object.url
let url = (typeof url_object==="undefined") ? DEDALO_LIB_BASE_URL + "/themes/default/0.jpg" : url_object.url
// remote images case
if (url.indexOf('gallica')!==-1) {
url = url + '.highres'
}

// Node create
const node = common.create_dom_element({
Expand All @@ -37,10 +41,6 @@ var render_component_image = new function() {
src : url
})

// Debug
//console.log("++ context", context);
//console.log("++ data:", data);

return node
}//end list

Expand Down
17 changes: 8 additions & 9 deletions lib/dedalo/component_pdf/html/component_pdf_viewer.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php
require_once( dirname(dirname(dirname(__FILE__))).'/config/config4.php');

if(login::is_logged()!==true) die("<span class='error'> Auth error: please login </span>");
if(login::is_logged()!==true) die("<span class='error'> Auth error: please login </span>");

// pdfjs paths
$pdf_viewer_base_path = DEDALO_ROOT_WEB .'/lib/pdfjs';
$pdf_js = $pdf_viewer_base_path .'/build/pdf.min.js';
$pdf_worker = $pdf_viewer_base_path .'/build/pdf.worker.min.js';
$pdf_worker = $pdf_viewer_base_path .'/build/pdf.worker.min.js';
$pdf_images = $pdf_viewer_base_path .'/web/images/';
$pdf_maps = $pdf_viewer_base_path .'/web/cmaps/';
$pdf_viewer_locale_properties = $pdf_viewer_base_path .'/web/locale/locale.properties';
$pdf_viewer_css = $pdf_viewer_base_path .'/web/viewer.css';

# Viewer custom. Read const dedalo_pdfjs_options to init the reader
#$pdf_viewer = $pdf_viewer_base_path .'/web/viewer-min.js';//'/web/viewer.min.js';
$pdf_viewer = DEDALO_LIB_BASE_URL .'/component_pdf/viewer/viewer-min.js'; // -min
$pdf_viewer = DEDALO_LIB_BASE_URL .'/component_pdf/viewer/viewer.js';
?>
<!DOCTYPE html>
<!--
Expand Down Expand Up @@ -56,18 +55,18 @@
<link rel="resource" type="application/l10n" href="<?php echo $pdf_viewer_locale_properties ?>"/>

<script src="<?php echo $pdf_js ?>"></script>
<script>
<script>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}
// pdfjsLib.GlobalWorkerOptions.workerSrc = '<?php echo $pdf_viewer_base_path .'/build/pdf.worker.js' ?>';

const dedalo_pdfjs_options = {
"locale" : '<?php echo lang::get_locale_from_code(DEDALO_APPLICATION_LANG) ?>',
"imageResourcesPath" : '<?php echo $pdf_images ?>',
"workerSrc" : '<?php echo $pdf_worker ?>',
"cMapUrl" : '<?php echo $pdf_maps ?>',
"url" : getURLParameter("pdf_url")
"url" : getURLParameter("pdf_url")
}
const SHOW_DEBUG = <?php var_export(SHOW_DEBUG); ?>;
if(SHOW_DEBUG===true) {
Expand Down Expand Up @@ -144,7 +143,7 @@ function getURLParameter(name) {
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>

<button id="full_screen" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to full screen" tabindex="51" data-l10n-id="presentation_mode"
<button id="full_screen" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to full screen" tabindex="51" data-l10n-id="presentation_mode"
onclick="top.component_pdf.toggle_full_pdf_viewer(this, parent.document.getElementById(window.name))">
<span data-l10n-id="presentation_mode_label">Full screen</span>
</button>
Expand Down Expand Up @@ -251,7 +250,7 @@ function getURLParameter(name) {
<button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
<button id="full_screen" class="toolbarButton presentationMode hiddenLargeView" title="Switch to full screen" tabindex="31" data-l10n-id="presentation_mode"
<button id="full_screen" class="toolbarButton presentationMode hiddenLargeView" title="Switch to full screen" tabindex="31" data-l10n-id="presentation_mode"
onclick="top.component_pdf.toggle_full_pdf_viewer(this, parent.document.getElementById(window.name))">
<span data-l10n-id="presentation_mode_label">Full screen</span>
</button>
Expand Down
9 changes: 9 additions & 0 deletions lib/dedalo/component_pdf/viewer/viewer-min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/dedalo/component_pdf/viewer/viewer-min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/dedalo/config/version.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1653,12 +1653,12 @@


# Version
$DEDALO_VERSION = '5.5.9b';
$DEDALO_VERSION = '5.5.14';
if(defined('DEVELOPMENT_SERVER') && DEVELOPMENT_SERVER===true) {
$DEDALO_VERSION .= '.'.time();
}
define('DEDALO_VERSION' , $DEDALO_VERSION);
define('DEDALO_BUILD' , '08-01-2020');
define('DEDALO_BUILD' , '05-02-2020');


/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3624,8 +3624,8 @@ public static function get_search_tipos($request_options) {
$ar_field = array_values($ar_field); # Reset keys
if (!empty($ar_field) && !empty($ar_field[0]->value)) {
# Existe valor de fecha_inicio
$ar_filter[$current_name][] = '(CAST(`fecha_fin` AS INT) <= '.$current_value.')';

// $ar_filter[$current_name][] = '(CAST(`fecha_fin` AS INT) <= '.$current_value.')';
$ar_filter[$current_name][] = '((`fecha_fin` IS null AND CAST(`fecha_inicio` AS INT) <= '.$current_value.') OR CAST(`fecha_fin` AS INT) <= '.$current_value.')';
}else{
# No hay fecha de inicio
$ar_filter[$current_name][] = '(`fecha_fin` = '.$current_value.')';
Expand Down
Loading

0 comments on commit 624e3dd

Please sign in to comment.