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 8, 2019
2 parents c948184 + 1fa6ce1 commit a34b5c9
Show file tree
Hide file tree
Showing 769 changed files with 37,661 additions and 144,980 deletions.
61 changes: 24 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ lib/dedalo/extras/*
vendor/*
!vendor/maxmind
!vendor/maxmind-db
!vendor/react
!vendor/symfony
!vendor/ringcentral
!vendor/geoip2
!vendor/socrata
!vendor/composer
Expand All @@ -64,7 +67,7 @@ temp
write
template_maps
tpl
lib/dedalo/publication/client_api/*/docu/ui/*
lib/dedalo/publication/client_api/**/docu/ui/*
lib/dedalo/tools/tool_layout_print/data/*
lib/dedalo/tools/tool_layout_print/print_pdf/*

Expand All @@ -81,41 +84,25 @@ koala-config.json
config.codekit3

# various minified
lib/dedalo/*/*-min.js
lib/dedalo/*/*-min.css
lib/dedalo/*/*/js/*-min.js
/lib/dedalo/button_delete/js/button_delete-min.js
/lib/dedalo/button_delete/js/button_delete-min.js.map
/lib/dedalo/common/js/common-min.js.map
/lib/dedalo/component_autocomplete/js/component_autocomplete-min.js
/lib/dedalo/component_autocomplete/js/component_autocomplete-min.js.map
/lib/dedalo/component_autocomplete_hi/js/component_autocomplete_hi-min.js
/lib/dedalo/component_calculation/js/component_calculation-min.js
/lib/dedalo/component_calculation/js/component_calculation-min.js.map
/lib/dedalo/component_common/js/component_common-min.js
/lib/dedalo/component_common/js/component_common-min.js.map
/lib/dedalo/component_geolocation/js/component_geolocation DES-min.js
/lib/dedalo/component_geolocation/js/component_geolocation DES-min.js.map
/lib/dedalo/component_image/js/component_image-min.js
/lib/dedalo/component_image/js/component_image-min.js.map
/lib/dedalo/component_image/js/component_image_read-min.js
/lib/dedalo/component_image/js/component_image_read-min.js.map
/lib/dedalo/component_portal/js/component_portal-min.js
/lib/dedalo/component_portal/js/component_portal-min.js.map
/lib/dedalo/component_state/js/component_state-min.js
/lib/dedalo/component_state/js/component_state-min.js.map
/lib/dedalo/login/js/login-min.js
/lib/dedalo/login/js/login-min.js.map
/lib/dedalo/section_group/js/section_group-min.js.map
/lib/dedalo/section_tab/js/section_tab-min.js.map
/lib/dedalo/services/service_autocomplete/js/service_autocomplete-min.js.map
/lib/dedalo/tools/tool_common/js/tool_common-min.js.map
/lib/dedalo/tools/tool_image_versions/js/tool_image_versions-min.js.map
/lib/dedalo/tools/tool_transcription/js/tool_transcription-min.js.map
/lib/dedalo/tools/tool_upload/js/tool_upload-min.js.map
/lib/dedalo/ts_object/js/ts_object-min.js
/lib/dedalo/ts_object/js/ts_object-min.js.map
# js min
lib/dedalo/**/*-min.js

# js map
lib/dedalo/**/*-min.js.map

# css min
lib/dedalo/**/*-min.css

# css map
# lib/dedalo/**/*.css.map

# saml
/lib/dedalo/login/saml/test_js.html
/lib/dedalo/login/saml/test.php
lib/dedalo/login/saml/test_js.html
lib/dedalo/login/saml/test.php

# Drafs
lib/dedalo/component_date_mod/
lib/dedalo/component_portal/_versions/



2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Some projects using Dédalo to manage their Cultural Heritage or Oral Archive:
- PHP 7.1+
- Apache 2.4.2+
- Postgres 10.1+
- MySQL 5.6+ (NOT REQUIRED, only if you want use it for publication)
- MySQL 5.6+ (NOT REQUIRED, only if you want use it for publication).

*libs required for the Dédalo*

Expand Down
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
http://www.fmomo.org
https://github.com/renderpci/dedalo
[email protected]
************************************************************************/
Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion lib/dedalo/area_development/css/area_root-min.css

This file was deleted.

23 changes: 9 additions & 14 deletions lib/dedalo/button_trigger/button_trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,30 @@

# CONTROLLER

$tipo = $this->get_tipo();
$tipo = $this->get_tipo();
$target_tipo = $this->get_target();
$id = NULL;
$modo = $this->get_modo();
$modo = $this->get_modo();
$label = $this->get_label();

$section_tipo = $this->get_section_tipo(); //!empty($target_tipo) ? $target_tipo : TOP_TIPO;

$section_tipo = $this->get_section_tipo();
$debugger = $this->get_debugger();
$permissions = common::get_permissions($section_tipo, $tipo);
$html_title = "Info about $tipo";
$permissions = common::get_permissions($section_tipo, $tipo);
$html_title = "Info about $tipo";
$file_name = $modo;


switch($modo) {

case 'list':
case 'edit':
$file_name = 'edit';
$propiedades = $this->get_propiedades();
#dump($propiedades,'propiedades');


$propiedades->component_parent = $this->parent; # add current parent section id_matrix to vars
$propiedades->lang_filter = DEDALO_DATA_LANG; # add current lang to vars
$propiedades_json = json_handler::encode($propiedades);

# Custom js_exec_function (instead default 'trigger')
$js_exec_function = isset($propiedades->js_exec_function) ? $propiedades->js_exec_function : false;
$js_exec_function = isset($propiedades->js_exec_function) ? $propiedades->js_exec_function : false;
break;

default:
Expand All @@ -40,5 +36,4 @@
$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>";
}
?>
}
31 changes: 15 additions & 16 deletions lib/dedalo/button_trigger/html/button_trigger_edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@
# VISUALIZADOR HTML


#print "\n\n<!-- BUTTON TRIGGER [tipo:$tipo id_matrix:$id] -->";

#print "\n<div class=\"css_wrap_button_trigger\">";

# CONTENIDO
$html_contenido = '';

switch(true) {

case ($permissions>=2) :

// Action js
// Default (when not defined)
$js_action = 'button_trigger.trigger(this)';
// Custom (defined in propiedades)
if ($js_exec_function!==false) {
$js_action = $js_exec_function .'(this, event)';
}

# BUTTON
$html_contenido .= "<div class='css_button_generic css_button_trigger' onclick=\"{$js_action}\"
data-parent='$this->parent'
data-tipo='$tipo'
data-propiedades='$propiedades_json'
>";

# BUTTON
$html_contenido .= '<div class="css_button_generic css_button_trigger" ';
$html_contenido .= 'onclick="'.$js_action.'" ';
$html_contenido .= 'data-parent="'.$this->parent.'" ';
$html_contenido .= 'data-tipo="'.$tipo.'" ';
$html_contenido .= 'data-section_tipo="'.$section_tipo.'" ';
$html_contenido .= 'data-propiedades=\''.$propiedades_json.'\' ';
$html_contenido .= '>';
$html_contenido .= $label;
$html_contenido .= "</div>";
$html_contenido .= '</div>';


# RESPONSE
# RESPONSE
$html_contenido .= "<div class='button_trigger_response' id=\"button_trigger_$tipo\">";
$html_contenido .= "";
$html_contenido .= "</div>";
Expand All @@ -38,7 +39,5 @@

# PRINT HTML
print $html_contenido;



#print "\n</div><!-- /css_wrap_button_trigger -->\n\n"; //wrap
?>
127 changes: 65 additions & 62 deletions lib/dedalo/button_trigger/js/button_trigger.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/**
* BUTTON_TRIGGER CLASS
* BUTTON_TRIGGER
*
*
*
*/
var button_trigger = new function() {
var button_trigger = new function() {

'use strict';


this.executing = false;
Expand All @@ -15,82 +17,83 @@ var button_trigger = new function() {
*
*/
this.trigger = function (button_obj) {

if (button_trigger.button_trigger === true) {
console.log("[button_trigger.trigger] Please wait process finish");
return false;
}

var tipo = button_obj.dataset.tipo
var propiedades = JSON.parse( button_obj.dataset.propiedades )
propiedades.section_tipo = page_globals.section_tipo
const tipo = button_obj.dataset.tipo
const propiedades = JSON.parse( button_obj.dataset.propiedades )
propiedades.section_tipo = page_globals.section_tipo

// Check trigger_url
if (typeof propiedades.trigger_url == "undefined") {
return alert("[button_trigger.trigger] Error Wrong url data [propiedades]")
}else{
var trigger_url = DEDALO_LIB_BASE_URL + propiedades.trigger_url;
}
if (typeof propiedades.trigger_url == "undefined") {
return alert("[button_trigger.trigger] Error Wrong url data [propiedades]")
}else{
var trigger_url = DEDALO_LIB_BASE_URL + propiedades.trigger_url;
}

// Check trigger mode
if (typeof propiedades.mode == "undefined") {
return alert("[button_trigger.trigger] Error Wrong mode data [propiedades]")
}

var target_div = document.getElementById('button_trigger_'+tipo);
if (!target_div) {
return alert("[button_trigger.trigger] Error target_div not found!");
}
if (typeof propiedades.mode == "undefined") {
return alert("[button_trigger.trigger] Error Wrong mode data [propiedades]")
}

// target_div
const target_div = document.getElementById('button_trigger_'+tipo);
if (!target_div) {
return alert("[button_trigger.trigger] Error target_div not found!");
}

// Spinner ON
target_div.innerHTML = ''
target_div.style.display = 'block'
target_div.classList.add("button_trigger_response_loading")
html_page.loading_content( target_div, 1 )
target_div.innerHTML = ''
target_div.style.display = 'block'
target_div.classList.add("button_trigger_response_loading")
html_page.loading_content( target_div, 1 )

// Set active
button_trigger.button_trigger = true;
button_trigger.button_trigger = true;


// Assign trigger vars from propiedades
var trigger_vars = cloneDeep(propiedades)
console.log("[button_trigger.trigger] trigger_vars", trigger_vars);

// PROMISE JSON XMLHttpRequest
var js_promise = common.get_json_data(trigger_url, trigger_vars).then(function(response){
if (SHOW_DEBUG===true) {
console.log("[component_state.update_state_locator] response.debug", response, trigger_url);
console.trace();
}

if (response && response.result) {
var msg = response.msg
}else{
// Notify to log messages in top of page
var msg = "<span class='error'>[button_trigger.trigger] ERROR. Null response</span>";
}

// msg show
target_div.innerHTML = msg
target_div.classList.remove("button_trigger_response_loading");
target_div.style.cursor = 'pointer'
target_div.addEventListener("dblclick", function(){
this.innerHTML = ''
this.style.display = 'none'
}, false);

// Spinner OFF
html_page.loading_content( target_div, 0 );
button_trigger.button_trigger = false;
}, function(error) {
// log
console.log("[component_state.update_state_locator] Error.", error);
top.inspector.show_log_msg( "<span class='error'>Error on " + getFunctionName() + " update_state_locator</span>" + error );

// Spinner OFF
html_page.loading_content( target_div, 0 );
button_trigger.button_trigger = false;
})
const trigger_vars = cloneDeep(propiedades)

// Promise json XMLHttpRequest
const js_promise = common.get_json_data(trigger_url, trigger_vars).then(function(response){
if (SHOW_DEBUG===true) {
console.log("[component_state.update_state_locator] response.debug", response, trigger_url);
console.trace();
}

// msg
if (response && response.result) {
var msg = response.msg
}else{
// Notify to log messages in top of page
var msg = "<span class='error'>[button_trigger.trigger] ERROR. Null response</span>";
}

// msg show
target_div.innerHTML = msg
target_div.classList.remove("button_trigger_response_loading");
target_div.style.cursor = 'pointer'
target_div.addEventListener("dblclick", function(){
this.innerHTML = ''
this.style.display = 'none'
}, false);

// Spinner OFF
html_page.loading_content( target_div, 0 );
button_trigger.button_trigger = false;
}, function(error) {
// log
console.log("[component_state.update_state_locator] Error.", error);
top.inspector.show_log_msg( "<span class='error'>Error on " + getFunctionName() + " update_state_locator</span>" + error );
// Spinner OFF
html_page.loading_content( target_div, 0 );
button_trigger.button_trigger = false;
})


return js_promise
Expand Down
Loading

0 comments on commit a34b5c9

Please sign in to comment.