← Back to team overview

dhis2-devs team mailing list archive

Re: System turn to offline when run the script

 


Hi Knut, 
              I am very much sorry for this,please check my code,now it is with comments.

<p>
                <script>

/* Data element id initializing to a variable*/
var ctvsa="Wuin0SXuPNj-Y8qBmhmsqyj-val";
var ema="QWNLnXFyksX-Y8qBmhmsqyj-val";
var hdua="yYtnZv1vGl7-Y8qBmhmsqyj-val";
var iccua="SIsEeVOISOS-Y8qBmhmsqyj-val";
var ituaa="xpjyW71hK6m-Y8qBmhmsqyj-val";
var ituba="vcgdbpDugas-Y8qBmhmsqyj-val";
var ituca="Tpck07W8Eze-Y8qBmhmsqyj-val";
var nicua="hsRySAvLXBi-Y8qBmhmsqyj-val";
var scbua="BG6u5O3arQ0-Y8qBmhmsqyj-val";
/* This function is calling at time of loading table and data element value become zero.*/
function intval()
{
 
$("#"+ctvsa).val(parseInt($("#"+ctitua).val(0)));
$("#"+ema).val(parseInt($("#"+ema).val(0)));
$("#"+hdua).val(parseInt($("#"+hdua).val(0)));
$("#"+iccua).val(parseInt($("#"+iccua).val(0)));
$("#"+ituaa).val(parseInt($("#"+ituaa).val(0)));
$("#"+ituba).val(parseInt($("#"+ituba).val(0)));
$("#"+ituca).val(parseInt($("#"+ituca).val(0)));
$("#"+scbua).val(parseInt($("#"+scbua).val(0)));
 };
$(document).ready(function() {
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(Wuin0SXuPNj-Y8qBmhmsqyj-val)*/
$("#btn_ptin_ctvs").on('click',function(){
         $("#"+ctvsa).val(parseInt($("#"+ctvsa).val())-1);        
        if(parseInt($("#"+ctvsa).val())<0)
        {
         $("#"+ctvsa).val(parseInt($("#"+ctvsa).val())+1);
       
          alert("Error Message :No Avialable Bed For CTVS");
        }
         $("#"+ctvsa).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(Wuin0SXuPNj-Y8qBmhmsqyj-val)*/

$("#btn_ptout_ctvs").on('click',function(){
        $("#"+ctvsa).val(parseInt($("#"+ctvsa).val())+1);        
          
         $("#"+ctvsa).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(QWNLnXFyksX-Y8qBmhmsqyj-val)*/

$("#btn_ptin_em").on('click',function(){
        $("#"+ema).val(parseInt($("#"+ema).val())-1);       
          if(parseInt($("#"+ema).val())<0)
        {
         $("#"+ema).val(parseInt($("#"+ema).val())+1);
       
          alert("Error Message :No Avialable Bed For EMS");
        }  
         $("#"+ema).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(QWNLnXFyksX-Y8qBmhmsqyj-val)*/

$("#btn_ptout_em").on('click',function(){
        $("#"+ema).val(parseInt($("#"+ema).val())+1);        
          
         $("#"+ema).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(yYtnZv1vGl7-Y8qBmhmsqyj-val)*/

$("#btn_ptin_hdu").on('click',function(){
        $("#"+hdua).val(parseInt($("#"+hdua).val())-1);       
           if(parseInt($("#"+hdua).val())<0)
        {
         $("#"+hdua).val(parseInt($("#"+hdua).val())+1);
       
          alert("Error Message :No Avialable Bed For HDU");
        }
         $("#"+hdua).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(yYtnZv1vGl7-Y8qBmhmsqyj-val)*/

$("#btn_ptout_hdu").on('click',function(){
        $("#"+hdua).val(parseInt($("#"+hdua).val())+1);        
          
         $("#"+hdua).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(SIsEeVOISOS-Y8qBmhmsqyj-val)*/

$("#btn_ptin_iccu").on('click',function(){
        $("#"+iccua).val(parseInt($("#"+iccua).val())-1);       
           if(parseInt($("#"+iccua).val())<0)
        {
         $("#"+iccua).val(parseInt($("#"+iccua).val())+1);
       
          alert("Error Message :No Avialable Bed For ICCU");
        }
         $("#"+iccua).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(SIsEeVOISOS-Y8qBmhmsqyj-val)*/

$("#btn_ptout_iccu").on('click',function(){
        $("#"+iccua).val(parseInt($("#"+iccua).val())+1);        
          
         $("#"+iccua).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(xpjyW71hK6m-Y8qBmhmsqyj-val)*/
$("#btn_ptin_itua").on('click',function(){
        $("#"+ituaa).val(parseInt($("#"+ituaa).val())-1);       
           if(parseInt($("#"+ituaa).val())<0)
        {
         $("#"+ituaa).val(parseInt($("#"+ituaa).val())+1);
       
          alert("Error Message :No Avialable Bed For ITU A");
        }
         $("#"+ituaa).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(xpjyW71hK6m-Y8qBmhmsqyj-val)*/

$("#btn_ptout_itua").on('click',function(){
        $("#"+ituaa).val(parseInt($("#"+ituaa).val())+1);        
          
         $("#"+ituaa).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(vcgdbpDugas-Y8qBmhmsqyj-val)*/

$("#btn_ptin_itub").on('click',function(){
        $("#"+ituba).val(parseInt($("#"+ituba).val())-1);       
           if(parseInt($("#"+ituba).val())<0)
        {
         $("#"+ituba).val(parseInt($("#"+ituba).val())+1);
       
          alert("Error Message :No Avialable Bed For ITU B");
        }
         $("#"+ituba).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(vcgdbpDugas-Y8qBmhmsqyj-val)*/

$("#btn_ptout_itub").on('click',function(){
        $("#"+ituba).val(parseInt($("#"+ituba).val())+1);        
          
         $("#"+ituba).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(Tpck07W8Eze-Y8qBmhmsqyj-val)*/

$("#btn_ptin_ituc").on('click',function(){
        $("#"+ituca).val(parseInt($("#"+ituca).val())-1);       
           if(parseInt($("#"+ituca).val())<0)
        {
         $("#"+ituca).val(parseInt($("#"+ituca).val())+1);
       
          alert("Error Message :No Avialable Bed For ITU C");
        }
         $("#"+ituca).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(Tpck07W8Eze-Y8qBmhmsqyj-val)*/

$("#btn_ptout_ituc").on('click',function(){
        $("#"+ituca).val(parseInt($("#"+ituca).val())+1);        
          
         $("#"+ituca).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(hsRySAvLXBi-Y8qBmhmsqyj-val)*/

$("#btn_ptin_nicu").on('click',function(){
        $("#"+nicua).val(parseInt($("#"+nicua).val())-1);       
           if(parseInt($("#"+nicua).val())<0)
        {
         $("#"+nicua).val(parseInt($("#"+nicua).val())+1);
       
          alert("Error Message :No Avialable Bed For NICU");
        }
         $("#"+nicua).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(hsRySAvLXBi-Y8qBmhmsqyj-val)*/

$("#btn_ptout_nicu").on('click',function(){
        $("#"+nicua).val(parseInt($("#"+nicua).val())+1);        
          
         $("#"+nicua).change();
        
});
/* This function is used to decreased the value of the data element and checking the value does not become zero-this is for data element id(BG6u5O3arQ0-Y8qBmhmsqyj-val)*/
$("#btn_ptin_scbu").on('click',function(){
        $("#"+scbua).val(parseInt($("#"+scbua).val())-1);       
           if(parseInt($("#"+scbua).val())<0)
        {
         $("#"+scbua).val(parseInt($("#"+scbua).val())+1);
       
          alert("Error Message :No Avialable Bed For SCBU");
        }
         $("#"+scbua).change();
       
});
/* This function is used to increased the value of the data element -this is for data element id(BG6u5O3arQ0-Y8qBmhmsqyj-val)*/
$("#btn_ptout_scbu").on('click',function(){
        $("#"+scbua).val(parseInt($("#"+scbua).val())+1);        
          
         $("#"+scbua).change();
        
});
});
 Thanks
Barnali Banerjee


________________________________
 From: Knut Staring <knutst@xxxxxxxxx>
To: Barnali Banerjee <barnali760@xxxxxxxxxxx> 
Cc: DHIS 2 developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx>; Lars Helge Øverland <larshelge@xxxxxxxxx> 
Sent: Friday, 23 August 2013 1:46 PM
Subject: Re: [Dhis2-devs] System turn to offline when run the script
 


Hi Barnali , would be good if you used some comments in your code to explain what you are aiming to achieve. 
Den 23. aug. 2013 09:52 skrev "Barnali Bhaduri" <barnali760@xxxxxxxxxxx> følgende:

Hi Sir,
>     
         I have been written following java script in
custom form dhis2 dataset, when I try to entering the data  in the form ,system have turn to offline .Please
check the my script and give  me my suggestion.
><p>
>                <script>
>var ctvsa="Wuin0SXuPNj-Y8qBmhmsqyj-val";
>var ema="QWNLnXFyksX-Y8qBmhmsqyj-val";
>var hdua="yYtnZv1vGl7-Y8qBmhmsqyj-val";
>var iccua="SIsEeVOISOS-Y8qBmhmsqyj-val";
>var ituaa="xpjyW71hK6m-Y8qBmhmsqyj-val";
>var ituba="vcgdbpDugas-Y8qBmhmsqyj-val";
>var ituca="Tpck07W8Eze-Y8qBmhmsqyj-val";
>var nicua="hsRySAvLXBi-Y8qBmhmsqyj-val";
>var scbua="BG6u5O3arQ0-Y8qBmhmsqyj-val";
>function intval()
>{
> 
>$("#"+ctvsa).val(parseInt($("#"+ctitua).val(0)));
>$("#"+ema).val(parseInt($("#"+ema).val(0)));
>$("#"+hdua).val(parseInt($("#"+hdua).val(0)));
>$("#"+iccua).val(parseInt($("#"+iccua).val(0)));
>$("#"+ituaa).val(parseInt($("#"+ituaa).val(0)));
>$("#"+ituba).val(parseInt($("#"+ituba).val(0)));
>$("#"+ituca).val(parseInt($("#"+ituca).val(0)));
>$("#"+scbua).val(parseInt($("#"+scbua).val(0)));
> 
> 
>};
>$(document).ready(function() {
>$("#btn_ptin_ctvs").on('click',function(){
>        
$("#"+ctvsa).val(parseInt($("#"+ctvsa).val())-1);
       
>       
if(parseInt($("#"+ctvsa).val())<0)
>        {
>        
$("#"+ctvsa).val(parseInt($("#"+ctvsa).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For CTVS");
>        }
>       
 $("#"+ctvsa).change();
>        
>});
>$("#btn_ptout_ctvs").on('click',function(){
>       
$("#"+ctvsa).val(parseInt($("#"+ctvsa).val())+1);  
     
>          
>       
 $("#"+ctvsa).change();
>        
>});
>$("#btn_ptin_em").on('click',function(){
>       
$("#"+ema).val(parseInt($("#"+ema).val())-1);        
>         
if(parseInt($("#"+ema).val())<0)
>        {
>        
$("#"+ema).val(parseInt($("#"+ema).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For EMS");
>        }   
>        
$("#"+ema).change();
>        
>});
>$("#btn_ptout_em").on('click',function(){
>        $("#"+ema).val(parseInt($("#"+ema).val())+1);
       
>          
>       
 $("#"+ema).change();
>        
>});
>$("#btn_ptin_hdu").on('click',function(){
>       
$("#"+hdua).val(parseInt($("#"+hdua).val())-1);        
>          
if(parseInt($("#"+hdua).val())<0)
>        {
>        
$("#"+hdua).val(parseInt($("#"+hdua).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For HDU");
>        }
>        
$("#"+hdua).change();
>        
>});
>$("#btn_ptout_hdu").on('click',function(){
>        $("#"+hdua).val(parseInt($("#"+hdua).val())+1);
       
>          
>       
 $("#"+hdua).change();
>        
>});
>$("#btn_ptin_iccu").on('click',function(){
>       
$("#"+iccua).val(parseInt($("#"+iccua).val())-1);        
>          
if(parseInt($("#"+iccua).val())<0)
>        {
>        
$("#"+iccua).val(parseInt($("#"+iccua).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For ICCU");
>        }
>        
$("#"+iccua).change();
>        
>});
>$("#btn_ptout_iccu").on('click',function(){
>       
$("#"+iccua).val(parseInt($("#"+iccua).val())+1);  
     
>          
>       
 $("#"+iccua).change();
>        
>});
>$("#btn_ptin_itua").on('click',function(){
>       
$("#"+ituaa).val(parseInt($("#"+ituaa).val())-1);        
>          
if(parseInt($("#"+ituaa).val())<0)
>        {
>        
$("#"+ituaa).val(parseInt($("#"+ituaa).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For ITU A");
>        }
>        
$("#"+ituaa).change();
>        
>});
>$("#btn_ptout_itua").on('click',function(){
>       
$("#"+ituaa).val(parseInt($("#"+ituaa).val())+1);  
     
>          
>       
 $("#"+ituaa).change();
>        
>});
>$("#btn_ptin_itub").on('click',function(){
>       
$("#"+ituba).val(parseInt($("#"+ituba).val())-1);        
>           if(parseInt($("#"+ituba).val())<0)
>        {
>        
$("#"+ituba).val(parseInt($("#"+ituba).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For ITU B");
>        }
>        
$("#"+ituba).change();
>        
>});
>$("#btn_ptout_itub").on('click',function(){
>       
$("#"+ituba).val(parseInt($("#"+ituba).val())+1);  
     
>          
>       
 $("#"+ituba).change();
>        
>});
>$("#btn_ptin_ituc").on('click',function(){
>       
$("#"+ituca).val(parseInt($("#"+ituca).val())-1);        
>          
if(parseInt($("#"+ituca).val())<0)
>        {
>        
$("#"+ituca).val(parseInt($("#"+ituca).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For ITU C");
>        }
>        
$("#"+ituca).change();
>        
>});
>$("#btn_ptout_ituc").on('click',function(){
>       
$("#"+ituca).val(parseInt($("#"+ituca).val())+1);  
     
>          
>       
 $("#"+ituca).change();
>        
>});
>$("#btn_ptin_nicu").on('click',function(){
>       
$("#"+nicua).val(parseInt($("#"+nicua).val())-1);        
>          
if(parseInt($("#"+nicua).val())<0)
>        {
>        
$("#"+nicua).val(parseInt($("#"+nicua).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For NICU");
>        }
>        
$("#"+nicua).change();
>        
>});
>$("#btn_ptout_nicu").on('click',function(){
>       
$("#"+nicua).val(parseInt($("#"+nicua).val())+1);  
     
>          
>       
 $("#"+nicua).change();
>        
>});
>$("#btn_ptin_scbu").on('click',function(){
>       
$("#"+scbua).val(parseInt($("#"+scbua).val())-1);        
>          
if(parseInt($("#"+scbua).val())<0)
>        {
>        
$("#"+scbua).val(parseInt($("#"+scbua).val())+1);
>        
>         
alert("Error Message :No Avialable Bed For SCBU");
>        }
>        
$("#"+scbua).change();
>        
>});
>$("#btn_ptout_scbu").on('click',function(){
>       
$("#"+scbua).val(parseInt($("#"+scbua).val())+1);  
     
>          
>       
 $("#"+scbua).change();
>        
>});
>});
></script>
>
>
>Thanks 
>Barnali Banerjee
>
>
>
>________________________________
> From: Lars Helge Øverland <larshelge@xxxxxxxxx>
>To: easy <lin_xd@xxxxxxx> 
>Cc: DHIS 2 developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx> 
>Sent: Friday, 23 August 2013 12:35 PM
>Subject: Re: [Dhis2-devs] how to order in chart module?
> 
>
>
>Okay that makes sense to me.
>
>
>I have written up a blueprint here:
>
>
>https://blueprints.launchpad.net/dhis2/+spec/visualizer-chart-sort
>
>
>
>Will try to get it in for 2.13 (2.14 if not).
>
>
>Lars
>
>
>
>
>
>On Sat, Aug 17, 2013 at 2:06 AM, easy <lin_xd@xxxxxxx> wrote:
>
>Hi,sir,
>>  Thanks,
>>   for example, I want make a chart about patients number for a year and some organziations,  order  from high to low, if have multiple series, I can specify some serie to order.
>>
>>
>>
>>
>>
>>
>>--
>>
>>此致
>>
>>easy
>>
>>莫愁前路无知己,天下谁人不识君。
>>
>>At 2013-08-16 17:52:59,"Lars Helge Øverland" <larshelge@xxxxxxxxx> wrote:
>>
>>Hi easy,
>>>
>>>
>>>we don't support that at the moment. But it is a requirement request we get frequently. 
>>>
>>>
>>>Can you explain a bit more detailed how you want the sorting to work? The tricky thing is to sort when you have multiple series and multiple categories - how would you like that to work?
>>>
>>>
>>>Any others with views on this?
>>>
>>>
>>>regards,
>>>
>>>
>>>Lars
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>On Fri, Aug 16, 2013 at 2:30 AM, easy <lin_xd@xxxxxxx> wrote:
>>>
>>>Hi,sir,
>>>>
>>>>
>>>>   I want to order the chart value, how to do ?
>>>>
>>>> Thanks.
>>>>
>>>>
>>>>
>>>>--
>>>>
>>>>此致
>>>>
>>>>  easy
>>>>
>>>>莫愁前路无知己,天下谁人不识君。
>>>>
>>>>
>>>>_______________________________________________
>>>>Mailing list: https://launchpad.net/~dhis2-devs
>>>>Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>
>>
>
>_______________________________________________
>Mailing list: https://launchpad.net/~dhis2-devs
>Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>Unsubscribe : https://launchpad.net/~dhis2-devs
>More help   : https://help.launchpad.net/ListHelp
>
>
>
>_______________________________________________
>Mailing list: https://launchpad.net/~dhis2-devs
>Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>Unsubscribe : https://launchpad.net/~dhis2-devs
>More help   : https://help.launchpad.net/ListHelp
>
>

References