Skip to content

Commit

Permalink
Merge branch 'master' of master.render.es:/home/dedalo/master_dedalo
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-render committed Apr 25, 2021
2 parents 69e939c + 8d275ff commit 3e595c0
Show file tree
Hide file tree
Showing 48 changed files with 2,036 additions and 1,221 deletions.
36 changes: 21 additions & 15 deletions lib/dedalo/button_stats/js/button_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
*/
var button_stats = new function() {



this.trigger_url = DEDALO_LIB_BASE_URL + '/button_stats/trigger.button_stats.php';



// Stats
/**
* Stats
*/
this.Stats = function (button_obj) {

const $stats_info = $('#stats_info')
Expand Down Expand Up @@ -73,13 +78,12 @@ var button_stats = new function() {
//html_page.loading_content( $('body'), 1 );

// AJAX REQUEST
$.ajax({
const js_promise = $.ajax({
url : this.trigger_url,
data : mydata,
type : "POST",
dataType : "html"
})
// DONE
.done(function(received_data) {

// If received_data contain 'error' show alert error with (received_data) else reload the page
Expand All @@ -90,17 +94,18 @@ var button_stats = new function() {
$target_div.html(received_data)
// }
})
// FAIL ERROR
.fail(function(jqXHR, textStatus) {
var msg = "[Stats] Request failed: " + textStatus ;
const msg = "[Stats] Request failed: " + textStatus ;
$target_div.append(" <span class='error'>Error on stats processing: " + msg + "</span>");
alert( msg );
console.error("this.Stats error textStatus:", textStatus);
// alert( msg );
})
// ALWAYS
.always(function() {
html_page.loading_content( $('body'), 0 );
})


return js_promise;
}//end this.Stats


Expand All @@ -111,18 +116,19 @@ var button_stats = new function() {
*/
this.Generate = function (button_obj) {

var fecha = $(button_obj).siblings('INPUT.input_stats_date').val(),
window_url = DEDALO_LIB_BASE_URL + '/diffusion/diffusion_section_stats/trigger.diffusion_section_stats.php/?mode=save_stats_data&launcher=dedalo_generate&date='+fecha ,
window_name = "Trigger generate stats";
const fecha = $(button_obj).siblings('INPUT.input_stats_date').val()
const window_url = DEDALO_LIB_BASE_URL + '/diffusion/diffusion_section_stats/trigger.diffusion_section_stats.php/?mode=save_stats_data&launcher=dedalo_generate&date='+fecha
const window_name = "Trigger generate stats"

if(!confirm("Overwrite any existing versions of processing statistics for date "+fecha+"?")) return false;
if(!confirm("Overwrite any existing versions of processing statistics for date "+fecha+"?")) {
return false;
}

// Open and focus window
var trigger_stats_window=window.open(window_url,window_name);
const trigger_stats_window = window.open(window_url,window_name);
trigger_stats_window.focus()
}

}//end this.Generate



};//end button_stats
}//end button_stats
2 changes: 1 addition & 1 deletion lib/dedalo/button_trigger/html/button_trigger_edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

# BUTTON
$html_contenido .= '<div class="css_button_generic css_button_trigger" ';
$html_contenido .= '<div class="css_button_generic css_button_trigger css_button_'.$tipo.'" ';
$html_contenido .= 'onclick="'.$js_action.'" ';
$html_contenido .= 'data-parent="'.$this->parent.'" ';
$html_contenido .= 'data-tipo="'.$tipo.'" ';
Expand Down
4 changes: 4 additions & 0 deletions lib/dedalo/button_trigger/js/button_trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ var button_trigger = new function() {
console.log("[button_trigger.trigger] Please wait process finish");
return false;
}

if (!confirm(get_label["seguro"])) {
return false;
}

const tipo = button_obj.dataset.tipo
const propiedades = JSON.parse( button_obj.dataset.propiedades )
Expand Down
13 changes: 9 additions & 4 deletions lib/dedalo/common/class.common.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function get_permissions( $tipo=null, $sub_tipo=null ) {
if(SHOW_DEBUG===true) {
dump($tipo,'tipo');
throw new Exception("Error Processing Request. get_permissions: tipo is empty", 1);
}
}
#die("Error Processing Request. get_permissions: tipo is empty");
debug_log(__METHOD__." Error Processing Request. get_permissions: tipo is empty ".to_string(), logger::ERROR);
return 0;
Expand All @@ -101,14 +101,19 @@ public static function get_permissions( $tipo=null, $sub_tipo=null ) {
if(SHOW_DEBUG===true) {
dump($sub_tipo,'sub_tipo');
throw new Exception("Error Processing Request. get_permissions: sub_tipo is empty", 1);
}
}
#die("Error Processing Request. get_permissions: sub_tipo is empty");
debug_log(__METHOD__." Error Processing Request. get_permissions: sub_tipo is empty ".to_string(), logger::ERROR);
return 0;
}
$permissions = security::get_security_permissions($tipo, $sub_tipo);



if ($tipo===DEDALO_HIERARCHY_SECTION_TIPO && SHOW_DEVELOPER!==true) {
if ($permissions>1) {
$permissions = 1;
}
}

return (int)$permissions;
}//end get_permissions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,29 @@

$component_alias_css = isset($propiedades->alias_component_tipo) ? ' alias_'.$propiedades->alias_component_tipo : '';

print '<div class="wrap_component css_wrap_'.$component_name.' wrap_component_'.$modo.' wrap_component_'.$tipo. $component_alias_css.' tooltip_active" ';
print "id=\"{$id_wrapper}\" ";
print '<div class="wrap_component css_wrap_'.$component_name.' wrap_component_'.$modo.' wrap_component_'.$tipo. $component_alias_css.' tooltip_active" ';
if ($modo==='search') {
print 'title="'.search_development2::search_options_title( $this->search_operators_info() ).'" ';
}
print "id=\"{$id_wrapper}\" ";
print "data-tipo=\"{$tipo}\" ";
print "data-section_tipo=\"{$section_tipo}\" ";
print "data-parent=\"{$parent}\" ";
print "data-lang=\"{$lang}\" ";
print "data-section_tipo=\"{$section_tipo}\" ";
print "data-parent=\"{$parent}\" ";
print "data-modo=\"{$modo}\" ";
print "data-from_modo=\"{$from_modo}\" ";
print "data-dato='".json_encode($dato)."' ";
print "data-component_name=\"{$component_name}\" ";
print "data-component_info='{$component_info}' ";
print "data-dato='".json_encode($dato)."' ";
print "data-component_info='{$component_info}' ";

// service autocomplete options
print "data-search_sections='". json_encode($search_sections)."' ";

print 'data-relation_type="'.$relation_type.'" ';

print 'data-search_query_object=\''.$json_search_query_object.'\' ';
print 'data-q_operator="'.$q_operator.'" ';

print 'data-search_query_object=\''.$json_search_query_object.'\' ';
print 'data-divisor="'. $divisor .'" ';
print 'data-limit="'. $limit .'" ';
print '>';
Expand All @@ -38,18 +39,18 @@

# CONTENIDO (INPUT)
$html_content = '';
switch($permissions) {
switch(true) {

case 0 :
case ($permissions === 0) :
$html_content .= "";
break;

case 1 :
case ($permissions === 1) :
$html_content .= $valor;
break;

case 2 :
case 3 :
case ($permissions>=2) :

// Button change mode
if($modo !== 'edit_in_list'){
if($modo!=='search' && $from_modo!=='edit'){
Expand Down Expand Up @@ -233,7 +234,7 @@



print "</div>"; //wrap
print '</div>'; //wrap

# html_delimiter
print component_common_draw::html_delimiter($component_name, $tipo, $parent, $label, 'out', $modo, $lang);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ var component_autocomplete_hi = new function() {
if (page_globals.modo==='edit' || page_globals.modo==='tool_cataloging' || page_globals.modo==='tool_add_component_data') {
this.Save(input_text_hide);
}else{
console.wan("Ignored save on command delete: mode not allowed", page_globals.modo);
console.warn("Ignored save on command delete: mode not allowed", page_globals.modo);
}

// Search component modo case
Expand Down
4 changes: 2 additions & 2 deletions lib/dedalo/component_geolocation/js/component_geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,11 @@ var component_geolocation = new function() {
self.refresh_map(map)
// observer.unobserve(entry.target);
observer.disconnect();
}
}
}, { threshold: [0] });

observer.observe(wrapper);
}
}


return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@
if($unique === true){
$html_content .= 'onkeyup="component_input_text.is_unique(this)" ';
}

$html_content .= 'id="'.$id_wrapper.'_input_'.$key.'" ';
$html_content .= 'name="'.$input_name.'" ';
$html_content .= 'value="'.$value.'" ';
$html_content .= 'data-value_original="'.$value.'" ';
$html_content .= 'title="'.$html_title.'" ';
$html_content .= $read_only .' ';
$html_content .= 'autocomplete="off" ';
Expand Down
Loading

0 comments on commit 3e595c0

Please sign in to comment.