fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14729] redirect on save


From: Sigurd Nes
Subject: [Fmsystem-commits] [14729] redirect on save
Date: Fri, 12 Feb 2016 12:13:51 +0000

Revision: 14729
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14729
Author:   sigurdne
Date:     2016-02-12 12:13:30 +0000 (Fri, 12 Feb 2016)
Log Message:
-----------
redirect on save

Modified Paths:
--------------
    trunk/property/inc/class.uibudget.inc.php
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/inc/class.uicustom.inc.php
    trunk/property/inc/class.uigab.inc.php
    trunk/property/inc/class.uigeneric.inc.php
    trunk/property/inc/class.uijasper.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/inc/class.uiresponsible.inc.php
    trunk/property/inc/class.uis_agreement.inc.php
    trunk/property/inc/class.uitemplate.inc.php
    trunk/property/inc/class.uitenant_claim.inc.php
    trunk/property/templates/base/custom.xsl

Modified: trunk/property/inc/class.uibudget.inc.php
===================================================================
--- trunk/property/inc/class.uibudget.inc.php   2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uibudget.inc.php   2016-02-12 12:13:30 UTC (rev 
14729)
@@ -1116,7 +1116,7 @@
                                try
                                {
                                        $receipt = $this->bo->save($values);
-                                       $values['budget_id'] = 
$receipt['budget_id'];
+                                       $budget_id = $values['budget_id'] = 
$receipt['budget_id'];
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -1124,14 +1124,19 @@
                                        if ($e)
                                        {
                                                
phpgwapi_cache::message_set($e->getMessage(), 'error');
-                                               $this->edit();
+                                               $this->edit($values);
                                                return;
                                        }
                                }
 
-                               //phpgwapi_cache::message_set($receipt, 
'message'); 
                                if ($values['apply'])
                                {
+                                       if ($budget_id)
+                                       {
+                                               
self::message_set($this->receipt);
+                                               
self::redirect(array('menuaction' => 'property.uibudget.edit', 'budget_id' => 
$budget_id));
+                                       }
+
                                        $this->edit($values);
                                        return;
                                }
@@ -1301,7 +1306,7 @@
                                try
                                {
                                        $receipt = 
$this->bo->save_basis($values);
-                                       $values['budget_id'] = 
$receipt['budget_id'];
+                                       $budget_id = $values['budget_id'] = 
$receipt['budget_id'];
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -1314,13 +1319,17 @@
                                        }
                                }
 
-                               //phpgwapi_cache::message_set($receipt, 
'message'); 
                                if ($values['apply'])
                                {
+                                       if ($budget_id)
+                                       {
+                                               
self::message_set($this->receipt);
+                                               
self::redirect(array('menuaction' => 'property.uibudget.edit_basis', 
'budget_id' => $budget_id));
+                                       }
                                        $this->edit_basis($values);
                                        return;
                                }
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uibudget.basis'));
+                               self::redirect(array('menuaction' => 
'property.uibudget.basis'));
                        }
                }
 

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2016-02-11 22:28:46 UTC 
(rev 14728)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2016-02-12 12:13:30 UTC 
(rev 14729)
@@ -607,7 +607,7 @@
                                else
                                {
                                        phpgwapi_cache::message_set('ok!', 
'message');
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uicondition_survey.edit',
+                                       self::redirect(array('menuaction' => 
'property.uicondition_survey.edit',
                                                'id' => $id));
                                }
                        }

Modified: trunk/property/inc/class.uicustom.inc.php
===================================================================
--- trunk/property/inc/class.uicustom.inc.php   2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uicustom.inc.php   2016-02-12 12:13:30 UTC (rev 
14729)
@@ -289,7 +289,6 @@
                                                $receipt = 
$this->bo->save($values);
                                                $custom_id = 
$receipt['custom_id'];
                                                $this->cat_id = 
($values['cat_id'] ? $values['cat_id'] : $this->cat_id);
-                                               $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
 
                                                if ($values['save'])
                                                {
@@ -307,8 +306,7 @@
                                                }
                                        }
 
-                                       $message = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-                                       
phpgwapi_cache::message_set($message[0]['msgbox_text'], 'message');
+                                       self::message_set($receipt);
                                        
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uicustom.edit',
                                                'custom_id' => $custom_id));
                                }

Modified: trunk/property/inc/class.uigab.inc.php
===================================================================
--- trunk/property/inc/class.uigab.inc.php      2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uigab.inc.php      2016-02-12 12:13:30 UTC (rev 
14729)
@@ -912,8 +912,8 @@
                                try
                                {
                                        $receipt = $this->bo->save($data);
-                                       $values['location_code'] = 
$receipt['location_code'];
-                                       $values['gab_id'] = $receipt['gab_id'];
+                                       $location_code = 
$values['location_code'] = $receipt['location_code'];
+                                       $gab_id = $values['gab_id'] = 
$receipt['gab_id'];
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -924,7 +924,14 @@
                                        }
                                }
 
-                               //phpgwapi_cache::message_set($receipt, 
'message'); 
+                               if ($location_code)
+                               {
+                                       self::message_set($receipt);
+                                       self::redirect(array('menuaction' => 
'property.uigab.edit', 'gab_id' => $gab_id,
+                                               'location_code' => 
$location_code,
+                                               'from' => 
phpgw::get_var('from')));
+                               }
+
                                $this->edit($values);
                                return;
                        }

Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php  2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uigeneric.inc.php  2016-02-12 12:13:30 UTC (rev 
14729)
@@ -940,6 +940,7 @@
                                        unset($fields['attributes']);
 
                                        $receipt = $this->bo->save($fields, 
$action, $attributes);
+                                       $id = $receipt['id'];
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -952,13 +953,23 @@
                                        }
                                }
 
-                               //phpgwapi_cache::message_set($receipt, 
'message'); 
                                if ($values['apply'])
                                {
+                                       if ($id)
+                                       {
+                                               
self::message_set($this->receipt);
+                                               
self::redirect(array('menuaction' => 'property.uigeneric.edit',
+                                                       'id' => $id,
+                                                       'appname' => 
$this->appname,
+                                                       'type' => $this->type,
+                                                       'type_id' => 
$this->type_id
+                                                       )
+                                               );
+                                       }
                                        $this->edit();
                                        return;
                                }
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uigeneric.index',
+                               self::redirect(array('menuaction' => 
'property.uigeneric.index',
                                        'appname' => $this->appname,
                                        'type' => $this->type,
                                        'type_id' => $this->type_id));

Modified: trunk/property/inc/class.uijasper.inc.php
===================================================================
--- trunk/property/inc/class.uijasper.inc.php   2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uijasper.inc.php   2016-02-12 12:13:30 UTC (rev 
14729)
@@ -519,7 +519,6 @@
                                        {
                                                $receipt = 
$this->bo->save($values);
                                                $id = $receipt['id'];
-                                               $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
 
                                                //-------------start files
                                                $bofiles = 
CreateObject('property.bofiles');
@@ -594,14 +593,15 @@
                                                }
                                        }
 
-                                       $message = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-
-                                       
phpgwapi_cache::message_set($message[0]['msgbox_text'], 'message');
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uijasper.edit',
-                                               'id' => $id));
+                                       self::redirect(array('menuaction' => 
'property.uijasper.edit','id' => $id));
                                }
                                else
                                {
+                                       if ($id)
+                                       {
+                                               self::message_set($receipt);
+                                               
self::redirect(array('menuaction' => 'property.uijasper.edit', 'id' => $id));
+                                       }
                                        $this->edit();
                                }
                        }

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uilocation.inc.php 2016-02-12 12:13:30 UTC (rev 
14729)
@@ -1050,6 +1050,7 @@
                                {
                                        $params['formatter'] = 
'JqueryPortico.searchLink';
                                        $params['sortable'] = true;
+                                       $params['dir'] = "desc";
                                }
                                else if ($uicols['name'][$k] == 'street_name')
                                {
@@ -2393,13 +2394,13 @@
                                                $values['saved'] = true;
                                                $values['error_id'] = false;
                                                $values['location_code'] = 
$receipt['location_code'];
+                                               $location_code = 
$receipt['location_code'];
                                        }
                                        else
                                        {
                                                $values['error_id'] = true;
                                        }
 
-                                       phpgwapi_cache::message_set($receipt, 
'message');
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -2432,10 +2433,12 @@
                                }
                        }
                        $GLOBALS['phpgw']->session->appsession('insert_record', 
'property', '');
-
+                       if ($location_code)
+                       {
+                               self::message_set($this->receipt);
+                               self::redirect(array('menuaction' => 
'property.uilocation.edit', 'location_code' => $location_code));
+                       }
                        $this->edit($values);
-
-                       return;
                }
 
                function delete()

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uirequest.inc.php  2016-02-12 12:13:30 UTC (rev 
14729)
@@ -1001,7 +1001,7 @@
                                try
                                {
                                        $receipt = $this->bo->save($values, 
$action, $values_attribute);
-                                       $values['id'] = $receipt['id'];
+                                       $id = $values['id'] = $receipt['id'];
                                        $this->receipt = $receipt;
                                }
                                catch (Exception $e)
@@ -1049,7 +1049,6 @@
                                        $this->receipt['message'][] = 
array('msg' => lang('%1 is notified', $values['mail_address']));
                                }
 
-                               //phpgwapi_cache::message_set($receipt, 
'message');
                                if ($values['save_new'])
                                {
                                        $values = 
$this->bo->read_single($values['id']);
@@ -1066,9 +1065,12 @@
                                        );
                                }
 
+                               if($id)
+                               {
+                                       self::message_set($this->receipt);
+                                       self::redirect(array('menuaction' => 
'property.uirequest.edit', 'id' => $id));
+                               }
                                $this->edit($values);
-
-                               return;
                        }
                }
 
@@ -1203,14 +1205,6 @@
                                $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')
-                       );
-
                        if ($id)
                        {
                                $function_msg = lang("{$mode} request");
@@ -1496,8 +1490,6 @@
                                'importance_weight' => $importance_weight,
                                'lang_no_workorders' => lang('No workorder 
budget'),
                                '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'),
                                'value_entry_date' => $values['entry_date'],

Modified: trunk/property/inc/class.uiresponsible.inc.php
===================================================================
--- trunk/property/inc/class.uiresponsible.inc.php      2016-02-11 22:28:46 UTC 
(rev 14728)
+++ trunk/property/inc/class.uiresponsible.inc.php      2016-02-12 12:13:30 UTC 
(rev 14729)
@@ -521,7 +521,6 @@
 
                                                $receipt = 
$this->bo->save_type($values);
                                                $id = $receipt['id'];
-                                               $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
 
                                                if (isset($values['save']) && 
$values['save'])
                                                {
@@ -540,10 +539,8 @@
                                                        return;
                                                }
                                        }
+                                       self::message_set($receipt);
 
-                                       $message = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-
-                                       
phpgwapi_cache::message_set($message[0]['msgbox_text'], 'message');
                                        
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uiresponsible.edit',
                                                'appname' => $this->appname, 
'id' => $id));
                                }

Modified: trunk/property/inc/class.uis_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uis_agreement.inc.php      2016-02-11 22:28:46 UTC 
(rev 14728)
+++ trunk/property/inc/class.uis_agreement.inc.php      2016-02-12 12:13:30 UTC 
(rev 14729)
@@ -673,7 +673,6 @@
                                                $receipt = 
$this->bo->save($values, $values_attribute, $action);
                                                $id = 
$receipt['s_agreement_id'];
                                                $this->cat_id = 
($values['cat_id'] ? $values['cat_id'] : $this->cat_id);
-                                               $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
 
                                                if ($values['file_name'])
                                                {
@@ -709,8 +708,7 @@
                                                }
                                        }
 
-                                       $message = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-                                       
phpgwapi_cache::message_set($message[0]['msgbox_text'], 'message');
+                                       self::message_set($receipt);
                                        
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uis_agreement.edit',
                                                'id' => $id));
                                }

Modified: trunk/property/inc/class.uitemplate.inc.php
===================================================================
--- trunk/property/inc/class.uitemplate.inc.php 2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/inc/class.uitemplate.inc.php 2016-02-12 12:13:30 UTC (rev 
14729)
@@ -550,11 +550,10 @@
                        self::render_template_xsl('datatable_jquery', $data);
                }
 
-               function edit_template()
+               function edit_template($values = array())
                {
-                       $template_id = phpgw::get_var('template_id', 'int');
-                       $values = phpgw::get_var('values');
-                       $receipt = array();
+                       $template_id = isset($values['template_id']) && 
$values['template_id'] ? $values['template_id'] : 
(int)phpgw::get_var('template_id', 'int');
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('template'));
 
                        $tabs = array();
@@ -577,11 +576,9 @@
                                'template_id' => $template_id
                        );
 
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
                                (
-                               'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
                                'done_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitemplate.index',
                                        'template_id' => $template_id)),
@@ -638,7 +635,6 @@
                                {
                                        $receipt = 
$this->bo->save_template($values);
                                        $template_id = $receipt['template_id'];
-                                       $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
                                }
                                catch (Exception $e)
                                {
@@ -650,15 +646,14 @@
                                        }
                                }
 
-                               $message = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-
+                               self::message_set($receipt);
                                
phpgwapi_cache::message_set($message[0]['msgbox_text'], 'message');
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uitemplate.edit_template',
                                        'template_id' => $template_id));
                        }
                        else
                        {
-                               $this->edit_template();
+                               $this->edit_template($values);
                        }
                }
 

Modified: trunk/property/inc/class.uitenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.uitenant_claim.inc.php     2016-02-11 22:28:46 UTC 
(rev 14728)
+++ trunk/property/inc/class.uitenant_claim.inc.php     2016-02-12 12:13:30 UTC 
(rev 14729)
@@ -542,12 +542,16 @@
                                                }
                                        }
                                        //-----------
+                                       self::message_set($receipt);
 
                                        if ($values['save'])
                                        {
-                                               
$GLOBALS['phpgw']->session->appsession('session_data', 'tenant_claim_receipt', 
$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uitenant_claim.index'));
+                                               
self::redirect(array('menuaction' => 'property.uitenant_claim.index'));
                                        }
+                                       else
+                                       {
+                                               
self::redirect(array('menuaction' => 'property.uitenant_claim.edit', 'claim_id' 
=> $claim_id));
+                                       }
                                }
                        }
 

Modified: trunk/property/templates/base/custom.xsl
===================================================================
--- trunk/property/templates/base/custom.xsl    2016-02-11 22:28:46 UTC (rev 
14728)
+++ trunk/property/templates/base/custom.xsl    2016-02-12 12:13:30 UTC (rev 
14729)
@@ -1,126 +1,35 @@
 
 <!-- $Id$ -->
 <xsl:template match="data">
-               <xsl:choose>
-                       <xsl:when test="edit">
-                               <xsl:apply-templates select="edit"/>
-                       </xsl:when>
-                       <xsl:when test="view">
-                               <xsl:apply-templates select="view"/>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:apply-templates select="list"/>
-                       </xsl:otherwise>
-               </xsl:choose>
+       <xsl:choose>
+               <xsl:when test="edit">
+                       <xsl:apply-templates select="edit"/>
+               </xsl:when>
+               <xsl:when test="view">
+                       <xsl:apply-templates select="view"/>
+               </xsl:when>
+       </xsl:choose>
 </xsl:template>
 
 <!-- New template-->
-<xsl:template match="list">
-               <xsl:apply-templates select="menu"/>
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <xsl:choose>
-                               <xsl:when test="msgbox_data != ''">
-                                       <tr>
-                                               <td align="left" colspan="3">
-                                                       <xsl:call-template 
name="msgbox"/>
-                                               </td>
-                                       </tr>
-                               </xsl:when>
-                       </xsl:choose>
-                       <tr>
-                               <td align="right">
-                                       <xsl:call-template name="search_field"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td colspan="3" width="100%">
-                                       <xsl:call-template name="nextmatchs"/>
-                               </td>
-                       </tr>
-               </table>
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <xsl:call-template name="table_header"/>
-                       <xsl:call-template name="values"/>
-                       <xsl:apply-templates select="table_add"/>
-               </table>
-</xsl:template>
-
-<!-- New template-->
-<xsl:template name="table_header">
-               <tr class="th">
-                       <xsl:for-each select="table_header">
-                               <td class="th_text" width="{with}" 
align="{align}">
-                                       <xsl:choose>
-                                               <xsl:when test="sort_link!=''">
-                                                       <a href="{sort}" 
onMouseover="window.status='{header}';return true;" 
onMouseout="window.status='';return true;">
-                                                               <xsl:value-of 
select="header"/>
-                                                       </a>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="header"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </td>
-                       </xsl:for-each>
-               </tr>
-</xsl:template>
-
-<!-- New template-->
-<xsl:template name="values">
-               <xsl:for-each select="values">
-                       <tr>
-                               <xsl:attribute name="class">
-                                       <xsl:choose>
-                                               <xsl:when test="@class">
-                                                       <xsl:value-of 
select="@class"/>
-                                               </xsl:when>
-                                               <xsl:when test="position() mod 
2 = 0">
-                                                       
<xsl:text>row_off</xsl:text>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       
<xsl:text>row_on</xsl:text>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               <xsl:for-each select="row">
-                                       <xsl:choose>
-                                               <xsl:when test="link">
-                                                       <td class="small_text" 
align="center">
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:value-of select="text"/>
-                                                               </a>
-                                                       </td>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <td class="small_text" 
align="left">
-                                                               <xsl:value-of 
select="value"/>
-                                                       </td>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:for-each>
-                       </tr>
-               </xsl:for-each>
-</xsl:template>
-
-<!-- New template-->
 <xsl:template match="table_add">
-               <tr>
-                       <td height="50">
-                               <xsl:variable name="add_action">
-                                       <xsl:value-of select="add_action"/>
-                               </xsl:variable>
-                               <xsl:variable name="lang_add">
-                                       <xsl:value-of select="lang_add"/>
-                               </xsl:variable>
-                               <form method="post" action="{$add_action}">
-                                       <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="lang_add_statustext"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </form>
-                       </td>
-               </tr>
+       <tr>
+               <td height="50">
+                       <xsl:variable name="add_action">
+                               <xsl:value-of select="add_action"/>
+                       </xsl:variable>
+                       <xsl:variable name="lang_add">
+                               <xsl:value-of select="lang_add"/>
+                       </xsl:variable>
+                       <form method="post" action="{$add_action}">
+                               <input type="submit" name="add" 
value="{$lang_add}">
+                                       <xsl:attribute name="title">
+                                               <xsl:value-of 
select="lang_add_statustext"/>
+                                       </xsl:attribute>
+                               </input>
+                       </form>
+               </td>
+       </tr>
 </xsl:template>
 
 <!-- add / edit -->
@@ -130,13 +39,13 @@
                <xsl:value-of select="lookup_functions"/>
        </script>
        <dl>
-                                       <xsl:choose>
-                                               <xsl:when test="msgbox_data != 
''">
+               <xsl:choose>
+                       <xsl:when test="msgbox_data != ''">
                                <dt>
-                                                                       
<xsl:call-template name="msgbox"/>
+                                       <xsl:call-template name="msgbox"/>
                                </dt>
-                                               </xsl:when>
-                                       </xsl:choose>
+                       </xsl:when>
+               </xsl:choose>
        </dl>
        <xsl:variable name="edit_url">
                <xsl:value-of select="edit_url"/>
@@ -145,43 +54,43 @@
                <div id="tab-content">
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
                        <div id="general">
-                                       <xsl:choose>
-                                               <xsl:when 
test="value_custom_id!=''">
+                               <xsl:choose>
+                                       <xsl:when test="value_custom_id!=''">
                                                <div class="pure-control-group">
                                                        <label>
-                                                                       
<xsl:value-of select="lang_custom_id"/>
+                                                               <xsl:value-of 
select="lang_custom_id"/>
                                                        </label>
                                                                         
-                                                                       
<xsl:value-of select="value_custom_id"/>
+                                                       <xsl:value-of 
select="value_custom_id"/>
                                                </div>
-                                               </xsl:when>
-                                       </xsl:choose>
+                                       </xsl:when>
+                               </xsl:choose>
                                <div class="pure-control-group">
                                        <label>
-                                                       <xsl:value-of 
select="lang_name"/>
+                                               <xsl:value-of 
select="lang_name"/>
                                        </label>
-                                       <input type="text" name="values[name]" 
data-validation="required" value="{value_name}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="lang_name_statustext"/>
-                                                               </xsl:attribute>
-                                                       </input>
+                                       <input type="text" name="values[name]" 
data-validation="required" value="{value_name}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_name_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
                                <div class="pure-control-group">
                                        <label>
-                                                       <xsl:value-of 
select="lang_sql_text"/>
+                                               <xsl:value-of 
select="lang_sql_text"/>
                                        </label>
-                                       <textarea cols="60" rows="6" 
name="values[sql_text]" data-validation="required" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="lang_sql_statustext"/>
-                                                               </xsl:attribute>
-                                                               <xsl:value-of 
select="value_sql_text"/>
-                                                       </textarea>
+                                       <textarea cols="60" rows="6" 
name="values[sql_text]" data-validation="required">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_sql_statustext"/>
+                                               </xsl:attribute>
+                                               <xsl:value-of 
select="value_sql_text"/>
+                                       </textarea>
                                </div>
-                                       <xsl:choose>
-                                               <xsl:when test="value_custom_id 
!= ''">
+                               <xsl:choose>
+                                       <xsl:when test="value_custom_id != ''">
                                                <div class="pure-control-group">
                                                        <label>
-                                                                       
<xsl:value-of select="lang_columns"/>
+                                                               <xsl:value-of 
select="lang_columns"/>
                                                        </label>
                                                        <!--xsl:call-template 
name="columns"/-->
                                                        <div 
class="pure-custom">
@@ -203,7 +112,7 @@
                                                                <label 
for="name">
                                                                        
<xsl:value-of select="lang_name"/>
                                                                </label>
-                                                               <input 
type="text" name="values[new_name]" data-validation="required" 
onMouseout="window.status='';return true;">
+                                                               <input 
type="text" name="values[new_name]">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="lang_new_name_statustext"/>
                                                                        
</xsl:attribute>
@@ -214,198 +123,42 @@
                                                                <label 
for="name">
                                                                        
<xsl:value-of select="lang_descr"/>
                                                                </label>
-                                                               <input 
type="text" name="values[new_descr]"  data-validation="required" 
onMouseout="window.status='';return true;">
+                                                               <input 
type="text" name="values[new_descr]">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="lang_new_descr_statustext"/>
                                                                        
</xsl:attribute>
                                                                </input>
                                                        </div>
                                                </div>
-                                               </xsl:when>
-                                       </xsl:choose>
+                                       </xsl:when>
+                               </xsl:choose>
                        </div>
                </div>
                <div class="pure-control-group">
-                                                       <xsl:variable 
name="lang_save">
-                                                               <xsl:value-of 
select="lang_save"/>
-                                                       </xsl:variable>
-                       <input type="submit" class="pure-button 
pure-button-primary" name="values[save]" value="{$lang_save}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="lang_save_statustext"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                                       <xsl:variable 
name="lang_apply">
-                                                               <xsl:value-of 
select="lang_apply"/>
-                                                       </xsl:variable>
-                       <input type="submit" class="pure-button 
pure-button-primary" name="values[apply]" value="{$lang_apply}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="lang_apply_statustext"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                                       <xsl:variable 
name="lang_cancel">
-                                                               <xsl:value-of 
select="lang_cancel"/>
-                                                       </xsl:variable>
-                       <input type="submit" class="pure-button 
pure-button-primary" name="values[cancel]" value="{$lang_cancel}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_cancel_statustext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
+                       <xsl:variable name="lang_save">
+                               <xsl:value-of select="lang_save"/>
+                       </xsl:variable>
+                       <input type="submit" class="pure-button 
pure-button-primary" name="values[save]" value="{$lang_save}">
+                               <xsl:attribute name="title">
+                                       <xsl:value-of 
select="lang_save_statustext"/>
+                               </xsl:attribute>
+                       </input>
+                       <xsl:variable name="lang_apply">
+                               <xsl:value-of select="lang_apply"/>
+                       </xsl:variable>
+                       <input type="submit" class="pure-button 
pure-button-primary" name="values[apply]" value="{$lang_apply}">
+                               <xsl:attribute name="title">
+                                       <xsl:value-of 
select="lang_apply_statustext"/>
+                               </xsl:attribute>
+                       </input>
+                       <xsl:variable name="lang_cancel">
+                               <xsl:value-of select="lang_cancel"/>
+                       </xsl:variable>
+                       <input type="submit" class="pure-button 
pure-button-primary" name="values[cancel]" value="{$lang_cancel}">
+                               <xsl:attribute name="title">
+                                       <xsl:value-of 
select="lang_cancel_statustext"/>
+                               </xsl:attribute>
+                       </input>
                </div>
        </form>
 </xsl:template>
-
-<!-- view -->
-<xsl:template match="view">
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <tr>
-                               <td class="small_text" valign="top" 
align="right">
-                                       <xsl:variable name="link_download">
-                                               <xsl:value-of 
select="link_download"/>
-                                       </xsl:variable>
-                                       <xsl:variable name="lang_download_help">
-                                               <xsl:value-of 
select="lang_download_help"/>
-                                       </xsl:variable>
-                                       <xsl:variable name="lang_download">
-                                               <xsl:value-of 
select="lang_download"/>
-                                       </xsl:variable>
-                                       <a href="javascript:var 
w=window.open('{$link_download}','','left=50,top=100')" 
onMouseOver="overlib('{$lang_download_help}', CAPTION, '{$lang_download}')" 
onMouseOut="nd()">
-                                               <xsl:value-of 
select="lang_download"/>
-                                       </a>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td colspan="3" width="100%">
-                                       <xsl:call-template name="nextmatchs"/>
-                               </td>
-                       </tr>
-               </table>
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <xsl:call-template name="table_header"/>
-                       <xsl:call-template name="values"/>
-                       <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}" onMouseover="window.status='Back 
to the list.';return true;" onMouseout="window.status='';return true;"/>
-                                       </form>
-                               </td>
-                       </tr>
-               </table>
-</xsl:template>
-
-<!-- New template-->
-<xsl:template name="columns">
-               <xsl:variable name="lang_up_text">
-                       <xsl:value-of select="lang_up_text"/>
-               </xsl:variable>
-               <xsl:variable name="lang_down_text">
-                       <xsl:value-of select="lang_down_text"/>
-               </xsl:variable>
-               <table cellpadding="2" cellspacing="2" width="100%" 
align="left">
-                       <xsl:choose>
-                               <xsl:when test="cols!=''">
-                                       <tr class="th">
-                                               <td class="th_text" width="85%" 
align="left">
-                                                       <xsl:value-of 
select="lang_col_name"/>
-                                               </td>
-                                               <td class="th_text" width="85%" 
align="left">
-                                                       <xsl:value-of 
select="lang_col_descr"/>
-                                               </td>
-                                               <td class="th_text" width="15%" 
align="center">
-                                                       <xsl:value-of 
select="lang_sorting"/>
-                                               </td>
-                                               <td class="th_text" width="15%" 
align="center">
-                                                       <xsl:value-of 
select="lang_delete_column"/>
-                                               </td>
-                                       </tr>
-                                       <xsl:for-each select="cols">
-                                               <tr>
-                                                       <xsl:attribute 
name="class">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="@class">
-                                                                               
<xsl:value-of select="@class"/>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="position() mod 2 = 0">
-                                                                               
<xsl:text>row_off</xsl:text>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<xsl:text>row_on</xsl:text>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>
-                                                       </xsl:attribute>
-                                                       <td align="left">
-                                                               <xsl:value-of 
select="name"/>
-                                                               <xsl:text> 
</xsl:text>
-                                                       </td>
-                                                       <td align="left">
-                                                               <xsl:value-of 
select="descr"/>
-                                                               <xsl:text> 
</xsl:text>
-                                                       </td>
-                                                       <td>
-                                                               <table 
align="left">
-                                                                       <tr>
-                                                                               
<td>
-                                                                               
        <xsl:value-of select="sorting"/>
-                                                                               
</td>
-                                                                               
<td align="left">
-                                                                               
        <xsl:variable name="link_up">
-                                                                               
                <xsl:value-of select="link_up"/>
-                                                                               
        </xsl:variable>
-                                                                               
        <a href="{$link_up}" 
onMouseover="window.status='{$lang_up_text}';return true;" 
onMouseout="window.status='';return true;">
-                                                                               
                <xsl:value-of select="text_up"/>
-                                                                               
        </a>
-                                                                               
        <xsl:text> | </xsl:text>
-                                                                               
        <xsl:variable name="link_down">
-                                                                               
                <xsl:value-of select="link_down"/>
-                                                                               
        </xsl:variable>
-                                                                               
        <a href="{$link_down}" 
onMouseover="window.status='{$lang_down_text}';return true;" 
onMouseout="window.status='';return true;">
-                                                                               
                <xsl:value-of select="text_down"/>
-                                                                               
        </a>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </table>
-                                                       </td>
-                                                       <td align="center">
-                                                               <input 
type="checkbox" name="values[delete_cols][]" value="{id}" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="title">
-                                                                               
<xsl:value-of select="//lang_delete_cols_statustext"/>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </td>
-                                               </tr>
-                                       </xsl:for-each>
-                               </xsl:when>
-                       </xsl:choose>
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_name"/>
-                               </td>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_descr"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td>
-                                       <input type="text" 
name="values[new_name]" onMouseout="window.status='';return true;">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="lang_new_name_statustext"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </td>
-                               <td>
-                                       <input type="text" 
name="values[new_descr]" onMouseout="window.status='';return true;">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="lang_new_descr_statustext"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </td>
-                       </tr>
-               </table>
-</xsl:template>




reply via email to

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