[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9121] Added support for changing internal and extern
From: |
Alexander Stevenson |
Subject: |
[Fmsystem-commits] [9121] Added support for changing internal and external billing sequential numbers through Administrator interface |
Date: |
Wed, 11 Apr 2012 12:39:33 +0000 |
Revision: 9121
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9121
Author: andvare
Date: 2012-04-11 12:39:29 +0000 (Wed, 11 Apr 2012)
Log Message:
-----------
Added support for changing internal and external billing sequential numbers
through Administrator interface
Modified Paths:
--------------
trunk/booking/inc/class.uisettings.inc.php
trunk/booking/setup/phpgw_no.lang
trunk/booking/templates/base/settings.xsl
Modified: trunk/booking/inc/class.uisettings.inc.php
===================================================================
--- trunk/booking/inc/class.uisettings.inc.php 2012-04-11 07:31:38 UTC (rev
9120)
+++ trunk/booking/inc/class.uisettings.inc.php 2012-04-11 12:39:29 UTC (rev
9121)
@@ -1,5 +1,6 @@
<?php
phpgw::import_class('booking.uicommon');
+ phpgw::import_class('booking.uicommon');
class booking_uisettings extends booking_uicommon
{
@@ -19,9 +20,13 @@
$config = CreateObject('phpgwapi.config','booking');
$config->read();
+ // Define internal and external billing sequence number
values
+ $internal_value = null;
+ $external_value = null;
+
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
- foreach($_POST as $dim => $value)
+ foreach($_POST['config_data'] as $dim => $value)
{
if (strlen(trim($value)) > 0)
{
@@ -33,8 +38,31 @@
}
}
$config->save_repository();
+
+ // Save internal and external sequential
numbers to database
+ if( isset( $_POST['billing'] ) ) {
+ $internal_value = intval(
$_POST['billing']['internal'] );
+ $external_value = intval(
$_POST['billing']['external'] );
+ $GLOBALS['phpgw']->db->query( "UPDATE
bb_billing_sequential_number_generator SET value=" . $internal_value . " WHERE
name='internal'" );
+ $GLOBALS['phpgw']->db->query( "UPDATE
bb_billing_sequential_number_generator SET value=" . $external_value . " WHERE
name='external'" );
+ }
}
-
- self::render_template('settings', array('config_data'
=>$config->config_data));
+
+ // Load internal and external sequential numbers from
database (if not already set) and insert into $billing
+ if( is_null( $internal_value ) || is_null(
$external_value ) ) {
+ $db = $GLOBALS['phpgw']->db;
+ $db->query( "SELECT name, value FROM
bb_billing_sequential_number_generator WHERE name='internal' OR name='external'
LIMIT 2" );
+ while( $db->next_record() ) {
+ if( !strcmp( $db->f( 'name', false ),
"internal" ) ) {
+ $internal_value = intval(
$db->f( 'value', false ) );
+ } else if( !strcmp( $db->f( 'name',
false ), "external" ) ) {
+ $external_value = intval(
$db->f( 'value', false ) );
+ }
+ }
+ }
+ $billing = array( 'internal' => $internal_value,
+ 'external' => $external_value );
+
+ self::render_template('settings', array('config_data'
=>$config->config_data, 'billing' => $billing ) );
}
}
Modified: trunk/booking/setup/phpgw_no.lang
===================================================================
--- trunk/booking/setup/phpgw_no.lang 2012-04-11 07:31:38 UTC (rev 9120)
+++ trunk/booking/setup/phpgw_no.lang 2012-04-11 12:39:29 UTC (rev 9121)
@@ -544,4 +544,8 @@
There is a cost of %1 assosiated with the allocation you are useing booking
no Det er en kostnad på %1kr knyttet til den tildelingen du bruker.
Export booking no Eksport
Upload booking no Last opp
-Get all contact and invoice information from organization booking no
Hent all kontakt/faktura informasjon fra Organisasjon
+Get all contact and invoice information from organization booking no
Hent all kontakt/faktura informasjon fra Organisasjon
+Current internal billing sequence number booking no Nåværende
sekvensnummer for intern fakturering
+Current external billing sequence number booking no Nåværende
sekvensnummer for ekstern fakturering
+Billing sequence numbers booking no Sekvensnummer for fakturering
+Do not change these values unless you know what they are. booking no
Ikke endre disse verdiene med mindre du vet hva de er.
Modified: trunk/booking/templates/base/settings.xsl
===================================================================
--- trunk/booking/templates/base/settings.xsl 2012-04-11 07:31:38 UTC (rev
9120)
+++ trunk/booking/templates/base/settings.xsl 2012-04-11 12:39:29 UTC (rev
9121)
@@ -10,10 +10,10 @@
<form action="" method="POST">
- <dl class="form-col">
+ <dl class="form">
<dt><label for="field_user_can_delete"><xsl:value-of
select="php:function('lang', 'Frontend users can delete bookings and
allocations')"/></label></dt>
<dd>
- <select id="field_user_can_delete"
name="user_can_delete">
+ <select id="field_user_can_delete"
name="config_data[user_can_delete]">
<option value="no">
<xsl:if test="config_data/user_can_delete='no'">
<xsl:attribute
name="selected">checked</xsl:attribute>
@@ -28,7 +28,24 @@
</option>
</select>
</dd>
- </dl>
+ <dt class="heading"><xsl:value-of select="php:function('lang',
'Billing sequence numbers')"/></dt>
+ <dd>
+ <xsl:value-of select="php:function('lang', 'Do
not change these values unless you know what they are.')"/>
+ </dd>
+ <dt><label
for="field_internal_billing_sequence_number"><xsl:value-of
select="php:function('lang', 'Current internal billing sequence number')"
/></label></dt>
+ <dd>
+ <input type="number" name="billing[internal]">
+ <xsl:attribute
name="value"><xsl:value-of select="billing/internal"/></xsl:attribute>
+ </input>
+ </dd>
+
+ <dt><label
for="field_external_billing_sequence_number"><xsl:value-of
select="php:function('lang', 'Current external billing sequence number')"
/></label></dt>
+ <dd>
+ <input type="number" name="billing[external]">
+ <xsl:attribute
name="value"><xsl:value-of select="billing/external"/></xsl:attribute>
+ </input>
+ </dd>
+ </dl>
<div class="form-buttons">
<input type="submit">
<xsl:attribute name="value"><xsl:value-of
select="php:function('lang', 'Save')"/></xsl:attribute>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9121] Added support for changing internal and external billing sequential numbers through Administrator interface,
Alexander Stevenson <=