Changing customer -> ticket to new formfield - stuff

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-02-12 18:54:44 +01:00
parent abe8446736
commit 382cf45e08
7 changed files with 192 additions and 130 deletions

View File

@@ -247,6 +247,13 @@ elseif($page == 'tickets')
} }
$ticketsopen = (int)$opentickets['count']; $ticketsopen = (int)$opentickets['count'];
$ticket_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ticket/formfield.ticket_add.php';
$ticket_add_form = htmlform::genHTMLForm($ticket_add_data);
$title = $ticket_add_data['ticket_add']['title'];
$image = $ticket_add_data['ticket_add']['image'];
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";"); eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
} }
} }
@@ -360,6 +367,12 @@ elseif($page == 'tickets')
// don't forget the main-ticket! // don't forget the main-ticket!
$ticket_reply_data = include_once dirname(__FILE__).'/lib/formfields/customer/ticket/formfield.ticket_reply.php';
$ticket_reply_form = htmlform::genHTMLForm($ticket_reply_data);
$title = $ticket_reply_data['ticket_reply']['title'];
$image = $ticket_reply_data['ticket_reply']['image'];
eval("echo \"" . getTemplate("ticket/tickets_reply") . "\";"); eval("echo \"" . getTemplate("ticket/tickets_reply") . "\";");
} }
} }

View File

@@ -0,0 +1,50 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ticket_add' => array(
'title' => $lng['ticket']['ticket_new'],
'image' => 'icons/ticket_add.png',
'sections' => array(
'section_a' => array(
'title' => $lng['ticket']['ticket_new'],
'image' => 'icons/ticket_add.png',
'fields' => array(
'subject' => array(
'label' => $lng['ticket']['subject'],
'type' => 'text',
),
'priority' => array(
'label' => $lng['ticket']['priority'],
'type' => 'select',
'select_var' => $priorities,
),
'categories' => array(
'label' => $lng['ticket']['category'],
'type' => 'select',
'select_var' => $categories,
),
'message' => array(
'label' => $lng['ticket']['message'],
'type' => 'textarea',
'rows' => 12,
'cols' => 60,
)
)
)
)
)
);

View File

@@ -0,0 +1,51 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
*/
return array(
'ticket_reply' => array(
'title' => $lng['ticket']['ticket_reply'],
'image' => 'icons/ticket_reply.png',
'sections' => array(
'section_a' => array(
'title' => $lng['ticket']['ticket_reply'],
'image' => 'icons/ticket_reply.png',
'fields' => array(
'subject' => array(
'label' => $lng['ticket']['subject'],
'type' => 'text',
'value' => "Re: $subject",
),
'priority' => array(
'label' => $lng['ticket']['priority'],
'type' => 'select',
'select_var' => $priorities,
),
'category' => array(
'label' => $lng['ticket']['category'],
'type' => 'label',
'value' => $row['name'],
),
'message' => array(
'label' => $lng['ticket']['message'],
'type' => 'textarea',
'rows' => 12,
'cols' => 60,
),
)
)
)
)
);

View File

@@ -5,29 +5,9 @@ $header
<input type="hidden" name="action" value="$action" /> <input type="hidden" name="action" value="$action" />
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60"> <table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60">
<tr> <tr>
<td class="maintitle" colspan="2"><b><img src="images/Classic/title.gif" alt="" />&nbsp;{$lng['ticket']['ticket_new']}</b></td> <td class="maintitle" colspan="2"><b><img src="images/Classic/title.gif" alt="" />&nbsp;{$title}</b></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['subject']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="subject" maxlength="70" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['priority']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="priority">$priorities</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['category']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="category">$categories</select></td>
</tr>
<tr>
<td class="main_field_name" colspan="2">{$lng['ticket']['message']}:</td>
</tr>
<tr>
<td class="main_field_display" colspan="2"><textarea class="textarea_border" rows="12" cols="60" name="message"></textarea></td>
</tr>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['ticket']['ticket_new']}" /></td>
</tr> </tr>
{$ticket_add_form}
</table> </table>
</form> </form>
<br /> <br />

View File

@@ -10,29 +10,9 @@ $header
<if $isclosed < 1 > <if $isclosed < 1 >
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60"> <table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60">
<tr> <tr>
<td class="maintitle" colspan="2"><b><img src="images/Classic/title.gif" alt="" />&nbsp;{$lng['ticket']['ticket_reply']}</b></td> <td class="maintitle" colspan="2"><b><img src="images/Classic/title.gif" alt="" />&nbsp;{$title}</b></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['subject']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="subject" value="Re: {$subject}" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['priority']}:</td>
<td class="main_field_display" nowrap="nowrap"><select name="priority">$priorities</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['category']}:</td>
<td class="main_field_display" nowrap="nowrap">{$row['name']}</td>
</tr>
<tr>
<td class="main_field_name" colspan="2">{$lng['ticket']['message']}:</td>
</tr>
<tr>
<td class="main_field_display" colspan="2"><textarea class="textarea_border" rows="12" cols="60" name="message"></textarea></td>
</tr>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['ticket']['ticket_reply']}" /></td>
</tr> </tr>
{$ticket_reply_form}
</table> </table>
</if> </if>
<if 0 < $isclosed > <if 0 < $isclosed >

View File

@@ -1,35 +1,31 @@
$header $header
<form method="post" action="$filename"> <article>
<header>
<h2>
<img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable">
{$ticket_add_form}
</table>
<p style="display: none;">
<input type="hidden" name="s" value="$s" /> <input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" /> <input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" /> <input type="hidden" name="action" value="$action" />
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60"> <input type="hidden" name="send" value="send" />
<tr> </p>
<td class="maintitle" colspan="2"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['ticket']['ticket_new']}</b></td> </fieldset>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['subject']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="subject" maxlength="70" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['priority']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="priority">$priorities</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['category']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="category">$categories</select></td>
</tr>
<tr>
<td class="main_field_name" colspan="2">{$lng['ticket']['message']}:</td>
</tr>
<tr>
<td class="main_field_display" colspan="2"><textarea class="textarea_border" rows="12" cols="60" name="message"></textarea></td>
</tr>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['ticket']['ticket_new']}" /></td>
</tr>
</table>
</form> </form>
<br />
<br /> </section>
</article>
$footer $footer

View File

@@ -1,51 +1,43 @@
$header $header
<form method="post" action="$filename"> <article>
<input type="hidden" name="s" value="$s" /> <header>
<input type="hidden" name="page" value="$page" /> <h2>
<input type="hidden" name="action" value="$action" /> <img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
<input type="hidden" name="id" value="$id" /> {$title}
</h2>
</header>
<if 0 < $ticket_replies_count > <if 0 < $ticket_replies_count >
<section class="fullform bradiusodd">
$ticket_replies $ticket_replies
</section>
</if> </if>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<if $isclosed < 1 > <if $isclosed < 1 >
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60"> <table class="formtable">
<tr> {$ticket_reply_form}
<td class="maintitle" colspan="2"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['ticket']['ticket_reply']}</b></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['subject']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="subject" value="Re: {$subject}" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['priority']}:</td>
<td class="main_field_display" nowrap="nowrap"><select name="priority">$priorities</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['ticket']['category']}:</td>
<td class="main_field_display" nowrap="nowrap">{$row['name']}</td>
</tr>
<tr>
<td class="main_field_name" colspan="2">{$lng['ticket']['message']}:</td>
</tr>
<tr>
<td class="main_field_display" colspan="2"><textarea class="textarea_border" rows="12" cols="60" name="message"></textarea></td>
</tr>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['ticket']['ticket_reply']}" /></td>
</tr>
</table> </table>
</if> </if>
<if 0 < $isclosed > <if 0 < $isclosed >
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60"> <a href="$filename?page=tickets&amp;action=reopen&amp;id={$id}&amp;s=$s">{$lng['ticket']['ticket_reopen']}</a>
<tr>
<td class="maintitle"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['ticket']['ticket_reopen']}</b></td>
</tr>
<tr>
<td class="main_field_confirm"><a href="$filename?page=tickets&amp;action=reopen&amp;id={$id}&amp;s=$s">{$lng['ticket']['ticket_reopen']}</a></td>
</tr>
</table>
</if> </if>
<p style="display: none;">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="send" value="send" />
<input type="hidden" name="id" value="$id" />
</p>
</fieldset>
</form> </form>
<br />
<br /> </section>
</article>
$footer $footer