error on tiket insertion

31 views
Skip to first unread message

beppe

unread,
Jun 6, 2013, 11:36:56 AM6/6/13
to phk...@googlegroups.com
Hi,
I have installed phkapa on my local webserver (lampp) and seems that work (no problem during the installation process)
Inserting a ticket when I try to set the "process" appears a warning "error loading data !!" and the system waits.
The strange is that if I push ok in the warning box and then push "submit" the process go away.
In the page compare a warning "Could not be saved. Please, try again." but is possible complete the form and when I push "submit" again the ticket is registered.
Do you have an idea about this strange behavior ?
thank's in advance for help

pHAlkaline

unread,
Jun 6, 2013, 4:33:14 PM6/6/13
to phk...@googlegroups.com
Hello, 
This message comes from a Javascript/Ajax Request , we will need more info

Try this.
Open your javascript console and check for "javascript errors"

open 
app/Plugin/phkapa/webroot/js/register_add.js file , go to line 17 
and change function to 
error:function(data, textStatus, error){
                console.log(data.responseText);
                console.log(textStatus);
                console.log(error);
                alert('Error loading data!!');
                $("#LoadProcessData").css('display', 'none');
            },

publish here or send us the outputs

 if you dont have access to your javascript console,  to read  this messages change "console.log" functions to  "alert"  , 

beppe

unread,
Jun 7, 2013, 3:42:12 AM6/7/13
to phk...@googlegroups.com

Hi,
this is the response on console

Error: The requested address '/phkapa/register/update_by_process' was not found on this server.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <title></title>
        <link href="/phkapa/favicon.ico" type="image/x-icon" rel="icon" /><link href="/phkapa/favicon.ico" type="image/x-icon" rel="shortcut icon" />
    <link rel="stylesheet" type="text/css" href="/phkapa/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/phkapa/css/text.css" />
    <link rel="stylesheet" type="text/css" href="/phkapa/css/grid.css" />
    <link rel="stylesheet" type="text/css" href="/phkapa/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="/phkapa/css/jquery-ui-theme/jquery-ui-1.8.23.custom.css" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="/phkapa/css/ie6.css" /><![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" href="/phkapa/css/ie.css" /><![endif]-->        <link href='http://fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,700,600,800,900' rel='stylesheet' type='text/css'>
       
       
    <script type="text/javascript" src="/phkapa/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/phkapa/js/jquery-ui-1.8.23.custom.min.js"></script>
    <script type="text/javascript" src="/phkapa/js/jquery-cookie.js"></script>
    <script type="text/javascript" src="/phkapa/js/spin.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                //$('#phkapa').fadeIn(2000);
                $('#mainContainer').fadeIn(1000);
                if (!$.cookie('appMaintenance')){
                    $('#maintenanceMessage').fadeIn(2000);
                }
                $('#maintenanceMessage').click(function(){
                    $.cookie('appMaintenance','foo');
                    $('#maintenanceMessage').fadeOut(2000);
                })
                $("a").each(function(){
                    var onClickEval=$(this).attr('onclick');
                    if (/confirm/i.test(onClickEval)){
                        //console.log(onClickEval);
                        $(this).attr('onClickEval',onClickEval);
                        $(this).removeAttr('onclick');
                        $(this).bind('click', function (e) {
                            var evalString=$(this).attr('onClickEval');
                            evalString=evalString.match(/'.*'/);
                            result = confirm (evalString);
                            //console.log(e.result);
                            return result;
                        });
                    } 
                   
                });
               
                var opts = {
                    lines: 8, // The number of lines to draw
                    length: 11, // The length of each line
                    width: 3, // The line thickness
                    radius: 6, // The radius of the inner circle
                    color: '#00aeef', // #rgb or #rrggbb
                    speed: 1, // Rounds per second
                    trail: 54, // Afterglow percentage
                    shadow: false // Whether to render a shadow
                };
                var target = document.getElementById('loading-indicator');
                $("a").bind('click', function (e) {
                    //console.log(e.result);
                    if (e.result==false) return false;
                    if (this.id=='setTodaysDate') return;
                    if (this.id=='toggle-admin-actions') return;
                    if (this.id=='toggle-related-records') return;
                    if (this.target=='_blank') return true;
                    $("#mainContainer div, h2").slice(4).hide();
                    var spinner = new Spinner(opts).spin(target);
                    $("#loading-indicator").show();
                    return true;
                });
               
               
                $("form").submit(function () {
                    var frmAction=$(this).attr('action');
                    if (/export/i.test(frmAction)){ return true;}
                    $("#mainContainer div, h2").slice(4).hide();
                    var spinner = new Spinner(opts).spin(target);
                    $("#loading-indicator").show();
                    return true;
                   
                });
               
                $("input:submit").button();
               
                $("#actions").accordion({
                    collapsible: true,
                    active: false
                });
               
                $("#related").accordion({
                    collapsible: true,
                    autoHeight: false,
                    active: 0
                       
                });
                $("#related-action").accordion({
                    collapsible: true,
                    autoHeight: false,
                    active: 0
                       
                });
               
               
               
            });
        </script>
    </head>
    <body>
        <div id="phkapa" ><!--img src="/img/PHKAPA_small.png" alt="PHKAPA"  --></div>
        <div id="header">
            <h1><a href="/phkapa/" class="zoom" target="_self"><img src="/phkapa/img/PHKAPAlogo2.png" alt="PHKAPA" /></a></h1>
        </div>

        <div id="header_separator">
                            <div style="width:99%; text-align: right;color: #FFFFFF; padding-top: 5px;">
                    User: giuseppe_phkapa ...<a href="/phkapa/users/logout" style="color:#fff;" class="menuitem" target="_self">End Session</a></div>
                        </div>
        <div class="clear" style="height: 35px;"></div>
        <div class="container_16" id="mainContainer">
            <!--div class="grid_16">
                <h1 id="branding">
                    <a href="/"></a>
                </h1>
            </div-->
            <div class="clear"></div>
            <div class="grid_16">
                                <div class="block" id="admin-left-menu">
    <ul class="section menu">
        
    </ul>
</div>            </div>
                        <div id="loading-indicator"></div>
            <div class="clear" style="height: 10px; width: 100%;"></div>
                                                <h2>Not Found</h2>
<p class="error">
    <strong>Error: </strong>
    The requested address <strong>'/phkapa/register/update_by_process'</strong> was not found on this server.</p>
            <div class="clear"></div>
        </div>

            </body>
</html>

pHAlkaline

unread,
Jun 7, 2013, 6:35:58 AM6/7/13
to phk...@googlegroups.com
this is due to this line ->   url:"/phkpa/register/update_by_process" and the pretty url system on CakePHP framework , 
change this line to  url:"{YOURCOMPLETEPHKAPAURL}/phkapa/register/update_by_process" here {YOURCOMPLETEPHKAPAURL} is your PHKAPA URL --- for example http://localhost/kapaapplication 

or 
update your app/Plugin/phkapa/webroot/js/register_add.js file to

$(function(){
    
    $("#TicketProcessId").live("change", function (event) {
        //$("#TicketProcessChange").val('1');
        $("#LoadProcessData").css('display', 'inline');
        $('#TicketActivityId').children().filter(function() {
            return this.value !== "";
        }).remove();
        $('#TicketCategoryId').children().filter(function() {
            return this.value !== "";
        }).remove();
        //$('#TicketActivityId').attr("disabled", "disabled");
        //$('#TicketCategoryId').attr("disabled", "disabled");
        var href = $(location).attr('href');
var PHKAPAurl = href.replace("phkapa/register/add", "");
        //console.log(x);
                
$.ajax({
            data:$("#TicketProcessId").closest("form").serialize(),
            dataType:"html",
            success:function (data, textStatus) {
                $("#LoadProcessData").css('display', 'none');
                $("#ProcessData").html(data);
            },
            error:function(data, textStatus, error){
                //console.log(data.responseText);
                //console.log(textStatus);
                //console.log(error);
                alert('Error loading data!!');
                $("#LoadProcessData").css('display', 'none');
            },
            type:"post",
            url:PHKAPAurl+"phkapa/register/update_by_process"
        });
        return false;
    });
    
    $("#setTodaysDate").click(function() {
        var myDate = new Date();
        var month = myDate.getMonth()+1;
        //alert(("0" + month).slice(-2));
        $("#TicketOriginDateYear").val(myDate.getFullYear());
        $("#TicketOriginDateMonth").val(("0" + month).slice(-2));
        $("#TicketOriginDateDay").val(("0" + myDate.getDate()).slice(-2));
        return false;
    });

/* $("#dialog-message").dialog({
        modal: true,
        height: 530,
        width: 500,
        autoOpen: false,
        buttons: {
            Ok: function() {
                $( this ).dialog( "close" );
            }
        }
    }); */

   

});


Quinta-feira, 6 de Junho de 2013 16:36:56 UTC+1, beppe escreveu:

beppe

unread,
Jun 7, 2013, 8:47:29 AM6/7/13
to phk...@googlegroups.com

Hi,
thanks very much, now works fine.
Now I be able to start to play with your very nice application
all the best
Reply all
Reply to author
Forward
0 new messages