Hilfe bei Ticketsystem

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Hilfe bei Ticketsystem

    Hi,
    Also ich bastel gerade ein Ticketsystem für das Wbb.
    Ich habe gerade die Formklasse vom Formular erstellt, aber irgendwie sagt er mir immer ich hätte einen Syntaxerror.
    Hoffe ihr könnt mir helfen.
    Bitte nicht auf Code achten, ist sehr unsauber und teils sogar unvollständig bzw. falsch ^^

    PHP Parse error: syntax error, unexpected '}', expecting T_CATCH in C:\xampp\htdocs\wbb31\wcf\lib\form\TicketAddForm.class.php on line 51


    Quellcode

    1. <?php
    2. // WCF imports
    3. require_once(WCF_DIR.'lib/form/MessageForm.class.php');
    4. /**
    5. *
    6. *
    7. * @package de.zumarta.ts
    8. * @author Zumarta
    9. * @copyright Zumarta.de
    10. */
    11. class TicketAddForm extends MessageForm {
    12. public $templateName = 'TicketAdd';
    13. public $title;
    14. public $text;
    15. public $showAttachments = true;
    16. public $attachmentsEditor;
    17. /**
    18. * @see Form::readFormParameters()
    19. */
    20. public function readFormParameters() {
    21. parent::readFormParameters();
    22. // Eingabe Auslesen
    23. if (isset($_POST['title'])) $this->title = StringUtil::trim($_POST['title']);
    24. if (isset($_POST['text'])) $this->text = StringUtil::trim($_POST['text']);
    25. }
    26. /**
    27. * @see Form::submit()
    28. */
    29. public function submit() {
    30. // call submit event
    31. EventHandler::fireAction($this, 'submit');
    32. $this->readFormParameters();
    33. try {
    34. // attachment handling
    35. if ($this->showAttachments) {
    36. $this->attachmentListEditor->handleRequest();
    37. }
    38. // send message or save as draft
    39. if ($this->send) {
    40. $this->validate();
    41. // no errors
    42. $this->save();
    43. }
    44. }
    45. }
    46. /**
    47. * @see Form::save()
    48. */
    49. public function save() {
    50. parent::save();
    51. $timestamp = time();
    52. $sql = "INSERT INTO `ts".WCF_N."_tickets` (`title`, `description`)
    53. VALUES ('".escapeString($this->title)."',
    54. '".escapeString($this->text)."',
    55. '".intval($licence['ID'])."',
    56. '".escapeString($this->data)."',
    57. '".WCF::getUser()->userID."',
    58. '0',
    59. '0',
    60. '2',
    61. '".$timestamp."')";
    62. WCF::getDB()->sendQuery($sql);
    63. HeaderUtil::redirect('index.php?page=ViewTicket&dataID='.WCF::getDB()->getInsertID().SID_ARG_2ND);
    64. /**
    65. * @see Page::show()
    66. */
    67. public function show() {
    68. parent::show();
    69. }
    70. }
    71. }
    72. ?>
    Alles anzeigen


    Ich werde bestimmt noch viele Fragen bezüglich des Ticketsystems haben. ^^

    Fehlermeldung vergessen^^
  • Hey,

    wenn du etwas versuchst musst du das versuchte auch auswerten ;)

    Quellcode

    1. try {
    2. // attachment handling
    3. if ($this->showAttachments) {
    4. $this->attachmentListEditor->handleRequest();
    5. }
    6. // send message or save as draft
    7. if ($this->send) {
    8. $this->validate();
    9. // no errors
    10. $this->save();
    11. }
    12. }
    13. catch (Exception $ausnahme) {
    14. //eine ausnahme
    15. }
    Alles anzeigen



    Hier ein Gutes Tutorial dazu.


    Gruß,
    Erasel
    My lovely mister singing club...
  • Quellcode

    1. /**
    2. * @see Page::show()
    3. */
    4. public function show() {
    5. require_once(WCF_DIR.'lib/page/util/menu/PageMenu.class.php');
    6. PageMenu::setActiveMenuItem('wcf.header.menu.ticket');
    7. $this->getAttachmentsEditor();
    8. parent::show();
    9. }
    10. public function getAttachmentsEditor(){
    11. if ($this->showAttachments) {
    12. require_once(WCF_DIR.'lib/data/message/attachment/AttachmentsEditor.class.php');
    13. $this->attachmentsEditor = new AttachmentsEditor(isset($this->articleID) ? $this->articleID : 0, 'article', 2000000, 'png\ngif', 3);
    14. }
    15. }
    16. }
    Alles anzeigen


    Jetzt scheint hier ein Fehler zu sein, habe noch eine Methode hinzugefügt, was die Dateianhänge dann später noch brauchen^^