Skip to content

Commit

Permalink
update to v4.0.15
Browse files Browse the repository at this point in the history
Fix Search Resources, some changes into the component_portal,
component_autocomplete, component_geolocation. New edit mode into the
component_portal, new svg icons and more.
  • Loading branch information
renderpci committed Oct 6, 2016
1 parent 3495a5d commit 62240b8
Show file tree
Hide file tree
Showing 217 changed files with 11,516 additions and 5,027 deletions.
14 changes: 7 additions & 7 deletions lib/dedalo/area/class.area.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public static function get_ar_ts_children_all_areas_hierarchized($include_main_t
$ar_ts_childrens_resource = $area_resource->get_ar_ts_children_areas($include_main_tipo);

# AREA_THESAURUS
/**/
$current_tipo = RecordObj_dd::get_ar_terminoID_by_modelo_name('area_thesaurus')[0];
$area_resource = new area_resource($current_tipo);
$ar_ts_childrens_thesaurus = $area_resource->get_ar_ts_children_areas($include_main_tipo);
#dump($ar_ts_childrens_thesaurus," ar_ts_childrens_thesaurus");

#$ar_ts_childrens_thesaurus = array();
if (isset(RecordObj_dd::get_ar_terminoID_by_modelo_name('area_thesaurus')[0])) {
$current_tipo = RecordObj_dd::get_ar_terminoID_by_modelo_name('area_thesaurus')[0];
$area_resource = new area_resource($current_tipo);
$ar_ts_childrens_thesaurus = $area_resource->get_ar_ts_children_areas($include_main_tipo);
}else{
$ar_ts_childrens_thesaurus = array();
}

# AREA_TOOLS
if (isset(RecordObj_dd::get_ar_terminoID_by_modelo_name('area_tool')[0])) {
Expand Down
97 changes: 53 additions & 44 deletions lib/dedalo/area_thesaurus/area_thesaurus.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,66 @@
switch($modo) {

case 'list':
# List
include(DEDALO_LIB_BASE_PATH.'/section_records/row_thesaurus/class.row_thesaurus.php');
# ts_object class
include(DEDALO_LIB_BASE_PATH."/ts_object/class.ts_object.php");

#
# ACTIVE HIERARCHIES
$ar_hierarchy_typologies = $this->get_hierarchy_typologies();
#dump($ar_hierarchy_typologies, ' ar_hierarchy_typologies ++ '.to_string());
# Load necessary js /css elements when we in thesaurus
$element_name = 'ts_object';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

$element_name = 'component_text_area';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

$element_name = 'component_order';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

$element_name = 'component_input_text';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

$element_name = 'component_relation_children';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

/*
$section_tipo = DEDALO_HIERARCHY_SECTION_TIPO;
$matrix_table = common::get_matrix_table_from_tipo($section_tipo);
$element_name = 'component_relation_model';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

# LAYOUT_MAP
# Build a custom layout map with our needs
$layout_map=array();
$layout_map[DEDALO_HIERARCHY_SECTION_TIPO] = array(
DEDALO_HIERARCHY_ACTIVE_TIPO,
DEDALO_HIERARCHY_ORDER_TIPO,
DEDALO_HIERARCHY_TERM_TIPO,
DEDALO_HIERARCHY_LANG_TIPO,
DEDALO_HIERARCHY_TIPOLOGY_TIPO,
DEDALO_HIERARCHY_TLD2_TIPO,
);
$element_name = 'component_relation_index';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

# Locator 'YES'
$locator = new locator();
$locator->set_section_tipo(DEDALO_SECTION_SI_NO_TIPO);
$locator->set_section_id(NUMERICAL_MATRIX_VALUE_YES);
$locator_json = json_encode($locator);
$element_name = 'component_number';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

# FILTER_BY_SEARCH . Uses a search similar as sections do
$filter_by_search = new stdClass();
$filter_by_search->{DEDALO_HIERARCHY_ACTIVE_TIPO} = (string)$locator_json;
$element_name = 'component_radio_button';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/css/$element_name.css";
js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";

# OPTIONS SEARCH . Prepares options to get search
$options = new stdClass();
$options->section_tipo = $section_tipo;
$options->section_real_tipo = $section_tipo;
$options->matrix_table = $matrix_table;
$options->layout_map = $layout_map;
$options->layout_map_list = $options->layout_map;
$options->offset_list = 0;
$options->limit = null; // Not limit amount of results (use null)
$options->filter_by_search = $filter_by_search;
$options->order_by = DEDALO_HIERARCHY_ORDER_TIPO.' ASC';
$options->modo = 'list_thesaurus';
$options->context = '';
$options->search_options_session_key = 'area_thesaurus';
$section_rows = new section_records($section_tipo, $options);
$rows_list_html = $section_rows->get_html();
*/
$element_name = 'diffusion_index_ts';
css::$ar_url[] = DEDALO_LIB_BASE_URL."/diffusion/$element_name/css/$element_name.css";
#js::$ar_url[] = DEDALO_LIB_BASE_URL."/$element_name/js/$element_name.js";


#
# SEARCH FORM . ROWS_SEARCH
# Render search form html
$section = section::get_instance(null, DEDALO_THESAURUS_SECTION_TIPO,'list');
$search_form_html = '';
$records_search = new records_search($section, 'list');
$search_form_html = $records_search->get_html();
#dump($records_search, ' $records_search ++ '.to_string());

#
# ACTIVE HIERARCHIES
$ar_hierarchy_typologies = $this->get_hierarchy_typologies();
#dump($ar_hierarchy_typologies, ' ar_hierarchy_typologies ++ '.to_string());

break;
}

Expand Down
71 changes: 13 additions & 58 deletions lib/dedalo/area_thesaurus/class.area_thesaurus.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function get_hierarchy_typologies() {


/**
* GET_OPTIONS_FOR_ROW
* GET_OPTIONS_FOR_SEARCH_HIERARCHIES
* @return object $options
*/
public function get_options_for_row( $tipology_section_tipo, $tipology_section_id ) {
public function get_options_for_search_hierarchies( $tipology_section_tipo, $tipology_section_id ) {

$section_tipo = DEDALO_HIERARCHY_SECTION_TIPO;
$matrix_table = common::get_matrix_table_from_tipo($section_tipo);
Expand All @@ -62,15 +62,17 @@ public function get_options_for_row( $tipology_section_tipo, $tipology_section_i
$layout_map=array();
$layout_map[DEDALO_HIERARCHY_SECTION_TIPO] = array(
DEDALO_HIERARCHY_TERM_TIPO,
DEDALO_HIERARCHY_CHIDRENS_TIPO
DEDALO_HIERARCHY_CHIDRENS_TIPO,
DEDALO_HIERARCHY_TLD2_TIPO
);
/*
DEDALO_HIERARCHY_ORDER_TIPO,
DEDALO_HIERARCHY_ACTIVE_TIPO,
DEDALO_HIERARCHY_LANG_TIPO,
DEDALO_HIERARCHY_TIPOLOGY_TIPO,
DEDALO_HIERARCHY_TLD2_TIPO,
*/
/*
DEDALO_HIERARCHY_ORDER_TIPO,
DEDALO_HIERARCHY_ACTIVE_TIPO,
DEDALO_HIERARCHY_LANG_TIPO,
DEDALO_HIERARCHY_TIPOLOGY_TIPO,
DEDALO_HIERARCHY_TLD2_TIPO,
*/

# FILTER_BY_SEARCH . Uses a search similar as sections do
$filter_by_search = new stdClass();
Expand Down Expand Up @@ -109,55 +111,8 @@ public function get_options_for_row( $tipology_section_tipo, $tipology_section_i
$options->search_options_session_key = 'area_thesaurus';
#dump($options, ' options ++ '.to_string());

/*
$rows_data = search::get_records_data($options);
dump($rows_data, ' $rows_data ++ '.to_string());
$section_rows = new section_records($section_tipo, $options);
$rows_list_html = $section_rows->get_html();
echo $rows_list_html;
*/

/*
$section_tipo = DEDALO_HIERARCHY_SECTION_TIPO;
$table = common::get_matrix_table_from_tipo($section_tipo);
$component_tipo = DEDALO_HIERARCHY_ACTIVE_TIPO;
$typology_tipo = DEDALO_HIERARCHY_TIPOLOGY_TIPO;
$locator = new locator();
$locator->set_section_tipo(DEDALO_SECTION_SI_NO_TIPO);
$locator->set_section_id(NUMERICAL_MATRIX_VALUE_YES);
$locator_json = json_encode($locator);
$strQuery = "
SELECT id, section_id, section_tipo, datos
datos#>>'{components, rsc20, valor_list, lg-nolan}' AS rsc20,
FROM \"$table\"
WHERE section_tipo = '$section_tipo' AND datos#>'{components,$component_tipo,dato,lg-nolan}' @> '[$locator_json]'::jsonb
ORDER BY datos#>'{components,$typology_tipo,dato,lg-nolan}' ASC
";
dump($strQuery, ' $strQuery ++ '.to_string());
if(!$result = JSON_RecordDataBoundObject::search_free($strQuery)) {
$msg = "Failed Search. Data is not found. Please contact with your admin (1)" ;
if(SHOW_DEBUG) {
throw new Exception($msg, 1);
}
trigger_error($msg);
die($msg);
}
$active_hierarchies= array();
while($rows = pg_fetch_assoc($result)) {
$section_id = $rows['section_id'];
$active_hierarchies[$section_id] = $rows['datos'];
}
dump($active_hierarchies, ' $active_hierarchies ++ '.to_string());
*/

return (object)$options;
}//end get_options_for_row
}//end get_options_for_search_hierarchies



Expand Down
1 change: 1 addition & 0 deletions lib/dedalo/area_thesaurus/css/area_thesaurus.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/dedalo/area_thesaurus/css/area_thesaurus.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions lib/dedalo/area_thesaurus/css/area_thesaurus.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
Only use to set general thesaurus styles, not dinamic rows
Specific CSS for ts_object must be writed in ts_object.less
*/
@line_height: 34px;

/* WRAPPER : CSS_WRAP_AREA_THESAURUS
------------------------------------------------ */
.css_wrap_area_thesaurus {

}
.css_wrap_area_thesaurus > ul {
padding: 25px;
//background-color: #F4DD79
}
.css_wrap_area_thesaurus > ul > li {
}
/* TIPOLOGY_NAME like 'Toponomy'
------------------------------------------------ */
.css_wrap_area_thesaurus .tipology_name {
background-color: #E6E6E6;
padding: 7px;text-transform: uppercase;
}
/* HIERARCHY_NAME like 'España'
------------------------------------------------ */
.css_wrap_area_thesaurus .hierarchy_name {
padding: 7px;
//background-color: #727272;
padding-left: 10px;
font-size: 1.15em;
color: #333333;
border-bottom: 1px solid #ebebeb;
}
.css_wrap_area_thesaurus .hierarchy_name .ts_object_add {
display: inline-block;
position: relative;
top: 5px;
left: 4px;
}


/* HIERARCHY_ROOT_NODE Container (childrens container)
------------------------------------------------ */
.css_wrap_area_thesaurus .hierarchy_root_node {
//background-color: #EDEDED;
padding: 7px;
min-height: @line_height;
margin-left: 10px;
}
.hierarchy_root_node > .childrens_container {
margin-left: 0 !important;
}


/* SEARCH FORM
------------------------------------------------ */
.search_form_container {
//background-color: #A6E1A2;
padding: 10px;
padding-top: 5px;
width: 100%;
}
Loading

0 comments on commit 62240b8

Please sign in to comment.