[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.2,1.3 clas
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.2,1.3 class.boinvoice.inc.php,1.4,1.5 class.soinvoice.inc.php,1.4,1.5 class.soXport.inc.php,1.10,1.11 class.uiinvoice.inc.php,1.2,1.3 class.uiXport.inc.php,1.8,1.9 |
Date: |
Mon, 06 Jan 2003 11:51:16 -0500 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv1016/inc
Modified Files:
class.bocommon.inc.php class.boinvoice.inc.php
class.soinvoice.inc.php class.soXport.inc.php
class.uiinvoice.inc.php class.uiXport.inc.php
Log Message:
no message
Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bocommon.inc.php 2 Jan 2003 22:03:57 -0000 1.2
--- class.bocommon.inc.php 6 Jan 2003 16:51:12 -0000 1.3
***************
*** 18,21 ****
--- 18,22 ----
var $district_id;
+
var $public_functions = array
(
***************
*** 98,102 ****
--- 99,131 ----
$this->district_id = $district_id;
}
+
+ if
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
+ {
+ $this->dateformat = "M d Y";
+ $this->datetimeformat = "M d Y g:iA";
+ }
+ else
+ {
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ }
+
}
+
+
+ function moneyformat ($amount)
+ {
+ if
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
+ {
+ $moneyformat =
"CONVERT(MONEY,"."'$amount'".",0)";
+ }
+ else
+ {
+ $moneyformat = "'" . $amount . "'";
+ }
+
+ return $moneyformat;
+ }
+
function list_methods($_type='xmlrpc')
Index: class.boinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvoice.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.boinvoice.inc.php 6 Jan 2003 08:29:56 -0000 1.4
--- class.boinvoice.inc.php 6 Jan 2003 16:51:12 -0000 1.5
***************
*** 27,30 ****
--- 27,31 ----
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so =
CreateObject($this->currentapp.'.soinvoice',True);
+ $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
if($useacl)
{
***************
*** 186,190 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif ($entry['sign']=='sign_janitor'
&& $entry['sign_orig']=='supervisor'):
--- 187,191 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif ($entry['sign']=='sign_janitor'
&& $entry['sign_orig']=='supervisor'):
***************
*** 193,197 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif ($entry['sign']=='sign_janitor'
&& $entry['sign_orig']=='budget_responsible'):
--- 194,198 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif ($entry['sign']=='sign_janitor'
&& $entry['sign_orig']=='budget_responsible'):
***************
*** 200,204 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' && !$entry['sign_orig']):
--- 201,205 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' && !$entry['sign_orig']):
***************
*** 207,211 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' && $entry['sign_orig']=='janitor'):
--- 208,212 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' && $entry['sign_orig']=='janitor'):
***************
*** 214,218 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' &&
$entry['sign_orig']=='budget_responsible'):
--- 215,219 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_supervisor' &&
$entry['sign_orig']=='budget_responsible'):
***************
*** 221,225 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' && $entry['sign_orig']=='janitor'):
--- 222,226 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'saksigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' && $entry['sign_orig']=='janitor'):
***************
*** 228,232 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' &&
$entry['sign_orig']=='supervisor'):
--- 229,233 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' &&
$entry['sign_orig']=='supervisor'):
***************
*** 235,239 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' && !$entry['sign_orig']):
--- 236,240 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
elseif
($entry['sign']=='sign_budget_responsible' && !$entry['sign_orig']):
***************
*** 242,246 ****
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" . date("Y-m-d
G:i:s") . "'";
$kommma=",";
endif;
--- 243,247 ----
$sign_id = "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
! $sign_date="'" .
date($this->bocommon->datetimeformat) . "'";
$kommma=",";
endif;
***************
*** 261,265 ****
if
(!($entry['num_days_orig']==$entry['num_days']))
{
! $payment_date =
date("Y-m-d",$entry['timestamp_invoice_date']+(24*3600*$entry['num_days']));
$GLOBALS['phpgw']->db->query("update t_ecobilag set forfallsdato=
'$payment_date' where bilagsnr='$invoice_id'");
}
--- 262,266 ----
if
(!($entry['num_days_orig']==$entry['num_days']))
{
! $payment_date =
date($this->bocommon->dateformat,$entry['timestamp_invoice_date']+(24*3600*$entry['num_days']));
$GLOBALS['phpgw']->db->query("update t_ecobilag set forfallsdato=
'$payment_date' where bilagsnr='$invoice_id'");
}
***************
*** 269,273 ****
$transfer_id="'$user_lid',";
! $transfer_date="'" .
date("Y-m-d G:i:s") . "'";
}
else
--- 270,274 ----
$transfer_id="'$user_lid',";
! $transfer_date="'" .
date($this->bocommon->datetimeformat) . "'";
}
else
***************
*** 338,341 ****
--- 339,361 ----
return $user_list;
+ }
+
+ function period_list($selected='')
+ {
+ for ($i=1; $i<=12; $i++)
+ {
+ $period_list[$i]['id'] = $i;
+ $period_list[$i]['name'] = $i;
+ if($i==$selected)
+ {
+ $period_list[$i]['selected'] =
'selected';
+ }
+ }
+ return $period_list;
+ }
+
+ function update_period($invoice_id='',$period='')
+ {
+ return $message =
$this->so->update_period($invoice_id,$period);
}
Index: class.soinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvoice.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.soinvoice.inc.php 6 Jan 2003 08:29:57 -0000 1.4
--- class.soinvoice.inc.php 6 Jan 2003 16:51:12 -0000 1.5
***************
*** 228,231 ****
--- 228,244 ----
+ function update_period($invoice_id='',$period='')
+ {
+ $this->db->transaction_begin();
+
+ $this->db->query("update t_ecobilag set
periode='$period' where bilagsnr='$invoice_id'");
+
+ $this->db->transaction_commit();
+
+ return lang('invoice period is updated');
+
+ }
+
+
function increment_bilagsnr()
{
Index: class.soXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soXport.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.soXport.inc.php 6 Jan 2003 08:29:57 -0000 1.10
--- class.soXport.inc.php 6 Jan 2003 16:51:12 -0000 1.11
***************
*** 8,12 ****
var $account_id = 0;
var $total_records = 0;
- var $grants = '';
/* The left side are the array elements used throughout phpgw,
right side are the db field names. */
--- 8,11 ----
***************
*** 47,55 ****
function soXport($useacl=True)
{
$this->db = $GLOBALS['phpgw']->db;
! if($useacl)
! {
! $this->grants =
$GLOBALS['phpgw']->acl->get_grants('property');
! }
$this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
--- 46,54 ----
function soXport($useacl=True)
{
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+
$this->db = $GLOBALS['phpgw']->db;
!
$this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
***************
*** 63,67 ****
$this->join = " LEFT JOIN ";
}
- return $join;
}
--- 62,65 ----
***************
*** 225,230 ****
$merknad=$fields['merknad'];
$sql= "INSERT INTO t_ecobilag
(pmwrkord_code,bilagsnr,splitt,kildeid,kidnr,typeid,fakturadato,forfallsdato,regtid,artid,godkjentbelop,spvend_code,dimb,oppsynsmannid,saksbehandlerid,budsjettansvarligid,fakturanr,spbudact_code,dima,dimd,mvakode,belop,periode,merknad)"
! . " values
($pmwrkord_code_value,'$bilagsnr','$splitt','$kildeid','$kidnr','$typeid','$fakturadato','$forfallsdato','$regtid','$artid',CONVERT(MONEY,"."'$godkjentbelop'".",0),'$spvend_code',$dimb_value,$oppsynsmannid_value,$saksbehandlerid_value,'$budsjettansvarligid','$fakturanr',$spbudact_code_value,'$dima',$dimd_value,'$mvakode',CONVERT(MONEY,"."'$belop'".",0),'$periode','$merknad')";
//echo 'sql'.$sql.'<br>';
--- 223,231 ----
$merknad=$fields['merknad'];
+ $belop=$this->bocommon->moneyformat($belop);
+
$godkjentbelop=$this->bocommon->moneyformat($godkjentbelop);
+
$sql= "INSERT INTO t_ecobilag
(pmwrkord_code,bilagsnr,splitt,kildeid,kidnr,typeid,fakturadato,forfallsdato,regtid,artid,godkjentbelop,spvend_code,dimb,oppsynsmannid,saksbehandlerid,budsjettansvarligid,fakturanr,spbudact_code,dima,dimd,mvakode,belop,periode,merknad)"
! . " values
($pmwrkord_code_value,'$bilagsnr','$splitt','$kildeid','$kidnr','$typeid','$fakturadato','$forfallsdato','$regtid','$artid',$godkjentbelop,'$spvend_code',$dimb_value,$oppsynsmannid_value,$saksbehandlerid_value,'$budsjettansvarligid','$fakturanr',$spbudact_code_value,'$dima',$dimd_value,'$mvakode',$belop,'$periode','$merknad')";
//echo 'sql'.$sql.'<br>';
***************
*** 736,740 ****
function log_start($batchid)
{
! $tid=date("M d Y g:iA");
$sql= "insert t_ecologg (batchid,melding,tid) values
('$batchid','Start transfer','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
--- 737,741 ----
function log_start($batchid)
{
! $tid=date($this->bocommon->datetimeformat);
$sql= "insert t_ecologg (batchid,melding,tid) values
('$batchid','Start transfer','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
***************
*** 742,746 ****
function log_end($batchid)
{
! $tid=date("M d Y g:iA");
$sql= "insert t_ecologg (batchid,melding,tid) values
('$batchid','End transfer','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
--- 743,747 ----
function log_end($batchid)
{
! $tid=date($this->bocommon->datetimeformat);
$sql= "insert t_ecologg (batchid,melding,tid) values
('$batchid','End transfer','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
***************
*** 749,753 ****
function log_error($batchid,$error_desr)
{
! $tid=date("M d Y g:iA");
$sql= "insert t_ecologg (batchid,ecobilagid,status,melding,tid)
values ('$batchid',NULL,0,'$error_desr','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
--- 750,754 ----
function log_error($batchid,$error_desr)
{
! $tid=date($this->bocommon->datetimeformat);
$sql= "insert t_ecologg (batchid,ecobilagid,status,melding,tid)
values ('$batchid',NULL,0,'$error_desr','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
***************
*** 758,762 ****
{
$message=lang('Invoice tranferred');
! $tid=date("M d Y g:iA");
$sql= "insert t_ecologg
(batchid,ecobilagid,melding,tid) values ('$batchid','$bilagid'
,'$message','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
--- 759,763 ----
{
$message=lang('Invoice tranferred');
! $tid=date($this->bocommon->datetimeformat);
$sql= "insert t_ecologg
(batchid,ecobilagid,melding,tid) values ('$batchid','$bilagid'
,'$message','$tid')";
$this->db->query($sql,__LINE__,__FILE__);
Index: class.uiinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiinvoice.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uiinvoice.inc.php 6 Jan 2003 08:29:57 -0000 1.2
--- class.uiinvoice.inc.php 6 Jan 2003 16:51:12 -0000 1.3
***************
*** 22,28 ****
var $public_functions = array
(
! 'index' => True,
! 'property' => True,
! 'equipment' => True
);
--- 22,29 ----
var $public_functions = array
(
! 'index' => True,
! 'edit_period' => True,
! 'property' => True,
! 'equipment' => True
);
***************
*** 102,106 ****
$content[$i]['lang_sub']
= lang('Invoice ID');
$content[$i]['lang_sub_help']
= lang('Klick this link to enter the list of sub-invoices');
! $content[$i]['link_period']
= $this->currentapp.'.uiinvoice.edit_period';
$content[$i]['lang_period']
= lang('Period');
$content[$i]['lang_period_help']
= lang('Klick this link to edit the period');
--- 103,107 ----
$content[$i]['lang_sub']
= lang('Invoice ID');
$content[$i]['lang_sub_help']
= lang('Klick this link to enter the list of sub-invoices');
! $content[$i]['link_period']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.edit_period');
$content[$i]['lang_period']
= lang('Period');
$content[$i]['lang_period_help']
= lang('Klick this link to edit the period');
***************
*** 219,222 ****
--- 220,259 ----
$this->save_sessiondata();
}
+
+ function edit_period()
+ {
+ $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
+
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header',
+
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'filter_select',
+
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'search_field'));
+
+ $invoice_id =
get_var('invoice_id',array('POST','GET'));
+ $period =
get_var('period',array('POST','GET'));
+ $submit =
get_var('submit',array('POST','GET'));
+
+ if($submit)
+ {
+ $message =
$this->bo->update_period($invoice_id,$period);
+ }
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uiinvoice.edit_period',
+ 'invoice_id' => $invoice_id);
+
+
+ $data = array
+ (
+ 'period_list'
=> $this->bo->period_list($period),
+ 'message'
=> $message,
+ 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'lang_save'
=> lang('save'),
+ 'select_name'
=> 'period'
+ );
+
+ //_debug_array($data);
+
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_period' => $data));
+ }
}
Index: class.uiXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiXport.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.uiXport.inc.php 2 Jan 2003 22:03:57 -0000 1.8
--- class.uiXport.inc.php 6 Jan 2003 16:51:12 -0000 1.9
***************
*** 28,31 ****
--- 28,32 ----
$this->browser = CreateObject('phpgwapi.browser');
$this->invoice =
CreateObject($this->currentapp.'.boinvoice');
+ $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
$this->$config =
CreateObject('phpgwapi.config','property');
***************
*** 68,71 ****
--- 69,76 ----
$download =
get_var('download',array('POST','GET'));
+ $sub = get_var('sub',array('POST','GET'));
+
+ $links = $this->bocommon->menu($sub);
+
//_debug_array($values);
***************
*** 122,126 ****
{
$sdate =
mktime(2,0,0,$smonth,$sday,$syear);
! $fakturadato= date("M d Y",$sdate);
}
else
--- 127,131 ----
{
$sdate =
mktime(2,0,0,$smonth,$sday,$syear);
! $fakturadato=
date($this->bocommon->dateformat,$sdate);
}
else
***************
*** 243,246 ****
--- 248,252 ----
+ 'links'
=> $links,
'link_calendar_invoice_date' =>
'setDateField(document.form.invoice_date);top.newWin=window.open('."'.".'/'.$this->currentapp.'/inc/calendar.html'."'".','."'".'cal'."'".','."'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes'".')',
'link_calendar_payment_date' =>
'setDateField(document.form.payment_date);top.newWin=window.open('."'.".'/'.$this->currentapp.'/inc/calendar.html'."'".','."'".'cal'."'".','."'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes'".')',
***************
*** 352,357 ****
//_debug_array($data);
! $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
!
'select_date',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header'));
--- 358,362 ----
//_debug_array($data);
!
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header'));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.2,1.3 class.boinvoice.inc.php,1.4,1.5 class.soinvoice.inc.php,1.4,1.5 class.soXport.inc.php,1.10,1.11 class.uiinvoice.inc.php,1.2,1.3 class.uiXport.inc.php,1.8,1.9,
Sigurd Nes <address@hidden> <=