[otrs] Core.AJAX.FormUpdate problem

2016-03-23 Thread Finetti, Stefano
Hi, I'm trying to use some of the advanced features of Json/Ajax on OTRS 5.
Basically I'd like to update the content of a form when changing the value
of an element of the same form, like when you select a queue in a new
ticket creation form.

My code is here:

[% WRAPPER JSOnDocumentComplete %]

//

[% END %]


where SystemSelection is the select control in the template, AJAXUpdate is
the subaction i created in the .pm file and CompanySelection is the control
that should be updated (I need to launch a db query using the value
obtained from SystemSelection as a WHERE condition to get values to
populate the CompanySelection control).


Now, every time I try to use that selection, I get this:

[ERROR] CommunicationError: Error during AJAX communication. Status:
parsererror, Error: SyntaxError: JSON.parse: unexpected character at line 1
column 1 of the JSON data

The perl module is never recalled with the new subaction. If I remove the
Formupdate function and put a stupid window.alert box with the
SystemSelection.value, I get the right value.

I don't think it's something in the .pm file, since I've also tried to
completely remove ANY Json code from the file and just see if the subaction
is called, and it isn't.

Any hint?

-- 
*Lynx International Srl*
*Stefano Finetti*
*http://www.lynx-international.com *

*Lynx International Srl is a part of AXED Group*
Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina

-- 
This e-mail and any files transmitted contain documentation which is highly 
confidential and intended solely for the use of the individual or entity to 
whom they are addressed. All written data and other information in the 
documentation is and shall remain the property of the disclosing party. If 
you are not the intended recipient you are hereby formally notified that 
any disclosure, dissemination, forwarding, storing, copying or use of any 
of the information is strictly prohibited and will be legally pursued. If 
you received this in error, please contact the sender and destroy the 
documentation including deletion of the same from any computer. Thank you.
-
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Re: [otrs] Core.AJAX.FormUpdate problem

2016-03-23 Thread Finetti, Stefano
After further investigating, I've noticed that Subaction is not passed to
the .pm file when the event change() occur. Thus, the .pm file answer is
not a Json answer and this triggers the parser error.

What I  don't understand is why FormUpdate does not send the Subaction
param to the pm file...



2016-03-23 8:54 GMT+01:00 Finetti, Stefano 
:

> Hi, I'm trying to use some of the advanced features of Json/Ajax on OTRS 5.
> Basically I'd like to update the content of a form when changing the value
> of an element of the same form, like when you select a queue in a new
> ticket creation form.
>
> My code is here:
>
> [% WRAPPER JSOnDocumentComplete %]
>
> //
> $('#SystemSelection').bind('change', function (Event) {
>
> Core.AJAX.FormUpdate($('#AS400Company'), 'AJAXUpdate', 'SystemSelection',
> [ 'CompanySelection' ] );
>
> }
>
> );
>
> //]]>
>
> [% END %]
>
>
> where SystemSelection is the select control in the template, AJAXUpdate is
> the subaction i created in the .pm file and CompanySelection is the control
> that should be updated (I need to launch a db query using the value
> obtained from SystemSelection as a WHERE condition to get values to
> populate the CompanySelection control).
>
>
> Now, every time I try to use that selection, I get this:
>
> [ERROR] CommunicationError: Error during AJAX communication. Status:
> parsererror, Error: SyntaxError: JSON.parse: unexpected character at line 1
> column 1 of the JSON data
>
> The perl module is never recalled with the new subaction. If I remove the
> Formupdate function and put a stupid window.alert box with the
> SystemSelection.value, I get the right value.
>
> I don't think it's something in the .pm file, since I've also tried to
> completely remove ANY Json code from the file and just see if the subaction
> is called, and it isn't.
>
> Any hint?
>
> --
> *Lynx International Srl*
> *Stefano Finetti*
> *http://www.lynx-international.com *
>
> *Lynx International Srl is a part of AXED Group*
> Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina
>
>


-- 
*Lynx International Srl*
*Stefano Finetti*
*http://www.lynx-international.com *

*Lynx International Srl is a part of AXED Group*
Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina

-- 
This e-mail and any files transmitted contain documentation which is highly 
confidential and intended solely for the use of the individual or entity to 
whom they are addressed. All written data and other information in the 
documentation is and shall remain the property of the disclosing party. If 
you are not the intended recipient you are hereby formally notified that 
any disclosure, dissemination, forwarding, storing, copying or use of any 
of the information is strictly prohibited and will be legally pursued. If 
you received this in error, please contact the sender and destroy the 
documentation including deletion of the same from any computer. Thank you.
-
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

[otrs] Ticket delete in OTRS 4 and OTRS 5

2016-03-23 Thread Úr Balázs
Hi,

There is a command line tool in OTRS 4 for deleting tickets:

otrs.TicketDelete.pl - delete tickets by number.
Copyright (C) 2001-2016 OTRS AG, http://otrs.com/

Usage: otrs.TicketDelete.pl [options]

  Options are as follows:
  --help display this option help
  --TicketNumber no1 no2 no3 delete listed tickets (by ticket number)
  --TicketID no1 no2 no3 delete listed tickets (by ticket id)

$ perl otrs.TicketDelete.pl  --TicketNumber 201512061616 201602011615
Deleting specified tickets...
2 tickets have been deleted.


In OTRS 5 there is also a command line tool to delete tickets:

perl otrs.Console.pl Maint::Ticket::Delete --help

Delete one or more tickets.

Usage:
 otrs.Console.pl Maint::Ticket::Delete [--ticket-number ...(+)]
[--ticket-id ...(+)]

Options:
 [--ticket-number ...(+)]   - Specify one or more ticket numbers
of tickets to be deleted.
 [--ticket-id ...(+)]   - Specify one or more ticket ids of
tickets to be deleted.
 [--help]   - Display help for this command.
 [--no-ansi]- Do not perform ANSI terminal output coloring.
 [--quiet]  - Suppress informative output, only
retain error messages.


This is not work:
perl otrs.Console.pl Maint::Ticket::Delete --ticket-number
201603234418 201602264441
Error: found unknown arguments on the command line ('201602264441').

But this works:
perl otrs.Console.pl Maint::Ticket::Delete --ticket-number
201603234418 --ticket-number 201602264441
Deleting tickets...
  8
  5
2 tickets have been deleted.

Why is it neccessary to set --ticket-number several times? Why doesn't
work with a list of ticket numbers separated by space or something
other separator?

Regards,
Balázs
-
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Re: [otrs] Ticket delete in OTRS 4 and OTRS 5

2016-03-23 Thread Martin Gruner
Hello Ur,

because those are »options« and not »positional arguments«. This allows to 
specify multiple TicketIDs and TicketNumbers on the same commandline.

Martin Gruner
Team Lead R&D

OTRS AG
Bahnhofplatz 1a
94315 Straubing

T: +49 (0)6172 681988 0
F: +49 (0)9421 56818 18
I:  www.otrs.com/

Geschäftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt-Nr.: 
DE256610065
Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann 
(Vorsitzender), Christopher Kuhn, Sabine Riedel

Mobile Kommunikation und transparente Prozesse - Mit der OTRS Business 
Solution™ Managed 5 schnell und ohne eigene IT-Ressourcen starten  - Jetzt neue 
Features entdecken und bestellen
https://www.otrs.com/neu-in-otrs-business-solution-5-mobile-kommunikation-transparente-prozesse/?lang=de

> Am 23.03.2016 um 12:57 schrieb Úr Balázs :
> 
> Hi,
> 
> There is a command line tool in OTRS 4 for deleting tickets:
> 
> otrs.TicketDelete.pl - delete tickets by number.
> Copyright (C) 2001-2016 OTRS AG, http://otrs.com/
> 
> Usage: otrs.TicketDelete.pl [options]
> 
>  Options are as follows:
>  --help display this option help
>  --TicketNumber no1 no2 no3 delete listed tickets (by ticket number)
>  --TicketID no1 no2 no3 delete listed tickets (by ticket id)
> 
> $ perl otrs.TicketDelete.pl  --TicketNumber 201512061616 201602011615
> Deleting specified tickets...
> 2 tickets have been deleted.
> 
> 
> In OTRS 5 there is also a command line tool to delete tickets:
> 
> perl otrs.Console.pl Maint::Ticket::Delete --help
> 
> Delete one or more tickets.
> 
> Usage:
> otrs.Console.pl Maint::Ticket::Delete [--ticket-number ...(+)]
> [--ticket-id ...(+)]
> 
> Options:
> [--ticket-number ...(+)]   - Specify one or more ticket numbers
> of tickets to be deleted.
> [--ticket-id ...(+)]   - Specify one or more ticket ids of
> tickets to be deleted.
> [--help]   - Display help for this command.
> [--no-ansi]- Do not perform ANSI terminal output coloring.
> [--quiet]  - Suppress informative output, only
> retain error messages.
> 
> 
> This is not work:
> perl otrs.Console.pl Maint::Ticket::Delete --ticket-number
> 201603234418 201602264441
> Error: found unknown arguments on the command line ('201602264441').
> 
> But this works:
> perl otrs.Console.pl Maint::Ticket::Delete --ticket-number
> 201603234418 --ticket-number 201602264441
> Deleting tickets...
>  8
>  5
> 2 tickets have been deleted.
> 
> Why is it neccessary to set --ticket-number several times? Why doesn't
> work with a list of ticket numbers separated by space or something
> other separator?
> 
> Regards,
> Balázs
> -
> OTRS mailing list: otrs - Webpage: http://otrs.org/
> Archive: http://lists.otrs.org/pipermail/otrs
> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

-
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs