1
0
Fork 0
This commit is contained in:
pezcurrel 2020-01-11 21:53:37 +01:00
parent ee5097b537
commit 6dbfb8166c
3 changed files with 31 additions and 29 deletions

View file

@ -6,4 +6,4 @@
* ripristinare le colonne descrittive in Languages: una per la locale impostata (it), una per en, una per fr, una per sp...
* instancesh.php: ritornare di tutte solo quelle che effettivamente sono usate, magari con un count tra ()
* instances.php: definito/non definito non vengono riprodotte bene dalla plancia dopo post
? quando si seleziona definito/non definito, oltre a disabilitare il campo valsel/valinp, farlo sparire proprio? assegnargli un css che da disabilitato lo fa diventare tuttonero? tipo
* quando si seleziona definito/non definito, oltre a disabilitare il campo valsel/valinp, farlo sparire proprio? assegnargli un css che da disabilitato lo fa diventare tuttonero? tipo

View file

@ -100,7 +100,7 @@ $cols=array(
'LongDesc'=>array('name'=>'Descrizione lunga','type'=>'text'),
'OurDesc'=>array('name'=>'Descrizione nostra','type'=>'text'),
'PlaceID'=>array('name'=>'[Località]','type'=>'join','join'=>array(),'ord'=>false),
'PlaceID'=>array('name'=>'Località ⮞','type'=>'join','join'=>array(),'ord'=>false),
'Places.Locality'=>array('name'=>'Località','type'=>'joini','join'=>array('Places ON Places.ID=Instances.PlaceID'),'subtype'=>'text'),
'Email'=>array('name'=>'Email di contatto','type'=>'text'),
@ -122,29 +122,29 @@ $cols=array(
'AdmAvatar'=>array('name'=>'Avatar admin','type'=>'text','search'=>false,'ord'=>false),
'AdmNote'=>array('name'=>'Note delladmin','type'=>'text'),
'LangID'=>array('name'=>'[Lingue dichiarate]','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'ord'=>false),
'LangID'=>array('name'=>'Lingue dichiarate ⮞','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'ord'=>false),
'Languages.Code'=>array('name'=>'Lingue dichiarate','type'=>'joini','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID','Languages ON Languages.ID=InstLangs.LangID'),'subtype'=>'text','ord'=>false),
'InstLangs.LangID'=>array('name'=>'[Lingua primaria dichiarata]','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'wheremore'=>'AND InstLangs.Pos=1','ord'=>false),
'InstLangs.LangID'=>array('name'=>'Lingua primaria dichiarata ⮞','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'wheremore'=>'AND InstLangs.Pos=1','ord'=>false),
'Languages.NameIT'=>array('name'=>'Lingua primaria dichiarata','type'=>'joini','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID','Languages ON Languages.ID=InstLangs.LangID'),'subtype'=>'text','wheremore'=>'AND InstLangs.Pos=1'),
'OurLangID'=>array('name'=>'[Lingue impostate da noi]','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'ord'=>false),
'OurLangID'=>array('name'=>'Lingue impostate da noi ⮞','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'ord'=>false),
'OurLanguages.Code'=>array('name'=>'Lingue impostate da noi','type'=>'joini','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID','Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID'),'subtype'=>'text','ord'=>false),
'InstOurLangs.OurLangID'=>array('name'=>'[Lingua primaria impostata da noi]','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'wheremore'=>'AND InstOurLangs.Pos=1','ord'=>false),
'InstOurLangs.OurLangID'=>array('name'=>'Lingua primaria impostata da noi ⮞','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'wheremore'=>'AND InstOurLangs.Pos=1','ord'=>false),
'OurLanguages.NameIT'=>array('name'=>'Lingua primaria impostata da noi','type'=>'joini','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID','Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID'),'subtype'=>'text','wheremore'=>'AND InstOurLangs.Pos=1'),
'FinID'=>array('name'=>'[Modalità di finanziamento]','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'ord'=>false),
'FinID'=>array('name'=>'Modalità di finanziamento ⮞','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'ord'=>false),
'Financing.Type'=>array('name'=>'Modalità di finanziamento','type'=>'joini','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID','Financing ON Financing.ID=InstFinancing.FinID'),'subtype'=>'text'),
'InstFinancing.FinID'=>array('name'=>'[Modalità di finanziamento primaria]','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'wheremore'=>'AND InstFinancing.Pos=1','ord'=>false),
'InstFinancing.FinID'=>array('name'=>'Modalità di finanziamento primaria ⮞','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'wheremore'=>'AND InstFinancing.Pos=1','ord'=>false),
'XFinancing.Type'=>array('name'=>'Modalità di finanziamento primaria','type'=>'joini','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID','Financing AS XFinancing ON XFinancing.ID=InstFinancing.FinID'),'subtype'=>'text','wheremore'=>'AND InstFinancing.Pos=1'),
'PolID'=>array('name'=>'[Restrizioni sui contenuti]','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'ord'=>false),
'PolID'=>array('name'=>'Restrizioni sui contenuti ⮞','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'ord'=>false),
'Policies.Name'=>array('name'=>'Restrizioni sui contenuti','type'=>'joini','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID','Policies ON Policies.ID=InstPolicies.PolID'),'subtype'=>'text'),
'InstPolicies.PolID'=>array('name'=>'[Restrizione sui contenuti primaria]','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'wheremore'=>'AND InstPolicies.Pos=1','ord'=>false),
'InstPolicies.PolID'=>array('name'=>'Restrizione sui contenuti primaria ⮞','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'wheremore'=>'AND InstPolicies.Pos=1','ord'=>false),
'XPolicies.Name'=>array('name'=>'Restrizione sui contenuti primaria','type'=>'joini','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID','Policies AS XPolicies ON XPolicies.ID=InstPolicies.PolID'),'subtype'=>'text','wheremore'=>'AND InstPolicies.Pos=1'),
'TagID'=>array('name'=>'[Tags]','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'ord'=>false),
'TagID'=>array('name'=>'Tags ⮞','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'ord'=>false),
'Tags.Name'=>array('name'=>'Tags','type'=>'joini','join'=>array('InstTags ON InstTags.InstID=Instances.ID','Tags ON Tags.ID=InstTags.TagID'),'subtype'=>'text'),
'InstTags.TagID'=>array('name'=>'[Tag primaria]','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'wheremore'=>'AND InstTags.Pos=1','ord'=>false),
'InstTags.TagID'=>array('name'=>'Tag primaria ⮞','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'wheremore'=>'AND InstTags.Pos=1','ord'=>false),
'XTags.Name'=>array('name'=>'Tag primaria','type'=>'joini','join'=>array('InstTags ON InstTags.InstID=Instances.ID','Tags AS XTags ON XTags.ID=InstTags.TagID'),'subtype'=>'text','wheremore'=>'AND InstTags.Pos=1'),
/*'Statuses'=>array('name'=>'Stati ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','selmore'=>'MAX(Week) AS maxweek'),
@ -462,15 +462,15 @@ mysqli_close($link);
<!--
function chulsh(el,sh) {
if (sh)
el.querySelector('ul').style='display:block';
el.querySelector('ul').style.display='block';
else
el.querySelector('ul').style='display:none';
el.querySelector('ul').style.display='none';
}
function ulsh(el,sh) {
if (sh)
el.style='display:block';
el.style.display='block';
else
el.style='display:none';
el.style.display='none';
}
function golang(lang) {
var loc=document.location.href;
@ -509,6 +509,7 @@ function addselopt(el,val,txt) {
el.add(option);
}
function inpdisif(index) {
console.log('inpdisif index: '+index);
var source=document.getElementById('condsel-'+index);
var inp=document.getElementById('valueinp-'+index);
var sel=document.getElementById('valuesel-'+index);
@ -522,7 +523,7 @@ function inpdisif(index) {
}
}
function popusels(index,valselval) {
console.log('Index: '+index);
console.log('popusels index: '+index);
var key=document.getElementById('fieldsel-'+index).value;
var type=key.replace(/^.*:(.*):.*$/,'$1');
var subtype=key.replace(/^.*:.*:(.*)$/,'$1');
@ -530,6 +531,7 @@ function popusels(index,valselval) {
var condsel=document.getElementById('condsel-'+index);
var valsel=document.getElementById('valuesel-'+index);
var valinp=document.getElementById('valueinp-'+index);
condsel.setAttribute('onchange','inpdisif('+index+');');
if (type=='joini')
type=subtype;
if (type=='bool') {
@ -542,11 +544,10 @@ function popusels(index,valselval) {
addselopt(valsel,'NULL','non definito');
if (valselval!==false)
selind('valuesel-'+index,valselval);
valinp.style='display:none';
valinp.style.display='none';
valinp.disabled=true;
valsel.style='display:block';
valsel.style.display='block';
valsel.disabled=false;
condsel.removeAttribute('onchange');
} else if (type=='text') {
truncsel('condsel-'+index);
addselopt(condsel,'LIKE','contiene');
@ -559,11 +560,10 @@ function popusels(index,valselval) {
addselopt(condsel,'<','è minore di');
addselopt(condsel,'IS NOT NULL','è definito');
addselopt(condsel,'IS NULL','non è definito');
valsel.style='display:none';
valsel.style.display='none';
valsel.disabled=true;
valinp.style='display:block';
valinp.style.display='block';
valinp.disabled=false;
condsel.setAttribute('onchange','inpdisif('+index+');');
} else if (type=='int' || type=='time') {
truncsel('condsel-'+index);
addselopt(condsel,'>=','è maggiore o uguale a');
@ -574,22 +574,20 @@ function popusels(index,valselval) {
addselopt(condsel,'!=','è diverso da');
addselopt(condsel,'IS NOT NULL','è definito');
addselopt(condsel,'IS NULL','non è definito');
valsel.style='display:none';
valsel.style.display='none';
valsel.disabled=true;
valinp.style='display:block';
valinp.style.display='block';
valinp.disabled=false;
condsel.setAttribute('onchange','inpdisif('+index+');');
} else if (type=='join') {
truncsel('condsel-'+index);
addselopt(condsel,'=','è uguale a');
addselopt(condsel,'!=','è diverso da');
addselopt(condsel,'IS NOT NULL','è definito');
addselopt(condsel,'IS NULL','non è definito');
valsel.style='display:block';
valsel.style.display='block';
valsel.disabled=false;
valinp.style='display:none';
valinp.style.display='none';
valinp.disabled=true;
condsel.setAttribute('onchange','inpdisif('+index+');');
truncsel('valuesel-'+index);
let xhr=new XMLHttpRequest();
xhr.open('GET','instancesh.php?key='+key);
@ -663,6 +661,7 @@ function synctai() {
for (i=cnodes; i>-1; i--) {
nodes[i].setAttribute('id','condsel-'+(i+1));
nodes[i].setAttribute('name','condsel-'+(i+1));
nodes[i].setAttribute('onchange','inpdisif('+(i+1)+');');
}
nodes=table.querySelectorAll('.valuesel');
for (i=cnodes; i>-1; i--) {

View file

@ -407,6 +407,9 @@ input {
#plancia .valuesel {
min-width: 120px;
}
#plancia .valuesel:disabled, .valueinp:disabled {
opacity: 0.5;
}
#plancia .minus, .plus {
width: 22px;
height: 22px;