449 lines
12 KiB
JavaScript
449 lines
12 KiB
JavaScript
function DisplayErrorMessage() {
|
|
if (Le(m_nLastError,-1)) {
|
|
return;
|
|
}
|
|
if (Eq(typeof(m_cErrorInChild),'undefined') || Empty(m_cErrorInChild)) {
|
|
var l_cErrorMsg = m_cLastMsgError;
|
|
if (Eq(l_cErrorMsg,'')) {
|
|
if (Eq(m_nLastError,1)) {
|
|
l_cErrorMsg='MSG_OBBLI_FIELD';
|
|
} else if (Eq(m_nLastError,2)) {
|
|
l_cErrorMsg='MSG_VALUE_NOT_ALLOWED';
|
|
} else if (Eq(m_nLastError,3)) {
|
|
l_cErrorMsg='MSG_VALUE_NOT_ALLOWED';
|
|
} else {
|
|
l_cErrorMsg='MSG_UNSPEC_ERROR';
|
|
}
|
|
}
|
|
if (Eq(m_nLastError,1)) {
|
|
WindowAlert(Translate(m_cObblFieldName)+' : '+Translate(l_cErrorMsg));
|
|
} else {
|
|
if (Eq(l_cErrorMsg,'MSG_VALUE_NOT_ALLOWED') && Ne(m_cLastWorkVarErrorMsg,'')) {
|
|
WindowAlert(Translate(m_cLastWorkVarErrorMsg)+': '+Translate(l_cErrorMsg));
|
|
} else {
|
|
WindowAlert(Translate(l_cErrorMsg));
|
|
}
|
|
}
|
|
if (Ne(m_cLastWorkVarError,'')) {
|
|
SetControlFocus(m_cLastWorkVarError);
|
|
SetErrorField(m_cLastWorkVarError,true);
|
|
m_cLastWorkVarError='';
|
|
}
|
|
} else if (Ne(typeof('DisplayErrorMessage_'+m_cErrorInChild),'undefined')) {
|
|
DisplayErrorMessageOfChild(m_cErrorInChild);
|
|
}
|
|
}
|
|
function ResetErrorVars() {
|
|
m_nLastError=0;
|
|
m_cLastMsgError='';
|
|
m_cLastWorkVarError='';
|
|
m_cLastWorkVarErrorMsg='';
|
|
m_cErrorInChild='';
|
|
}
|
|
function EnableControlsUnderCondition() {
|
|
}
|
|
function EnableControlsUnderCondition_WhenReady() {
|
|
var l_bEnabled = true;
|
|
// * --- Area Manuale = UI - Enable Controls Init
|
|
// * --- Fine Area Manuale
|
|
if (window.Z && window.Z.Tabs) {
|
|
Z.Tabs.Get('tabs').CheckTabStrip();
|
|
}
|
|
LibJavascript.forEachItem(m_FoundlingEditExpression,i_body_0)
|
|
function i_body_0(child){
|
|
child();
|
|
}
|
|
DisableUI();
|
|
HideControlsUnderCondition();
|
|
ObligatoryControlsUnderCondition();
|
|
// * --- Area Manuale = UI - Enable Controls End
|
|
// * --- Fine Area Manuale
|
|
}
|
|
function ObligatoryControlsUnderCondition() {
|
|
var l_bObligatory = true;
|
|
}
|
|
function SetDynamicClasses() {
|
|
var c;
|
|
}
|
|
function SetDynamicTooltip() {
|
|
var c;
|
|
}
|
|
function Set_color(ctrlValue,kmode,e) {
|
|
if (Ne(w_color,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'QMMPPRPKPM');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_color=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('QMMPPRPKPM',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','C',9,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_postit(ctrlValue,kmode,e) {
|
|
if (Ne(w_postit,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'DLOXQBSMCM');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_postit=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('DLOXQBSMCM',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','M',10,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_rgb(ctrlValue,kmode,e) {
|
|
if (Ne(w_rgb,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'QJYBYSKPAF');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_rgb=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('QJYBYSKPAF',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','C',9,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_textualpostit(ctrlValue,kmode,e) {
|
|
if (Ne(w_textualpostit,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'AXQOJKZPCB');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_textualpostit=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('AXQOJKZPCB',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','M',10,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_MultiCompS(ctrlValue,kmode,e) {
|
|
if (Ne(w_MultiCompS,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'BGICHNXDNR');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_MultiCompS=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('BGICHNXDNR',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','M',10,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_color_sample(ctrlValue,kmode,e) {
|
|
if (Ne(w_color_sample,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'TINSZXUJXJ');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_color_sample=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('TINSZXUJXJ',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('','M',10,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_datestop(ctrlValue,kmode,e) {
|
|
if (Ne(w_datestop,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'GPUYALDNLH');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_datestop=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('GPUYALDNLH',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH(NullDateTime(),'T',14,0,TranslatePicture(GetDatePicture(false,'T'),'T'));
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_datestart(ctrlValue,kmode,e) {
|
|
if (Ne(w_datestart,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'AIFEBZGNZP');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_datestart=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('AIFEBZGNZP',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH(NullDateTime(),'T',14,0,TranslatePicture(GetDatePicture(false,'T'),'T'));
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Set_status(ctrlValue,kmode,e) {
|
|
if (Ne(w_status,ctrlValue)) {
|
|
var ctl = _GetCtl(e,'QHAFRTKOJS');
|
|
if (_tracker.goon(ctl,ctrlValue)) {
|
|
w_status=ctrlValue;
|
|
SetModified();
|
|
var l_bResult = true;
|
|
SetErrorField(ctl,false);
|
|
l_bResult=_ChkObl('QHAFRTKOJS',0);
|
|
DoUpdate(l_bResult);
|
|
return l_bResult;
|
|
} else {
|
|
ctl.value=WtH('A','C',3,0,'');
|
|
_ResetTracker();
|
|
return true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Calculate() {
|
|
var l_bTmpRes;
|
|
var l_bResult = true;
|
|
m_bCalculating=true;
|
|
if ((Ne(o_postit,w_postit))) {
|
|
w_textualpostit=(Empty(w_postit)?w_scrivi_postit:Strtran(Substr(w_postit,2,At(Chr(13)+Chr(10),w_postit)-3),'\xff',"\n"));
|
|
}
|
|
if ((Ne(o_rgb,w_rgb))) {
|
|
Calculation_VMDWAVIZVN();
|
|
}
|
|
if ((Ne(o_postit,w_postit))) {
|
|
Calculation_DIDXBNLFCE();
|
|
}
|
|
if ((Ne(o_textualpostit,w_textualpostit)) || (Ne(o_color,w_color)) || (Ne(o_datestart,w_datestart)) || (Ne(o_datestop,w_datestop)) || (Ne(o_status,w_status))) {
|
|
Calculation_LNITZOUCAZ();
|
|
}
|
|
if ((Ne(o_color_sample,w_color_sample))) {
|
|
w_color_sample='';
|
|
}
|
|
LibJavascript.forEachItem(m_FoundlingCopyWorkVar,i_body_1)
|
|
function i_body_1(child){
|
|
child();
|
|
}
|
|
// * --- Area Manuale = UI - Calculate
|
|
// * --- Fine Area Manuale
|
|
if (Ne(typeof(Calculation_ZSZJTCYCID),'undefined')) {
|
|
Calculation_ZSZJTCYCID();
|
|
}
|
|
m_bCalculating=false;
|
|
}
|
|
function Calculation_VMDWAVIZVN() {
|
|
w_color=Str((Mod(Val(''+parseInt(Substr(w_rgb,2),16)),256))*65536+(Mod(Int(Val(''+parseInt(Substr(w_rgb,2),16))/256),256))*256+Mod(Int(Val(''+parseInt(Substr(w_rgb,2),16))/65536),256),9);
|
|
}
|
|
function Calculation_DIDXBNLFCE() {
|
|
w_color=Right(w_postit,Len(w_postit)-At(Chr(13)+Chr(10)+']'+Chr(13)+Chr(10),w_postit)-4);
|
|
w_color=Left(w_color,At(Chr(13)+Chr(10),w_color));
|
|
}
|
|
function Calculation_LNITZOUCAZ() {
|
|
w_postit=(Empty(w_textualpostit)?'':'\"'+Strtran(Strtran(Strtran(w_textualpostit,Chr(13)+Chr(10),'\xff'),Chr(13),'\xff'),Chr(10),'\xff')+'\"'+Chr(13)+Chr(10)+' 0'+Chr(13)+Chr(10)+' 0'+Chr(13)+Chr(10)+' 0'+Chr(13)+Chr(10)+'['+Chr(13)+Chr(10)+']'+Chr(13)+Chr(10)+w_color+Chr(13)+Chr(10)+'\"\"'+Chr(13)+Chr(10)+'*'+Chr(13)+Chr(10));
|
|
}
|
|
function Calculation_ZSZJTCYCID() {
|
|
w_color=ZtVWeb.getPortletInc('bodyDiv','postin_user').setBackgroundColor(w_color);
|
|
w_color=(Ne(Left(w_color,1),' ')?' '+w_color:w_color);
|
|
}
|
|
function SaveDependsOn() {
|
|
o_postit=w_postit;
|
|
o_textualpostit=w_textualpostit;
|
|
o_color=w_color;
|
|
o_rgb=w_rgb;
|
|
o_status=w_status;
|
|
o_datestart=w_datestart;
|
|
o_datestop=w_datestop;
|
|
o_color_sample=w_color_sample;
|
|
}
|
|
function SaveLabelDependsOn() {
|
|
}
|
|
function SendData(formaction,url,data) {
|
|
if (Eq(m_bAlreadySubmitted,true)) {
|
|
WindowAlert(Translate('MSG_SERVER_DATA'));
|
|
return;
|
|
}
|
|
var Frm = document.FSender;
|
|
var bResult = true;
|
|
function l_Checks() {
|
|
bResult=bResult && Check() && CheckPwdOTP();
|
|
if (bResult) {
|
|
bResult=m_Ctx.GetAuthority().HasWarns(w_code);
|
|
if ( ! (bResult)) {
|
|
m_cLastMsgError=AlertErrorMessage('MSG_CANNOT_SAVE');
|
|
}
|
|
}
|
|
}
|
|
if (Eq(formaction,'moveto') && m_bUpdated) {
|
|
bResult=WindowConfirm(Translate('MSG_LEAVE_MOD'));
|
|
}
|
|
if (bResult) {
|
|
if (Eq(formaction,'moveto') || (Eq(m_cFunction,'edit') && ! (m_bUpdated))) {
|
|
formaction='discard';
|
|
}
|
|
if (Eq(formaction,'save')) {
|
|
NotifyEvent('Before Save');
|
|
l_Checks();
|
|
}
|
|
if (bResult) {
|
|
Frm.m_cSelectedPage.value=GetSelectedPage(InitWvApplet()).asString();
|
|
SubmitForm.SetAction(formaction);
|
|
SubmitForm.SetPwdAndOTP();
|
|
Frm.m_cAltInterface.value=m_cAltInterface;
|
|
Frm.m_cLayerInterface.value=m_cLayerInterface;
|
|
FillWv();
|
|
Frm.m_cWv.value=WvApplet().asString(1);
|
|
if (Ne(parent,window) && parent.ZtVWeb) {
|
|
parent.ZtVWeb.raiseEventToEvalParms('postin_user_beforeSubmit',{'action':formaction});
|
|
}
|
|
Frm.submit();
|
|
m_bAlreadySubmitted=true;
|
|
InstTR();
|
|
} else {
|
|
DisplayErrorMessage();
|
|
if (Ne(parent,window) && parent.ZtVWeb) {
|
|
parent.ZtVWeb.raiseEventToEvalParms('postin_user_dataNotSent',{'action':formaction});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
CheckChild.child=[];
|
|
function Check() {
|
|
var l_bResult = true;
|
|
ResetErrorVars();
|
|
m_nLastError=0;
|
|
if ( ! (_ChkObl('DLOXQBSMCM',1))) {
|
|
_SignErr('DLOXQBSMCM');
|
|
m_cLastWorkVarErrorMsg='1809361341';
|
|
l_bResult=false;
|
|
w_postit=HtW('','M');
|
|
} else if ( ! (_ChkObl('AXQOJKZPCB',1))) {
|
|
_SignErr('AXQOJKZPCB');
|
|
m_cLastWorkVarErrorMsg='textualpostit';
|
|
l_bResult=false;
|
|
w_textualpostit=HtW('','M');
|
|
} else if ( ! (_ChkObl('QMMPPRPKPM',1))) {
|
|
_SignErr('QMMPPRPKPM');
|
|
m_cLastWorkVarErrorMsg='color';
|
|
l_bResult=false;
|
|
w_color=HtW('','C');
|
|
} else if ( ! (_ChkObl('QJYBYSKPAF',1))) {
|
|
_SignErr('QJYBYSKPAF');
|
|
m_cLastWorkVarErrorMsg='rgb';
|
|
l_bResult=false;
|
|
w_rgb=HtW('','C');
|
|
} else if ( ! (_ChkObl('BGICHNXDNR',1))) {
|
|
_SignErr('BGICHNXDNR');
|
|
m_cLastWorkVarErrorMsg='MultiCompS';
|
|
l_bResult=false;
|
|
w_MultiCompS=HtW('','M');
|
|
} else if ( ! (_ChkObl('QHAFRTKOJS',1))) {
|
|
_SignErr('QHAFRTKOJS');
|
|
m_cLastWorkVarErrorMsg='status';
|
|
l_bResult=false;
|
|
w_status='A';
|
|
} else if ( ! (_ChkObl('AIFEBZGNZP',1))) {
|
|
_SignErr('AIFEBZGNZP');
|
|
m_cLastWorkVarErrorMsg='812962054';
|
|
l_bResult=false;
|
|
w_datestart=HtW('','T');
|
|
} else if ( ! (_ChkObl('GPUYALDNLH',1))) {
|
|
_SignErr('GPUYALDNLH');
|
|
m_cLastWorkVarErrorMsg='11734680314';
|
|
l_bResult=false;
|
|
w_datestop=HtW('','T');
|
|
} else if ( ! (_ChkObl('TINSZXUJXJ',1))) {
|
|
_SignErr('TINSZXUJXJ');
|
|
m_cLastWorkVarErrorMsg='color_sample';
|
|
l_bResult=false;
|
|
w_color_sample=HtW('','M');
|
|
}
|
|
if (l_bResult) {
|
|
l_bResult=CheckChild(0);
|
|
}
|
|
// * --- Area Manuale = UI - Check Form
|
|
// * --- Fine Area Manuale
|
|
return l_bResult;
|
|
}
|
|
function link_index(lc) {
|
|
if (Eq('AIFEBZGNZP_ZOOM',lc)) {
|
|
return 0;
|
|
}
|
|
if (Eq('GPUYALDNLH_ZOOM',lc)) {
|
|
return 0;
|
|
}
|
|
return -1;
|
|
}
|
|
function link_url(index) {
|
|
var l_oWv;
|
|
}
|
|
function FillWv() {
|
|
var l_oWv = InitWvApplet();
|
|
l_oWv.setValue('m_CheckVars',JSON.stringify(m_CheckVars));
|
|
l_oWv.setValue('code',WtA(w_code,'C'));
|
|
l_oWv.setValue('postit',WtA(w_postit,'M'));
|
|
l_oWv.setValue('usercode',WtA(w_usercode,'N'));
|
|
l_oWv.setValue('createdby',WtA(w_createdby,'N'));
|
|
l_oWv.setValue('status',WtA(w_status,'C'));
|
|
l_oWv.setValue('datestart',WtA(w_datestart,'T'));
|
|
l_oWv.setValue('datestop',WtA(w_datestop,'T'));
|
|
l_oWv.setValue('scrivi_postit',WtA(w_scrivi_postit,'C'));
|
|
l_oWv.setValue('textualpostit',WtA(w_textualpostit,'M'));
|
|
l_oWv.setValue('color',WtA(w_color,'C'));
|
|
l_oWv.setValue('rgb',WtA(w_rgb,'C'));
|
|
l_oWv.setValue('MultiCompS',WtA(w_MultiCompS,'M'));
|
|
l_oWv.setValue('color_sample',WtA(w_color_sample,'M'));
|
|
_FillChildren(l_oWv);
|
|
if (m_bExtended) {
|
|
ExtendWv(l_oWv);
|
|
}
|
|
if (Ne(m_cFunction,'view')) {
|
|
l_oWv.setValue('m_bUpdated',WtA(m_bUpdated,'L'));
|
|
l_oWv.setValue('m_cPrvsStt',WtA(m_cPrvsStt,'C'));
|
|
}
|
|
l_oWv.setValue('m_bLoaded',WtA(m_bLoaded,'L'));
|
|
l_oWv.setValue('m_cOldCPCCCHK',WtA(m_cOldCPCCCHK,'C'));
|
|
}
|
|
_FillChildren.n=[];
|
|
FillWv.n=["code","postit","usercode","createdby","status","datestart","datestop","scrivi_postit","textualpostit","color","rgb","MultiCompS","color_sample"];
|
|
function SetModified() {
|
|
m_bUpdated=true;
|
|
}
|