[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property inc/class.botts.inc.php inc/class.sott...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property inc/class.botts.inc.php inc/class.sott... |
Date: |
Sun, 29 Oct 2006 20:04:40 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 06/10/29 20:04:40
Modified files:
inc : class.botts.inc.php class.sotts.inc.php
class.uitts.inc.php
setup : default_records.inc.php setup.inc.php
tables_current.inc.php tables_update.inc.php
templates/base : tts.xsl
Added files:
. : login.php
templates/base : login.tpl
Log message:
Enable mapping of groups of tenants to single user for limited access.
Log in as phpgw-user or mapped external user
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.botts.inc.php?cvsroot=phpgroupware&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.sotts.inc.php?cvsroot=phpgroupware&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uitts.inc.php?cvsroot=phpgroupware&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/property/setup/default_records.inc.php?cvsroot=phpgroupware&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/property/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/property/login.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/tts.xsl?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/login.tpl?cvsroot=phpgroupware&rev=1.1
Patches:
Index: inc/class.botts.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.botts.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- inc/class.botts.inc.php 26 Sep 2006 13:46:01 -0000 1.27
+++ inc/class.botts.inc.php 29 Oct 2006 20:04:40 -0000 1.28
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage helpdesk
- * @version $Id: class.botts.inc.php,v 1.27 2006/09/26 13:46:01 sigurdne
Exp $
+ * @version $Id: class.botts.inc.php,v 1.28 2006/10/29 20:04:40 sigurdne
Exp $
*/
/**
@@ -224,7 +224,7 @@
}
- function read($start_date='',$end_date='')
+ function read($start_date='',$end_date='', $external='')
{
$start_date =
$this->bocommon->date_to_timestamp($start_date);
$end_date =
$this->bocommon->date_to_timestamp($end_date);
@@ -232,11 +232,19 @@
$tickets = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'filter' => $this->filter,'cat_id' => $this->cat_id,'district_id' =>
$this->district_id,
'start_date'=>$start_date,'end_date'=>$end_date,
-
'allrows'=>$this->allrows,'user_filter' => $this->user_filter));
+
'allrows'=>$this->allrows,'user_filter' =>
$this->user_filter,'external'=>$external));
$this->total_records = $this->so->total_records;
+ if(!$external)
+ {
$entity = $this->so->get_origin_entity_type();
-
$this->uicols=$this->so->uicols;
+ }
+ else
+ {
+ $entity[0]['type']='project';
+ $this->uicols[] = lang('project');
+ }
+
for ($i=0; $i<count($tickets); $i++)
{
if($tickets[$i]['assignedto'])
Index: inc/class.sotts.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.sotts.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- inc/class.sotts.inc.php 5 Oct 2006 11:33:53 -0000 1.18
+++ inc/class.sotts.inc.php 29 Oct 2006 20:04:40 -0000 1.19
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage helpdesk
- * @version $Id: class.sotts.inc.php,v 1.18 2006/10/05 11:33:53 sigurdne
Exp $
+ * @version $Id: class.sotts.inc.php,v 1.19 2006/10/29 20:04:40 sigurdne
Exp $
*/
/**
@@ -72,6 +72,7 @@
$allrows =
(isset($data['allrows'])?$data['allrows']:'');
$start_date =
(isset($data['start_date'])?$data['start_date']:'');
$end_date =
(isset($data['end_date'])?$data['end_date']:'');
+ $external =
(isset($data['external'])?$data['external']:'');
}
Index: inc/class.uitts.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uitts.inc.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- inc/class.uitts.inc.php 6 Oct 2006 08:56:22 -0000 1.45
+++ inc/class.uitts.inc.php 29 Oct 2006 20:04:40 -0000 1.46
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage helpdesk
- * @version $Id: class.uitts.inc.php,v 1.45 2006/10/06 08:56:22 sigurdne
Exp $
+ * @version $Id: class.uitts.inc.php,v 1.46 2006/10/29 20:04:40 sigurdne
Exp $
*/
/**
@@ -21,14 +21,19 @@
var $public_functions = array
(
'index' => True,
+ 'index2' => True,
'view' => True,
+ 'view2' => True,
'add' => True,
+ 'add2' => True,
'delete' => True,
- 'excel' => True
+ 'excel' => True,
+ 'excel2' => True
);
function uitts()
{
+ $this->tenant_id =
$GLOBALS['phpgw']->session->appsession('tenant_id','property');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
@@ -38,7 +43,8 @@
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
$this->menu =
CreateObject($this->currentapp.'.menu');
- $this->acl =
CreateObject('phpgwapi.acl');
+ // $this->acl =
CreateObject('phpgwapi.acl');
+ $this->acl = &
$GLOBALS['phpgw']->acl;
$this->acl_location = '.ticket';
$this->acl_read =
$this->acl->check('.ticket',1);
$this->acl_add =
$this->acl->check('.ticket',2);
@@ -81,14 +87,24 @@
$this->bo->save_sessiondata($data);
}
+ function excel2()
+ {
+ if(!$this->acl->check('.ticket.external',1))
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=>
'.ticket.external'));
+ }
+
+ $this->excel($external = true);
+ }
+
- function excel()
+ function excel($external='')
{
$start_date = urldecode($this->start_date);
$end_date = urldecode($this->end_date);
$this->bo->allrows = True;
- $list = $this->bo->read($start_date,$end_date);
+ $list =
$this->bo->read($start_date,$end_date,$external);
if (isset($list) AND is_array($list))
{
@@ -549,26 +565,596 @@
'lang_district_statustext' =>
lang('Select the district the selection belongs to. To do not use a district
select NO DISTRICT'),
'select_district_name' =>
'district_id',
- 'lang_user_statustext' =>
lang('Assigned to'),
- 'select_user_name' =>
'user_filter',
- 'lang_no_user' =>
lang('No user'),
- 'user_list' =>
$this->bocommon->get_user_list_right2($group_filters,4,$this->user_filter,$this->acl_location,'',$default='')
+ 'lang_user_statustext' =>
lang('Assigned to'),
+ 'select_user_name' =>
'user_filter',
+ 'lang_no_user' =>
lang('No user'),
+ 'user_list' =>
$this->bocommon->get_user_list_right2($group_filters,4,$this->user_filter,$this->acl_location,'',$default='')
+ );
+
+ $appname =
lang('helpdesk');
+ $function_msg =
lang('list ticket');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+ // $GLOBALS['phpgw']->xslttpl->pp();
+ $this->save_sessiondata();
+ }
+
+ function index2()
+ {
+ if(!$this->acl->check('.ticket.external',1))
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=>
'.ticket.external'));
+ }
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('tts',
+
'menu',
+
'nextmatchs'));
+
+
+ $second_display =
get_var('second_display',array('POST','GET'));
+
+ $default_category =
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district']:'');
+ $default_status =
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status']:'');
+ $start_date = urldecode($this->start_date);
+ $end_date = urldecode($this->end_date);
+
+ if ($default_category && !$second_display &&
!$this->district_id)
+ {
+ $this->bo->district_id = $default_category;
+ $this->district_id =
$default_category;
+ }
+
+ if ($default_status && !$second_display)
+ {
+ $this->bo->filter = $default_status;
+ $this->filter = $default_status;
+ }
+
+ $bgcolor['1'] = '#dadada';
+ $bgcolor['2'] = '#dad0d0';
+ $bgcolor['3'] = '#dacaca';
+ $bgcolor['4'] = '#dac0c0';
+ $bgcolor['5'] = '#dababa';
+ $bgcolor['6'] = '#dab0b0';
+ $bgcolor['7'] = '#daaaaa';
+ $bgcolor['8'] = '#da9090';
+ $bgcolor['9'] = '#da8a8a';
+ $bgcolor['10'] = '#da7a7a';
+
+
+ $links = $this->menu->links();
+
+ $ticket_list =
$this->bo->read($start_date,$end_date,$external=true);
+
+ $uicols=$this->bo->uicols;
+
+//_debug_array($uicols);
+//_debug_array($ticket_list);
+ while (is_array($ticket_list) && list(,$ticket) =
each($ticket_list))
+ {
+ if($ticket['subject'])
+ {
+ $first= $ticket['subject'];
+ }
+ else
+ {
+ $first= $ticket['category'];
+ }
+
+ if ($ticket['status']=='O')
+ {
+ $status = lang('Open');
+ }
+ else
+ {
+ $status = lang('Closed');
+ }
+
+ $content[] = array
+ (
+ 'id'
=> $ticket['id'],
+ 'bgcolor'
=> $bgcolor[$ticket['priority']],
+ 'new_ticket' =>
(isset($ticket['new_ticket'])?$ticket['new_ticket']:''),
+ 'priostr'
=> str_repeat("||", $ticket['priority']),
+ 'first'
=> $first,
+ 'location_code' =>
$ticket['location_code'],
+ 'address'
=> $ticket['address'],
+ 'date'
=> $ticket['timestampopened'],
+ 'finnish_date' =>
$ticket['finnish_date'],
+ 'delay'
=> (isset($ticket['delay'])?$ticket['delay']:''),
+ 'user'
=> $ticket['user'],
+ 'assignedto' =>
$ticket['assignedto'],
+ 'child_date' =>
$ticket['child_date'],
+ 'link_view'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.view2', 'id'=> $ticket['id'])),
+ 'lang_view_statustext' => lang('view
the ticket'),
+ 'text_view'
=> lang('view'),
+ 'status'
=> $status,
+ );
+ }
+
+ $table_header[] = array
+ (
+ 'sort_priority' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'priority',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id'
=>$this->cat_id,
+
'filter'
=>$this->filter,
+
'user_filter'
=>$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query'
=>$this->query,
+
'second_display'
=> true,
+
'allrows'=>$this->allrows,
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date
+
)
+
)),
+
+ 'lang_priority' => lang('Priority'),
+ 'lang_priority_statustext' =>
lang('Sort the tickets by their priority'),
+
+ 'sort_id' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'fm_tts_tickets.id',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id'
=>$this->cat_id,
+
'filter'
=>$this->filter,
+
'user_filter'
=>$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query'
=>$this->query,
+
'second_display'
=> true,
+
'allrows'=>$this->allrows,
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date
+
)
+
)),
+
+ 'lang_id' => lang('ID'),
+ 'lang_id_statustext' => lang('Sort the
tickets by their ID'),
+
+ 'lang_subject' => lang('Subject'),
+ 'lang_time_created' => lang('Started'),
+ 'lang_view' => lang('view'),
+ 'lang_location_code' => lang('Location'),
+ 'lang_address' => lang('Address'),
+ 'lang_user' => lang('user'),
+ 'sort_assigned_to' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'assignedto',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id'
=>$this->cat_id,
+
'filter'
=>$this->filter,
+
'user_filter'
=>$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query'
=>$this->query,
+
'second_display'
=> true,
+
'allrows'=>$this->allrows,
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date
+
)
+
)),
+ 'lang_assigned_to' => lang('Assigned to'),
+ 'sort_opened_by' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'user_lid',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id'
=>$this->cat_id,
+
'filter'
=>$this->filter,
+
'user_filter'
=>$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query'
=>$this->query,
+
'second_display'
=> true,
+
'allrows'=>$this->allrows,
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date
+
)
+
)),
+ 'sort_date' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'fm_tts_tickets.entry_date',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id'
=>$this->cat_id,
+
'filter'
=>$this->filter,
+
'user_filter'
=>$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query'
=>$this->query,
+
'second_display'
=> true,
+
'allrows'=>$this->allrows,
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date
+
)
+
)),
+ 'sort_finnish_date' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'finnish_date',
+
'order' => $this->order,
+
'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+
'cat_id' =>
$this->cat_id,
+
'filter' =>
$this->filter,
+
'user_filter' =>
$this->user_filter,
+
'district_id' =>
$this->district_id,
+
'query' =>
$this->query,
+
'second_display'=> true,
+
'allrows' =>
$this->allrows,
+
'start_date' =>
$start_date,
+
'end_date' =>
$end_date
+
)
+
)),
+ 'lang_finnish_date' => lang('finnish date'),
+ 'lang_delay' => lang('delay'),
+ 'lang_finnish_statustext'=> lang('presumed
finnish date'),
+ 'lang_opened_by' => lang('Opened by'),
+ 'lang_status' => lang('Status')
+ );
+
+ for ($i=0;$i<count($uicols);$i++)
+ {
+ $table_header[0]['extra'][$i]['header'] =
$uicols[$i];
+ }
+
+ $table_add[] = array
+ (
+ 'lang_add' => lang('add'),
+ 'lang_add_statustext' => lang('add a ticket'),
+ 'add_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.add2'))
+ );
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uitts.index2',
+ 'second_display'=> true,
+ 'sort' => $this->sort,
+ 'order' => $this->order,
+ 'cat_id' => $this->cat_id,
+ 'filter' => $this->filter,
+ 'user_filter' => $this->user_filter,
+ 'query' => $this->query,
+ 'district_id' => $this->district_id,
+ 'start_date' => $start_date,
+ 'end_date' => $end_date,
+ 'allrows' => $this->allrows
+ );
+
+ $receipt =
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
+
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+
+ $GLOBALS['phpgw']->preferences->read_repository();
+ $autorefresh ='';
+ if
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval']))
+ {
+ $autorefresh =
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval'].';
URL='.$GLOBALS['phpgw']->link('/index.php',$link_data);
+ }
+
+
+ if(!$this->allrows)
+ {
+ $record_limit =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ }
+ else
+ {
+ $record_limit = $this->bo->total_records;
+ }
+
+
+ $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+ $link_date_search =
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uiproject.date_search'));
+
+ $link_excel = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uitts.excel2',
+ 'second_display' => true,
+ 'sort' => $this->sort,
+ 'order' => $this->order,
+ 'cat_id' =>
$this->cat_id,
+ 'filter' =>
$this->filter,
+ 'user_filter' => $this->user_filter,
+ 'query' => $this->query,
+ 'district_id' => $this->district_id,
+ 'allrows' =>
$this->allrows,
+ 'start_date' => $start_date,
+ 'end_date' => $end_date,
+ 'start' => $this->start
+ );
+
+
$GLOBALS['phpgw']->xslttpl->add_file(array('search_field'));
+
+ $data = array
+ (
+ 'lang_excel'
=> 'excel',
+ 'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
+ 'lang_excel_help'
=> lang('Download table to MS Excel'),
+
+ 'start_date'
=> $start_date,
+ 'end_date'
=> $end_date,
+ 'lang_none'
=> lang('None'),
+ 'lang_date_search'
=> lang('Date search'),
+ 'lang_date_search_help' =>
lang('Narrow the search by dates'),
+ 'link_date_search'
=> $link_date_search,
+
+ 'overlib_source'
=> './'.$this->currentapp.'/inc/overlib.js',
+
+ 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+ 'autorefresh'
=> $autorefresh,
+ 'links'
=> $links,
+ 'allow_allrows'
=> True,
+ 'allrows'
=> $this->allrows,
+ 'start_record'
=> $this->start,
+ 'record_limit'
=> $record_limit,
+ 'num_records'
=> count($ticket_list),
+ 'all_records'
=> $this->bo->total_records,
+ 'link_url'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+
+ 'select_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'filter_name'
=> 'filter',
+ 'filter_list'
=> $this->bo->filter(array('format' => 'filter', 'filter'=>
$this->filter,'default' => 'open')),
+ 'lang_show_all'
=> lang('Open'),
+ 'lang_filter_statustext' =>
lang('Select the filter. To show all entries select SHOW ALL'),
+ 'lang_searchfield_statustext' => lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again'),
+ 'lang_searchbutton_statustext' => lang('Submit
the search string'),
+ 'query'
=> $this->query,
+ 'lang_search'
=> lang('search'),
+ 'table_header2'
=> $table_header,
+ 'values2'
=> (isset($content)?$content:''),
+ 'table_add'
=> $table_add,
+ );
+
+ $appname =
lang('helpdesk');
+ $function_msg =
lang('list ticket');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list2' => $data));
+ // $GLOBALS['phpgw']->xslttpl->pp();
+ $this->save_sessiondata();
+ }
+
+ function add()
+ {
+ if(!$this->acl_add)
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=>
$this->acl_location));
+ }
+
+ $bolocation =
CreateObject($this->currentapp.'.bolocation');
+
+ $values = get_var('values',array('POST'));
+ $insert_record =
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+ $insert_record_entity =
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+
+ if(isset($insert_record_entity) &&
is_array($insert_record_entity))
+ {
+ for ($j=0;$j<count($insert_record_entity);$j++)
+ {
+
$insert_record['extra'][$insert_record_entity[$j]] =
$insert_record_entity[$j];
+ }
+ }
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('tts'));
+
+//_debug_array($insert_record);
+ if (isset($values['save']))
+ {
+ for ($i=0;
$i<count($insert_record['location']); $i++)
+ {
+
if($_POST[$insert_record['location'][$i]])
+ {
+
$values['location'][$insert_record['location'][$i]]=
$_POST[$insert_record['location'][$i]];
+ }
+ }
+
+ while (is_array($insert_record['extra']) &&
list($key,$column) = each($insert_record['extra']))
+ {
+ if($_POST[$key])
+ {
+ $values['extra'][$column]
= $_POST[$key];
+ }
+ }
+
+ $values['street_name'] =
$_POST['street_name'];
+ $values['street_number'] =
$_POST['street_number'];
+ if(isset($values['location']) &&
$values['location'])
+ {
+ $values['location_name'] =
$_POST['loc' . (count($values['location'])).'_name']; // if not address - get
the parent name as address
+ }
+
+/* if(!$values['subject'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please type a subject for this ticket
!'));
+ }
+
+*/ if(!$values['assignedto'] &&
!$values['group_id'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a person or a group to
handle the ticket !'));
+ }
+
+ if(!$values['cat_id'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
+ }
+
+ if(!isset($values['details']) ||
!$values['details'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please give som details !'));
+ }
+
+ if((!isset($values['location']['loc1']) ||
!$values['location']['loc1']) && (!isset($values['extra']['p_num']) ||
!$values['extra']['p_num']))
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a location - or an
entity!'));
+ }
+
+ if(!isset($receipt['error']))
+ {
+ $receipt = $this->bo->add($values);
+
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.index'));
+ }
+ else
+ {
+ if(isset($values['location']) &&
$values['location'])
+ {
+ $location_code=implode("-",
$values['location']);
+ $values['location_data'] =
$bolocation->read_single($location_code,(isset($values['extra'])?$values['extra']:false));
+ }
+ if(isset($values['extra']['p_num']) &&
$values['extra']['p_num'])
+ {
+
$values['p'][$values['extra']['p_entity_id']]['p_num']=$values['extra']['p_num'];
+
$values['p'][$values['extra']['p_entity_id']]['p_entity_id']=$values['extra']['p_entity_id'];
+
$values['p'][$values['extra']['p_entity_id']]['p_cat_id']=$values['extra']['p_cat_id'];
+
$values['p'][$values['extra']['p_entity_id']]['p_cat_name']=$_POST['entity_cat_name_'.$values['extra']['p_entity_id']];
+ }
+ }
+ }
+
+ $location_data=$bolocation->initiate_ui_location(array(
+ 'values' =>
(isset($values['location_data'])?$values['location_data']:''),
+ 'type_id' => -1, //
calculated from location_types
+ 'no_link' => False, //
disable lookup links for location type less than type_id
+ 'tenant' => True,
+ 'lookup_type' => 'form',
+ 'lookup_entity' =>
$this->bocommon->get_lookup_entity('ticket'),
+ 'entity_data' =>
(isset($values['p'])?$values['p']:'')
+ ));
+
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uitts.add'
+ );
+
+ if(!isset($values['assignedto']))
+ {
+ $values['assignedto']=
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault']:'');
+ }
+ if(!isset($values['group_id']))
+ {
+ $values['group_id']=
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault']:'');
+ }
+
+ if(!isset($values['cat_id']))
+ {
+ $this->cat_id =
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category']:'');
+ }
+ else
+ {
+ $this->cat_id = $values['cat_id'];
+ }
+
+ $dateformat =
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $sep = '/';
+ $dlarr[strpos($dateformat,'y')] = 'yyyy';
+ $dlarr[strpos($dateformat,'m')] = 'MM';
+ $dlarr[strpos($dateformat,'d')] = 'DD';
+ ksort($dlarr);
+
+ $dateformat= (implode($sep,$dlarr));
+
+ switch(substr($dateformat,0,1))
+ {
+ case 'M':
+ $dateformat_validate=
"javascript:vDateType='1'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'1')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'1')";
+ break;
+ case 'y':
+
$dateformat_validate="javascript:vDateType='2'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'2')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'2')";
+ break;
+ case 'D':
+
$dateformat_validate="javascript:vDateType='3'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'3')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'3')";
+ break;
+ }
+
+
+ $msgbox_data =
(isset($receipt)?$this->bocommon->msgbox_data($receipt):'');
+
+ $data = array
+ (
+ 'lang_dateformat' =>
strtolower($dateformat),
+ 'dateformat_validate' =>
$dateformat_validate,
+ 'onKeyUp' =>
$onKeyUp,
+ 'onBlur' =>
$onBlur,
+ 'dateformat_source' =>
'./'.$this->currentapp.'/inc/dateformat.js',
+ 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+ 'location_data' =>
$location_data,
+ 'lang_assign_to' =>
lang('Assign to'),
+ 'lang_no_user' =>
lang('Select user'),
+ 'lang_user_statustext' =>
lang('Select the user the selection belongs to. To do not use a user select NO
USER'),
+ 'select_user_name' =>
'values[assignedto]',
+ 'user_list' =>
$this->bocommon->get_user_list_right2('select',4,$values['assignedto'],$this->acl_location),
+
+ 'lang_group' =>
lang('Group'),
+ 'lang_no_group' =>
lang('No group'),
+ 'group_list' =>
$this->bocommon->get_group_list('select',$values['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+ 'select_group_name' =>
'values[group_id]',
+
+ 'lang_priority' =>
lang('Priority'),
+ 'lang_priority_statustext' =>
lang('Select the priority the selection belongs to.'),
+ 'select_priority_name' =>
'values[priority]',
+ 'priority_list' =>
$this->bo->get_priority_list((isset($values['priority'])?$values['priority']:'')),
+
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'done_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.index')),
+ 'lang_subject' =>
lang('Subject'),
+ 'lang_subject_statustext' =>
lang('Enter the subject of this ticket'),
+
+ 'lang_details' =>
lang('Details'),
+ 'lang_details_statustext' =>
lang('Enter the details of this ticket'),
+ 'lang_category' =>
lang('category'),
+ 'lang_save' =>
lang('save'),
+ 'lang_done' =>
lang('done'),
+ 'value_details' =>
(isset($values['details'])?$values['details']:''),
+ 'value_subject' =>
(isset($values['subject'])?$values['subject']:''),
+
+ 'lang_finnish_date' =>
lang('finnish date'),
+ 'value_finnish_date' =>
(isset($values['finnish_date'])?$values['finnish_date']:''),
+
+ 'lang_done_statustext' =>
lang('Back to the ticket list'),
+ 'lang_save_statustext' =>
lang('Save the ticket'),
+ 'lang_no_cat' =>
lang('no category'),
+ 'lang_cat_statustext' =>
lang('Select the category the selection belongs to. To do not use a category
select NO CATEGORY'),
+ 'select_name' =>
'values[cat_id]',
+ 'lang_town_statustext' =>
lang('Select the part of town the building belongs to. To do not use a part of
town - select NO PART OF TOWN'),
+ 'lang_part_of_town' =>
lang('Part of town'),
+ 'lang_no_part_of_town' =>
lang('No part of town'),
+ 'cat_list' =>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$this->cat_id,'type' =>'ticket','order'=>'descr')),
+
+ 'mailnotification' =>
(isset($this->bo->config->config_data['mailnotification'])?$this->bo->config->config_data['mailnotification']:''),
+ 'lang_mailnotification' =>
lang('Send e-mail'),
+ 'lang_mailnotification_statustext' =>
lang('Choose to send mailnotification'),
+ 'pref_send_mail' =>
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification']:''),
);
+//_debug_array($data);
$appname =
lang('helpdesk');
- $function_msg =
lang('list ticket');
+ $function_msg =
lang('add ticket');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add'
=> $data));
// $GLOBALS['phpgw']->xslttpl->pp();
- $this->save_sessiondata();
}
- function add()
+ function add2()
{
- if(!$this->acl_add)
+ if(!$this->acl->check('.ticket.external',2))
{
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=>
$this->acl_location));
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=>
'.ticket.external'));
}
$bolocation =
CreateObject($this->currentapp.'.bolocation');
@@ -613,21 +1199,11 @@
$values['location_name'] =
$_POST['loc' . (count($values['location'])).'_name']; // if not address - get
the parent name as address
}
-/* if(!$values['subject'])
+ if(!$values['subject'])
{
$receipt['error'][]=array('msg'=>lang('Please type a subject for this ticket
!'));
}
-*/ if(!$values['assignedto'] &&
!$values['group_id'])
- {
-
$receipt['error'][]=array('msg'=>lang('Please select a person or a group to
handle the ticket !'));
- }
-
- if(!$values['cat_id'])
- {
-
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
- }
-
if(!isset($values['details']) ||
!$values['details'])
{
$receipt['error'][]=array('msg'=>lang('Please give som details !'));
@@ -667,15 +1243,15 @@
'type_id' => -1, //
calculated from location_types
'no_link' => False, //
disable lookup links for location type less than type_id
'tenant' => True,
- 'lookup_type' => 'form',
- 'lookup_entity' =>
$this->bocommon->get_lookup_entity('ticket'),
- 'entity_data' =>
(isset($values['p'])?$values['p']:'')
+ 'lookup_type' => 'view',
+ 'lookup_entity' => false,
+ 'entity_data' => false
));
$link_data = array
(
- 'menuaction' =>
$this->currentapp.'.uitts.add'
+ 'menuaction' =>
$this->currentapp.'.uitts.add2'
);
if(!isset($values['assignedto']))
@@ -753,7 +1329,7 @@
'priority_list' =>
$this->bo->get_priority_list((isset($values['priority'])?$values['priority']:'')),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
- 'done_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.index')),
+ 'done_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uitts.index2')),
'lang_subject' =>
lang('Subject'),
'lang_subject_statustext' =>
lang('Enter the subject of this ticket'),
@@ -782,6 +1358,13 @@
'lang_mailnotification' =>
lang('Send e-mail'),
'lang_mailnotification_statustext' =>
lang('Choose to send mailnotification'),
'pref_send_mail' =>
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification']:''),
+ 'lang_contact_phone'
=> lang('contact phone'),
+ 'lang_contact_phone_statustext' =>
lang('contact phone'),
+ 'value_contact_phone'
=> (isset($values['contact_phone'])?$values['contact_phone']:''),
+
+ 'lang_contact_email'
=> lang('contact email'),
+ 'lang_contact_email_statustext' =>
lang('contact email'),
+ 'value_contact_email'
=> (isset($values['contact_email'])?$values['contact_email']:''),
);
//_debug_array($data);
@@ -789,7 +1372,7 @@
$function_msg =
lang('add ticket');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add'
=> $data));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add2' => $data));
// $GLOBALS['phpgw']->xslttpl->pp();
}
@@ -1099,5 +1682,234 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
// $GLOBALS['phpgw']->xslttpl->pp();
}
+
+ function view2()
+ {
+ if(!$this->acl->check('.ticket.external',1))
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=>
'.ticket.external'));
+ }
+
+ $bolocation =
CreateObject($this->currentapp.'.bolocation');
+
+ $id = get_var('id',array('GET'));
+ $values = get_var('values',array('POST','GET'));
+ $receipt = '';
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('tts'));
+
+ if(isset($values['save']))
+ {
+ if(!$this->acl->check('.ticket.external',2))
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
$this->currentapp.'.uilocation.stop', 'perm'=>4, 'acl_location'=>
'.ticket.external'));
+ }
+
+ $so2 =
CreateObject($this->currentapp.'.sotts2');
+ $so2->acl_location = $this->acl_location;
+ $receipt = $so2->update_ticket($values,$id);
+ }
+
+ $ticket = $this->bo->read_single($id);
+
+ $additional_notes =
$this->bo->read_additional_notes($id);
+ $record_history = $this->bo->read_record_history($id);
+
+ $form_link = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uitts.view2',
+ 'id' => $id
+ );
+
+ $table_header_history[] = array
+ (
+ 'lang_date' => lang('Date'),
+ 'lang_user' => lang('User'),
+ 'lang_action' => lang('Action'),
+ 'lang_new_value' => lang('New value')
+ );
+
+ $table_header_additional_notes[] = array
+ (
+ 'lang_count' => '#',
+ 'lang_date' => lang('Date'),
+ 'lang_user' => lang('User'),
+ 'lang_note' => lang('Note'),
+ );
+
+//_debug_array($ticket['location_data']);
+
+ $location_data=$bolocation->initiate_ui_location(array(
+ 'values' =>
$ticket['location_data'],
+ 'type_id' =>
count(explode('-',$ticket['location_data']['location_code'])),
+ 'no_link' => False, //
disable lookup links for location type less than type_id
+ 'tenant' =>
(isset($ticket['location_data']['tenant_id'])?$ticket['location_data']['tenant_id']:''),
+ 'lookup_type' => 'view',
+ 'lookup_entity' =>
$this->bocommon->get_lookup_entity('ticket'),
+ 'entity_data' =>
(isset($ticket['p'])?$ticket['p']:'')
+ ));
+
+
+ if($ticket['contact_phone'])
+ {
+ for
($i=0;$i<count($location_data['location']);$i++)
+ {
+
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+ {
+
unset($location_data['location'][$i]['value']);
+ }
+ }
+ }
+
+ if ($ticket['cat_id'])
+ {
+ $this->cat_id = $ticket['cat_id'];
+ }
+
+
+ $dateformat =
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $sep = '/';
+ $dlarr[strpos($dateformat,'y')] = 'yyyy';
+ $dlarr[strpos($dateformat,'m')] = 'MM';
+ $dlarr[strpos($dateformat,'d')] = 'DD';
+ ksort($dlarr);
+
+ $dateformat= (implode($sep,$dlarr));
+
+ switch(substr($dateformat,0,1))
+ {
+ case 'M':
+ $dateformat_validate=
"javascript:vDateType='1'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'1')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'1')";
+ break;
+ case 'y':
+
$dateformat_validate="javascript:vDateType='2'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'2')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'2')";
+ break;
+ case 'D':
+
$dateformat_validate="javascript:vDateType='3'";
+ $onKeyUp =
"DateFormat(this,this.value,event,false,'3')";
+ $onBlur =
"DateFormat(this,this.value,event,true,'3')";
+ break;
+ }
+
+ $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+ if (isset($ticket['origin']) AND
is_array($ticket['origin']))
+ {
+ for ($i=0;$i<count($ticket['origin']);$i++)
+ {
+
$ticket['origin'][$i]['link']=$GLOBALS['phpgw']->link('/index.php',$ticket['origin'][$i]['link']);
+
+
if(substr($ticket['origin'][$i]['type'],0,6)=='entity')
+ {
+ $type =
explode("_",$ticket['origin'][$i]['type']);
+ $entity_id = $type[1];
+ $cat_id = $type[2];
+
+ if(!is_object($boadmin_entity))
+ {
+ $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
+ }
+ $entity_category =
$boadmin_entity->read_single_category($entity_id,$cat_id);
+ $ticket['origin'][$i]['descr']
= $entity_category['name'];
+ }
+ else
+ {
+ $ticket['origin'][$i]['descr']=
lang($ticket['origin'][$i]['type']);
+ }
+ }
+ }
+
+ $data = array
+ (
+ 'value_origin'
=> (isset($ticket['origin'])?$ticket['origin']:''),
+ 'lang_dateformat'
=> strtolower($dateformat),
+ 'dateformat_validate' =>
$dateformat_validate,
+ 'onKeyUp'
=> $onKeyUp,
+ 'onBlur'
=> $onBlur,
+ 'dateformat_source'
=> './'.$this->currentapp.'/inc/dateformat.js',
+ 'lang_finnish_date'
=> lang('finnish date'),
+ 'value_finnish_date' =>
$ticket['finnish_date'],
+
+ 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+
+ 'location_data'
=> $location_data,
+ 'lang_location_code' =>
lang('Location Code'),
+
+ 'lang_ticket'
=> lang('Ticket'),
+ 'table_header_additional_notes' =>
$table_header_additional_notes,
+ 'table_header_history' =>
$table_header_history,
+ 'lang_status'
=> lang('Status'),
+ 'status_name'
=> 'values[status]',
+ 'status_list'
=> $this->bo->get_status_list($ticket['status']),
+ 'lang_status_statustext' =>
lang('Set the status of the ticket'),
+
+ 'lang_no_user'
=> lang('Select user'),
+ 'lang_user_statustext' =>
lang('Select the user the selection belongs to. To do not use a user select NO
USER'),
+ 'select_user_name'
=> 'values[assignedto]',
+ 'user_list'
=>
$this->bocommon->get_user_list_right2('select',4,$ticket['assignedto'],$this->acl_location),
+
+ 'lang_group'
=> lang('Group'),
+ 'lang_no_group'
=> lang('No group'),
+ 'group_list'
=>
$this->bocommon->get_group_list('select',$ticket['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+ 'select_group_name'
=> 'values[group_id]',
+
+ 'lang_priority'
=> lang('Priority'),
+ 'value_priority'
=> $ticket['priority'],
+ 'lang_priority_statustext' =>
lang('Select the priority the selection belongs to.'),
+ 'select_priority_name' =>
'values[priority]',
+ 'priority_list'
=> $this->bo->get_priority_list($ticket['priority']),
+
+ 'lang_no_cat'
=> lang('no category'),
+ 'lang_cat_statustext' =>
lang('Select the category the building belongs to. To do not use a category
select NO CATEGORY'),
+ 'select_name'
=> 'values[cat_id]',
+ 'cat_list'
=>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$this->cat_id,'type' =>'ticket','order'=>'descr')),
+
+ 'lang_category'
=> lang('category'),
+ 'value_category_name' =>
$ticket['category_name'],
+
+ 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$form_link),
+ 'done_action'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uitts.index2')),
+ 'value_subject'
=> $ticket['subject'],
+ 'lang_subject_statustext' =>
lang('update subject'),
+ 'value_id'
=> '[ #'. $id . ' ] - ',
+
+ 'lang_details'
=> lang('Details'),
+ 'value_details'
=> $ticket['details'],
+ 'lang_details_statustext' =>
lang('Add new comments'),
+
+ 'lang_additional_notes' =>
lang('Additional notes'),
+
+ 'lang_new_note'
=> lang('New Note'),
+ 'lang_opendate'
=> lang('Open Date'),
+ 'value_opendate'
=> $ticket['timestampopened'],
+
+ 'lang_assignedfrom'
=> lang('Assigned from'),
+ 'value_assignedfrom' =>
$ticket['user_name'],
+ 'lang_assignedto'
=> lang('Assigned to'),
+ 'value_assignedto'
=> $ticket['assignedto_name'],
+
+ 'lang_no_additional_notes' =>
lang('No additional notes'),
+ 'lang_history'
=> lang('History'),
+ 'lang_no_history'
=> lang('No history for this record'),
+ 'additional_notes'
=> $additional_notes,
+ 'record_history'
=> $record_history,
+
+ 'lang_save'
=> lang('save'),
+ 'lang_name'
=> lang('name'),
+ 'lang_done'
=> lang('done'),
+ 'lang_contact_phone' =>
lang('Contact phone'),
+ 'contact_phone'
=> $ticket['contact_phone'],
+ );
+//_debug_array($data);
+ $appname = lang('helpdesk');
+ $function_msg = lang('view ticket detail');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view2' => $data));
+ }
}
?>
Index: setup/default_records.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/default_records.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- setup/default_records.inc.php 27 Oct 2006 08:31:35 -0000 1.32
+++ setup/default_records.inc.php 29 Oct 2006 20:04:40 -0000 1.33
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: default_records.inc.php,v 1.32 2006/10/27 08:31:35
sigurdne Exp $
+ * @version $Id: default_records.inc.php,v 1.33 2006/10/29 20:04:40
sigurdne Exp $
*/
@@ -200,6 +200,7 @@
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr) VALUES ('property', '.custom', 'custom queries')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr, allow_grant) VALUES ('property', '.project', 'Demand ->
Workorder', 1)");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr, allow_grant) VALUES ('property', '.ticket', 'Helpdesk',
1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr) VALUES ('property', '.ticket.external', 'Helpdesk External
user')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr) VALUES ('property', '.agreement', 'Agreement')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr) VALUES ('property', '.invoice', 'Invoice')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location
(appname, id, descr) VALUES ('property', '.document', 'Documents')");
Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/setup.inc.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- setup/setup.inc.php 27 Oct 2006 08:31:35 -0000 1.50
+++ setup/setup.inc.php 29 Oct 2006 20:04:40 -0000 1.51
@@ -8,12 +8,12 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: setup.inc.php,v 1.50 2006/10/27 08:31:35 sigurdne Exp $
+ * @version $Id: setup.inc.php,v 1.51 2006/10/29 20:04:40 sigurdne Exp $
*/
$setup_info['property']['name'] = 'property';
$setup_info['property']['title'] = 'Property';
- $setup_info['property']['version'] = '0.9.17.529';
+ $setup_info['property']['version'] = '0.9.17.530';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_current.inc.php,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- setup/tables_current.inc.php 26 Oct 2006 14:19:35 -0000 1.68
+++ setup/tables_current.inc.php 29 Oct 2006 20:04:40 -0000 1.69
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_current.inc.php,v 1.68 2006/10/26 14:19:35
sigurdne Exp $
+ * @version $Id: tables_current.inc.php,v 1.69 2006/10/29 20:04:40
sigurdne Exp $
*/
$phpgw_baseline = array(
@@ -64,7 +64,11 @@
'first_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
'last_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
'contact_phone' => array('type' =>
'varchar','precision' => '20','nullable' => True),
- 'category' => array('type' => 'int','precision'
=> '4','nullable' => True)
+ 'category' => array('type' => 'int','precision'
=> '4','nullable' => True),
+ 'phpgw_account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
+ 'account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
+ 'account_pwd' => array('type' =>
'varchar','precision' => '32','nullable' => True),
+ 'account_status' => array('type' =>
'char','precision' => '1','nullable' => True,'default' => 'A')
),
'pk' => array('id'),
'fk' => array(),
Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_update.inc.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- setup/tables_update.inc.php 27 Oct 2006 08:31:35 -0000 1.56
+++ setup/tables_update.inc.php 29 Oct 2006 20:04:40 -0000 1.57
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_update.inc.php,v 1.56 2006/10/27 08:31:35
sigurdne Exp $
+ * @version $Id: tables_update.inc.php,v 1.57 2006/10/29 20:04:40
sigurdne Exp $
*/
/**
@@ -1520,3 +1520,23 @@
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.529';
return $GLOBALS['setup_info']['property']['currentver'];
}
+
+ /**
+ * Update property version from 0.9.17.529 to 0.9.17.530
+ */
+
+ $test[] = '0.9.17.529';
+ function property_upgrade0_9_17_529()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
phpgw_acl_location (appname, id, descr) VALUES ('property', '.ticket.external',
'Helpdesk External user')");
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','phpgw_account_lid',
array('type' => 'varchar','precision' => '25','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_lid',
array('type' => 'varchar','precision' => '25','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_pwd',
array('type' => 'varchar','precision' => '32','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_status',
array('type' => 'char','precision' => '1','nullable' => True,'default' => 'A'));
+
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.530';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
\ No newline at end of file
Index: templates/base/tts.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/tts.xsl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- templates/base/tts.xsl 19 Sep 2006 21:09:48 -0000 1.13
+++ templates/base/tts.xsl 29 Oct 2006 20:04:40 -0000 1.14
@@ -1,13 +1,22 @@
-<!-- $Id: tts.xsl,v 1.13 2006/09/19 21:09:48 sigurdne Exp $ -->
+<!-- $Id: tts.xsl,v 1.14 2006/10/29 20:04:40 sigurdne Exp $ -->
<xsl:template name="app_data">
<xsl:choose>
<xsl:when test="add">
<xsl:apply-templates select="add"/>
</xsl:when>
+ <xsl:when test="add2">
+ <xsl:apply-templates select="add2"/>
+ </xsl:when>
<xsl:when test="view">
<xsl:apply-templates select="view"/>
</xsl:when>
+ <xsl:when test="view">
+ <xsl:apply-templates select="view2"/>
+ </xsl:when>
+ <xsl:when test="list2">
+ <xsl:apply-templates select="list2"/>
+ </xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="list"/>
</xsl:otherwise>
@@ -224,6 +233,160 @@
</tr>
</xsl:template>
+
+ <xsl:template match="list2">
+ <xsl:variable name="autorefresh"><xsl:value-of
select="autorefresh"/></xsl:variable>
+ <META HTTP-EQUIV="Refresh" CONTENT="{$autorefresh}"/>
+
+ <xsl:variable name="overlib_source"><xsl:value-of
select="overlib_source"/></xsl:variable>
+ <SCRIPT LANGUAGE="JavaScript" SRC="{$overlib_source}"></SCRIPT>
+
+ <xsl:call-template name="menu"/>
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <tr>
+ <td align="left">
+ <xsl:call-template
name="filter_filter"/>
+ </td>
+ <td colspan="10" align="right">
+ <xsl:call-template name="search_field"/>
+ </td>
+ <td class="small_text" valign="top"
align="left">
+ <xsl:variable
name="link_excel"><xsl:value-of select="link_excel"/></xsl:variable>
+ <xsl:variable
name="lang_excel_help"><xsl:value-of select="lang_excel_help"/></xsl:variable>
+ <xsl:variable
name="lang_excel"><xsl:value-of select="lang_excel"/></xsl:variable>
+ <a href="javascript:var
w=window.open('{$link_excel}','','')"
+
onMouseOver="overlib('{$lang_excel_help}', CAPTION, '{$lang_excel}')"
+ onMouseOut="nd()">
+ <xsl:value-of
select="lang_excel"/></a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="12" width="100%">
+ <xsl:call-template name="nextmatchs"/>
+ </td>
+ </tr>
+ </table>
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:apply-templates select="table_header2"/>
+ <xsl:apply-templates select="values2"/>
+ <xsl:apply-templates select="table_add"/>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="table_header2">
+ <xsl:variable name="lang_priority_statustext"><xsl:value-of
select="lang_priority_statustext"/></xsl:variable>
+ <xsl:variable name="lang_id_statustext"><xsl:value-of
select="lang_id_statustext"/></xsl:variable>
+ <xsl:variable name="lang_opened_by_statustext"><xsl:value-of
select="lang_opened_by_statustext"/></xsl:variable>
+ <xsl:variable name="lang_assigned_to_statustext"><xsl:value-of
select="lang_assigned_to_statustext"/></xsl:variable>
+ <xsl:variable name="lang_finnish_statustext"><xsl:value-of
select="lang_finnish_statustext"/></xsl:variable>
+ <tr class="th">
+ <td class="th_text" width="1%" align="right">
+ <xsl:variable
name="sort_priority"><xsl:value-of select="sort_priority"/></xsl:variable>
+ <a href="{$sort_priority}"
onMouseover="window.status='{$lang_priority_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="lang_priority"/></a>
+ </td>
+ <td class="th_text" width="6%" align="right">
+ <xsl:variable
name="sort_id"><xsl:value-of select="sort_id"/></xsl:variable>
+ <a href="{$sort_id}"
onMouseover="window.status='{$lang_id_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="lang_id"/></a>
+ </td>
+ <td class="th_text" width="10%">
+ <xsl:value-of select="lang_subject"/>
+ </td>
+ <td class="th_text" width="15%" align="left">
+ <xsl:value-of
select="lang_location_code"/>
+ </td>
+ <td class="th_text" width="30%" align="left">
+ <xsl:value-of select="lang_address"/>
+ </td>
+ <td class="th_text" width="8%" align="center">
+ <xsl:variable
name="sort_opened_by"><xsl:value-of select="sort_opened_by"/></xsl:variable>
+ <a href="{$sort_opened_by}"
onMouseover="window.status='{$lang_opened_by_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="lang_opened_by"/></a>
+ </td>
+ <td class="th_text" width="8%" align="center">
+ <xsl:variable
name="sort_assigned_to"><xsl:value-of select="sort_assigned_to"/></xsl:variable>
+ <a href="{$sort_assigned_to}"
onMouseover="window.status='{$lang_assigned_to_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="lang_assigned_to"/></a>
+ </td>
+ <td class="th_text" width="8%" align="center">
+ <xsl:variable
name="sort_date"><xsl:value-of select="sort_date"/></xsl:variable>
+ <a href="{$sort_date}"
onMouseover="window.status='{$lang_opened_by_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="lang_time_created"/></a>
+ </td>
+ <xsl:for-each select="extra" >
+ <td class="th_text" width="{with}"
align="{align}">
+ <xsl:value-of select="header"/>
+ </td>
+ </xsl:for-each>
+ <td class="th_text" width="8%" align="center">
+ <xsl:variable
name="sort_finnish_date"><xsl:value-of
select="sort_finnish_date"/></xsl:variable>
+ <a href="{$sort_finnish_date}"
onMouseover="window.status='{$lang_finnish_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="lang_finnish_date"/></a>
+ </td>
+ <td class="th_text" width="15%" align="center">
+ <xsl:value-of select="lang_delay"/>
+ </td>
+ <td class="th_text" width="15%" align="center">
+ <xsl:value-of select="lang_status"/>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="values2">
+ <xsl:variable name="lang_view_statustext"><xsl:value-of
select="lang_view_statustext"/></xsl:variable>
+ <xsl:variable name="link_view"><xsl:value-of
select="link_view"/></xsl:variable>
+ <tr bgcolor="{bgcolor}" >
+ <td class="small_text" align="right">
+ <xsl:value-of select="priostr"/>
+ </td>
+ <td class="small_text" align="right">
+ <xsl:value-of select="new_ticket"/>
+ <a href="{$link_view}"
onMouseover="window.status='{$lang_view_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="id"/></a>
+ </td>
+ <td class="small_text" align="left">
+ <xsl:value-of select="first"/>
+ </td>
+ <td class="small_text" align="left">
+ <xsl:value-of select="location_code"/>
+ </td>
+ <td class="small_text" align="left">
+ <xsl:value-of select="address"/>
+ </td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="user"/>
+ </td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="assignedto"/>
+ </td>
+ <td class="small_text" align="center">
+ <a href="{$link_view}"
onMouseover="window.status='{$lang_view_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="date"/></a>
+ </td>
+ <xsl:for-each select="child_date" >
+ <td class="small_text">
+ <xsl:for-each
select="date_info" >
+ <xsl:variable
name="link"><xsl:value-of select="link"/></xsl:variable>
+ <a href="{$link}"
onMouseover="window.status='';return true;" onMouseout="window.status='';return
true;"><xsl:value-of select="entry_date"/></a>
+ <br/>
+ </xsl:for-each>
+ </td>
+ </xsl:for-each>
+ <td class="small_text" align="center">
+ <xsl:value-of select="finnish_date"/>
+ </td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="delay"/>
+ </td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="status"/>
+ </td>
+ </tr>
+ </xsl:template>
+
+
<!-- add -->
<xsl:template match="add">
@@ -395,38 +558,13 @@
</xsl:template>
- <xsl:template match="priority_list">
- <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="selected">
- <option value="{$id}"
selected="selected"><xsl:value-of disable-output-escaping="yes"
select="name"/></option>
- </xsl:when>
- <xsl:otherwise>
- <option value="{$id}"><xsl:value-of
disable-output-escaping="yes" select="name"/></option>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- view -->
-
+<!-- add2 -->
- <xsl:template match="view">
- <script language="JavaScript">
- self.name="first_Window";
- function generate_order()
- {
- Window1=window.open('<xsl:value-of
select="order_link"/>');
- }
- function generate_request()
- {
- Window1=window.open('<xsl:value-of
select="request_link"/>');
- }
- </script>
+ <xsl:template match="add2">
<xsl:variable name="dateformat_source"><xsl:value-of
select="dateformat_source"/></xsl:variable>
<SCRIPT LANGUAGE="JavaScript"
SRC="{$dateformat_source}"></SCRIPT>
- <div align="left">
+ <div align="left">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -439,70 +577,244 @@
</xsl:choose>
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<form name="form" method="post" action="{$form_action}">
- <tr class="th">
- <td class="th_text" valign="top">
- <xsl:value-of select="lang_ticket"/>
- </td>
- <td class="th_text" valign="top">
- <xsl:value-of select="value_id"/>
- <input type="text"
name="values[subject]" value="{value_subject}"
onMouseout="window.status='';return true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_subject_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </td>
- </tr>
+
<xsl:call-template name="location_view"/>
- <xsl:choose>
- <xsl:when test="contact_phone !=''">
- <tr>
- <td class="th_text"
align="left">
- <xsl:value-of
select="lang_contact_phone"/>
- </td>
- <td align="left">
- <xsl:value-of
select="contact_phone"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="lang_opendate"/>
- </td>
<td valign="top">
- <xsl:value-of select="value_opendate"/>
+ <xsl:value-of select="lang_priority"/>
+ </td>
+ <td>
+ <xsl:variable
name="lang_priority_statustext"><xsl:value-of
select="lang_priority_statustext"/></xsl:variable>
+ <xsl:variable
name="select_priority_name"><xsl:value-of
select="select_priority_name"/></xsl:variable>
+ <select name="{$select_priority_name}"
class="forms" onMouseover="window.status='{$lang_priority_statustext}'; return
true;" onMouseout="window.status='';return true;">
+ <xsl:apply-templates
select="priority_list"/>
+ </select>
</td>
</tr>
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of
select="lang_assignedfrom"/>
+ <td>
+ <xsl:value-of select="lang_category"/>
</td>
- <td valign="top">
- <xsl:value-of
select="value_assignedfrom"/>
+ <td>
+ <xsl:call-template name="cat_select"/>
</td>
</tr>
+
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="lang_assignedto"/>
- </td>
<td valign="top">
- <xsl:value-of
select="value_assignedto"/>
+ <xsl:value-of
select="lang_contact_phone"/>
+ </td>
+ <td>
+ <input type="text"
name="values[contact_phone]" value="{value_contact_phone}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_contact_phone_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
</td>
</tr>
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="lang_priority"/>
- </td>
<td valign="top">
- <xsl:value-of select="value_priority"/>
+ <xsl:value-of
select="lang_contact_email"/>
+ </td>
+ <td>
+ <input type="text"
name="values[contact_email]" value="{value_contact_email}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_contact_email_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
</td>
</tr>
+
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="lang_category"/>
+ <td>
+ <xsl:value-of
select="lang_finnish_date"/>
+ </td>
+ <td>
+ <input type="text"
name="values[finnish_date]" value="{value_finnish_date}"
onFocus="{dateformat_validate}" onKeyUp="{onKeyUp}" onBlur="{onBlur}" size="12"
maxlength="10" onMouseout="window.status='';return true;" >
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="statustext"/>
+ <xsl:text>';return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ [<xsl:value-of
select="lang_dateformat"/>]
+ </td>
+ </tr>
+
+
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_subject"/>
+ </td>
+ <td>
+ <input type="text"
name="values[subject]" value="{value_subject}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_subject_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_details"/>
+ </td>
+ <td>
+ <textarea cols="60" rows="10"
name="values[details]" wrap="virtual" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_details_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of
select="value_details"/>
+ </textarea>
+
+ </td>
+ </tr>
+ <tr height="50">
+ <td>
+ <xsl:variable
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
+ <input type="submit"
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_save_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ </form>
+ <tr>
+ <td>
+ <xsl:variable
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
+ <xsl:variable
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
+ <form method="post"
action="{$done_action}">
+ <input type="submit"
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+
<xsl:value-of select="lang_done_statustext"/>
+ <xsl:text>';
return true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </form>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </xsl:template>
+
+ <xsl:template match="priority_list">
+ <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="selected">
+ <option value="{$id}"
selected="selected"><xsl:value-of disable-output-escaping="yes"
select="name"/></option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option value="{$id}"><xsl:value-of
disable-output-escaping="yes" select="name"/></option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+<!-- view -->
+ <xsl:template match="view">
+ <script language="JavaScript">
+ self.name="first_Window";
+ function generate_order()
+ {
+ Window1=window.open('<xsl:value-of
select="order_link"/>');
+ }
+ function generate_request()
+ {
+ Window1=window.open('<xsl:value-of
select="request_link"/>');
+ }
+ </script>
+ <xsl:variable name="dateformat_source"><xsl:value-of
select="dateformat_source"/></xsl:variable>
+ <SCRIPT LANGUAGE="JavaScript"
SRC="{$dateformat_source}"></SCRIPT>
+ <div align="left">
+
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
+ <form name="form" method="post" action="{$form_action}">
+ <tr class="th">
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_ticket"/>
+ </td>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="value_id"/>
+ <input type="text"
name="values[subject]" value="{value_subject}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_subject_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <xsl:call-template name="location_view"/>
+ <xsl:choose>
+ <xsl:when test="contact_phone !=''">
+ <tr>
+ <td class="th_text"
align="left">
+ <xsl:value-of
select="lang_contact_phone"/>
+ </td>
+ <td align="left">
+ <xsl:value-of
select="contact_phone"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_opendate"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of select="value_opendate"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of
select="lang_assignedfrom"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of
select="value_assignedfrom"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_assignedto"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of
select="value_assignedto"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_priority"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of select="value_priority"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_category"/>
</td>
<td valign="top">
<xsl:value-of
select="value_category_name"/>
@@ -816,6 +1128,281 @@
<hr noshade="noshade" width="100%" align="center" size="1"/>
</xsl:template>
+<!-- view2 -->
+ <xsl:template match="view2">
+ <script language="JavaScript">
+ self.name="first_Window";
+ function generate_order()
+ {
+ Window1=window.open('<xsl:value-of
select="order_link"/>');
+ }
+ function generate_request()
+ {
+ Window1=window.open('<xsl:value-of
select="request_link"/>');
+ }
+ </script>
+ <xsl:variable name="dateformat_source"><xsl:value-of
select="dateformat_source"/></xsl:variable>
+ <SCRIPT LANGUAGE="JavaScript"
SRC="{$dateformat_source}"></SCRIPT>
+ <div align="left">
+
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
+ <form name="form" method="post" action="{$form_action}">
+ <tr class="th">
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_ticket"/>
+ </td>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="value_id"/>
+ <input type="text"
name="values[subject]" value="{value_subject}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_subject_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <xsl:call-template name="location_view"/>
+ <xsl:choose>
+ <xsl:when test="contact_phone !=''">
+ <tr>
+ <td class="th_text"
align="left">
+ <xsl:value-of
select="lang_contact_phone"/>
+ </td>
+ <td align="left">
+ <xsl:value-of
select="contact_phone"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_opendate"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of select="value_opendate"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of
select="lang_assignedfrom"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of
select="value_assignedfrom"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_assignedto"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of
select="value_assignedto"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_priority"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of select="value_priority"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_category"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of
select="value_category_name"/>
+ </td>
+ </tr>
+
+ <xsl:for-each select="value_origin" >
+ <xsl:variable
name="link_origin_type"><xsl:value-of select="link"/></xsl:variable>
+ <tr>
+ <td class="th_text" valign ="top">
+ <xsl:value-of select="descr"/>
+ </td>
+ <td class="th_text"
align="left" >
+ <xsl:for-each select="data">
+ <a
href="{$link_origin_type}&id={id}"
onMouseover="window.status='{//lang_origin_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="id"/></a>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:for-each>
+
+
+
+ <xsl:for-each select="entity_origin_list" >
+ <tr>
+ <td class="th_text">
+ <xsl:value-of select="name"/>
+ </td>
+ <td class="th_text">
+ <xsl:for-each select="link_info" >
+ <xsl:variable
name="link_entity_origin"><xsl:value-of select="link"/>&id=<xsl:value-of
select="id"/></xsl:variable>
+ <xsl:variable
name="lang_entity_statustext"><xsl:value-of select="entry_date"/></xsl:variable>
+ <a href="{$link_entity_origin}"
onMouseover="window.status='{$lang_entity_statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="id"/></a>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:for-each>
+
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of select="lang_details"/>
+ </td>
+ <td valign="top">
+ <xsl:value-of select="value_details"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" valign="top">
+ <xsl:value-of
select="lang_additional_notes"/>
+ </td>
+ <xsl:choose>
+ <xsl:when test="additional_notes=''">
+ <td class="th_text">
+ <xsl:value-of
select="lang_no_additional_notes"/>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>
+ <table width="100%" cellpadding="2"
cellspacing="2" align="center">
+ <xsl:apply-templates
select="table_header_additional_notes"/>
+ <xsl:apply-templates
select="additional_notes"/>
+ </table>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_priority"/>
+ </td>
+ <td>
+ <xsl:variable
name="lang_priority_statustext"><xsl:value-of
select="lang_priority_statustext"/></xsl:variable>
+ <xsl:variable
name="select_priority_name"><xsl:value-of
select="select_priority_name"/></xsl:variable>
+ <select name="{$select_priority_name}"
class="forms" onMouseover="window.status='{$lang_priority_statustext}'; return
true;" onMouseout="window.status='';return true;">
+ <xsl:apply-templates
select="priority_list"/>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_status"/>
+ </td>
+ <td>
+ <xsl:variable
name="lang_status_statustext"><xsl:value-of
select="lang_status_statustext"/></xsl:variable>
+ <xsl:variable name="status_name"><xsl:value-of
select="status_name"/></xsl:variable>
+ <select name="{$status_name}"
class="forms" onMouseover="window.status='{$lang_status_statustext}'; return
true;" onMouseout="window.status='';return true;">
+ <xsl:apply-templates
select="status_list"/>
+ </select>
+ </td>
+ </tr>
+<!-- <tr>
+ <td>
+ <xsl:value-of select="lang_category"/>
+ </td>
+ <td>
+ <xsl:call-template name="cat_select"/>
+ </td>
+ </tr>
+-->
+ <tr>
+ <td>
+ <xsl:value-of
select="lang_finnish_date"/>
+ </td>
+ <td>
+ <input type="text"
name="values[finnish_date]" value="{value_finnish_date}"
onFocus="{dateformat_validate}" onKeyUp="{onKeyUp}" onBlur="{onBlur}" size="12"
maxlength="10" onMouseout="window.status='';return true;" >
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="statustext"/>
+ <xsl:text>';return
true;</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="disabled">
+
<xsl:text>="disabled"</xsl:text>
+ </xsl:attribute>
+ </input>
+ [<xsl:value-of
select="lang_dateformat"/>]
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_new_note"/>
+ </td>
+ <td>
+ <textarea cols="60" rows="10"
name="values[note]" wrap="virtual" onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_details_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </textarea>
+
+ </td>
+ </tr>
+ <tr height="50">
+ <td>
+ <xsl:variable
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
+ <input type="submit"
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_save_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ </form>
+ <tr>
+ <td>
+ <xsl:variable
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
+ <xsl:variable
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
+ <form method="post"
action="{$done_action}">
+ <input type="submit"
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+
<xsl:value-of select="lang_done_statustext"/>
+ <xsl:text>';
return true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </form>
+ </td>
+ </tr>
+ </table>
+ <hr noshade="noshade" width="100%" align="center" size="1"/>
+ <table width="80%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:choose>
+ <xsl:when test="record_history=''">
+ <tr>
+ <td class="th_text"
align="center">
+ <xsl:value-of
select="lang_no_history"/>
+ </td>
+ </tr>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates
select="table_header_history"/>
+ <xsl:apply-templates
select="record_history"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ </div>
+ <hr noshade="noshade" width="100%" align="center" size="1"/>
+ </xsl:template>
+
<xsl:template match="table_header_additional_notes">
<tr class="th">
<td class="th_text" width="4%" align="right">
Index: login.php
===================================================================
RCS file: login.php
diff -N login.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ login.php 29 Oct 2006 20:04:40 -0000 1.1
@@ -0,0 +1,512 @@
+<?php
+ /**
+ * phpGroupWare
+ *
+ * phpgroupware base
+ * @author Dan Kuykendall <address@hidden>
+ * @author Joseph Engo <address@hidden>
+ * @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 phpgroupware
+ * @version $Id: login.php,v 1.1 2006/10/29 20:04:40 sigurdne Exp $
+ */
+
+ $phpgw_info = array();
+
+ $GLOBALS['phpgw_info']['flags'] = array(
+ 'disable_template_class' => true,
+ 'login' => true,
+ 'currentapp' => 'login',
+ 'noheader' => true
+ );
+ if(file_exists('../header.inc.php'))
+ {
+
+ /**
+ * Include phpgroupware header
+ */
+ include_once('../header.inc.php');
+
+ $GLOBALS['phpgw']->sessions = createObject('phpgwapi.sessions');
+ }
+ else
+ {
+ Header('Location: ../setup/index.php');
+ exit;
+ }
+ $GLOBALS['phpgw_info']['server']['template_set'] =
$GLOBALS['phpgw_info']['login_template_set'];
+
+ $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT
+ .
"/phpgwapi/templates/{$GLOBALS['phpgw_info']['login_template_set']}";
+
+// $tmpl = CreateObject('phpgwapi.Template',
$GLOBALS['phpgw_info']['server']['template_dir']);
+ $tmpl = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT .
'/property/templates/base');
+
+ // This is used for system downtime, to prevent new logins.
+ if( isset($GLOBALS['phpgw_info']['server']['deny_all_logins'])
+ && $GLOBALS['phpgw_info']['server']['deny_all_logins'] )
+ {
+
$tmpl->set_root($GLOBALS['phpgw_info']['server']['template_dir']);
+ $tmpl->set_file(
+ array
+ (
+ 'login_form' => 'login_denylogin.tpl'
+ )
+ );
+ $tmpl->pfp('loginout','login_form');
+ exit;
+ }
+
+ /**
+ * Check logout error code
+ *
+ * @param integer $code Error code
+ * @return string Error message
+ */
+ function check_logoutcode($code)
+ {
+ switch($code)
+ {
+ case 1:
+ return lang('You have been successfully logged
out');
+ case 2:
+ return lang('Sorry, your login has expired');
+ case 5:
+ return lang('Bad login or password');
+ case 99:
+ return lang('Blocked, too many attempts');
+ case 10:
+
$GLOBALS['phpgw']->sessions->phpgw_setcookie('sessionid');
+
$GLOBALS['phpgw']->sessions->phpgw_setcookie('kp3');
+
$GLOBALS['phpgw']->sessions->phpgw_setcookie('domain');
+
+ // fix for bug in php expired sessions not
being cleared
+
if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php')
+ {
+
$GLOBALS['phpgw']->sessions->phpgw_setcookie(PHPGW_PHPSESSID);
+ }
+
+ return lang('Your session could not be
verified.');
+ default:
+ return ' ';
+ }
+ }
+
+
+ /**
+ * Check languages
+ */
+ function check_langs()
+ {
+ // echo "<h1>check_langs()</h1>\n";
+ if ( isset($GLOBALS['phpgw_info']['server']['lang_ctimes'])
+ &&
!is_array($GLOBALS['phpgw_info']['server']['lang_ctimes']))
+ {
+ $GLOBALS['phpgw_info']['server']['lang_ctimes'] =
unserialize($GLOBALS['phpgw_info']['server']['lang_ctimes']);
+ }
+ else if (
!isset($GLOBALS['phpgw_info']['server']['lang_ctimes']) )
+ {
+ $GLOBALS['phpgw_info']['server']['lang_ctimes'] =
array();
+ }
+ //
_debug_array($GLOBALS['phpgw_info']['server']['lang_ctimes']);
+
+ $lang =
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
+ $apps = $GLOBALS['phpgw_info']['user']['apps'];
+ $apps['phpgwapi'] = true; // check the api too
+ while (list($app,$data) = each($apps))
+ {
+ $fname = PHPGW_SERVER_ROOT .
"/$app/setup/phpgw_$lang.lang";
+
+ if (file_exists($fname))
+ {
+ $ctime = filectime($fname);
+ $ltime =
isset($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app])
+ ?
intval($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app]) : 0;
+ //echo "checking lang='$lang', app='$app',
ctime='$ctime', ltime='$ltime'<br>\n";
+
+ if ($ctime != $ltime)
+ {
+ update_langs(); // update all
langs
+ break;
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Update languages
+ */
+ function update_langs()
+ {
+ $GLOBALS['phpgw_setup'] = CreateObject('phpgwapi.setup');
+ $GLOBALS['phpgw_setup']->db = $GLOBALS['phpgw']->db;
+
+ $GLOBALS['phpgw_setup']->detection->check_lang(false); // get
installed langs
+ $langs = $GLOBALS['phpgw_info']['setup']['installed_langs'];
+ while (list($lang) = @each($langs))
+ {
+ $langs[$lang] = $lang;
+ }
+ $_POST['submit'] = true;
+ $_POST['lang_selected'] = $langs;
+ $_POST['upgrademethod'] = 'dumpold';
+ $included = 'from_login';
+
+ /**
+ * Include languages setup
+ */
+ include(PHPGW_SERVER_ROOT . '/setup/lang.php');
+ }
+
+ /* Program starts here */
+ $login = isset($_POST['login']) ? $_POST['login'] : '';
+ $passwd = isset($_POST['passwd']) ? $_POST['passwd'] : '';
+ if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' &&
isset($_SERVER['PHP_AUTH_USER']))
+ {
+ $submit = true;
+ $login = $_SERVER['PHP_AUTH_USER'];
+ $passwd = $_SERVER['PHP_AUTH_PW'];
+ }
+
+ if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'ntlm' &&
isset($_SERVER['REMOTE_USER']))
+ {
+ $submit = true;
+ $login = $_SERVER['REMOTE_USER'];
+ $passwd = '';
+ }
+
+ # Apache + mod_ssl style SSL certificate authentication
+ # Certificate (chain) verification occurs inside mod_ssl
+ if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' &&
isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd']))
+ {
+ # an X.509 subject looks like:
+ #
/CN=john.doe/OU=Department/O=Company/C=xx/address@hidden/L=City/
+ # the username is deliberately lowercase, to ease LDAP
integration
+ $sslattribs = explode('/',$_SERVER['SSL_CLIENT_S_DN']);
+ # skip the part in front of the first '/' (nothing)
+ while ($sslattrib = next($sslattribs))
+ {
+ list($key,$val) = explode('=',$sslattrib);
+ $sslattributes[$key] = $val;
+ }
+
+ if (isset($sslattributes['Email']))
+ {
+ $submit = true;
+
+ # login will be set here if the user logged out and
uses a different username with
+ # the same SSL-certificate.
+ if
(!isset($_POST['login'])&&isset($sslattributes['Email'])) {
+ $login = $sslattributes['Email'];
+ # not checked against the database, but
delivered to authentication module
+ $passwd = $_SERVER['SSL_CLIENT_S_DN'];
+ }
+ }
+ unset($key);
+ unset($val);
+ unset($sslattributes);
+ }
+
+ if (isset($_POST['passwd_type']) && (isset($_POST['submitit']) ||
isset($_POST['submit_x']) || isset($_POST['submit_y']) ) )
+ {
+ if ( $_SERVER['REQUEST_METHOD'] != 'POST' &&
+ !isset($_SERVER['PHP_AUTH_USER']) &&
+ !isset($_SERVER['REMOTE_USER']) &&
+ !isset($_SERVER['SSL_CLIENT_S_DN'])
+ )
+ {
+ $GLOBALS['phpgw']->redirect('login.php', array('cd' =>
'5'));
+ }
+
+// start mapping
+ if(isset($_POST['loginusertype']) && $_POST['loginusertype'] ==
'tenant')
+ {
+ $db = & $GLOBALS['phpgw']->db;
+ $join = $db->join;
+
+ $_passwd = md5($passwd);
+
+ $db->query("SELECT fm_tenant.id,
phpgw_account_lid,phpgw_accounts.account_pwd FROM fm_tenant $join
phpgw_accounts ON fm_tenant.phpgw_account_lid = phpgw_accounts.account_lid
WHERE fm_tenant.account_lid = '$login' AND "
+ . "fm_tenant.account_pwd='" . $_passwd . "' AND
fm_tenant.account_status ='A'",__LINE__,__FILE__);
+ $db->next_record();
+
+ if (!$db->f('phpgw_account_lid'))
+ {
+ $GLOBALS['phpgw']->redirect('login.php?cd=5');
+ exit;
+ }
+
+ $tenant_id = $db->f('id');
+ $login = $db->f('phpgw_account_lid');
+ $passwd = $db->f('account_pwd');
+
+ $_POST['passwd_type'] = 'md5';
+
+ if (
isset($GLOBALS['phpgw_info']['server']['usecookies']) &&
$GLOBALS['phpgw_info']['server']['usecookies'] )
+ {
+
$GLOBALS['phpgw']->session->phpgw_setcookie('last_usertype',
$_POST['loginusertype'] ,time()+1209600); /* For 2 weeks */
+ }
+ }
+// end mapping
+
+ if (strstr($login,'@') === false &&
isset($_POST['logindomain']))
+ {
+ $login .= '@' . $_POST['logindomain'];
+ }
+
+ $GLOBALS['sessionid'] =
$GLOBALS['phpgw']->session->create($login,$passwd,$_POST['passwd_type']);
+
+
$GLOBALS['phpgw']->session->appsession('tenant_id','property',$tenant_id);
+
+
+ if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
+ {
+ $GLOBALS['phpgw']->redirect('login.php?cd=' .
$GLOBALS['phpgw']->session->cd_reason);
+ exit;
+ }
+
+ $forward = get_var('phpgw_forward', array('GET', 'POST'), 0);
+ if($forward)
+ {
+ $extra_vars['phpgw_forward'] = $forward;
+ foreach($_GET as $name => $value)
+ {
+ if (ereg('phpgw_',$name))
+ {
+ $extra_vars[$name] = $value;
+ }
+ }
+ }
+ if (
!isset($GLOBALS['phpgw_info']['server']['disable_autoload_langfiles']) ||
!$GLOBALS['phpgw_info']['server']['disable_autoload_langfiles'] )
+ {
+ check_langs();
+ }
+ $extra_vars['cd'] = 'yes';
+
+ $GLOBALS['phpgw']->hooks->process('login');
+
+ if( isset($GLOBALS['phpgw_info']['server']['shm_lang'])
+ && $GLOBALS['phpgw_info']['server']['shm_lang']
+ && function_exists('sem_get'))
+ {
+ if(!$GLOBALS['phpgw']->shm->get_value('lang_en'))
+ {
+ $GLOBALS['phpgw']->translation->populate_shm();
+ }
+ }
+
+ $GLOBALS['phpgw']->redirect_link('/home.php', $extra_vars);
+ exit;
+ }
+
+ $tmpl->set_file(array('login_form' => 'login.tpl'));
+ $tmpl->set_var('charset', lang('charset'));
+ $tmpl->set_block('login_form', 'domain_option', 'domain_options');
+ $tmpl->set_block('login_form', 'domain_select', 'domain_selects');
+ $tmpl->set_block('login_form', 'domain_from_host', 'domain_from_hosts');
+ $tmpl->set_block('login_form', 'usertype_option', 'usertype_options');
+ $tmpl->set_block('login_form', 'usertype_select', 'usertype_selects');
+
+ if( $GLOBALS['phpgw_info']['server']['domain_from_host']
+ && !$GLOBALS['phpgw_info']['server']['show_domain_selectbox'] )
+ {
+ $tmpl->set_var(
+ array(
+ 'domain_selects' => '',
+ 'logindomain' =>
$_SERVER['SERVER_NAME']
+ )
+ );
+ $tmpl->parse('domain_from_hosts', 'domain_from_host');
+ }
+ elseif( $GLOBALS['phpgw_info']['server']['show_domain_selectbox'] )
+ {
+ foreach($GLOBALS['phpgw_domain'] as $domain_name =>
$domain_vars)
+ {
+ $tmpl->set_var('domain_name', $domain_name);
+
+ if (isset($_COOKIE['last_domain']) &&
$_COOKIE['last_domain'] == $domain_name)
+ {
+ $tmpl->set_var('domain_selected',
'selected="selected"');
+ }
+ else
+ {
+ $tmpl->set_var('domain_selected', '');
+ }
+ $tmpl->parse('domain_options', 'domain_option', true);
+ }
+ $tmpl->parse('domain_selects', 'domain_select');
+ $tmpl->set_var(
+ array(
+ 'domain_from_hosts' => '',
+ 'lang_domain' =>
lang('domain')
+ )
+ );
+ }
+ else
+ {
+ $tmpl->set_var(
+ array(
+ 'domain_selects' => '',
+ 'domain_from_hosts' => ''
+ )
+ );
+
+ }
+
+ $usertypes =
array('tenant'=>lang('tenant'),'internal'=>lang('internal'));
+ foreach($usertypes as $usertype_id => $usertype_name)
+ {
+ $tmpl->set_var('usertype_id', $usertype_id);
+ $tmpl->set_var('usertype_name', $usertype_name);
+
+ if (isset($_COOKIE['last_usertype']) &&
$_COOKIE['last_usertype']==$usertype_id)
+ {
+ $tmpl->set_var('usertype_selected',
'selected="selected"');
+ }
+ else
+ {
+ $tmpl->set_var('usertype_selected', '');
+ }
+ $tmpl->parse('usertype_options', 'usertype_option', true);
+ }
+ $tmpl->parse('usertype_selects', 'usertype_select');
+ $tmpl->set_var(
+ array(
+ 'usertype_from_hosts' => '',
+ 'lang_usertype' => lang('Usertype')
+ )
+ );
+
+ if (isset($_COOKIE['last_loginid']))
+ {
+ $accounts = CreateObject('phpgwapi.accounts');
+ $prefs = CreateObject('phpgwapi.preferences',
$accounts->name2id($_COOKIE['last_loginid']));
+
+ if (! $prefs->account_id)
+ {
+
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en';
+ }
+ else
+ {
+ $GLOBALS['phpgw_info']['user']['preferences'] =
$prefs->read_repository();
+ }
+ #print 'LANG:' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '<br>';
+ }
+ else
+ {
+ // If the lastloginid cookies isn't set, we will default to
english.
+ // Change this if you need.
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']
= 'en';
+ }
+ $GLOBALS['phpgw']->translation->add_app('login');
+ $GLOBALS['phpgw']->translation->add_app('loginscreen');
+ if ( ($login_msg = lang('loginscreen_message') ) !=
'loginscreen_message*')
+ {
+ $tmpl->set_var('lang_message', stripslashes($login_msg) );
+ }
+ else
+ {
+ $tmpl->set_var('lang_message', ' ');
+ }
+
+ if( ( !isset($GLOBALS['phpgw_info']['server']['usecookies']) ||
!$GLOBALS['phpgw_info']['server']['usecookies'] )
+ && (isset($_COOKIE) && is_array($_COOKIE) ) )
+ {
+ if ( isset($_COOKIE['last_loginid']) )
+ {
+ unset($_COOKIE['last_loginid']);
+ }
+
+ if ( isset($_COOKIE['last_domain']) )
+ {
+ unset($_COOKIE['last_domain']);
+ }
+ if ( isset($_COOKIE['last_usertype']) )
+ {
+ unset($_COOKIE['last_usertype']);
+ }
+
+ }
+
+ $last_loginid = isset($_COOKIE['last_loginid']) ?
$_COOKIE['last_loginid'] : '';
+ if($GLOBALS['phpgw_info']['server']['show_domain_selectbox'] &&
$last_loginid !== '')
+ {
+ reset($GLOBALS['phpgw_domain']);
+ list($default_domain) = each($GLOBALS['phpgw_domain']);
+
+ if ($_COOKIE['last_domain'] != $default_domain &&
!empty($_COOKIE['last_domain']))
+ {
+ $last_loginid .= '@' . $_COOKIE['last_domain'];
+ }
+ }
+
+ //FIXME switch to an array
+ $extra_vars = array();
+ foreach($_GET as $name => $value)
+ {
+ if (ereg('phpgw_',$name))
+ {
+ $extra_vars[$name] = urlencode($value);
+ }
+ }
+
+ $cd = 0;
+ if ( isset($_GET['cd']) )
+ {
+ $cd = (int) $_GET['cd'];
+ }
+
+ $tmpl->set_var('login_url',
$GLOBALS['phpgw_info']['server']['webserver_url'] . '/property/login.php?' .
http_build_query($extra_vars) );
+
$tmpl->set_var('registration_url',$GLOBALS['phpgw_info']['server']['webserver_url']
. '/registration/');
+ $tmpl->set_var('version',
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
+ $tmpl->set_var('cd', check_logoutcode($cd) );
+ $tmpl->set_var('last_loginid', $last_loginid);
+
+ $tmpl->set_var('lang_username', lang('username'));
+ $tmpl->set_var('lang_password', lang('password'));
+ $tmpl->set_var('lang_login', lang('login'));
+
+ $tmpl->set_var('lang_testjs', lang('Your browser does not support
javascript and/or css, please use a modern standards compliant browser. If you
have disabled either of these features please enable them for this site.') );
+
+ $tmpl->set_var('website_title',
isset($GLOBALS['phpgw_info']['server']['site_title'])
+ ?
$GLOBALS['phpgw_info']['server']['site_title']
+ : 'phpGroupWare'
+ );
+
+ $tmpl->set_var('template_set',
$GLOBALS['phpgw_info']['login_template_set']);
+
+ if( is_file( PHPGW_SERVER_ROOT . SEP . 'phpgwapi' . SEP . 'templates'
+ . SEP . $GLOBALS['phpgw_info']['login_template_set'] . SEP .
'css' . SEP . 'base.css') )
+ {
+ $base_css = '../phpgwapi/templates/' .
$GLOBALS['phpgw_info']['login_template_set'] . '/css/base.css';
+ }
+ else
+ {
+ $base_css = '../phpgwapi/templates/base/css/base.css';
+ }
+
+ if( is_file( PHPGW_SERVER_ROOT . SEP . 'phpgwapi' . SEP . 'templates'
+ . SEP . $GLOBALS['phpgw_info']['login_template_set'] . SEP .
'css' . SEP . 'login.css') )
+ {
+ $login_css = '../phpgwapi/templates/' .
$GLOBALS['phpgw_info']['login_template_set'] . '/css/login.css';
+ }
+ else
+ {
+ $login_css = '../phpgwapi/templates/base/css/login.css';
+ }
+
+ $tmpl->set_var('base_css', $base_css);
+ $tmpl->set_var('login_css', $login_css);
+
+ $autocomplete = '';
+ if ( isset($GLOBALS['phpgw_info']['server']['autocomplete_login'])
+ && $GLOBALS['phpgw_info']['server']['autocomplete_login'] )
+ {
+ $autocomplete = 'autocomplete="off"';
+ }
+ $tmpl->set_var('autocomplete', $autocomplete);
+ unset($autocomplete);
+
+ $tmpl->pfp('loginout','login_form');
+?>
Index: templates/base/login.tpl
===================================================================
RCS file: templates/base/login.tpl
diff -N templates/base/login.tpl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ templates/base/login.tpl 29 Oct 2006 20:04:40 -0000 1.1
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<!-- BEGIN login_form -->
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset={charset}"
/>
+ <meta name="author" content="phpGroupWare http://www.phpgroupware.org"
/>
+ <meta name="description" content="{website_title} login screen, working
environment powered by phpGroupWare" />
+ <meta name="keywords" content="{website_title} login screen,
phpgroupware, groupware, groupware suite" />
+ <meta name="robots" content="noindex,nofollow" />
+
+ <title>{website_title} - {lang_login}</title>
+
+ <link rel="stylesheet" href="{base_css}" type="text/css" />
+ <link rel="stylesheet" href="{login_css}" type="text/css" />
+
+ <!--[if gte IE 5.5000]>
+ <script type="text/javascript">
+ function fixIE()
+ {
+
document.getElementsByTagName('body')[0].className = 'MSIE';
+ }
+ window.attachEvent('onload', fixIE);
+ </script>
+ <![endif]-->
+
+ <script type="text/javascript">
+ <!--
+ function testjs()
+ {
+ document.getElementById('testjs').style.display =
'none';
+ }
+ -->
+ </script>
+</head>
+
+<body onLoad="testjs();">
+ <div id="horizon">
+
+ <div id="loginmsg">{lang_message}</div>
+
+ <form name="login" method="post" action="{login_url}"
{autocomplete}>
+ <div id="loginbox">
+ <div id="logintitle">{website_title} -
{lang_login}</div>
+ <p class="msg">{cd}</p>
+ <input type="hidden" name="passwd_type" value="text" />
+
+ <label for="login">{lang_username}:</label>
+ <input type="text" name="login" id="login"
value="{last_loginid}" />
+ <!-- BEGIN domain_from_host -->
+ @{logindomain}<input type="hidden"
name="logindomain" value="{logindomain}" />
+ <!-- END domain_from_host -->
+ <br />
+
+ <label for="passwd">{lang_password}:</label>
+ <input type="password" name="passwd" id="passwd" /><br
/>
+
+ <!-- BEGIN domain_select -->
+ <label for="logindomain">{lang_domain}:</label>
+ <select name="logindomain" id="logindomain">
+ <!-- BEGIN domain_option -->
+ <option value="{domain_name}"
{domain_selected}>{domain_name}</option>
+ <!-- END domain_option -->
+ </select><br />
+ <!-- END domain_select -->
+
+ <!-- BEGIN usertype_select -->
+ <label for="loginusertype">{lang_usertype}:</label>
+ <select name="loginusertype" id="loginusertype">
+ <!-- BEGIN usertype_option -->
+ <option value="{usertype_id}"
{usertype_selected}>{usertype_name}</option>
+ <!-- END usertype_option -->
+ </select><br />
+ <!-- END usertype_select -->
+
+ <p class="button_group"><input type="submit"
value="{lang_login}" name="submitit" /></p>
+ <p id="version">phpGroupWare {version}</p>
+ </div>
+ </form>
+ <div id="testjs">
+ {lang_testjs}<br />
+ <a href="http://getfirefox.com/" target="_blank"
+ title="Get Firefox"><img
src="http://www.mozilla.org/products/firefox/buttons/firefox_80x15.png"
+ width="80" height="15" alt="Get Firefox" /></a>
+ </div>
+ </div>
+</body>
+<!-- END login_form -->
+</html>
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property inc/class.botts.inc.php inc/class.sott...,
Sigurd Nes <=