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 Jan 19, 2020
2 parents bac3694 + 4d0a965 commit 5c1cfb8
Show file tree
Hide file tree
Showing 521 changed files with 57,455 additions and 552 deletions.
Binary file modified install/db/dedalo4_install.backup
Binary file not shown.
78 changes: 39 additions & 39 deletions lib/dedalo/component_autocomplete/component_autocomplete.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

# CONTROLLER

$tipo = $this->get_tipo();
$parent = $this->get_parent();
$section_tipo = $this->get_section_tipo();
$modo = $this->get_modo();
$modo = $this->get_modo();
$label = $this->get_label();
$required = $this->get_required();
$propiedades = $this->get_propiedades();
Expand All @@ -21,14 +21,14 @@
$component_name = get_class($this);

if($permissions===0) return null;

# Verify component content record is inside section record filter
if ($this->get_filter_authorized_record()===false) return NULL;

$file_name = $modo;
$from_modo = $modo;
switch($modo) {

switch($modo) {

case 'edit_in_list':
// Fix always edit as modo / filename
Expand All @@ -40,48 +40,48 @@
}

$wrap_style = '';
// Dont break here. Continue as modo edit
// Dont break here. Continue as modo edit

case 'tool_description':
// Take care previous case don't break !
if ($modo==='tool_description') {
$file_name = 'edit';
}
}
// Dont break here. Continue as modo edit

case 'edit' :
case 'edit' :

# Custom propiedades external dato
# Custom propiedades external dato
if(isset($propiedades->source->mode) && $propiedades->source->mode==='external'){
$this->set_dato_external($save=false, $changed=false, $current_dato=false); // Forces update dato with calculated external dato
$dato = $this->get_dato();
}
// General vars

// General vars
$tipo_to_search = $this->get_tipo_to_search();
$ar_valor = $this->get_valor($lang,'array');
$ar_labels = array_map(function($element){
return $element->label;
}, $ar_valor);
}, $ar_valor);
$valor = implode('<br>', $ar_labels);

$id_wrapper = 'wrapper_'.$identificador_unico;
$input_name = "{$tipo}_{$parent}";
$component_info = $this->get_component_info('json');
$dato_json = json_handler::encode($dato);
$dato_json = json_handler::encode($dato);

// service autocomplete options
$ar_target_section_tipo = $this->get_ar_target_section_tipo();

// search_sections . set and remove search sections duplicates
$search_sections = array_values( array_unique($ar_target_section_tipo) );

// from_modo. get the change modo from portal list to edit
$from_modo_requested = common::get_request_var('from_modo');
if ($from_modo_requested!==false) {
$from_modo = $from_modo_requested;
}

// Semantic nodes
$semantic_nodes = $this->get_semantic_nodes();
if ( !empty($this->semantic_nodes) ) {
Expand All @@ -93,7 +93,7 @@
// time machine. get the change in_time_machine
$var_requested_m = common::get_request_var('m');
$var_requested = common::get_request_var('mode');
$in_time_machine = (!empty($var_requested_m) && $var_requested_m==='tool_time_machine') ||
$in_time_machine = (!empty($var_requested_m) && $var_requested_m==='tool_time_machine') ||
(!empty($var_requested) && $var_requested==='load_preview_component') ? true : false;

// Filter_by_list (Propiedades option)
Expand All @@ -102,14 +102,14 @@
$filter_by_list = $propiedades->source->filter_by_list;
}
$json_filter_by_list = json_encode($filter_by_list);

// search_query_object params
# Limit
$limit = isset($propiedades->limit) ? (int)$propiedades->limit : 0;
$limit = isset($propiedades->limit) ? (int)$propiedades->limit : 0;
# Divisor
$divisor = $this->get_divisor();
# q_operator is injected by trigger search2
$q_operator = isset($this->q_operator) ? $this->q_operator : null;
$q_operator = isset($this->q_operator) ? $this->q_operator : null;

// search_query_object build
$query_object_options = new stdClass();
Expand All @@ -124,7 +124,7 @@
$json_search_query_object = json_encode( $search_query_object, JSON_UNESCAPED_UNICODE | JSON_HEX_APOS );

#$filter_by_list_component_tipo = isset($propiedades->source->filter_by_list->component_tipo) ? $propiedades->source->filter_by_list->component_tipo : null;

// Dataframe manager
$ar_dataframe_obj = array();
$ar_dataframe = isset($propiedades->dataframe) ? $propiedades->dataframe : false;
Expand All @@ -135,12 +135,12 @@
$dataframe_obj = new dataframe($current_dataframe->tipo, $current_dataframe->type, $this, 'dataframe_edit', $key);
$ar_dataframe_obj[] = $dataframe_obj;
//dump($ar_dataframe_obj[0]->get_html(), ' $ar_dataframe_obj[$i]->get_html(); ++ '.to_string());
}
}
}
}
}
break;

case 'search':
// General vars
# dato is injected by trigger search wen is needed
Expand All @@ -150,29 +150,29 @@
$ar_valor = $this->get_valor($lang,'array');
$ar_labels = array_map(function($element){
return $element->label;
}, $ar_valor);
}, $ar_valor);
$valor = implode('<br>', $ar_labels);
$id_wrapper = 'wrapper_'.$identificador_unico;
$input_name = $tipo.'_'.$parent;
$tipo_to_search = $this->get_tipo_to_search();
$input_name = $tipo.'_'.$parent;
$tipo_to_search = $this->get_tipo_to_search();
# Search input name (var search_input_name is injected in search -> records_search_list.phtml)
# and recovered in component_common->get_search_input_name()
# Normally is section_tipo + component_tipo, but when in portal can be portal_tipo + section_tipo + component_tipo
$search_input_name = $this->get_search_input_name();
$component_info = $this->get_component_info('json');
$in_time_machine = false;
$in_time_machine = false;

// Filter_by_list (Propiedades option)
$filter_by_list = false; // Default
if (isset($propiedades->source->filter_by_list)) {
$filter_by_list = $propiedades->source->filter_by_list;
}
$json_filter_by_list = json_encode($filter_by_list);
$json_filter_by_list = json_encode($filter_by_list);

// service autocomplete options
$ar_target_section_tipo = $this->get_ar_target_section_tipo();
$search_sections = $ar_target_section_tipo;
$search_sections = $ar_target_section_tipo;

// Filter_by_list (Propiedades option)
$filter_by_list = false; // Default
if (isset($propiedades->source->filter_by_list)) {
Expand All @@ -184,7 +184,7 @@
$limit = 1;
# q_operator is injected by trigger search2
$q_operator = isset($this->q_operator) ? $this->q_operator : null;
$divisor = $this->get_divisor();
$divisor = $this->get_divisor();

// search_query_object build
$query_object_options = new stdClass();
Expand All @@ -198,7 +198,7 @@

//search mode always can edit the field, permissions always in 2
$permissions = 2;

$file_name = 'edit';
break;

Expand All @@ -218,19 +218,19 @@

case 'portal_list':
$id_wrapper = 'wrapper_'.$identificador_unico;
$tipo_to_search = $this->get_tipo_to_search();
$tipo_to_search = $this->get_tipo_to_search();
$ar_target_section_tipo = $this->get_ar_target_section_tipo();
$ar_target_section_tipo_json = json_encode($ar_target_section_tipo);
$dato_json = json_encode($dato);
$component_info = $this->get_component_info('json');
$valor = $this->get_valor($lang,'string');
$ar_valor = $this->get_valor($lang,'array');

$file_name = 'list';
break;

case 'list':
# Return direct value for store in 'valor_list'
# Return direct value for store in 'valor_list'
$valor = $this->get_valor($lang,'string');
echo (string)$valor; # Like "Catarroja, L'Horta Sud, Valencia/València, Comunidad Valenciana, España"
return; // NOT load html file
Expand All @@ -253,8 +253,8 @@
break;

}


$page_html = DEDALO_LIB_BASE_PATH .'/'. get_class($this) . '/html/' . get_class($this) . '_' . $file_name . '.phtml';
if( !include($page_html) ) {
echo "<div class=\"error\">Invalid mode $this->modo</div>";
Expand Down
13 changes: 10 additions & 3 deletions lib/dedalo/component_common/class.component_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,14 @@ public function get_ar_target_section_tipo() {

if(isset($propiedades->source->search)){
foreach ($propiedades->source->search as $current_search) {
$ar_terminoID_by_modelo_name[] = $current_search->section_tipo;
$current_section_tipo = $current_search->section_tipo;
// check if is available
$current_model = RecordObj_dd::get_modelo_name_by_tipo($current_section_tipo,true);
if ($current_model==='section') {
$ar_terminoID_by_modelo_name[] = $current_section_tipo;
}else{
debug_log(__METHOD__." !!!!!!!!!!! IGNORED NO SECTION element: $current_section_tipo ".to_string($current_model), logger::ERROR);
}
}
}

Expand Down Expand Up @@ -4341,8 +4348,8 @@ public function autocomplete_search($search_query_object, $divisor=', ') {

// debug
if(SHOW_DEBUG===true) {
debug_log(__METHOD__." search_query_object - modo:$this->modo - ".json_encode($search_query_object, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT), logger::DEBUG);
debug_log(__METHOD__." rows_data->strQuery ".to_string($rows_data->strQuery), logger::DEBUG);
// debug_log(__METHOD__." search_query_object - modo:$this->modo - ".json_encode($search_query_object, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT), logger::DEBUG);
// debug_log(__METHOD__." rows_data->strQuery ".to_string($rows_data->strQuery), logger::DEBUG);
}

// childrens addition optional
Expand Down
4 changes: 2 additions & 2 deletions lib/dedalo/component_image/component_image_json.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// Available image files
$value = [];

//$ar_quality = $this->get_ar_image_quality();
//foreach ($ar_quality as $quality) {
// $image_url = $this->get_image_url($quality, true, true, false); // ($quality=false, $test_file=true, $absolute=false, $default_add=true)
Expand Down Expand Up @@ -42,4 +42,4 @@
$data[] = $item;

// JSON string
return common::build_element_json_output($context, $data);
return common::build_element_json_output($context, $data);
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.9';
$DEDALO_VERSION = '5.5.9b';
if(defined('DEVELOPMENT_SERVER') && DEVELOPMENT_SERVER===true) {
$DEDALO_VERSION .= '.'.time();
}
define('DEDALO_VERSION' , $DEDALO_VERSION);
define('DEDALO_BUILD' , '02-01-2020');
define('DEDALO_BUILD' , '08-01-2020');


/*
Expand Down
Loading

0 comments on commit 5c1cfb8

Please sign in to comment.