From 9a89c0d90eb68a4e14f2a195bb51fc4434df30dd Mon Sep 17 00:00:00 2001 From: Quitta Date: Sat, 6 Jul 2013 19:12:55 +0200 Subject: [PATCH] woops forgot to add those in last update, also loading all categories from the db works now --- .../ams_lib/autoload/ticket_category.php | 18 +++++- .../ryzom_ams/www/html/inc/createticket.php | 14 +++++ .../www/html/templates/createticket.tpl | 59 +++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/templates/createticket.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php index 0736282c9..ec4956097 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php @@ -25,9 +25,24 @@ class Ticket_Category{ $instance = new self($db_data); $instance->setTCategoryId($id); return $instance; - } + //returns list of all category objects + public static function getAllCategories($db_data) { + $dbl = new DBLayer($db_data); + $statement = $dbl->executeWithoutParams("SELECT * FROM ticket_category"); + $row = $statement->fetchAll(); + $result = Array(); + foreach($row as $category){ + $instance = new self($db_data); + $instance->tCategoryId = $category['TCategoryId']; + $instance->name = $category['Name']; + $result[] = $instance; + } + return $result; + } + + //return constructed element based on TCategoryId public function load_With_TCategoryId( $id) { $dbl = new DBLayer($this->db); @@ -37,6 +52,7 @@ class Ticket_Category{ $this->name = $row['Name']; } + //update private data to DB. public function update(){ $dbl = new DBLayer($this->db); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php new file mode 100644 index 000000000..4f83b4631 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php @@ -0,0 +1,14 @@ +getTCategoryId()] = $catObj->getName(); + } + //print_r($result); + return $result; +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/createticket.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/createticket.tpl new file mode 100644 index 000000000..eb0fb45f1 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/createticket.tpl @@ -0,0 +1,59 @@ +{block name=content} +
+
+
+

Create a new Ticket

+
+ + +
+
+
+
+
+ New ticket + +
+ +
+
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+
+
+ + + +
+ +
+ +
+
+
+
+
+
+
+{/block} +