[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] tts newticket.php
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] tts newticket.php |
Date: |
Wed, 27 Dec 2006 00:44:04 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: tts
Changes by: Dave Hall <skwashd> 06/12/27 00:44:04
Removed files:
. : newticket.php
Log message:
remove uneeded file
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/tts/newticket.php?cvsroot=phpgroupware&r1=1.36&r2=0
Patches:
Index: newticket.php
===================================================================
RCS file: newticket.php
diff -N newticket.php
--- newticket.php 14 Oct 2006 05:39:41 -0000 1.36
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,326 +0,0 @@
- <?php
- /**
- * Trouble Ticket System
- *
- * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc.
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @package tts
- * @version $Id: newticket.php,v 1.36 2006/10/14 05:39:41 skwashd Exp $
- */
-
- $GLOBALS['phpgw_info']['flags'] = array
- (
-
'currentapp' => 'tts',
-
'app_section' => 'create new ticket',
-
'enable_send_class' => True,
-
'enable_config_class' => True,
-
'enable_categories_class' => True,
-
'enable_vfs_class' => True,
-
'enable_javascript' => True,
-
'enable_jscalendar_class' => True,
-
'css' => '@import url(css/base.css);',
-
'java_script' => get_js()
- );
-
- $submit =& $_POST['submit'];
- $cancel =& $_POST['cancel'];
- if ( $submit || $cancel )
- {
- $GLOBALS['phpgw_info']['flags'] += array
-
(
-
'noheader' => True,
-
'nonavbar' => True
-
);
- }
-
-
- /**
- * Include phpgroupware header
- */
- include('../header.inc.php');
-
- if($cancel)
- {
- $GLOBALS['phpgw']->redirect_link('/tts/index.php');
- }
-
- $GLOBALS['phpgw']->config->read_repository();
-
- if($submit)
- {
- $deadline =
$GLOBALS['phpgw']->jscalendar->input2date($_POST['ticket']['deadline']);
- $sql = $GLOBALS['phpgw']->db->adodb->Prepare('INSERT INTO
phpgw_tts_tickets('
- . ' ticket_group,'
- . ' ticket_priority,'
- . ' ticket_owner,'
- . ' ticket_assignedto,'
- . ' ticket_subject,'
- . ' ticket_category,'
- . ' ticket_billable_hours,'
- . ' ticket_billable_rate,'
- . ' ticket_status,'
- . ' ticket_deadline,'
- . ' ticket_effort,'
- . ' ticket_type,'
- . ' ticket_details,'
- . ' ticket_lastmod'
- . ' ticket_lastmod_user)'
- . ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?)');
-
- $params = array
- (
- (int) $_POST['ticket']['group'],
- (int)
$_POST['ticket']['priority'],
- (int)
$_POST['ticket']['reported_by'],
- (int)
$_POST['ticket']['assignedto'],
- "'" .
$GLOBALS['phpgw']->db->db_addslashes($_POST['ticket']['subject']) . "'",
- (int)
$_POST['ticket']['category'],
- (float)
$_POST['ticket']['billable_hour'],
- (float)
$_POST['ticket']['billable_rate'],
- 0,
- $deadline['raw'],
- "'" .
$GLOBALS['phpgw']->db->db_addslashes($_POST['ticket']['effort']) . "'",
-
(isset($_POST['ticket']['type']) ? (int) $_POST['ticket']['type'] : 0),
- "'" .
$GLOBALS['phpgw']->db->db_addslashes($_POST['ticket']['details']) . "'",
- time(),
- (int)
$GLOBALS['phpgw_info']['user']['account_id']
- );
-
- $GLOBALS['phpgw']->db->adodb->Execute($sql, $params);
- $ticket_id = $GLOBALS['phpgw']->db->adodb->Insert_ID();
-
- $historylog = createobject('phpgwapi.historylog','tts');
- $historylog->add('O',$ticket_id,' ','');
-
- //File-Upload
- if ( isset($_FILES['attachment']['name'])
- && $_FILES['attachment']['name'] != '')
- {
- $basedir = "{$GLOBALS['phpgw']->vfs->basedir}/tts";
- //Check if tts directory exists. If not, we create it
- if (!file_exists($basedir))
- {
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->mkdir (array (
- 'string' => $basedir,
- 'relatives' => array
(RELATIVE_ALL)));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
- }
-
- $tid = $ticket_id =
$phpgw->db->get_last_insert_id('phpgw_tts_tickets','ticket_id');
- $attdir = "{$basedir}/{$tid}";
-
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->mkdir (array (
- 'string' => $attdir,
- 'relatives' => array
(RELATIVE_ALL)));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
-
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->cp(array (
- 'from' =>
$_FILES['attachment']['tmp_name'],
- 'to' => $attdir . '/' .
$_FILES['attachment']['name'],
- 'relatives' => array
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
-
- }
-
- if($GLOBALS['phpgw']->config->config_data['mailnotification'])
- {
- mail_ticket($ticket_id);
- }
-
- $GLOBALS['phpgw']->redirect_link('/tts/viewticket_details.php',
array('ticket_id' => $ticket_id) );
- }
-
- $account_selected = array();
- $entry_selected = array();
- $priority_selected = array();
- $priority_comment = array();
-
- if(!$submit)
- {
- $GLOBALS['phpgw']->preferences->read_repository();
-
- /*
-
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault'])
- {
-
$entry_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault']]
= ' selected';
- }
-
-
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault'])
- {
-
$account_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault']]
= ' selected';
- }
-
-
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault'])
- {
-
$priority_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault']]
= ' selected';
- }
- */
- $GLOBALS['phpgw']->template->set_file('newticket',
'newticket.tpl');
-
- $GLOBALS['phpgw']->template->set_block('newticket',
'assignedto_option', 'assignedto_options');
- $GLOBALS['phpgw']->template->set_block('newticket',
'options_select');
- $GLOBALS['phpgw']->template->set_block('newticket',
'reported_by', 'reported_bys');
- $GLOBALS['phpgw']->template->set_block('newticket',
'reported_via', 'reported_vias');
- $GLOBALS['phpgw']->template->set_block('newticket',
'ticket_priority', 'ticket_priorities');
- $GLOBALS['phpgw']->template->set_block('newticket', 'form');
-
- $GLOBALS['phpgw']->template->set_var('currency',
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency']);
- $GLOBALS['phpgw']->template->set_var('form_action',
$GLOBALS['phpgw']->link('/tts/newticket.php'));
-
- $GLOBALS['phpgw']->template->set_var('img_cancel',
$GLOBALS['phpgw']->common->image('tts', 'stock_cancel', '.png', False) );
- $GLOBALS['phpgw']->template->set_var('img_help',
$GLOBALS['phpgw']->common->image('tts', 'stock_help', '.png', False) );
- $GLOBALS['phpgw']->template->set_var('img_ok',
$GLOBALS['phpgw']->common->image('tts', 'stock_ok', '.png', False) );
-
- $GLOBALS['phpgw']->template->set_var('lang_addticket',
lang('Add Ticket'));
-
$GLOBALS['phpgw']->template->set_var('lang_assignedto',lang('Assign to'));
-
$GLOBALS['phpgw']->template->set_var('lang_attachment',lang('Attachment'));
-
$GLOBALS['phpgw']->template->set_var('lang_billable_hours',lang('Billable
hours'));
-
$GLOBALS['phpgw']->template->set_var('lang_billable_hours_rate',lang('Billable
hours rate'));
-
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel'));
-
$GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
- $GLOBALS['phpgw']->template->set_var('lang_clearform',
lang('Clear Form'));
-
$GLOBALS['phpgw']->template->set_var('lang_create_new_ticket',lang('Create new
ticket'));
-
$GLOBALS['phpgw']->template->set_var('lang_deadline',lang('Deadline'));
- $GLOBALS['phpgw']->template->set_var('lang_details',
lang('Details'));
-
$GLOBALS['phpgw']->template->set_var('lang_effort',lang('Effort'));
- $GLOBALS['phpgw']->template->set_var('lang_group',
lang('Group'));
- $GLOBALS['phpgw']->template->set_var('lang_help', lang('help'));
- $GLOBALS['phpgw']->template->set_var('lang_highest',
lang('Highest'));
- $GLOBALS['phpgw']->template->set_var('lang_lowest',
lang('Lowest'));
- $GLOBALS['phpgw']->template->set_var('lang_medium',
lang('Medium'));
- $GLOBALS['phpgw']->template->set_var('lang_nosubject', lang('No
subject'));
- $GLOBALS['phpgw']->template->set_var('lang_ok', lang('ok') );
-
$GLOBALS['phpgw']->template->set_var('lang_platform',lang('Platform'));
- $GLOBALS['phpgw']->template->set_var('lang_priority',
lang('Priority'));
- $GLOBALS['phpgw']->template->set_var('lang_reported_by',
lang('reported by'));
- $GLOBALS['phpgw']->template->set_var('lang_reported_note',
lang('reported note'));
- $GLOBALS['phpgw']->template->set_var('lang_reported_via',
lang('reported via'));
- $GLOBALS['phpgw']->template->set_var('lang_subject',
lang('Subject') );
-
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
- $GLOBALS['phpgw']->template->set_var('lang_type',lang('Type'));
-
-
$GLOBALS['phpgw']->template->set_var('value_billable_hours_rate',($ticket['billable_rate']?$ticket['billable_rate']:'0.00'));
-
$GLOBALS['phpgw']->template->set_var('value_billable_hours',($ticket['billable_hours']?$ticket['billable_hours']:'0.00'));
- $GLOBALS['phpgw']->template->set_var('value_details',
$ticket['details']); // check this line
- $GLOBALS['phpgw']->template->set_var('value_subject',
$ticket['details']); // check this line
-
- unset($s);
- $groups = CreateObject('phpgwapi.accounts');
- $group_list = array();
- $group_list =
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
-
- foreach ( $group_list as $key => $entry )
- {
-
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault'] ==
$entry['account_id'])
- {
- $selected = 'selected="selected"';
- }
- else
- {
- $selected = '';
- }
- $s .= '<option value="' . $entry['account_id'] . '" ' .
$selected
- . '>' . $entry['account_name'] . '</option>';
- }
- $GLOBALS['phpgw']->template->set_var('options_group', $s);
-
- foreach (
ExecMethod('phpgwapi.contacts.get_contact_comm_descr') as $comm_descr )
- {
- $GLOBALS['phpgw']->template->set_var(
-
array
-
(
-
'via_id' => $comm_descr['comm_descr_id'],
-
'via_text' => $comm_descr['comm_description'],
-
));
-
$GLOBALS['phpgw']->template->parse('reported_vias', 'reported_via', true);
- }
-
- $GLOBALS['phpgw']->template->set_var('ticket_deadline',
$GLOBALS['phpgw']->jscalendar->input('ticket_deadline', $ticket['deadline']));
-
- $GLOBALS['phpgw']->template->set_var('value_cat_top',
$GLOBALS['phpgw']->categories->formated_list('select', 'mains', $group, False));
-
- unset($s);
- $accounts = $groups;
- $accounts->account_id = $group_id;
-
- $tts_users =
$GLOBALS['phpgw']->acl->get_ids_for_location('run', 1, 'tts');
-
-
- $GLOBALS['phpgw']->template->set_var(array
-
(
-
'acct_id' => 0,
-
'acct_name' => lang('please select')
-
)
-
);
- $GLOBALS['phpgw']->template->parse('reported_bys',
'reported_by', true);
-
- $account_list = $accounts->get_list('accounts', -1,
'account_firstname');
- foreach ( $account_list as $key => $entry )
- {
-
$GLOBALS['phpgw']->accounts->get_account_name($entry['account_id'],$lid,$fname,$lname);
- if(!$fname && !$lname)
- {
- continue;
- }
-
- $GLOBALS['phpgw']->template->set_var(array
-
(
-
'acct_id' => $entry['account_id'],
-
'acct_name' =>
$GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
-
)
-
);
- $GLOBALS['phpgw']->template->parse('reported_bys',
'reported_by', true);
-
- if( in_array($entry['account_id'], $tts_users) )
- {
- $employees_list[$entry['account_id']] =
$GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname);
-
- if(count($employees_list))
- {
- asort($employees_list);
- reset($employees_list);
- }
- }
- }
-
- // Choose the correct priority to display
- $prority_selected[$ticket['priority']] = ' selected';
- $priority_comment[1] = ' - ' . lang('Lowest');
- $priority_comment[5] = ' - ' . lang('Medium');
- $priority_comment[10] = ' - ' . lang('Highest');
- for($i = 1; $i <= 10; ++$i)
- {
-
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault'] ==
$i)
- {
-
$GLOBALS['phpgw']->template->set_var('priority_selected',
'selected="selected"');
- }
- else
- {
-
$GLOBALS['phpgw']->template->set_var('priority_selected', '');
- }
-
- $GLOBALS['phpgw']->template->set_var(array
-
(
-
'priority_val' => $i,
-
'priority_text' => strval($i) . (
isset($priority_comment[$i]) ? $priority_comment[$i] : '')
-
)
-
);
- $GLOBALS['phpgw']->template->parse('ticket_priorities',
'ticket_priority', true);
- }
-
- $GLOBALS['phpgw']->template->set_var('tts_select_options','');
- $GLOBALS['phpgw']->template->set_var('tts_new_lstcategory','');
- $GLOBALS['phpgw']->template->set_var('tts_new_lstassignto','');
-
- $GLOBALS['phpgw']->template->pfp('out','form');
- $GLOBALS['phpgw']->common->phpgw_footer();
- }
-
- function get_js()
- {
- return '\{\};';
- }
-?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] tts newticket.php,
Dave Hall <=