suggestion : DetailView enable uitype 10 change - Printable Version +- CoreBOSBB (https://discussions.corebos.org) +-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18) +--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4) +---- Forum: coreBOS (https://discussions.corebos.org/forumdisplay.php?fid=5) +---- Thread: suggestion : DetailView enable uitype 10 change (/showthread.php?tid=269) Pages:
1
2
|
suggestion : DetailView enable uitype 10 change - saidmsl - 04-27-2016 Hi, under DetailView , it is possible to change any data (edit link) except the related fields it would be a good idea to enable also edit (popup button) for all uitype = 10 Rgds RE: suggestion : DetailView enable uitype 10 change - joebordes - 04-28-2016 This one has been on my mind for a long time, I just never got around to looking into it. Your post motivated me and a couple of hours later I committed this: https://github.com/tsolucio/corebos/commit/92c492fb4d35f0e88ccd4fad8ac72200d57d9069 give it a try when you can and let me know how it goes. RE: suggestion : DetailView enable uitype 10 change - saidmsl - 04-29-2016 Hi, Thanks, however the set_return does not fill the data because of from_link value i have set in vtlib.js : function vtlib_open_popup_window(fromlink,fldname,MODULE,ID) { if (fromlink == 'qcreate') window.open("index.php?module="+ document.QcEditView[fldname+'_type'].value +"&action=Popup&html=Popup_picker&form=vtlibPopupView&forfield="+fldname+"&srcmodule="+MODULE+"&forrecord="+ID,"vtlibui10qc","width=680,height=602,resizable=0,scrollbars=0,top=150,left=200"); else if (fromlink == 'DetailView') //MSL window.open("index.php?module="+ document.DetailView[fldname+'_type'].value +"&action=Popup&html=Popup_picker&form=vtlibPopupView&forfield="+fldname+"&srcmodule="+MODULE+"&forrecord="+ID,"vtlibui10","width=680,height=602,resizable=0,scrollbars=0,top=150,left=200"); else window.open("index.php?module="+ document.EditView[fldname+'_type'].value +"&action=Popup&html=Popup_picker&form=vtlibPopupView&forfield="+fldname+"&srcmodule="+MODULE+"&forrecord="+ID,"vtlibui10","width=680,height=602,resizable=0,scrollbars=0,top=150,left=200"); return true; } still investigating... RE: suggestion : DetailView enable uitype 10 change - joebordes - 04-29-2016 Sorry, the previous commit is necessary for this one to work. It isn't directly related to this issue because it permits putting a uitype10 on any form. I assumed you would apply all the changes not just that one. https://github.com/tsolucio/corebos/commit/c3247304b7f4409f92996e9c84b7405e79d508ed Apply this commit too and you will get the correct result (as you have very well noted already). RE: suggestion : DetailView enable uitype 10 change - saidmsl - 04-29-2016 Thanks it works now i just notice another issue : i have created a link between Project and potential : under project, field : potential_id , uitype = 10 when i use the popup window, the javascript function is set to set_return(...) i have changed it to : $forform = vtlib_purify($_REQUEST['form']); $forform = htmlspecialchars($forform, ENT_QUOTES, $default_charset); $forfield = vtlib_purify($_REQUEST['forfield']); $forfield = htmlspecialchars($forfield, ENT_QUOTES, $default_charset); //$value = '<a href="javascript:window.close();" onclick=\'set_return("' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\''; $value = "<a href='javascript:if (document.getElementById(\"closewindow\").value==\"true\") {window.close();}' onclick='return vtlib_setvalue_from_popup($entity_id, \"". nl2br(decode_html($slashes_temp_val)) . "\", \"$forfield\"".(empty($forform)?'':',"'.$forform.'"').")'"; //MSL in ListViewUtils.php i don't know what other implications it has if i disable the set_return function RE: suggestion : DetailView enable uitype 10 change - joebordes - 04-29-2016 I couldn't reproduce it. I went to the Project module, clicked on settings icon, layout editor and added a relation field to potentials. The field cf_747 was created and worked correctly pointing to the vtlib_setvalue_from_popup() function. I went to the database and changed the name to potential_id, thinking that maybe some "if" condition was looking exactly for that fieldname, but it still worked correctly both in full and inline edit. Can you reproduce in the online demo? RE: suggestion : DetailView enable uitype 10 change - joebordes - 04-29-2016 I did find an error with a missing ID. It isn't related to your problem, but you will need it to get it working correctly: https://github.com/tsolucio/corebos/commit/1584e7e22ae6b93714082223ac17a39ae20e9628 RE: suggestion : DetailView enable uitype 10 change - saidmsl - 05-08-2016 Hi found a small forgetting : in vtlig.js function vtlib_setvalue_from_popup , add this code else if(window.opener.document.DetailView) { var domnode_id = window.opener.document.DetailView[target_fieldname]; var domnode_display = window.opener.document.DetailView[target_fieldname+'_display']; if(domnode_id) domnode_id.value = recordid; if(domnode_display) domnode_display.value = value; ret = true; } RE: suggestion : DetailView enable uitype 10 change - joebordes - 05-08-2016 Where is the lack of that code producing an error? RE: suggestion : DetailView enable uitype 10 change - saidmsl - 05-09-2016 I'm using a code : http://corebos.org/documentation/doku.php?id=en:devel:corebos_hooks:popup_open_hook: srcmodule is ProjectMilestone i have created a link between ProjectMilestone and Project Task : field parentid, uitype = 10 ---------------- function productCaptureOnPhase(fromlink,fldname,MODULE,ID) { var projectid = document.getElementById('projectid').value; var phaseid = document.getElementById('phaseid').value; var BasicSearch = '&projectid=' + projectid + '&phaseid=' + phaseid ; var SpecialSearch = encodeURI(BasicSearch); window.open("index.php?module=ProjectTask&action=Popup&html=Popup_picker&form=vtlibPopupView&forfield="+fldname+"&srcmodule="+MODULE+"&forrecord="+ID+SpecialSearch,"vtlibui10","width=680,height=602,resizable=0,scrollbars=0,top=150,left=200"); } ------- when i popup and select the project task from Projectmilestone DetailView, the parentid is not set on the parent window had to change the function as : function vtlib_setvalue_from_popup(recordid,value,target_fieldname,formname) { var ret = false; if(window.opener.document.forms[formname]) { var domnode_id = window.opener.document.forms[formname][target_fieldname]; var domnode_display = window.opener.document.forms[formname][target_fieldname+'_display']; if(domnode_id) domnode_id.value = recordid; if(domnode_display) domnode_display.value = value; ret = true; } else if(window.opener.document.EditView) { var domnode_id = window.opener.document.EditView[target_fieldname]; var domnode_display = window.opener.document.EditView[target_fieldname+'_display']; if(domnode_id) domnode_id.value = recordid; if(domnode_display) domnode_display.value = value; ret = true; } else if(window.opener.document.DetailView) { var domnode_id = window.opener.document.DetailView[target_fieldname]; var domnode_display = window.opener.document.DetailView[target_fieldname+'_display']; if(domnode_id) domnode_id.value = recordid; if(domnode_display) domnode_display.value = value; ret = true; } else if(window.opener.document.QcEditView) { var domnode_id = window.opener.document.QcEditView[target_fieldname]; var domnode_display = window.opener.document.QcEditView[target_fieldname+'_display']; if(domnode_id) domnode_id.value = recordid; if(domnode_display) domnode_display.value = value; ret = true; } var func = window.opener.gVTModule + 'setValueFromCapture'; if (typeof window.opener[func] == 'function') { window.opener[func](recordid,value,target_fieldname); ret = true; } console.log(ret); return ret; } |