fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6786] property: tune request form


From: Sigurd Nes
Subject: [Fmsystem-commits] [6786] property: tune request form
Date: Mon, 17 Jan 2011 10:09:26 +0000

Revision: 6786
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6786
Author:   sigurdne
Date:     2011-01-17 10:09:25 +0000 (Mon, 17 Jan 2011)
Log Message:
-----------
property: tune request form

Modified Paths:
--------------
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/request.xsl

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2011-01-16 19:32:29 UTC (rev 
6785)
+++ trunk/property/inc/class.uirequest.inc.php  2011-01-17 10:09:25 UTC (rev 
6786)
@@ -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'],
@@ -1401,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: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2011-01-16 19:32:29 UTC (rev 
6785)
+++ trunk/property/inc/class.uitts.inc.php      2011-01-17 10:09:25 UTC (rev 
6786)
@@ -2066,22 +2066,27 @@
                                        
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter an 
integer !'));
                                }
 
-                               $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($access_order && $status_data['actual_cost'])
+                               if($access_order)
                                {
-                                       if(!$values['actual_cost'] || 
!abs($values['actual_cost']) > 0)
+                                       if((!isset($values['make_order']) || 
!$values['make_order']) && (!isset($values['budget']) || !$values['budget']) )
                                        {
-//_Debug_Array(abs($values['actual_cost']));
-//_debug_Array($values['actual_cost']);die();
+                                               
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Missing value'));
+                                       }
 
-                                               
$receipt['error'][]=array('msg'=>lang('actual cost') . ': ' . lang('Missing 
value'));
-                                       }
-                                       else 
if(!is_numeric($values['actual_cost']))
+                                       $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'])
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter a 
numeric value'));                                 
+                                               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'));                                 
+                                               }
                                        }
                                }
                                

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2011-01-16 19:32:29 UTC (rev 6785)
+++ trunk/property/setup/phpgw_no.lang  2011-01-17 10:09:25 UTC (rev 6786)
@@ -1626,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: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2011-01-16 19:32:29 UTC (rev 
6785)
+++ trunk/property/templates/base/request.xsl   2011-01-17 10:09:25 UTC (rev 
6786)
@@ -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"/> ]
@@ -356,7 +344,7 @@
                                                                        
<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;" >
+                                                                       <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:attribute>
@@ -369,7 +357,7 @@
                                                                        
<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;" >
+                                                                       <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:attribute>
@@ -377,6 +365,7 @@
                                                                        <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"/>
@@ -389,6 +378,7 @@
                                                                        
</select>
                                                                </td>
                                                        </tr>
+-->
                                                        <tr>
                                                                <xsl:choose>
                                                                        
<xsl:when test="notify='yes'">
@@ -396,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>
@@ -479,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>
@@ -520,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>
@@ -542,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>
 
@@ -702,285 +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/options" >
-                                               <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/options" >
-                                               <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>




reply via email to

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