fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6789] Merge 6765:6788 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [6789] Merge 6765:6788 from trunk
Date: Mon, 17 Jan 2011 14:43:03 +0000

Revision: 6789
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6789
Author:   sigurdne
Date:     2011-01-17 14:43:03 +0000 (Mon, 17 Jan 2011)
Log Message:
-----------
Merge 6765:6788 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/booking/inc/class.uievent.inc.php
    branches/Version-1_0-branch/bookingfrontend/logout.php
    branches/Version-1_0-branch/bookingfrontend/setup/phpgw_no.lang
    branches/Version-1_0-branch/bookingfrontend/templates/base/config.tpl
    branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.setup_process.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.translation.inc.php
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.sotts.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/request.xsl
    branches/Version-1_0-branch/property/templates/base/tts.xsl
    branches/Version-1_0-branch/sms/inc/class.bosms.inc.php
    branches/Version-1_0-branch/sms/inc/class.sosms.inc.php
    branches/Version-1_0-branch/sms/inc/class.uisms.inc.php

Added Paths:
-----------
    branches/Version-1_0-branch/booking/templates/base/event_info.xsl

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788

Modified: branches/Version-1_0-branch/booking/inc/class.uievent.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uievent.inc.php       
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/booking/inc/class.uievent.inc.php       
2011-01-17 14:43:03 UTC (rev 6789)
@@ -9,6 +9,7 @@
                        'index'                 =>      true,
                        'add'                   =>      true,
                        'edit'                  =>      true,
+                       'info'                  =>      true,
                        'toggle_show_inactive'  =>      true,
                );
                
@@ -23,6 +24,7 @@
                        $this->agegroup_bo = CreateObject('booking.boagegroup');
                        $this->audience_bo = CreateObject('booking.boaudience');
                        $this->organization_bo = 
CreateObject('booking.boorganization');
+                       $this->resource_bo = CreateObject('booking.boresource');
                        self::set_active_menu('booking::applications::events');
                        $this->fields = array('activity_id', 'description',
                                                                                
'resources', 'cost', 'application_id',
@@ -594,4 +596,27 @@
                        self::render_template('event_edit', array('event' => 
$event, 'activities' => $activities, 'agegroups' => $agegroups, 'audience' => 
$audience, 'comments' => $comments));
                }
 
+               public function info()
+               {
+                       $event = 
$this->bo->read_single(intval(phpgw::get_var('id', 'GET')));
+                       $resources = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$event['resources']), 
'sort'=>'name'));
+                       $event['resources'] = $resources['results'];
+                       $res_names = array();
+                       foreach($event['resources'] as $res)
+                       {
+                               $res_names[] = $res['name'];
+                       }
+                       $event['resource'] = phpgw::get_var('resource', 'GET');
+                       $event['resource_info'] = join(', ', $res_names);
+                       $event['building_link'] = self::link(array('menuaction' 
=> 'booking.uibuilding.show', 'id' => $event['resources'][0]['building_id']));
+                       $event['org_link'] = self::link(array('menuaction' => 
'booking.uiorganization.show', 'id' => $event['organization_id']));
+                       $event['add_link'] = self::link(array('menuaction' => 
'booking.uibooking.add', 'allocation_id'=>$event['id'], 
'from_'=>$event['from_'], 'to_'=>$event['to_'], 
'resource'=>$event['resource']));
+                       $event['when'] = pretty_timestamp($event['from_']).' - 
'.pretty_timestamp($event['to_']);
+
+                       $event['edit_link'] = self::link(array('menuaction' => 
'booking.uievent.edit', 'id' => $event['id']));
+
+                       self::render_template('event_info', 
array('event'=>$event));
+                       $GLOBALS['phpgw']->xslttpl->set_output('wml'); // Evil 
hack to disable page chrome
+               }
+
        }

Copied: branches/Version-1_0-branch/booking/templates/base/event_info.xsl (from 
rev 6788, trunk/booking/templates/base/event_info.xsl)
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/event_info.xsl           
                (rev 0)
+++ branches/Version-1_0-branch/booking/templates/base/event_info.xsl   
2011-01-17 14:43:03 UTC (rev 6789)
@@ -0,0 +1,35 @@
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+       <div style="float: right"><a onclick="YAHOO.booking.closeOverlay(); 
return false" href=""><xsl:value-of select="php:function('lang', 
'Close')"/></a></div>
+       <h3><xsl:value-of select="php:function('lang', 'Event')"/> 
#<xsl:value-of select="event/id"/></h3>
+       <xsl:if test="event/is_public=1">
+               <div>
+                       <xsl:value-of select="event/description" 
disable-output-escaping="yes"/>
+               </div>
+       </xsl:if>
+       <dl>
+               <dt><xsl:value-of select="php:function('lang', 'Where')"/></dt>
+               <dd>
+                       <a href="{event/building_link}"><xsl:value-of 
select="event/resources[position()=1]/building_name"/></a>
+                       (<xsl:value-of select="event/resource_info"/>)
+               </dd>
+               <dt><xsl:value-of select="php:function('lang', 'When')"/></dt>
+               <dd><xsl:value-of select="event/when"/></dd>
+               <dt><xsl:value-of select="php:function('lang', 'Who')"/></dt>
+               <xsl:if test="event/is_public=1">
+                       <dd>
+                               <xsl:value-of select="event/contact_name"/>
+                       </dd>
+               </xsl:if>
+               <xsl:if test="event/is_public=0">
+                       <dd>
+                               <xsl:value-of select="php:function('lang', 
'Private event')"/>
+                       </dd>
+               </xsl:if>
+       </dl>
+       <xsl:if test="event/edit_link">
+               <div class="actions">
+                       <button 
onclick="location.href='{event/edit_link}'"><xsl:value-of 
select="php:function('lang', 'Edit event')"/></button>
+               </div>
+       </xsl:if>
+
+</xsl:template>

Modified: branches/Version-1_0-branch/bookingfrontend/logout.php
===================================================================
--- branches/Version-1_0-branch/bookingfrontend/logout.php      2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/bookingfrontend/logout.php      2011-01-17 
14:43:03 UTC (rev 6789)
@@ -21,12 +21,15 @@
 
        $verified = $GLOBALS['phpgw']->session->verify();
        
+       $bookingfrontend_host = '';
        $external_logout = '';
        if ($verified)
        {
                $config         = 
CreateObject('phpgwapi.config','bookingfrontend');
                $config->read();
 
+               $bookingfrontend_host = 
isset($config->config_data['bookingfrontend_host']) && 
$config->config_data['bookingfrontend_host'] ? 
$config->config_data['bookingfrontend_host'] : '';
+               $bookingfrontend_host = rtrim($bookingfrontend_host,'/');
                $external_logout = 
isset($config->config_data['external_logout']) && 
$config->config_data['external_logout'] ? 
$config->config_data['external_logout'] : '';
 //             $external_logout = 
"https://login-vip.bergen.kommune.no/SSO/logout?p_done_url=";//https://www.bergen.kommune.no";
 
@@ -108,7 +111,7 @@
                {
                        $result_redirect = 
$GLOBALS['phpgw']->link('/bookingfrontend/', $extra_vars, true);
                }
-               $external_logout_url = "{$external_logout}{$result_redirect}";
+               $external_logout_url = 
"{$external_logout}{$bookingfrontend_host}{$result_redirect}";
                Header("Location: {$external_logout_url}");
        }
        exit;

Modified: branches/Version-1_0-branch/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/bookingfrontend/setup/phpgw_no.lang     
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/bookingfrontend/setup/phpgw_no.lang     
2011-01-17 14:43:03 UTC (rev 6789)
@@ -323,3 +323,4 @@
 Go back to calendar    bookingfrontend no      Tilbake til kalender
 Agegroups kan not be larger than 9999 peoples  bookingfrontend no      
Estimert antall deltakere kan ikke være større en 9999 personer
 Contact information name is to long. max 50 characters bookingfrontend no      
Navn i kontakt informasjon er for langt. Maks 50 tegn
+Unable to fill report  bookingfrontend no      Greide ikke å fylle ut rapport

Modified: branches/Version-1_0-branch/bookingfrontend/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/bookingfrontend/templates/base/config.tpl       
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/bookingfrontend/templates/base/config.tpl       
2011-01-17 14:43:03 UTC (rev 6789)
@@ -87,6 +87,12 @@
                        </td>
                        <td><input name="newsettings[external_logout]" 
value="{value_external_logout}"></td>
                </tr>
+               <tr class="row_off">
+                       <td>{lang_bookingfrontend_host}:
+                       <br/> Needed for the return from the external_logout
+                       </td>
+                       <td><input name="newsettings[bookingfrontend_host]" 
value="{value_bookingfrontend_host}"></td>
+               </tr>
 
 <!-- END body -->
 <!-- BEGIN footer -->

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php        
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php        
2011-01-17 14:43:03 UTC (rev 6789)
@@ -18,7 +18,7 @@
        * @package phpgwapi
        * @subpackage application
        */
-       class setup
+       class phpgwapi_setup
        {
                var $db;
                var $oProc;
@@ -35,7 +35,7 @@
                var $tbl_config;
                var $tbl_hooks;
 
-               function setup($html = False, $translation = False)
+               public function __construct($html = False, $translation = False)
                {
                        $this->detection = 
createObject('phpgwapi.setup_detection');
                        $this->process   = 
createObject('phpgwapi.setup_process');

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.setup_process.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.setup_process.inc.php        
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.setup_process.inc.php        
2011-01-17 14:43:03 UTC (rev 6789)
@@ -23,14 +23,14 @@
        * V : Version mismatch at end of upgrade (Not used, proposed only)
        * M : Missing files at start of upgrade (Not used, proposed only)
        */
-       class setup_process
+       class phpgwapi_setup_process
        {
                var $oProc;
                var $tables;
                var $updateincluded = array();
                var $translation;
 
-               function setup_process()
+               function __construct()
                {
                        $this->translation = 
createObject('phpgwapi.setup_translation');
                }

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.translation.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.translation.inc.php  
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.translation.inc.php  
2011-01-17 14:43:03 UTC (rev 6789)
@@ -338,9 +338,12 @@
 
                        if (count($lang_selected))
                        {
-                               $GLOBALS['phpgw']->db->query("SELECT 
config_value FROM phpgw_config WHERE config_app='phpgwapi' AND 
config_name='install_id'",__LINE__,__FILE__);
-                               $GLOBALS['phpgw']->db->next_record();
-                               $GLOBALS['phpgw_info']['server']['install_id'] 
= $GLOBALS['phpgw']->db->f('config_value', true);
+                               $c = createObject('phpgwapi.config','phpgwapi');
+                               $c->read();
+                               foreach ($c->config_data as $k => $v)
+                               {
+                                       $GLOBALS['phpgw_info']['server'][$k] = 
$v;
+                               }
 
                                if ($upgrademethod == 'dumpold')
                                {

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-01-17 14:43:03 UTC (rev 6789)
@@ -192,6 +192,7 @@
 
                function select_conditions($request_id='')
                {
+                       $conditions = array();
                        $condition_type_list = 
$this->so->select_condition_type_list();
 
                        if($request_id)
@@ -201,9 +202,9 @@
 
                        for ($i=0;$i<count($condition_type_list);$i++)
                        {
-                               $conditions[$i]['degree']                       
        = $this->select_degree_list($conditions[$i]['degree']);
-                               $conditions[$i]['probability']                  
= $this->select_probability_list($conditions[$i]['probability']);
-                               $conditions[$i]['consequence']                  
= $this->select_consequence_list($conditions[$i]['consequence']);
+                               $conditions[$i]['degree']                       
        = array('options' => 
$this->select_degree_list($conditions[$i]['degree']));
+                               $conditions[$i]['probability']                  
= array('options' => 
$this->select_probability_list($conditions[$i]['probability']));
+                               $conditions[$i]['consequence']                  
= array('options' => 
$this->select_consequence_list($conditions[$i]['consequence']));
                                $conditions[$i]['condition_type']               
= $condition_type_list[$i]['id'];
                                $conditions[$i]['condition_type_name']  = 
$condition_type_list[$i]['name'];
                        }

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-01-17 14:43:03 UTC (rev 6789)
@@ -92,7 +92,9 @@
                        $location_code                  = 
phpgw::get_var('location_code');
 
 
-                       $this->start                    = $start                
                                        ? $start                        : 0;
+//                     $this->start                    = $start                
                                        ? $start                        : 0;
+
+                       $this->start                    = 
isset($_REQUEST['start'])             ? $start                        : 
$this->start;
                        $this->query                    = 
isset($_REQUEST['query'])             ? $query                        : 
$this->query;
                        $this->sort                             = 
isset($_REQUEST['sort'])                      ? $sort                         : 
$this->sort;
                        $this->order                    = 
isset($_REQUEST['order'])             ? $order                        : 
$this->order;
@@ -981,9 +983,9 @@
                        return $receipt;
                }
 
-               public function update_ticket($data, $id)
+               public function update_ticket($data, $id,$receipt = array())
                {
-                       $receipt        = $this->so->update_ticket($data, $id);
+                       $receipt = $this->so->update_ticket($data, $id, 
$receipt);
                        $this->fields_updated = $this->so->fields_updated;      
        
                        return $receipt;
                }

Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-01-17 
14:43:03 UTC (rev 6789)
@@ -400,6 +400,11 @@
                                                        'text'  => 
lang('Request condition_type'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'r_condition_type') )
                                                ),
+                                               'authorities_demands'   => array
+                                               (
+                                                       'text'  => 
lang('authorities demands'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'authorities_demands') )
+                                               ),
                                                'request_attribs'       => array
                                                (
                                                        'text'  => 
lang('request Attributes'),
@@ -642,7 +647,7 @@
                        
$menus['navigation']['helpdesk']['children']['response_template'] = array
                                (
                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'response_template') ),
-                                       'text'  => lang('order template'),
+                                       'text'  => lang('response template'),
                                        'image'         => array('property', 
'helpdesk')
                                );
 

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2011-01-17 14:43:03 UTC (rev 6789)
@@ -409,6 +409,13 @@
                                                {
                                                        case 'V':
                                                        case 'email':
+                                                       case 'T':
+                                                               
if(!$criteria_id)
+                                                               {
+                                                                       
$_querymethod[]= "$entity_table." . $this->db->f('column_name') . " 
{$this->like} '%{$query}%'";
+                                                                       
$__querymethod = array(); // remove block
+                                                               }
+                                                               break;
                                                        case 'CH':
                                                                
if(!$criteria_id)
                                                                {
@@ -486,7 +493,7 @@
 
                        $sql .= " $filtermethod $querymethod";
 
-                       //_debug_array($sql);
+_debug_array($sql);
                        $this->db->query('SELECT count(*) as cnt ' . 
substr($sql,strripos($sql,'from')),__LINE__,__FILE__);
                        $this->db->next_record();
                        $this->total_records = $this->db->f('cnt');

Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2011-01-17 14:43:03 UTC (rev 6789)
@@ -894,11 +894,39 @@
                                                ),
                                                'edit_msg'      => lang('edit'),
                                                'add_msg'       => lang('add'),
-                                               'name'          => '',
+                                               'name'          => 'condition 
type',
                                                'acl_location' => '.admin',
                                                'menu_selection' => 
'admin::property::request_condition'
                                        );
                                break;
+                       case 'authorities_demands':
+                               $info = array
+                                       (
+                                               'table' => 
'fm_authorities_demands',
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
+                                               'fields'                        
=> array
+                                               (
+                                                       array
+                                                       (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg'      => lang('edit'),
+                                               'add_msg'       => lang('add'),
+                                               'name'          => 
lang('authorities demands'),
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::authorities_demands',
+                                               'default'                       
=> array
+                                               (
+                                                       'user_id'               
=> array('add'  => '$this->account'),
+                                                       'entry_date'    => 
array('add'  => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant'           => false
+                                       );
+                               break;
                        case 'b_account':
                                $info = array
                                        (
@@ -1427,6 +1455,12 @@
                                                                'name' => 
'closed',
                                                                'descr' => 
lang('closed'),
                                                                'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'actual_cost',
+                                                               'descr' => 
lang('mandatory actual cost'),
+                                                               'type' => 
'checkbox'
                                                        )
                                                ),
                                                'edit_msg'                      
=> lang('edit'),

Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-01-17 14:43:03 UTC (rev 6789)
@@ -518,7 +518,7 @@
                                $ticket['order_dim1']           = 
$this->db->f('order_dim1');
                                $ticket['publish_note']         = 
$this->db->f('publish_note');
                                $ticket['billable_hours']       = 
$this->db->f('billable_hours');
-
+                               $ticket['branch_id']            = 
$this->db->f('branch_id');
                                $user_id=(int)$this->db->f('user_id');
 
                                $ticket['user_name']    = 
$GLOBALS['phpgw']->accounts->get($user_id)->__toString();
@@ -740,10 +740,9 @@
 
                }
 
-               function update_ticket($ticket,$id = 0)
+               function update_ticket($ticket,$id = 0, $receipt = array())
                {
                        $id = (int) $id;
-                       $receipt = array();
                        // DB Content is fresher than http posted value.
                        $this->db->query("select * from fm_tts_tickets where 
id='$id'",__LINE__,__FILE__);
                        $this->db->next_record();
@@ -956,7 +955,7 @@
                                $this->db->query("UPDATE fm_tts_tickets SET 
actual_cost='" . (float)$ticket['actual_cost']
                                        . "' WHERE id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('AC',$id,(float)$ticket['actual_cost'] , 
$old_actual_cost);
-                               $receipt['message'][]= array('msg' => 
lang('actual_cost has been updated'));
+                               $receipt['message'][]= array('msg' => 
lang('actual cost has been updated'));
                        }
 
                        if ((int)$old_order_cat_id != 
(int)$ticket['order_cat_id'])
@@ -1084,6 +1083,7 @@
                        $value_set['order_descr']       = 
$this->db->db_addslashes($ticket['order_descr']);
                        $value_set['ecodimb']           = $ticket['ecodimb'];
                        $value_set['budget']            = $ticket['budget'];
+                       $value_set['branch_id']         = $ticket['branch_id'];
                        $value_set                                      = 
$this->db->validate_update($value_set);
                        $this->db->query("UPDATE fm_tts_tickets SET $value_set 
WHERE id={$id}",__LINE__,__FILE__);
 

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-01-17 14:43:03 UTC (rev 6789)
@@ -768,7 +768,7 @@
                }
 
 
-               function edit()
+               function edit($mode = 'edit')
                {
                        $id     = phpgw::get_var('id', 'int');
 
@@ -777,6 +777,23 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uirequest.view', 'id'=> $id));
                        }
 
+                       if($mode == 'view')
+                       {
+                               if( !$this->acl_read)
+                               {
+                                       $this->bocommon->no_access();
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               if(!$this->acl_add && !$this->acl_edit)
+                               {
+                                       $this->bocommon->no_access();
+                                       return;
+                               }
+                       }
+
                        $values                         = 
phpgw::get_var('values');
                        $values_attribute       = 
phpgw::get_var('values_attribute');
 
@@ -793,7 +810,7 @@
                                }
                                $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
                        }
-                       else
+                       elseif ($mode == 'edit')
                        {
                                $location_code  = 
phpgw::get_var('location_code');
                                $tenant_id              = 
phpgw::get_var('tenant_id', 'int');
@@ -862,7 +879,7 @@
                        //_debug_array($values);
                        $this->config->read();
 
-                       if ($values['save'])
+                       if ($values['save'] && $mode == 'edit')
                        {
                                if(!$values['location'])
                                {
@@ -1026,7 +1043,7 @@
 
                        if ($id)
                        {
-                               $function_msg = lang('Edit request');
+                               $function_msg = lang("{$mode} request");
                        }
                        else
                        {
@@ -1038,8 +1055,9 @@
                        {
                                $this->cat_id = $values['cat_id'];
                        }
-                       $lookup_type='form';
 
+                       $lookup_type = $mode == 'edit' ? 'form' : 'view';
+
                        
$location_data=$this->bolocation->initiate_ui_location(array
                                (
                                        'values'        => 
$values['location_data'],
@@ -1066,7 +1084,7 @@
 
                        $link_data = array
                                (
-                                       'menuaction'    => 
'property.uirequest.edit',
+                                       'menuaction'    => 
"property.uirequest.{$mode}",
                                        'id'                    => $id
                                );
 
@@ -1198,6 +1216,8 @@
 
                        $data = array
                                (
+                                       'mode'                                  
                        => $mode,
+                                       'suppressmeter'                         
                => isset($this->config->config_data['project_suppressmeter']) 
&& $this->config->config_data['project_suppressmeter'] ? 1 : '',
                                        'attributes'                            
                => $values['attributes'],
                                        'property_js'                           
                => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
                                        'datatable'                             
                        => $datavalues,
@@ -1225,6 +1245,7 @@
                                        'lang_origin_statustext'                
        => lang('Link to the origin for this request'),
 
                                        'generate_project_action'               
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit')),
+                                       'edit_action'                           
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit', 'id'=> $id)),
                                        'lang_generate_project'                 
        => lang('Generate project'),
                                        'lang_generate_project_statustext'      
=> lang('Generate a project from this request'),
                                        'location_code'                         
                => $values['location_code'],
@@ -1300,13 +1321,12 @@
                                        'lang_no_user'                          
                => lang('Select coordinator'),
                                        'user_list'                             
                        => 
$this->bocommon->get_user_list_right2('select',4,$values['coordinator'],$this->acl_location),
 
-                                       'status_list'                           
                => $this->bo->select_status_list('select',$values['status']),
-                                       'status_name'                           
                => 'values[status]',
+                                       'status_list'                           
                => array('options' => 
$this->bo->select_status_list('select',$values['status'])),
                                        'lang_no_status'                        
                => lang('Select status'),
                                        'lang_status'                           
                => lang('Status'),
                                        'lang_status_statustext'                
        => lang('What is the current status of this request ?'),
 
-                                       'branch_list'                           
                => $this->boproject->select_branch_list($values['branch_id']),
+                                       'branch_list'                           
                => array('options' => 
$this->boproject->select_branch_list($values['branch_id'])),
                                        'lang_branch'                           
                => lang('branch'),
                                        'lang_no_branch'                        
                => lang('Select branch'),
                                        'lang_branch_statustext'                
        => lang('Select the branches for this request'),
@@ -1318,12 +1338,10 @@
 
                                        'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
 
-                                       'lang_authorities_demands'              
        => lang('Authorities Demands'),
-                                       'lang_authorities_demands_statustext'   
=> lang('Is there a demand from the authorities to correct this condition?'),
-                                       'authorities_demands'                   
        => $values['authorities_demands'],
+                                       'authorities_demands'                   
        => array('options' => 
execMethod('property.bogeneric.get_list',array('type' => 'authorities_demands', 
'selected' => $values['authorities_demands']))),
 
                                        'condition_list'                        
                => $this->bo->select_conditions($id),
-                                       'building_part_list'                    
        => array('status_list' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num' ))),
+                                       'building_part_list'                    
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num' ))),
                                );
 
                        phpgwapi_yui::load_widget('dragdrop');
@@ -1404,196 +1422,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
+                               $this->bocommon->no_access();
+                               return;
                        }
-
-                       $id     = phpgw::get_var('id', 'int');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('request', 
'files'));
-
-                       $values = $this->bo->read_single($id);
-
-                       $record_history = $this->bo->read_record_history($id);
-
-                       $table_header_history[] = array
-                               (
-                                       'lang_date'             => lang('Date'),
-                                       'lang_user'             => lang('User'),
-                                       'lang_action'           => 
lang('Action'),
-                                       'lang_new_value'        => lang('New 
value')
-                               );
-
-                       $function_msg = lang('View request');
-
-                       if ($values['cat_id'])
-                       {
-                               $this->cat_id = $values['cat_id'];
-                       }
-
-                       
$location_data=$this->bolocation->initiate_ui_location(array
-                               (
-                                       'values'        => 
$values['location_data'],
-                                       'type_id'       => 
count(explode('-',$values['location_data']['location_code'])),
-                                       'no_link'       => false, // disable 
lookup links for location type less than type_id
-                                       'tenant'        => 
$values['location_data']['tenant_id'],
-                                       'lookup_type'   => 'view',
-                                       'lookup_entity' => 
$this->bocommon->get_lookup_entity('project'),
-                                       'entity_data'   => $values['p']
-                               )
-                       );
-
-                       if($values['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']);
-                                       }
-                               }
-                       }
-
-
-                       $link_data = array
-                               (
-                                       'menuaction'    => 
'property.uirequest.edit',
-                                       'id'                    => $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));
-
-
-                       $table_header_importance[] = array
-                               (
-                                       'lang_subject'          => 
lang('Subject'),
-                                       'lang_condition_degree' => 
lang('Condidtion degree'),
-                                       'lang_prob_worsening'   => 
lang('Probability'),
-                                       'lang_consequence'      => 
lang('Consequence')
-                               );
-
-                       if($values['project_id'])
-                       {
-                               $project_lookup_data = array
-                                       (
-                                               'menuaction'    => 
'property.uiproject.view'
-                                       );
-                       }
-
-                       $link_file_data = array
-                               (
-                                       'menuaction'    => 
'property.uirequest.view_file',
-                                       'location_code' 
=>$values['location_data']['location_code'],
-                                       'id'            =>$id
-                               );
-
-                       $this->config->read();
-                       $link_to_files = 
$this->config->config_data['files_url'];
-
-                       $j      = count($values['files']);
-                       for ($i=0;$i<$j;$i++)
-                       {
-                               
$values['files'][$i]['file_name']=urlencode($values['files'][$i]['name']);
-                       }
-
-                       $categories = 
$this->cats->formatted_xslt_list(array('selected' => $values['cat_id']));
-
-                       $data = array
-                               (
-                                       'link_view_file'                        
        => $GLOBALS['phpgw']->link('/index.php',$link_file_data),
-                                       'link_to_files'                         
        => $link_to_files,
-                                       'files'                                 
                => $values['files'],
-                                       'lang_files'                            
        => lang('files'),
-                                       'lang_filename'                         
        => lang('Filename'),
-                                       'lang_view_file_statustext'             
=> lang('click to view file'),
-
-                                       'value_target'                          
        => $values['target'],
-                                       'value_origin'                          
        => $values['origin'],
-                                       'value_origin_type'                     
        => $origin,
-                                       'value_origin_id'                       
        => $origin_id,
-
-                                       'lang_project'                          
        => lang('Project'),
-                                       'lang_project_statustext'               
=> lang('Link to the project originatet from this request'),
-                                       'link_project'                          
        => $GLOBALS['phpgw']->link('/index.php',$project_lookup_data),
-                                       'value_project_id'                      
        => $values['project_id'],
-
-                                       'lang_importance'                       
        => lang('Importance'),
-                                       'table_header_importance'               
=> $table_header_importance,
-                                       'importance_weight_view'                
=> $importance_weight,
-
-                                       'workorder_link'                        
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
-                                       'record_history'                        
        => $record_history,
-                                       'table_header_history'                  
        => $table_header_history,
-                                       'lang_history'                          
        => lang('History'),
-                                       'lang_no_history'                       
        => lang('No history'),
-
-                                       'lang_start_date'                       
        => lang('request start date'),
-                                       'value_start_date'                      
        => $values['start_date'],
-
-                                       'lang_end_date'                         
        => lang('request end date'),
-                                       'value_end_date'                        
        => $values['end_date'],
-
-                                       'lang_power_meter'                      
        => lang('Power meter'),
-                                       'value_power_meter'                     
        => $values['power_meter'],
-
-                                       'lang_budget'                           
        => lang('Budget'),
-                                       'value_budget'                          
        => $values['budget'],
-
-                                       'location_data'                         
        => $location_data,
-                                       'location_type'                         
        => 'view',
-                                       'done_action'                           
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index')),
-                                       'lang_category'                         
        => lang('category'),
-                                       'lang_save'                             
                => lang('save'),
-                                       'lang_done'                             
                => lang('done'),
-
-                                       'lang_request_id'                       
        => lang('request ID'),
-                                       'value_request_id'                      
        => $values['request_id'],
-
-                                       'lang_title'                            
        => lang('Title'),
-                                       'value_title'                           
        => $values['title'],
-
-                                       'lang_descr'                            
        => lang('Description'),
-                                       'value_descr'                           
        => $values['descr'],
-                                       'lang_score'                            
        => lang('Score'),
-                                       'value_score'                           
        => $values['score'],
-                                       'lang_done_statustext'                  
        => lang('Back to the list'),
-                                       'value_cat_id'                          
        => $values['cat_id'],
-                                       'cat_list'                              
                => $categories['cat_list'],
-
-                                       'lang_coordinator'                      
        => lang('Coordinator'),
-                                       'lang_no_user'                          
        => lang('Select coordinator'),
-                                       'user_list'                             
                => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
-
-                                       'status_list'                           
        => $this->bo->select_status_list('select',$values['status']),
-                                       'lang_status'                           
        => lang('Status'),
-
-                                       'branch_list'                           
        => $this->boproject->select_branch_list($values['branch_id']),
-                                       'lang_branch'                           
        => lang('branch'),
-
-                                       'edit_action'                           
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit', 'id'=> $id)),
-                                       'lang_edit_statustext'                  
        => lang('Edit this entry request'),
-                                       'lang_edit'                             
                => lang('Edit'),
-                                       'currency'                              
                => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
-                                       'lang_contact_phone'                    
=> lang('Contact phone'),
-                                       'contact_phone'                         
        => $values['contact_phone'],
-
-                                       'lang_authorities_demands'              
=> lang('Authorities Demands'),
-                                       'authorities_demands'                   
=> $values['authorities_demands'],
-
-                                       'condition_list_view'                   
=> $this->bo->select_conditions($id),
-                               );
-
-                       $appname        = lang('request');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $this->edit($mode = 'view');
                }
 
                protected function _generate_tabs()

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-01-17 14:43:03 UTC (rev 6789)
@@ -293,9 +293,23 @@
                                return lang('sorry - insufficient rights');
                        }
 
-
                        $new_status = phpgw::get_var('new_status', 'string', 
'GET');
                        $id             = phpgw::get_var('id', 'int');
+
+                       $ticket = $this->bo->read_single($id);
+
+                       if($ticket['order_id'] &&  abs($ticket['actual_cost']) 
== 0)
+                       {
+                               $sogeneric              = 
CreateObject('property.sogeneric');
+                               
$sogeneric->get_location_info('ticket_status',false);
+                               $status_data    = 
$sogeneric->read_single(array('id' => (int)ltrim($new_status,'C')),array());
+
+                               if($status_data['actual_cost'])
+                               {
+                                       return "id ".$id." ".lang('actual 
cost') . ': ' . lang('Missing value');
+                               }
+                       }
+
                        $receipt        = 
$this->bo->update_status(array('status'=>$new_status),$id);
                        if 
(isset($this->bo->config->config_data['mailnotification']) && 
$this->bo->config->config_data['mailnotification'])
                        {
@@ -1753,9 +1767,9 @@
 
                                        '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']:'')),
+                                       'priority_list'                         
        => array('options' => 
$this->bo->get_priority_list((isset($values['priority'])?$values['priority']:''))),
 
-                                       'status_list'                           
        => $this->bo->get_status_list('O'),
+                                       'status_list'                           
        => array('options' => $this->bo->get_status_list('O')),
 
                                        'form_action'                           
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
 
@@ -2007,11 +2021,25 @@
 
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
                        
$GLOBALS['phpgw']->session->appsession('receipt','property','');
+                       if(!$receipt)
+                       {
+                               $receipt = array();
+                       }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('tts', 
'files'));
 
                        $historylog     = 
CreateObject('property.historylog','tts');
 
+                       $order_read                     = 
$this->acl->check('.ticket.order', PHPGW_ACL_READ, 'property');
+                       $order_add                              = 
$this->acl->check('.ticket.order', PHPGW_ACL_ADD, 'property');
+                       $order_edit                     = 
$this->acl->check('.ticket.order', PHPGW_ACL_EDIT, 'property');
+
+                       $access_order = false;
+                       if($order_add || $order_edit)
+                       {
+                               $access_order = true;
+                       }
+
                        if(isset($values['save']))
                        {
                                if(!$this->acl_edit)
@@ -2038,11 +2066,35 @@
                                        
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter an 
integer !'));
                                }
 
+                               if($access_order)
+                               {
+                                       if((!isset($values['make_order']) || 
!$values['make_order']) && (!isset($values['budget']) || !$values['budget']) )
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Missing value'));
+                                       }
+
+                                       $sogeneric              = 
CreateObject('property.sogeneric');
+                                       
$sogeneric->get_location_info('ticket_status',false);
+                                       $status_data    = 
$sogeneric->read_single(array('id' => 
(int)ltrim($values['status'],'C')),array());
+
+                                       if(isset($status_data['actual_cost']) 
&& $status_data['actual_cost'])
+                                       {
+                                               if(!$values['actual_cost'] || 
!abs($values['actual_cost']) > 0)
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('actual cost') . ': ' . lang('Missing 
value'));
+                                               }
+                                               else 
if(!is_numeric($values['actual_cost']))
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter a 
numeric value'));                                 
+                                               }
+                                       }
+                               }
+                               
                                if(isset($values['takeover']) && 
$values['takeover'])
                                {
                                        $values['assignedto'] = $this->account;
                                }
-                               $receipt = 
$this->bo->update_ticket($values,$id);
+                               $receipt = 
$this->bo->update_ticket($values,$id, $receipt);
 
                                if ( (isset($values['send_mail']) && 
$values['send_mail']) 
                                        || 
(isset($this->bo->config->config_data['mailnotification'])
@@ -2260,16 +2312,7 @@
                        }
 
                        // -------- start order section
-                       $order_read                     = 
$this->acl->check('.ticket.order', PHPGW_ACL_READ, 'property');
-                       $order_add                              = 
$this->acl->check('.ticket.order', PHPGW_ACL_ADD, 'property');
-                       $order_edit                     = 
$this->acl->check('.ticket.order', PHPGW_ACL_EDIT, 'property');
 
-                       $access_order = false;
-                       if($order_add || $order_edit)
-                       {
-                               $access_order = true;
-                       }
-
                        if($access_order)
                        {
                                
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array(
@@ -2752,9 +2795,8 @@
 
                                        'location_data'                         
        => $location_data,
 
-                                       'status_name'                           
        => 'values[status]',
                                        'value_status'                          
        => $ticket['status'],
-                                       'status_list'                           
        => $this->bo->get_status_list($ticket['status']),
+                                       'status_list'                           
        => array('options' => $this->bo->get_status_list($ticket['status'])),
 
                                        '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'),
@@ -2772,7 +2814,7 @@
                                        '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']),
+                                       'priority_list'                         
        => array('options' => 
$this->bo->get_priority_list($ticket['priority'])),
 
                                        'lang_no_cat'                           
        => lang('no category'),
                                        'value_cat_id'                          
        => $this->cat_id,
@@ -2816,8 +2858,9 @@
                                        'textareacols'                          
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 60,
                                        'textarearows'                          
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6,
                                        'order_cat_list'                        
        => $order_catetory,
-                                       'building_part_list'                    
=> array('status_list' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$ticket['building_part'], 'order' => 'id', 
'id_in_name' => 'num' ))),
-                                       'order_dim1_list'                       
        => array('status_list' => 
$this->bocommon->select_category_list(array('type'=> 'order_dim1','selected' 
=>$ticket['order_dim1'], 'order' => 'id', 'id_in_name' => 'num' ))),
+                                       'building_part_list'                    
=> array('options' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$ticket['building_part'], 'order' => 'id', 
'id_in_name' => 'num' ))),
+                                       'order_dim1_list'                       
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'order_dim1','selected' 
=>$ticket['order_dim1'], 'order' => 'id', 'id_in_name' => 'num' ))),
+                                       'branch_list'                           
        => array('options' => 
execMethod('property.boproject.select_branch_list', $values['branch_id'])),
                                );
 
                        //---datatable settings--------------------
@@ -3017,9 +3060,7 @@
                                        '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']),
+                                       'status_list'                           
        => array('options' => $this->bo->get_status_list($ticket['status'])),
                                        'lang_status_statustext'                
=> lang('Set the status of the ticket'),
 
                                        'lang_no_user'                          
        => lang('Select user'),

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-01-17 
14:43:03 UTC (rev 6789)
@@ -29,6 +29,7 @@
 actual cost    property        no      Faktisk kostnad
 actual_cost    property        no      Faktisk kostnad
 actual cost changed    property        no      Faktisk kostnad er endret
+actual cost has been updated   property        no      Faktisk kostnad er 
oppdatert
 actual cost - paid so far      property        no      Faktisk betalt - pr dd
 add a apartment        property        no      Legg til leilighet
 add a attrib   property        no      Legg til en attibutt
@@ -198,7 +199,7 @@
 attributes for the location type       property        no      Attributter for 
lokaliserings type
 attributes for the standard    property        no      verdier for standard
 a unique code for this activity        property        no      En unik kode fo 
denne aktiviteten
-authorities demands    property        no      Offentlige pålegg
+authorities demands    property        no      Myndighetskrav
 auto tax       property        no      Auto MVA
 b_account      property        no      Budsjett konto
 back to admin  property        no      Tilbake til Admin
@@ -493,6 +494,7 @@
 dim b  property        no      Kostnadssted
 dimb   property        no      Kostnadssted
 dimb roles     property        no      Roller kostnadssted
+no authorities demands property        no      Ingen myndighetskrav
 no dimb        property        no      K Ikke valgt
 dim d  property        no      Dim D
 directory created      property        no      katalog er opprettet
@@ -869,7 +871,7 @@
 invoice tranferred     property        no      bilag er overført
 is id  property        no      Er ID
 is registered  property        no      er registert
-is there a demand from the authorities to correct this condition?      
property        no      Finnes det offentlige pålegg fo å rette opp tilstanden?
+is there a demand from the authorities to correct this condition?      
property        no      Finnes det myndighetskrav for å rette opp tilstanden?
 items  property        no      Detaljer
 janitor        property        no      Bestiller
 jasper reports property        no      JasperReports
@@ -1011,6 +1013,7 @@
 minute property        no      Minutt
 minutes before the event       property        no      Minutter til hendelse
 Missing log message    property        no      Angi grunn for endring
+Missing value  property        no      Mangler verdi
 missing value for %1   property        no      Mangler verdi for %1
 month  property        no      Måned
 Monthly (by day)       property        no      Månedlig (dag)
@@ -1623,6 +1626,7 @@
 test cron      property        no      Test cron
 text   property        no      Tekst
 text_view      property        no      Vis tekst
+Ticket %1 has been saved       property        no      Melding %1 er lagret
 that vendor id is not valid !  property        no      Denne leverandør ID er 
ikke gyldig
 the address to which this order will be sendt  property        no      
Adressen ordren vil bli sendt til
 the apartment is private. if the apartment should be public, uncheck this box  
property        no      Leiligheter er ikke

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2011-01-17 
14:43:03 UTC (rev 6789)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.604';
+       $setup_info['property']['version']              = '0.9.17.606';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';
@@ -110,6 +110,7 @@
                'fm_wo_hours_category',
                'fm_wo_h_deviation',
                'fm_key_loc',
+               'fm_authorities_demands',
                'fm_request',
                'fm_request_condition_type',
                'fm_request_condition',

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-01-17 14:43:03 UTC (rev 6789)
@@ -748,6 +748,19 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'fm_authorities_demands' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'modified_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_request' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
@@ -837,6 +850,7 @@
                                'approved' => array('type' => 'int','precision' 
=> '2','nullable' => True),
                                'in_progress' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'delivered' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'actual_cost' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'sorting' => array('type' => 'int','precision' 
=> '4','nullable' => True)
                        ),
                        'pk' => array('id'),
@@ -884,7 +898,8 @@
                                'order_cat_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'building_part'=> array('type' => 
'varchar','precision' => 4,'nullable' => True),
                                'order_dim1'=> array('type' => 
'int','precision' => 4,'nullable' => True),
-                               'publish_note'=> array('type' => 
'int','precision' => 2,'nullable' => True)
+                               'publish_note'=> array('type' => 
'int','precision' => 2,'nullable' => True),
+                               'branch_id' => array('type' => 
'int','precision' => '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'ix' => array(),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-01-17 14:43:03 UTC (rev 6789)
@@ -4838,7 +4838,7 @@
                }
        }
        /**
-       * Update property version from 0.9.17.602 to 0.9.17.603
+       * Update property version from 0.9.17.603 to 0.9.17.604
        * convert data for datatype CH: from serialized array to comma 
separated list
        * 
        */
@@ -4922,3 +4922,56 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.604 to 0.9.17.605
+       * Add columns to  table fm_tts_tickets and fm_tts_status
+       * 
+       */
+
+       $test[] = '0.9.17.604';
+       function property_upgrade0_9_17_604()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tts_status','actual_cost',array('type'
 => 'int','precision' => 2,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tts_tickets','branch_id', 
array('type' => 'int','precision' => '4','nullable' => True));
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.605';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+       /**
+       * Update property version from 0.9.17.605 to 0.9.17.606
+       * Add authorities demands type to request
+       * 
+       */
+
+       $test[] = '0.9.17.605';
+       function property_upgrade0_9_17_605()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_authorities_demands', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
+                                       'user_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'modified_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+                               
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.606';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-01-17 14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-01-17 14:43:03 UTC (rev 6789)
@@ -68,11 +68,9 @@
                                <xsl:value-of select="descr"/>
                        </td>
                        <td class="small_text" align="left">
-                               <input type="text" size="3" 
name="values[priority_key][{id}]" value="{priority_key}" 
onMouseout="window.status='';return true;">
-                                       <xsl:attribute name="onMouseover">
-                                               
<xsl:text>window.status='</xsl:text>
+                               <input type="text" size="3" 
name="values[priority_key][{id}]" value="{priority_key}">
+                                       <xsl:attribute name="title">
                                                <xsl:value-of 
select="lang_priority_key_statustext"/>
-                                               <xsl:text>'; return 
true;</xsl:text>
                                        </xsl:attribute>
                                </input>
                        </td>
@@ -108,11 +106,9 @@
                                                                <input 
type="hidden" name="p_num" value="{p_num}"></input>
                                                                <input 
type="hidden" name="p_entity_id" value="{p_entity_id}"></input>
                                                                <input 
type="hidden" name="p_cat_id" value="{p_cat_id}"></input>
-                                                               <input 
type="submit" class="forms" name="generate_project" 
value="{$lang_generate_project}" onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
+                                                               <input 
type="submit" class="forms" name="generate_project" 
value="{$lang_generate_project}">
+                                                                       
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="lang_generate_project_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
                                                                        
</xsl:attribute>
                                                                </input>
                                                        </form>
@@ -138,11 +134,9 @@
                                                                                
        <xsl:value-of select="lang_copy_request"/>
                                                                                
</td>
                                                                                
<td>
-                                                                               
        <input type="checkbox" name="values[copy_request]" value="True"  
onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="onMouseover">
-                                                                               
                        <xsl:text>window.status='</xsl:text>
+                                                                               
        <input type="checkbox" name="values[copy_request]" value="True" >
+                                                                               
                <xsl:attribute name="title">
                                                                                
                        <xsl:value-of select="lang_copy_request_statustext"/>
-                                                                               
                        <xsl:text>'; return true;</xsl:text>
                                                                                
                </xsl:attribute>
                                                                                
        </input>
                                                                                
</td>
@@ -172,11 +166,9 @@
 
                                                                                
                                                <xsl:choose>
                                                                                
                                                        <xsl:when 
test="location ='.project.request'">
-                                                                               
                                                                <input 
type="checkbox" name="values[delete_request][]" value="{id}"  
onMouseout="window.status='';return true;">
-                                                                               
                                                                        
<xsl:attribute name="onMouseover">
-                                                                               
                                                                                
<xsl:text>window.status='</xsl:text>
+                                                                               
                                                                <input 
type="checkbox" name="values[delete_request][]" value="{id}" >
+                                                                               
                                                                        
<xsl:attribute name="title">
                                                                                
                                                                                
<xsl:value-of select="//lang_delete_request_statustext"/>
-                                                                               
                                                                                
<xsl:text>'; return true;</xsl:text>
                                                                                
                                                                        
</xsl:attribute>
                                                                                
                                                                </input>
                                                                                
                                                        </xsl:when>
@@ -218,7 +210,7 @@
                                                                        </td>
                                                                        <td 
class="th_text"  align="left" >
                                                                                
<xsl:for-each select="data">
-                                                                               
        <a href="{link}"  title="{//lang_target_statustext}" style 
="cursor:help"><xsl:value-of select="id"/></a>
+                                                                               
        <a href="{link}"  title="{//lang_target_statustext}"><xsl:value-of 
select="id"/></a>
                                                                                
        <xsl:text> </xsl:text>
                                                                                
</xsl:for-each>
                                                                        </td>
@@ -230,11 +222,9 @@
                                                                        
<xsl:value-of select="lang_title"/>
                                                                </td>
                                                                <td>
-                                                                       <input 
type="text" name="values[title]" value="{value_title}" 
onMouseout="window.status='';return true;">
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                       <input 
type="text" name="values[title]" value="{value_title}" size="60">
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_title_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                </td>
@@ -244,11 +234,9 @@
                                                                        
<xsl:value-of select="lang_descr"/>
                                                                </td>
                                                                <td>
-                                                                       
<textarea cols="60" rows="6" name="values[descr]" 
onMouseout="window.status='';return true;">
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                       
<textarea cols="60" rows="6" name="values[descr]">
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_descr_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                                
<xsl:value-of select="value_descr"/>
                                                                        
</textarea>
@@ -263,7 +251,7 @@
                                                                </td>
                                                        </tr>
                                                        <xsl:choose>
-                                                               <xsl:when 
test="location_type='form'">
+                                                               <xsl:when 
test="mode ='edit'">
                                                                        
<xsl:call-template name="location_form"/>
                                                                </xsl:when>
                                                                <xsl:otherwise>
@@ -280,34 +268,34 @@
                                                                                
        </tr>
                                                                                
</xsl:when>
                                                                        
</xsl:choose>
-
                                                                </xsl:otherwise>
                                                        </xsl:choose>
 
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="suppressmeter =''">
+                                                                       <tr>
+                                                                               
<td valign="top">
+                                                                               
        <xsl:value-of select="lang_power_meter"/>
+                                                                               
</td>
+                                                                               
<td>
+                                                                               
        <input type="text" name="values[power_meter]" 
value="{value_power_meter}" size="12" >
+                                                                               
                <xsl:attribute name="title">
+                                                                               
                        <xsl:value-of select="lang_power_meter_statustext"/>
+                                                                               
                </xsl:attribute>
+                                                                               
        </input>
+                                                                               
</td>
+                                                                       </tr>
+                                                               </xsl:when>
+                                                       </xsl:choose>
+
                                                        <tr>
                                                                <td 
valign="top">
-                                                                       
<xsl:value-of select="lang_power_meter"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'cost estimate')" />
                                                                </td>
                                                                <td>
-                                                                       <input 
type="text" name="values[power_meter]" value="{value_power_meter}" size="12" 
onMouseout="window.status='';return true;" >
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="lang_power_meter_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
-                                                                               
</xsl:attribute>
-                                                                       </input>
-                                                               </td>
-                                                       </tr>
-                                                       <tr>
-                                                               <td 
valign="top">
-                                                                       
<xsl:value-of select="lang_budget"/>
-                                                               </td>
-                                                               <td>
-                                                                       <input 
type="text" name="values[budget]" value="{value_budget}" 
onMouseout="window.status='';return true;">
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                       <input 
type="text" name="values[budget]" value="{value_budget}">
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_budget_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                        
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
@@ -325,7 +313,7 @@
                                                                                
<option value="0">
                                                                                
        <xsl:value-of select="php:function('lang', 'select building part')" />
                                                                                
</option>
-                                                                               
<xsl:apply-templates select="building_part_list/status_list"/>
+                                                                               
<xsl:apply-templates select="building_part_list/options"/>
                                                                        
</select>
                                                                </td>
                                                        </tr>
@@ -338,11 +326,17 @@
                                                                </td>
                                                        </tr>
                                                        <tr>
-                                                               <td>
-                                                                       
<xsl:value-of select="lang_status"/>
+                                                               <td 
valign="top">
+                                                                       
<xsl:value-of select="php:function('lang', 'status')" />
                                                                </td>
                                                                <td>
-                                                                       
<xsl:call-template name="status_select"/>
+                                                                       <select 
name="values[status]" class="forms">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'Set the status of the 
ticket')" />
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0"><xsl:value-of select="php:function('lang', 'no status')" 
/></option>
+                                                                               
<xsl:apply-templates select="status_list/options"/>
+                                                                       
</select>                       
                                                                </td>
                                                        </tr>
                                                        <tr>
@@ -350,11 +344,9 @@
                                                                        
<xsl:value-of select="lang_start_date"/>
                                                                </td>
                                                                <td>
-                                                                       <input 
type="text" id="values_start_date" name="values[start_date]" size="10" 
value="{value_start_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                       <input 
type="text" id="values_start_date" name="values[start_date]" size="10" 
value="{value_start_date}" readonly="readonly" >
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_start_date_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                        <img 
id="values_start_date-trigger" src="{img_cal}" alt="{lang_datetitle}" 
title="{lang_datetitle}" style="cursor:pointer; cursor:hand;" />
@@ -365,28 +357,28 @@
                                                                        
<xsl:value-of select="lang_end_date"/>
                                                                </td>
                                                                <td>
-                                                                       <input 
type="text" id="values_end_date" name="values[end_date]" size="10" 
value="{value_end_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                       <input 
type="text" id="values_end_date" name="values[end_date]" size="10" 
value="{value_end_date}" readonly="readonly" >
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_end_date_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                        <img 
id="values_end_date-trigger" src="{img_cal}" alt="{lang_datetitle}" 
title="{lang_datetitle}" style="cursor:pointer; cursor:hand;" />
                                                                </td>
                                                        </tr>
+<!--
                                                        <tr>
                                                                <td 
valign="top">
                                                                        
<xsl:value-of select="lang_branch"/>
                                                                </td>
                                                                <td>
                                                                        
<xsl:variable name="lang_branch_statustext"><xsl:value-of 
select="lang_branch_statustext"/></xsl:variable>
-                                                                       <select 
name="values[branch_id]" class="forms" 
onMouseover="window.status='{$lang_branch_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+                                                                       <select 
name="values[branch_id]" class="forms" title="{$lang_branch_statustext}">
                                                                                
<option value=""><xsl:value-of select="lang_no_branch"/></option>
-                                                                               
<xsl:apply-templates select="branch_list"/>
+                                                                               
<xsl:apply-templates select="branch_list/options"/>
                                                                        
</select>
                                                                </td>
                                                        </tr>
+-->
                                                        <tr>
                                                                <xsl:choose>
                                                                        
<xsl:when test="notify='yes'">
@@ -394,19 +386,15 @@
                                                                                
        <xsl:value-of select="lang_notify"/>
                                                                                
</td>
                                                                                
<td>
-                                                                               
        <input type="checkbox" name="values[notify]" value="True"  
onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="onMouseover">
-                                                                               
                        <xsl:text>window.status='</xsl:text>
+                                                                               
        <input type="checkbox" name="values[notify]" value="True" >
+                                                                               
                <xsl:attribute name="title">
                                                                                
                        <xsl:value-of select="lang_notify_statustext"/>
-                                                                               
                        <xsl:text>'; return true;</xsl:text>
                                                                                
                </xsl:attribute>
                                                                                
        </input>
 
-                                                                               
        <input type="text" name="values[mail_address]" 
value="{value_notify_mail_address}" onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="onMouseover">
-                                                                               
                        <xsl:text>window.status='</xsl:text>
+                                                                               
        <input type="text" name="values[mail_address]" 
value="{value_notify_mail_address}">
+                                                                               
                <xsl:attribute name="title">
                                                                                
                        <xsl:value-of select="lang_notify_statustext"/>
-                                                                               
                        <xsl:text>'; return true;</xsl:text>
                                                                                
                </xsl:attribute>
                                                                                
        </input>
                                                                                
</td>
@@ -415,8 +403,6 @@
                                                        </tr>
                                                </table>
                                        </div>
-
-
                                        <div id="importance">
                                                <table>
                                                        <tr>
@@ -426,25 +412,17 @@
                                                                                
<xsl:apply-templates select="condition_list"/>
                                                                                
<tr>
                                                                                
        <td align="left">
-                                                                               
                <xsl:value-of select="lang_authorities_demands"/>
+                                                                               
                <xsl:value-of select="php:function('lang', 'Authorities 
Demands')" />
                                                                                
        </td>
+
                                                                                
        <td>
-                                                                               
                <xsl:choose>
-                                                                               
                        <xsl:when test="authorities_demands='1'">
-                                                                               
                                <input type="checkbox" 
name="values[authorities_demands]" value="1" checked="checked">
-                                                                               
                                        <xsl:attribute name="title">
-                                                                               
                                                <xsl:value-of 
select="lang_authorities_demands_statustext"/>
-                                                                               
                                        </xsl:attribute>
-                                                                               
                                </input>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:otherwise>
-                                                                               
                                <input type="checkbox" 
name="values[authorities_demands]" value="1">
-                                                                               
                                        <xsl:attribute name="title">
-                                                                               
                                                <xsl:value-of 
select="lang_authorities_demands_statustext"/>
-                                                                               
                                        </xsl:attribute>
-                                                                               
                                </input>
-                                                                               
                        </xsl:otherwise>
-                                                                               
                </xsl:choose>
+                                                                               
                <select name="values[authorities_demands]" class="forms">
+                                                                               
                        <xsl:attribute name="title">
+                                                                               
                                <xsl:value-of select="php:function('lang', 'Is 
there a demand from the authorities to correct this condition?')" />
+                                                                               
                        </xsl:attribute>
+                                                                               
                        <option value="0"><xsl:value-of 
select="php:function('lang', 'no authorities demands')" /></option>
+                                                                               
                        <xsl:apply-templates 
select="authorities_demands/options"/>
+                                                                               
                </select>                       
                                                                                
        </td>
                                                                                
</tr>
                                                                                
<xsl:call-template name="attributes"/>
@@ -487,11 +465,9 @@
                                                        <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>
+                                                                       <input 
type="submit" name="values[save]" value="{$lang_save}">
+                                                                               
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="lang_save_statustext"/>
-                                                                               
        <xsl:text>'; return true;</xsl:text>
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                </td>
@@ -528,20 +504,22 @@
                                        </div>
                                </div>
                        </div>
-                       <table>
-                               <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>
-                       </table>
+                       <xsl:choose>
+                               <xsl:when test="mode = 'edit'">
+                                       <table>
+                                               <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}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="lang_save_statustext"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </xsl:when>
+                       </xsl:choose>
                </form>
 
                <table>
@@ -550,15 +528,28 @@
                                        <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>
+                                               <input type="submit" 
name="done" value="{$lang_done}">
+                                                       <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="lang_done_statustext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
                                                        </xsl:attribute>
                                                </input>
                                        </form>
                                </td>
+                               <xsl:choose>
+                                       <xsl:when test="mode = 'view'">
+                                               <td>
+                                                       <xsl:variable 
name="edit_action"><xsl:value-of select="edit_action"/></xsl:variable>
+                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
+                                                       <form method="post" 
action="{$edit_action}">
+                                                               <input 
type="submit" class="forms" name="edit" value="{$lang_edit}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'edit')" />
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
+                                               </td>
+                                       </xsl:when>
+                               </xsl:choose>
                        </tr>
                </table>
 
@@ -584,20 +575,20 @@
                        </td>
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_degree_statustext"><xsl:value-of 
select="//lang_degree_statustext"/></xsl:variable>
-                               <select 
name="values[condition][{condition_type}][degree]" class="forms" 
onMouseover="window.status='{$lang_degree_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                       <xsl:apply-templates select="degree"/>
+                               <select 
name="values[condition][{condition_type}][degree]" class="forms" 
title="{$lang_degree_statustext}">
+                                       <xsl:apply-templates 
select="degree/options"/>
                                </select>
                        </td>
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_probability_statustext"><xsl:value-of 
select="//lang_probability_statustext"/></xsl:variable>
-                               <select 
name="values[condition][{condition_type}][probability]" class="forms" 
onMouseover="window.status='{$lang_probability_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                       <xsl:apply-templates 
select="probability"/>
+                               <select 
name="values[condition][{condition_type}][probability]" class="forms" 
title="{$lang_probability_statustext}">
+                                       <xsl:apply-templates 
select="probability/options"/>
                                </select>
                        </td>
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_consequence_statustext"><xsl:value-of 
select="//lang_consequence_statustext"/></xsl:variable>
-                               <select 
name="values[condition][{condition_type}][consequence]" class="forms" 
onMouseover="window.status='{$lang_consequence_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                       <xsl:apply-templates 
select="consequence"/>
+                               <select 
name="values[condition][{condition_type}][consequence]" class="forms" 
title="{$lang_consequence_statustext}">
+                                       <xsl:apply-templates 
select="consequence/options"/>
                                </select>
                        </td>
                </tr>
@@ -639,275 +630,15 @@
                </tr>
        </xsl:template>
 
-
-       <xsl:template match="degree">
-               <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 match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" value="selected" 
/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
        </xsl:template>
 
-       <xsl:template match="probability">
-               <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>
-
-       <xsl:template match="consequence">
-               <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>
-
-
-
-       <xsl:template match="branch_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>
-
-       <xsl:template match="degree_list_safety">
-               <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>
-
-       <xsl:template match="degree_list_aesthetics">
-               <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>
-
-       <xsl:template match="degree_list_indoor_climate">
-               <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>
-
-       <xsl:template match="degree_list_consequential_damage">
-               <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>
-
-       <xsl:template match="degree_list_user_gratification">
-               <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>
-
-       <xsl:template match="degree_list_residential_environment">
-               <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>
-
-       <xsl:template match="probability_list_safety">
-               <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>
-
-       <xsl:template match="probability_list_aesthetics">
-               <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>
-
-
-       <xsl:template match="probability_list_indoor_climate">
-               <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>
-
-       <xsl:template match="probability_list_consequential_damage">
-               <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>
-
-       <xsl:template match="probability_list_user_gratification">
-               <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>
-
-       <xsl:template match="probability_list_residential_environment">
-               <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>
-
-       <xsl:template match="consequence_list_safety">
-               <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>
-
-       <xsl:template match="consequence_list_aesthetics">
-               <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>
-
-       <xsl:template match="consequence_list_indoor_climate">
-               <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>
-
-       <xsl:template match="consequence_list_consequential_damage">
-               <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>
-
-       <xsl:template match="consequence_list_user_gratification">
-               <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>
-
-       <xsl:template match="consequence_list_residential_environment">
-               <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>
-
-
        <xsl:template match="table_header_history">
                <tr class="th">
                        <td class="th_text" width="20%" align="left">
@@ -970,287 +701,3 @@
                        </td>
                </tr>
        </xsl:template>
-
-
-<!-- view -->
-
-       <xsl:template match="view">
-
-               <div align="left">
-
-                       <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
-                               <xsl:for-each select="value_origin" >
-                                       <tr>
-                                               <td class="th_text" valign 
="top">
-                                                       <xsl:value-of 
select="descr"/>
-                                               </td>
-                                               <td>
-                                                       <table>
-                                                               <xsl:for-each 
select="data">
-                                                                       <tr>
-                                                                               
<td class="th_text"  align="left" >
-                                                                               
        <a href="{link}"  title="{statustext}" style 
="cursor:help"><xsl:value-of select="id"/></a>
-                                                                               
        <xsl:text> </xsl:text>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </xsl:for-each>
-                                                       </table>
-                                               </td>
-                                       </tr>
-                               </xsl:for-each>
-                               <xsl:for-each select="value_target" >
-                                       <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}"  title="{//lang_target_statustext}" style 
="cursor:help"><xsl:value-of select="id"/></a>
-                                                               <xsl:text> 
</xsl:text>
-                                                       </xsl:for-each>
-                                               </td>
-                                       </tr>
-                               </xsl:for-each>
-
-                               <tr>
-                                       <td>
-                                               <xsl:value-of 
select="lang_request_id"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_request_id"/>
-                                       </td>
-                               </tr>
-                               <xsl:choose>
-                                       <xsl:when test="value_project_id!=''">
-                                               <tr>
-                                                       <td align="left" 
valign="top">
-                                                               <xsl:value-of 
select="//lang_project"/>
-                                                       </td>
-                                                       <td class="th_text"  
align="left">
-                                                               <xsl:for-each 
select="value_project_id" >
-                                                                       
<xsl:variable name="link_project"><xsl:value-of 
select="//link_project"/>&amp;id=<xsl:value-of select="id"/></xsl:variable>
-                                                                       <a 
href="{$link_project}" 
onMouseover="window.status='{//lang_project_statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="id"/></a>
-                                                                       
<xsl:text> </xsl:text>
-                                                               </xsl:for-each>
-                                                       </td>
-                                               </tr>
-                                       </xsl:when>
-                               </xsl:choose>
-                               <xsl:choose>
-                                       <xsl:when test="value_origin_id!=''">
-                                               <tr>
-                                                       <td>
-                                                               <!-- FIXME-->
-                                                               <a 
href="{link_origin}" 
onMouseover="window.status='{lang_origin_statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="lang_origin"/></a>
-                                                       </td>
-                                               </tr>
-                                       </xsl:when>
-                               </xsl:choose>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_title"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_title"/>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_descr"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_descr"/>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               <xsl:value-of 
select="lang_category"/>
-                                       </td>
-                                       <xsl:for-each select="cat_list" >
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected='selected'">
-                                                               <td>
-                                                                       
<xsl:value-of select="name"/>
-                                                               </td>
-                                                       </xsl:when>
-                                               </xsl:choose>
-                                       </xsl:for-each>
-                               </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 valign="top">
-                                               <xsl:value-of 
select="lang_power_meter"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_power_meter"/>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_budget"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_budget"/>
-                                               <xsl:text> </xsl:text> [ 
<xsl:value-of select="currency"/> ]
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               <xsl:value-of 
select="lang_coordinator"/>
-                                       </td>
-                                       <xsl:for-each select="user_list" >
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected">
-                                                               <td>
-                                                                       
<xsl:value-of select="name"/>
-                                                               </td>
-                                                       </xsl:when>
-                                               </xsl:choose>
-                                       </xsl:for-each>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               <xsl:value-of 
select="lang_status"/>
-                                       </td>
-                                       <xsl:for-each select="status_list" >
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected">
-                                                               <td>
-                                                                       
<xsl:value-of select="name"/>
-                                                               </td>
-                                                       </xsl:when>
-                                               </xsl:choose>
-                                       </xsl:for-each>
-                               </tr>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_start_date"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_start_date"/>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_end_date"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_end_date"/>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td valign="top">
-                                               <xsl:value-of 
select="lang_branch"/>
-                                       </td>
-                                       <xsl:for-each select="branch_list" >
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected">
-                                                               <td>
-                                                                       
<xsl:value-of select="name"/>
-                                                               </td>
-                                                       </xsl:when>
-                                               </xsl:choose>
-                                       </xsl:for-each>
-                               </tr>
-                               <tr>
-                                       <td>
-                                               <table width="100%" 
cellpadding="2" cellspacing="2" align="center">
-                                                       <xsl:apply-templates 
select="table_header_importance"/>
-                                                       <xsl:apply-templates 
select="condition_list_view"/>
-                                                       <tr>
-                                                               <td 
align="left" colspan="3">
-                                                                       
<xsl:value-of select="lang_authorities_demands"/>
-                                                               </td>
-                                                               <td 
align="center">
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="authorities_demands='1'">
-                                                                               
        <b>x</b>
-                                                                               
</xsl:when>
-                                                                       
</xsl:choose>
-                                                               </td>
-                                                       </tr>
-
-                                               </table>
-                                       </td>
-                               </tr>
-
-                               <tr>
-                                       <td align="left">
-                                               <xsl:value-of 
select="lang_score"/>
-                                       </td>
-                                       <td>
-                                               <xsl:value-of 
select="value_score"/>
-                                       </td>
-                               </tr>
-                               <xsl:choose>
-                                       <xsl:when test="files!=''">
-                                               <xsl:call-template 
name="file_list_view"/>
-                                       </xsl:when>
-                               </xsl:choose>
-
-                               <tr height="50">
-                                       <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" 
class="forms" 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>
-                                               <xsl:variable 
name="edit_action"><xsl:value-of select="edit_action"/></xsl:variable>
-                                               <xsl:variable 
name="lang_edit"><xsl:value-of select="lang_edit"/></xsl:variable>
-                                               <form method="post" 
action="{$edit_action}">
-                                                       <input type="submit" 
class="forms" name="edit" value="{$lang_edit}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_edit_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>
-                                               <tr>
-                                                       <td class="th_text" 
align="left">
-                                                               <xsl:value-of 
select="lang_history"/>
-                                                       </td>
-                                               </tr>
-                                               <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>
-
-

Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2011-01-17 
14:43:03 UTC (rev 6789)
@@ -483,7 +483,7 @@
                                                                                
<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}" 
onMouseover="window.status='{$lang_priority_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                                                               
        <xsl:apply-templates select="priority_list"/>
+                                                                               
        <xsl:apply-templates select="priority_list/options"/>
                                                                                
</select>                       
                                                                        </td>
                                                                </tr>
@@ -496,7 +496,7 @@
                                                                                
        <xsl:attribute name="title">
                                                                                
                <xsl:value-of select="php:function('lang', 'Set the status of 
the ticket')" />
                                                                                
        </xsl:attribute>
-                                                                               
        <xsl:apply-templates select="status_list"/>
+                                                                               
        <xsl:apply-templates select="status_list/options"/>
                                                                                
</select>                       
                                                                        </td>
                                                                </tr>
@@ -742,18 +742,6 @@
 
        </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" xmlns:php="http://php.net/xsl";>
                <script type="text/javascript">
@@ -988,7 +976,7 @@
                                                        <xsl:variable 
name="lang_priority_statustext"><xsl:value-of select="php:function('lang', 
'Select the priority the selection belongs to')" /></xsl:variable>
                                                        <xsl:variable 
name="select_priority_name"><xsl:value-of 
select="select_priority_name"/></xsl:variable>
                                                        <select 
name="{$select_priority_name}" class="forms" title = 
"{$lang_priority_statustext}" 
onMouseover="window.status='{$lang_priority_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                                               
<xsl:apply-templates select="priority_list"/>
+                                                               
<xsl:apply-templates select="priority_list/options"/>
                                                        </select>               
        
                                                </td>
                                        </tr>
@@ -999,12 +987,11 @@
                                                                        
<xsl:value-of select="php:function('lang', 'status')" />
                                                                </td>
                                                                <td>
-                                                                       
<xsl:variable name="status_name"><xsl:value-of 
select="status_name"/></xsl:variable>
-                                                                       <select 
name="{$status_name}" class="forms">
+                                                                       <select 
name="values[status]" class="forms">
                                                                                
<xsl:attribute name="title">
                                                                                
        <xsl:value-of select="php:function('lang', 'Set the status of the 
ticket')" />
                                                                                
</xsl:attribute>
-                                                                               
<xsl:apply-templates select="status_list"/>
+                                                                               
<xsl:apply-templates select="status_list/options"/>
                                                                        
</select>                       
                                                                </td>
                                                        </tr>
@@ -1213,12 +1200,28 @@
                                                                                
<option value="0">
                                                                                
        <xsl:value-of select="php:function('lang', 'select building part')" />
                                                                                
</option>
-                                                                               
<xsl:apply-templates select="building_part_list/status_list"/>
+                                                                               
<xsl:apply-templates select="building_part_list/options"/>
                                                                        
</select>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td>
+                                                                       
<xsl:value-of select="php:function('lang', 'branch')" />
+                                                               </td>
+                                                               <td>
+                                                                       <select 
name="values[branch_id]" >
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select branch')" />
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select branch')" />
+                                                                               
</option>
+                                                                               
<xsl:apply-templates select="branch_list/options"/>
+                                                                       
</select>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
                                                                        
<xsl:value-of select="php:function('lang', 'order_dim1')" />
                                                                </td>
                                                                <td>
@@ -1229,7 +1232,7 @@
                                                                                
<option value="0">
                                                                                
        <xsl:value-of select="php:function('lang', 'order_dim1')" />
                                                                                
</option>
-                                                                               
<xsl:apply-templates select="order_dim1_list/status_list"/>
+                                                                               
<xsl:apply-templates select="order_dim1_list/options"/>
                                                                        
</select>
                                                                </td>
                                                        </tr>
@@ -1336,12 +1339,11 @@
                                                                <xsl:value-of 
select="php:function('lang', 'status')" />
                                                        </td>
                                                        <td>
-                                                               <xsl:variable 
name="status_name"><xsl:value-of select="status_name"/></xsl:variable>
-                                                               <select 
name="{$status_name}" class="forms">
+                                                               <select 
name="values[status]" class="forms">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'Set the status of the ticket')" />
                                                                        
</xsl:attribute>
-                                                                       
<xsl:apply-templates select="status_list"/>
+                                                                       
<xsl:apply-templates select="status_list/options"/>
                                                                </select>       
                
                                                        </td>
                                                </tr>
@@ -1673,9 +1675,8 @@
                                </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 name="values[status]" 
class="forms" onMouseover="window.status='{$lang_status_statustext}'; return 
true;" onMouseout="window.status='';return true;">
+                                                       <xsl:apply-templates 
select="status_list/options"/>
                                        </select>                       
                                </td>
                        </tr>
@@ -1866,7 +1867,7 @@
        </xsl:template>
 
 
-       <xsl:template match="priority_list">
+       <xsl:template match="options">
                <option value="{id}">
                        <xsl:if test="selected != 0">
                                <xsl:attribute name="selected" value="selected" 
/>
@@ -1875,15 +1876,6 @@
                </option>
        </xsl:template>
 
-       <xsl:template match="status_list">
-               <option value="{id}">
-                       <xsl:if test="selected != 0">
-                               <xsl:attribute name="selected" value="selected" 
/>
-                       </xsl:if>
-                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
-               </option>
-       </xsl:template>
-
        <xsl:template match="vendor_email" xmlns:php="http://php.net/xsl";>
                <tr>
                        <td>

Modified: branches/Version-1_0-branch/sms/inc/class.bosms.inc.php
===================================================================
--- branches/Version-1_0-branch/sms/inc/class.bosms.inc.php     2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/sms/inc/class.bosms.inc.php     2011-01-17 
14:43:03 UTC (rev 6789)
@@ -1,22 +1,22 @@
 <?php
        /**
-       * phpGroupWare - HRM: a  human resource competence management system.
+       * phpGroupWare - SMS: a  human resource competence management system.
        *
        * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @copyright Copyright (C) 2003-2011 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
+       * @package sms
        * @subpackage place
        * @version $Id$
        */
 
        /**
         * Description
-        * @package hrm
+        * @package sms
         */
 
-       class bosms
+       class sms_bosms
        {
                var $start;
                var $query;
@@ -29,10 +29,10 @@
                var $public_functions = array
                (
                        'read'                  => true,
-                       'read_single'           => true,
+                       'read_single'   => true,
                        'save'                  => true,
                        'delete'                => true,
-                       'check_perms'           => true
+                       'check_perms'   => true
                );
 
                function __construct($session=false)
@@ -110,14 +110,25 @@
                        $inbox = $this->so->read_inbox(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'allrows'=>$this->allrows,'acl_location' =>$this->acl_location));
                        $this->total_records = $this->so->total_records;
+
+                       foreach($inbox as $dummy => &$msg)
+                       {
+                               $msg['entry_time'] = 
$GLOBALS['phpgw']->common->show_date(strtotime($msg['entry_time']));
+                       }
+
                        return $inbox;
                }
 
-
                function read_outbox()
                {
                        $outbox = $this->so->read_outbox(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'allrows'=>$this->allrows,'acl_location' =>$this->acl_location));
+
+                       foreach($outbox as $dummy => &$msg)
+                       {
+                               $msg['entry_time'] = 
$GLOBALS['phpgw']->common->show_date(strtotime($msg['entry_time']));
+                       }
+
                        $this->total_records = $this->so->total_records;
                        return $outbox;
                }

Modified: branches/Version-1_0-branch/sms/inc/class.sosms.inc.php
===================================================================
--- branches/Version-1_0-branch/sms/inc/class.sosms.inc.php     2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/sms/inc/class.sosms.inc.php     2011-01-17 
14:43:03 UTC (rev 6789)
@@ -114,22 +114,12 @@
 
                function read_outbox($data)
                {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                               $acl_location   = 
(isset($data['acl_location'])?$data['acl_location']:'');
-                       }
+                       $query                  = isset($data['start']) && 
$data['start'] ? (int)$data['start']:0;
+                       $query                  = 
isset($data['query'])?$data['query']:'';
+                       $sort                   = 
isset($data['sort'])?$data['sort']:'DESC';
+                       $order                  = 
isset($data['order'])?$data['order']:'';
+                       $allrows                = 
isset($data['allrows'])?$data['allrows']:'';
+                       $acl_location   = 
isset($data['acl_location'])?$data['acl_location']:'';
 
                        if($acl_location)
                        {
@@ -139,7 +129,6 @@
                        if ($order)
                        {
                                $ordermethod = " ORDER BY $order $sort";
-
                        }
                        else
                        {

Modified: branches/Version-1_0-branch/sms/inc/class.uisms.inc.php
===================================================================
--- branches/Version-1_0-branch/sms/inc/class.uisms.inc.php     2011-01-17 
14:38:45 UTC (rev 6788)
+++ branches/Version-1_0-branch/sms/inc/class.uisms.inc.php     2011-01-17 
14:43:03 UTC (rev 6789)
@@ -201,12 +201,12 @@
                        {
                                $table_add[] = array
                                (
-                                       'lang_send'                     => 
lang('Send text SMS'),
+                                       'lang_send'                             
        => lang('Send text SMS'),
                                        'lang_send_statustext'          => 
lang('send single'),
-                                       'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.send', 
'from'=>'index')),
-                                       'lang_send_group'               => 
lang('Send broadcast SMS'),
+                                       'send_action'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.send', 
'from'=>'index')),
+                                       'lang_send_group'                       
=> lang('Send broadcast SMS'),
                                        'lang_send_group_statustext'    => 
lang('send group'),
-                                       'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.send_group', 'from'=>'index')),
+                                       'send_group_action'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.send_group', 'from'=>'index')),
                                );
                        }
 
@@ -217,19 +217,19 @@
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
                                'allow_allrows'                                 
=> true,
-                               'allrows'                                       
=> $this->allrows,
+                               'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
                                'num_records'                                   
=> count($sms_info),
                                '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'),
-                               '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,
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               '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_header_inbox'                            
=> $table_header,
-                               'table_add'                                     
=> $table_add,
+                               'table_header_inbox'                    => 
$table_header,
+                               'table_add'                                     
        => $table_add,
                                'values_inbox'                                  
=> $content
                        );
 
@@ -263,7 +263,7 @@
 
                        $sms_info = $this->bo->read_outbox();
 
-                       while (is_array($sms_info) && list(,$entry) = 
each($sms_info))
+                       foreach ($sms_info as $entry)
                        {
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
@@ -279,11 +279,11 @@
                                        'user'                                  
=> $entry['user'],
                                        'message'                               
=> $entry['message'],
                                        'dst_group'                             
=> $entry['dst_group'],
-                                       'entry_time'                            
=> $entry['entry_time'],
+                                       'entry_time'                    => 
$entry['entry_time'],
                                        'status'                                
=> $entry['status'],
-                                       'link_delete'                           
=> $link_delete,
-                                       'text_delete'                           
=> $text_delete,
-                                       'lang_delete_sms_text'                  
=> $lang_delete_sms_text,
+                                       'link_delete'                   => 
$link_delete,
+                                       'text_delete'                   => 
$text_delete,
+                                       'lang_delete_sms_text'  => 
$lang_delete_sms_text,
                                );
 
                                unset ($link_delete);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]