fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14777] controller integration


From: Sigurd Nes
Subject: [Fmsystem-commits] [14777] controller integration
Date: Sat, 27 Feb 2016 15:47:03 +0000

Revision: 14777
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14777
Author:   sigurdne
Date:     2016-02-27 15:43:46 +0000 (Sat, 27 Feb 2016)
Log Message:
-----------
controller integration

Modified Paths:
--------------
    trunk/controller/inc/class.socase.inc.php
    trunk/controller/inc/class.socheck_item.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/js/portico/entity.edit.js
    trunk/property/templates/base/entity.xsl

Modified: trunk/controller/inc/class.socase.inc.php
===================================================================
--- trunk/controller/inc/class.socase.inc.php   2016-02-27 15:31:55 UTC (rev 
14776)
+++ trunk/controller/inc/class.socase.inc.php   2016-02-27 15:43:46 UTC (rev 
14777)
@@ -158,8 +158,9 @@
                        $control_item_id = (int)$control_item_id;
                        $check_list_id = (int)$check_list_id;
 
-                       $sql = "SELECT controller_check_item_case.*, 
check_list_id FROM controller_check_item_case "
+                       $sql = "SELECT controller_check_item_case.*, 
check_list_id, controller_control_item.title FROM controller_check_item_case "
                                . " {$this->join} controller_check_item ON 
controller_check_item_case.check_item_id = controller_check_item.id"
+                               . " {$this->join} controller_control_item ON 
controller_control_item.id = controller_check_item.control_item_id"
                                . " WHERE 
controller_check_item_case.component_location_id = {$component_location_id} AND 
controller_check_item_case.component_id = {$component_id}";
 
                        if ($control_item_id)
@@ -181,6 +182,7 @@
                                        (
                                        'id' => $this->db->f('id'),
                                        'check_list_id' => 
$this->db->f('check_list_id'),
+                                       'title' => $this->db->f('title', true),
                                        'descr' => $this->db->f('descr', true),
                                        'measurement' => 
$this->db->f('measurement', true),
                                        'user_id' => $this->db->f('user_id'),

Modified: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php     2016-02-27 15:31:55 UTC 
(rev 14776)
+++ trunk/controller/inc/class.socheck_item.inc.php     2016-02-27 15:43:46 UTC 
(rev 14777)
@@ -29,6 +29,7 @@
         */
        phpgw::import_class('controller.socommon');
 
+       include_class('controller', 'control_item', 'inc/model/');
        include_class('controller', 'check_item', 'inc/model/');
        include_class('controller', 'check_item_case', 'inc/model/');
 

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2016-02-27 15:31:55 UTC (rev 
14776)
+++ trunk/property/inc/class.uientity.inc.php   2016-02-27 15:43:46 UTC (rev 
14777)
@@ -74,7 +74,8 @@
                        'inventory_calendar' => true,
                        'get_controls_at_component' => true,
                        'get_assigned_history' => true,
-                       'get_cases' => true
+                       'get_cases' => true,
+                       'get_cases_for_checklist' => true
                );
 
                function __construct()
@@ -1089,7 +1090,7 @@
 
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && ! 
isset($_REQUEST['district_id']))
+                       if ($default_district && 
!isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;
@@ -1202,7 +1203,7 @@
                                        'allrows' => true,
                                        'editor_action' => '',
                                        'field' => array(),
-                                       'query' => 
phpgw::get_var('location_code')
+                                       'query' => 
phpgw::get_var('location_code')
                                )
                        );
 
@@ -2159,32 +2160,61 @@
                                                )
                                        );
 
-                                       $_cases = 
$this->get_cases($location_id, $id, date('Y'));
+                                       $_checklists = 
$this->get_checklists($location_id, $id, date('Y'));
                                        $cases_time_span = 
$this->cases_time_span;
 
-                                       $_case_def = array
+                                       $_checklists_def = array
                                                (
-                                               array('key' => 'url', 'label' 
=> lang('id'), 'sortable' => false, 'resizeable' => true),
-                                               array('key' => 'type', 'label' 
=> lang('type'), 'sortable' => true, 'resizeable' => true),
-                                               array('key' => 'title', 'label' 
=> lang('title'), 'sortable' => false, 'resizeable' => true),
-                                               array('key' => 'status', 
'label' => lang('status'), 'sortable' => false, 'resizeable' => true),
-                                               array('key' => 'user', 'label' 
=> lang('user'), 'sortable' => true, 'resizeable' => true),
-                                               array('key' => 'entry_date', 
'label' => lang('entry date'), 'sortable' => false,
-                                                       'resizeable' => true),
+                                               array('key' => 'id', 'label' => 
lang('id'), 'sortable' => false),
+                                               array('key' => 'control_name', 
'label' => lang('name'), 'sortable' => false),
+                                               array('key' => 'status', 
'label' => lang('status'), 'sortable' => true),
+                                               array('key' => 'user', 'label' 
=> lang('user'), 'sortable' => false),
+                                               array('key' => 'deadline', 
'label' => lang('deadline'), 'sortable' => false),
+                                               array('key' => 'planned_date', 
'label' => lang('planned date'), 'sortable' => true),
+                                               array('key' => 
'completed_date', 'label' => lang('completed date'), 'sortable' => false),
+                                               array('key' => 
'num_open_cases', 'label' => lang('open_cases'), 'sortable' => false),
+                                               array('key' => 
'num_pending_cases', 'label' => lang('pending_cases'), 'sortable' => false),
                                        );
 
                                        $datatable_def[] = array
                                                (
                                                'container' => 
'datatable-container_5',
                                                'requestUrl' => "''",
-                                               'ColumnDefs' => $_case_def,
-                                               'data' => json_encode($_cases),
+                                               'ColumnDefs' => 
$_checklists_def,
+                                               'data' => 
json_encode($_checklists),
                                                'config' => array(
                                                        array('disableFilter' 
=> true),
-                                                       
array('disablePagination' => true)
+                                                       
array('disablePagination' => true),
+                                                       array('singleSelect' => 
true)
                                                )
                                        );
                                }
+
+                               $_cases = $this->get_cases($location_id, $id, 
date('Y')); // initial search
+                               $cases_time_span = $this->cases_time_span;
+
+                               $_case_def = array
+                                       (
+                                       array('key' => 'url', 'label' => 
lang('id'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'type', 'label' => 
lang('type'), 'sortable' => true, 'resizeable' => true),
+                                       array('key' => 'title', 'label' => 
lang('title'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'status', 'label' => 
lang('status'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'user', 'label' => 
lang('user'), 'sortable' => true, 'resizeable' => true),
+                                       array('key' => 'entry_date', 'label' => 
lang('entry date'), 'sortable' => false,
+                                               'resizeable' => true),
+                               );
+
+                               $datatable_def[] = array
+                                       (
+                                       'container' => 'datatable-container_6',
+                                       'requestUrl' => "''",
+                                       'ColumnDefs' => $_case_def,
+                                       'data' => json_encode($_cases),
+                                       'config' => array(
+                                               array('disableFilter' => true),
+                                               array('disablePagination' => 
true)
+                                       )
+                               );
                        }
 
                        //$category['org_unit'] =1;
@@ -3218,23 +3248,6 @@
                                'location_id' => $location_id, 'component_id' 
=> $id));
                        foreach ($controls as &$entry)
                        {
-                               /*
-                                 $menuaction   = 
'controller.uicalendar.view_calendar_year_for_locations';
-                                 if($entry['repeat_type'] < 2)
-                                 {
-                                 $menuaction   = 
'controller.uicalendar.view_calendar_month_for_locations';
-                                 }
-
-                                 $control_link_data = array
-                                 (
-                                 'menuaction'  => $menuaction,
-                                 'control_id'  => $entry['control_id'],
-                                 'location_id' => $location_id,
-                                 'component_id'        => $id,
-                                 'serie_id'            => $entry['serie_id']
-                                 );
-                                */
-
                                $menuaction = 'controller.uicomponent.index';
 
                                $control_link_data = array
@@ -3250,7 +3263,6 @@
                                $entry['start_date'] = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'], 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                                $entry['repeat_type'] = 
$repeat_type_array[$entry['repeat_type']];
                                $entry['total_time'] = $entry['service_time'] + 
$entry['controle_time'];
-//                             $entry['select'] = "<input type='checkbox' 
class='mychecks' value='{$entry['serie_id']}'></input>";
                        }
 
                        $phpgw_return_as = phpgw::get_var('phpgw_return_as');
@@ -3351,7 +3363,7 @@
                                        (
                                        'url' => "<a href=\"{$_link}\" > 
{$case['check_list_id']}</a>",
                                        'type' => $_control_name,
-                                       'title' => $case['descr'],
+                                       'title' => $case['title'],
                                        'value' => $case['measurement'],
                                        'status' => 
$_statustext[$case['status']],
                                        'user' => 
$GLOBALS['phpgw']->accounts->get($case['user_id'])->__toString(),
@@ -3383,4 +3395,159 @@
                        }
                        return $_cases;
                }
+
+               /**
+                * Get controller cases related to this item and a spesific 
checklist.
+                * @return array
+                */
+               public function get_cases_for_checklist()
+               {
+                       $check_list_id = phpgw::get_var('check_list_id', 'int');
+                       $so_check_item = 
CreateObject('controller.socheck_item');
+                       $controller_cases = 
$so_check_item->get_check_items_with_cases($check_list_id, $_type = null, 
'all', null, null);
+
+                       $_statustext = array();
+                       $_statustext[0] = lang('open');
+                       $_statustext[1] = lang('closed');
+                       $_statustext[2] = lang('pending');
+
+                       $_case_years = array();
+                       $_cases = array();
+
+                       $socheck_list = CreateObject('controller.socheck_list');
+                       $socontrol = CreateObject('controller.socontrol');
+
+                       foreach ($controller_cases as $check_item)
+                       {
+                               $checklist_id = 
$check_item->get_check_list_id();
+                               $control_id = 
$socheck_list->get_single($checklist_id)->get_control_id();
+
+                               $_control_name = 
$socontrol->get_single($control_id)->get_title();
+
+                               $cases_array = $check_item->get_cases_array();
+                               foreach ($cases_array as $case)
+                               {
+                                       switch ($case->get_status())
+                                       {
+                                               case 0:
+                                               case 2:
+                                                       $_method = 
'view_open_cases';
+                                                       break;
+                                               case 1:
+                                                       $_method = 
'view_closed_cases';
+                                                       break;
+                                               default:
+                                                       $_method = 
'view_open_cases';
+                                       }
+
+                                       $_link = 
$GLOBALS['phpgw']->link('/index.php', array
+                                               (
+                                               'menuaction' => 
"controller.uicase.{$_method}",
+                                               'check_list_id' => 
$check_list_id
+                                               )
+                                       );
+
+                                       $_cases[] = array
+                                               (
+                                               'url' => "<a href=\"{$_link}\" 
> {$check_list_id}</a>",
+                                               'type' => $_control_name,
+                                               'title' 
=>$check_item->get_control_item()->get_title(),
+                                               'value' => 
$case->get_measurement(),
+                                               'status' => 
$_statustext[$case->get_status()],
+                                               'user' => 
$GLOBALS['phpgw']->accounts->get($case->get_user_id())->__toString(),
+                                               'entry_date' => 
$GLOBALS['phpgw']->common->show_date($case->get_modified_date(), 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                       );
+                                       unset($_link);
+                               }
+                       }
+
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               $result_data = array
+                                       (
+                                       'results' => $_cases,
+                                       'total_records' => count($_cases),
+                                       'draw' => phpgw::get_var('draw', 'int')
+                               );
+
+                               return $this->jquery_results($result_data);
+                       }
+                       return $_cases;
+               }
+
+               /**
+                * Get controller checklists related to this item.
+                * @param integer $location_id
+                * @param integer $id
+                * @param integer $year
+                * @return string
+                */
+               public function get_checklists( $location_id = 0, $id = 0, 
$year = 0 )
+               {
+                       if (!$location_id)
+                       {
+                               $location_id = phpgw::get_var('location_id', 
'int');
+                       }
+                       if (!$id)
+                       {
+                               $id = phpgw::get_var('id', 'int');
+                       }
+                       if (!$year)
+                       {
+                               $year = phpgw::get_var('year', 'int', 
'REQUEST', date('Y'));
+                       }
+
+                       $from_date_ts = 0;//mktime(0, 0, 0, 1, 1, $year);
+                       $to_date_ts = mktime(23, 59, 59, 12, 31, ($year + 2));
+                       $socheck_list = CreateObject('controller.socheck_list');
+                       $socontrol = CreateObject('controller.socontrol');
+
+                       $control_id_with_check_list_array = 
$socheck_list->get_check_lists_for_component($location_id, $id, $from_date_ts, 
$to_date_ts);
+
+                       $_statustext = array();
+                       $_statustext[0] = lang('open');
+                       $_statustext[1] = lang('closed');
+                       $_statustext[2] = lang('pending');
+                       $_check_list = array();
+                       foreach ($control_id_with_check_list_array as $control)
+                       {
+                               $_control_name = 
$socontrol->get_single($control->get_id())->get_title();
+                               $check_lists = 
$control->get_check_lists_array();
+
+                               foreach ($check_lists as $check_list)
+                               {
+                                       $_link = self::link(array(
+                                                       'menuaction' => 
"controller.uicheck_list.edit_check_list",
+                                                       'check_list_id' => 
$check_list->get_id()
+                                                       )
+                                       );
+                                       $_check_list[] = array
+                                               (
+                                               'id' => $check_list->get_id(),
+                                               'control_name' => "<a 
href=\"{$_link}\" >{$_control_name}</a>",
+                                               'status' => 
$_statustext[$check_list->get_status()],
+                                               'user' => 
$GLOBALS['phpgw']->accounts->get($check_list->get_assigned_to())->__toString(),
+                                               'deadline' => 
$GLOBALS['phpgw']->common->show_date($check_list->get_deadline(), 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                               'planned_date' => 
$GLOBALS['phpgw']->common->show_date($check_list->get_planned_date(), 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                               'completed_date' => 
$GLOBALS['phpgw']->common->show_date($check_list->get_completed_date(), 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                               'num_open_cases' => 
$check_list->get_num_open_cases(),
+                                               'num_pending_cases' => 
$check_list->get_num_pending_cases(),
+                                       );
+                                       unset($_link);
+                               }
+                       }
+
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               $result_data = array
+                                       (
+                                       'results' => $_check_list,
+                                       'total_records' => count($_check_list),
+                                       'draw' => phpgw::get_var('draw', 'int')
+                               );
+
+                               return $this->jquery_results($result_data);
+                       }
+                       return $_check_list;
+               }
        }
\ No newline at end of file

Modified: trunk/property/js/portico/entity.edit.js
===================================================================
--- trunk/property/js/portico/entity.edit.js    2016-02-27 15:31:55 UTC (rev 
14776)
+++ trunk/property/js/portico/entity.edit.js    2016-02-27 15:43:46 UTC (rev 
14777)
@@ -281,6 +281,26 @@
        {
                var oArgs = {menuaction: 'property.uientity.get_cases', 
location_id: location_id, id: item_id, year: $(this).val()};
                var requestUrl = phpGWLink('index.php', oArgs, true);
-               JqueryPortico.updateinlineTableHelper('datatable-container_5', 
requestUrl);
+               JqueryPortico.updateinlineTableHelper('datatable-container_6', 
requestUrl);
        });
+
+
+       $("#datatable-container_5 tr").on("click", function (e)
+       {
+               var check_list_id = $('td', this).eq(0).text();
+               updateCaseTable(check_list_id);
+       });
+
 });
+
+function updateCaseTable(check_list_id)
+{
+       if (!check_list_id)
+       {
+               return;
+       }
+       $("#cases_time_span").hide();
+       var oArgs = {menuaction: 'property.uientity.get_cases_for_checklist', 
check_list_id: check_list_id};
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+       JqueryPortico.updateinlineTableHelper('datatable-container_6', 
requestUrl);
+}

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2016-02-27 15:31:55 UTC (rev 
14776)
+++ trunk/property/templates/base/entity.xsl    2016-02-27 15:43:46 UTC (rev 
14777)
@@ -1,20 +1,20 @@
 
 <!-- $Id$ -->
 <xsl:template match="data">
-               <xsl:choose>
-                       <xsl:when test="edit">
-                               <xsl:apply-templates select="edit"/>
-                       </xsl:when>
-                       <xsl:when test="empty">
-                               <xsl:apply-templates select="empty"/>
-                       </xsl:when>
-                       <xsl:when test="edit_inventory">
-                               <xsl:apply-templates select="edit_inventory"/>
-                       </xsl:when>
-                       <xsl:when test="add_inventory">
-                               <xsl:apply-templates select="add_inventory"/>
-                       </xsl:when>
-               </xsl:choose>
+       <xsl:choose>
+               <xsl:when test="edit">
+                       <xsl:apply-templates select="edit"/>
+               </xsl:when>
+               <xsl:when test="empty">
+                       <xsl:apply-templates select="empty"/>
+               </xsl:when>
+               <xsl:when test="edit_inventory">
+                       <xsl:apply-templates select="edit_inventory"/>
+               </xsl:when>
+               <xsl:when test="add_inventory">
+                       <xsl:apply-templates select="add_inventory"/>
+               </xsl:when>
+       </xsl:choose>
        <xsl:call-template name="jquery_phpgw_i18n"/>
 </xsl:template>
 
@@ -26,7 +26,7 @@
                        <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:property.uientity.edit_inventory')" />
                </xsl:variable>
                <xsl:variable name="lang_inventory">
-                               <xsl:value-of select="php:function('lang', 
'inventory')" />
+                       <xsl:value-of select="php:function('lang', 
'inventory')" />
                </xsl:variable>
 
                <form name="form" id="edit_inventory" action="{$action_url}" 
method="post" class="pure-form pure-form-aligned">
@@ -39,12 +39,12 @@
                                        </xsl:when>
                                </xsl:choose>
                        </dl>
-        <fieldset>
-               <legend>
-                       <xsl:value-of select="system_location/descr"/>
-                       <xsl:text>::</xsl:text>                 
-                       <xsl:value-of select="php:function('lang', 'edit 
inventory')" />
-               </legend>
+                       <fieldset>
+                               <legend>
+                                       <xsl:value-of 
select="system_location/descr"/>
+                                       <xsl:text>::</xsl:text>
+                                       <xsl:value-of 
select="php:function('lang', 'edit inventory')" />
+                               </legend>
 
                                <xsl:call-template name="location_view"/>
 
@@ -62,92 +62,92 @@
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'id')" />
                                        </label>
-                                               <xsl:value-of select="item_id"/>
-                                               <input type="hidden" 
name="location_id" value="{location_id}"/>
-                                               <input type="hidden" name="id" 
value="{item_id}"/>
-                                               <input type="hidden" 
name="inventory_id" value="{inventory_id}"/>
+                                       <xsl:value-of select="item_id"/>
+                                       <input type="hidden" name="location_id" 
value="{location_id}"/>
+                                       <input type="hidden" name="id" 
value="{item_id}"/>
+                                       <input type="hidden" 
name="inventory_id" value="{inventory_id}"/>
                                </div>
 
                                <div class="pure-control-group">
                                        <label for="unit_id">
                                                <xsl:value-of 
select="php:function('lang', 'unit')" />
                                        </label>
-                                               <select id = 'unit_id' 
name="values[unit_id]" class="forms">
-                                                       <xsl:if test="lock_unit 
= 1">
-                                                               <xsl:attribute 
name="disabled" value="disabled"/>
-                                                       </xsl:if>
-                                                       <xsl:apply-templates 
select="unit_list/options"/>
-                                               </select>
+                                       <select id = 'unit_id' 
name="values[unit_id]" class="forms">
+                                               <xsl:if test="lock_unit = 1">
+                                                       <xsl:attribute 
name="disabled" value="disabled"/>
+                                               </xsl:if>
+                                               <xsl:apply-templates 
select="unit_list/options"/>
+                                       </select>
                                </div>
 
                                <div class="pure-control-group">
-                                               <label for="old_inventory">
-                                                       <xsl:value-of 
select="$lang_inventory"/>
-                                               </label>
-                                               <xsl:value-of 
select="value_inventory"/>
+                                       <label for="old_inventory">
+                                               <xsl:value-of 
select="$lang_inventory"/>
+                                       </label>
+                                       <xsl:value-of select="value_inventory"/>
                                </div>
 
                                <div class="pure-control-group">
-                                               <label for="inventory">
-                                                       <xsl:value-of 
select="php:function('lang', 'new')" />
-                                                       <xsl:text> </xsl:text>
-                                                       <xsl:value-of 
select="$lang_inventory"/>
-                                               </label>
-                                               <input type="text" id = 
'inventory' name="values[inventory]" value="{value_inventory}" size="12">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_inventory_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <label for="inventory">
+                                               <xsl:value-of 
select="php:function('lang', 'new')" />
+                                               <xsl:text> </xsl:text>
+                                               <xsl:value-of 
select="$lang_inventory"/>
+                                       </label>
+                                       <input type="text" id = 'inventory' 
name="values[inventory]" value="{value_inventory}" size="12">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_inventory_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'bookable')" />
                                        </label>
-                                               <input type="checkbox" 
name="values[bookable]" value="1">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'bookable')"/>
+                                       <input type="checkbox" 
name="values[bookable]" value="1">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'bookable')"/>
+                                               </xsl:attribute>
+                                               <xsl:if test="bookable = '1'">
+                                                       <xsl:attribute 
name="checked">
+                                                               
<xsl:text>checked</xsl:text>
                                                        </xsl:attribute>
-                                                       <xsl:if test="bookable 
= '1'">
-                                                               <xsl:attribute 
name="checked">
-                                                                       
<xsl:text>checked</xsl:text>
-                                                               </xsl:attribute>
-                                                       </xsl:if>
-                                               </input>
+                                               </xsl:if>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
-                                               <label>
-                                                       <xsl:value-of 
select="php:function('lang', 'active from')"/>
-                                               </label>
-                                               <input type="text" 
id="active_from" name="values[active_from]" size="10" 
value="{value_active_from}" readonly="readonly">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_active_from_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'active from')"/>
+                                       </label>
+                                       <input type="text" id="active_from" 
name="values[active_from]" size="10" value="{value_active_from}" 
readonly="readonly">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_active_from_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'active to')"/>
                                        </label>
-                                               <input type="text" 
id="active_to" name="values[active_to]" size="10" value="{value_active_to}" 
readonly="readonly">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_active_to_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <input type="text" id="active_to" 
name="values[active_to]" size="10" value="{value_active_to}" 
readonly="readonly">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_active_to_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'remark')" />
                                        </label>
-                                               <textarea cols="60" rows="4" 
name="values[remark]">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'remark')"/>
-                                                       </xsl:attribute>
-                                                       <xsl:value-of 
select="value_remark"/>
-                                               </textarea>
+                                       <textarea cols="60" rows="4" 
name="values[remark]">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'remark')"/>
+                                               </xsl:attribute>
+                                               <xsl:value-of 
select="value_remark"/>
+                                       </textarea>
                                </div>
                                        
                                <div class="pure-g">
@@ -168,7 +168,7 @@
                                                        <xsl:value-of 
select="php:function('lang', 'Back to the list')"/>
                                                </xsl:attribute>
                                        </input>
-        </div>
+                               </div>
                        </fieldset>
                </form>
        </fieldset>
@@ -186,7 +186,7 @@
                                <xsl:choose>
                                        <xsl:when test="msgbox_data != ''">
                                                <dt>
-                                                               
<xsl:call-template name="msgbox"/>
+                                                       <xsl:call-template 
name="msgbox"/>
                                                </dt>
                                        </xsl:when>
                                </xsl:choose>
@@ -197,82 +197,82 @@
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'id')" />
                                        </label>
-                                               <xsl:value-of select="item_id"/>
-                                               <input type="hidden" 
name="location_id" value="{location_id}"/>
-                                               <input type="hidden" name="id" 
value="{item_id}"/>
+                                       <xsl:value-of select="item_id"/>
+                                       <input type="hidden" name="location_id" 
value="{location_id}"/>
+                                       <input type="hidden" name="id" 
value="{item_id}"/>
                                </div>
 
                                <div class="pure-control-group">
                                        <label for="unit_id">
                                                <xsl:value-of 
select="php:function('lang', 'unit')" />
                                        </label>
-                                               <select id = 'unit_id' 
name="values[unit_id]" class="forms">
-                                                       <xsl:if test="lock_unit 
= 1">
-                                                               <xsl:attribute 
name="disabled" value="disabled"/>
-                                                       </xsl:if>
-                                                       <xsl:apply-templates 
select="unit_list/options"/>
-                                               </select>
+                                       <select id = 'unit_id' 
name="values[unit_id]" class="forms">
+                                               <xsl:if test="lock_unit = 1">
+                                                       <xsl:attribute 
name="disabled" value="disabled"/>
+                                               </xsl:if>
+                                               <xsl:apply-templates 
select="unit_list/options"/>
+                                       </select>
                                </div>
 
                                <div class="pure-control-group">
                                        <label for="inventory">
                                                <xsl:value-of 
select="php:function('lang', 'inventory')" />
                                        </label>
-                                               <input type="text" id = 
'inventory' name="values[inventory]" value="{value_inventory}" size="12">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_inventory_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <input type="text" id = 'inventory' 
name="values[inventory]" value="{value_inventory}" size="12">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_inventory_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'bookable')" />
                                        </label>
-                                               <input type="checkbox" 
name="values[bookable]" value="1">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'bookable')"/>
+                                       <input type="checkbox" 
name="values[bookable]" value="1">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'bookable')"/>
+                                               </xsl:attribute>
+                                               <xsl:if test="bookable = '1'">
+                                                       <xsl:attribute 
name="checked">
+                                                               
<xsl:text>checked</xsl:text>
                                                        </xsl:attribute>
-                                                       <xsl:if test="bookable 
= '1'">
-                                                               <xsl:attribute 
name="checked">
-                                                                       
<xsl:text>checked</xsl:text>
-                                                               </xsl:attribute>
-                                                       </xsl:if>
-                                               </input>
+                                               </xsl:if>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
-                                               <label>
-                                                       <xsl:value-of 
select="php:function('lang', 'active from')"/>
-                                               </label>
-                                               <input type="text" 
id="active_from" name="values[active_from]" size="10" 
value="{value_active_from}" readonly="readonly">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_active_from_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'active from')"/>
+                                       </label>
+                                       <input type="text" id="active_from" 
name="values[active_from]" size="10" value="{value_active_from}" 
readonly="readonly">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_active_from_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'active to')"/>
                                        </label>
-                                               <input type="text" 
id="active_to" name="values[active_to]" size="10" value="{value_active_to}" 
readonly="readonly">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_active_to_statustext"/>
-                                                       </xsl:attribute>
-                                               </input>
+                                       <input type="text" id="active_to" 
name="values[active_to]" size="10" value="{value_active_to}" 
readonly="readonly">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_active_to_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
                                </div>
 
                                <div class="pure-control-group">
                                        <label>
                                                <xsl:value-of 
select="php:function('lang', 'remark')" />
                                        </label>
-                                               <textarea cols="60" rows="4" 
name="values[remark]">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'remark')"/>
-                                                       </xsl:attribute>
-                                                       <xsl:value-of 
select="value_remark"/>
-                                               </textarea>
+                                       <textarea cols="60" rows="4" 
name="values[remark]">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'remark')"/>
+                                               </xsl:attribute>
+                                               <xsl:value-of 
select="value_remark"/>
+                                       </textarea>
                                </div>
                                        
                                <div class="pure-g">
@@ -292,47 +292,47 @@
                                                        <xsl:value-of 
select="php:function('lang', 'Back to the list')"/>
                                                </xsl:attribute>
                                        </input>
-        </div>
+                               </div>
                        </fieldset>
                </form>
        </fieldset>
 </xsl:template>
 
 <xsl:template match="options">
-               <option value="{id}">
-                       <xsl:if test="selected != 0">
-                               <xsl:attribute name="selected" 
value="selected"/>
-                       </xsl:if>
-                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
-               </option>
+       <option value="{id}">
+               <xsl:if test="selected != 0">
+                       <xsl:attribute name="selected" value="selected"/>
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
 </xsl:template>
 
 <!-- add / edit -->
 <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
-               <xsl:choose>
-                       <xsl:when test="mode = 'edit'">
-                               <script type="text/javascript">
-                       var location_id = '<xsl:value-of 
select="value_location_id"/>';
-                       var item_id = '<xsl:value-of select="value_id"/>';
+       <xsl:choose>
+               <xsl:when test="mode = 'edit'">
+                       <script type="text/javascript">
+                               var location_id = '<xsl:value-of 
select="value_location_id"/>';
+                               var item_id = '<xsl:value-of 
select="value_id"/>';
 
                                function set_tab(active_tab)
-                                       {
+                               {
                                document.form.active_tab.value = active_tab;
-                                       }
+                               }
                                <xsl:value-of select="lookup_functions"/>
-               </script>
+                       </script>
                </xsl:when>
        </xsl:choose>
 
        <div id="entity_edit_tabview">
                <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="form_action">
                        <xsl:value-of select="form_action"/>
@@ -340,225 +340,225 @@
                <form id="form" name="form" action="{$form_action}" 
method="post" ENCTYPE="multipart/form-data" class= "pure-form 
pure-form-aligned">
                        <input type="hidden" name="active_tab" 
value="{active_tab}"/>
                        <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
-                                       <xsl:choose>
-                                               <xsl:when test="value_id !=''">
-                                                       <tr>
-                                                               <td 
class="th_text" valign="top">
-                                                                       <a 
href="{link_pdf}" target="_blank">PDF</a>
-                                                               </td>
-                                                       </tr>
-                                               </xsl:when>
-                                       </xsl:choose>
+                               <xsl:choose>
+                                       <xsl:when test="value_id !=''">
+                                               <tr>
+                                                       <td class="th_text" 
valign="top">
+                                                               <a 
href="{link_pdf}" target="_blank">PDF</a>
+                                                       </td>
+                                               </tr>
+                                       </xsl:when>
+                               </xsl:choose>
                                <xsl:if test="cat_list=''">
                                        <xsl:if test="mode = 'edit'">
-                                                       <tr>
+                                               <tr>
                                                        <td colspan="2" 
align="left">
-                                                                       
<xsl:call-template name="table_apply">
-                                                                               
<xsl:with-param name="lean" select="lean"/>
+                                                               
<xsl:call-template name="table_apply">
+                                                                       
<xsl:with-param name="lean" select="lean"/>
                                                                        
<xsl:with-param name="cat_list" select="cat_list"/>
-                                                                       
</xsl:call-template>
-                                                               </td>
-                                                       </tr>
+                                                               
</xsl:call-template>
+                                                       </td>
+                                               </tr>
                                        </xsl:if>
                                </xsl:if>
-                               </table>
+                       </table>
                        <table class="pure-table pure-table-bordered"  
width="100%" cellpadding="2" cellspacing="2" align="center">
-                                       <xsl:for-each select="origin_list">
+                               <xsl:for-each select="origin_list">
+                                       <tr>
+                                               <td class="th_text">
+                                                       <xsl:value-of 
select="name"/>
+                                               </td>
+                                               <td class="th_text">
+                                                       <a href="{link}" 
title="{statustext}">
+                                                               <xsl:value-of 
select="id"/>
+                                                       </a>
+                                               </td>
+                                       </tr>
+                               </xsl:for-each>
+                               <xsl:choose>
+                                       <xsl:when test="value_ticket_id!=''">
                                                <tr>
-                                                       <td class="th_text">
-                                                               <xsl:value-of 
select="name"/>
+                                                       <td>
+                                                               <xsl:value-of 
select="lang_ticket"/>
                                                        </td>
-                                                       <td class="th_text">
-                                                               <a 
href="{link}" title="{statustext}">
-                                                                       
<xsl:value-of select="id"/>
-                                                               </a>
+                                                       <td class="th_text" 
align="left">
+                                                               <xsl:for-each 
select="value_ticket_id">
+                                                                       
<xsl:variable name="link_ticket">
+                                                                               
<xsl:value-of select="//link_ticket"/>&amp;id=<xsl:value-of select="id"/>
+                                                                       
</xsl:variable>
+                                                                       <a 
href="{$link_ticket}" 
onMouseover="window.status='{//lang_ticket_statustext}';return true;" 
onMouseout="window.status='';return true;">
+                                                                               
<xsl:value-of select="id"/>
+                                                                       </a>
+                                                                       
<xsl:text> </xsl:text>
+                                                               </xsl:for-each>
                                                        </td>
                                                </tr>
-                                       </xsl:for-each>
-                                       <xsl:choose>
-                                               <xsl:when 
test="value_ticket_id!=''">
+                                       </xsl:when>
+                               </xsl:choose>
+                               <tr>
+                                       <td class="th_text">
+                                               <xsl:value-of 
select="lang_entity"/>
+                                       </td>
+                                       <td class="th_text">
+                                               <xsl:value-of 
select="entity_name"/>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td class="th_text">
+                                               <xsl:value-of 
select="lang_category"/>
+                                               <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
+                                               <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
+                                       </td>
+                                       <td class="th_text">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="cat_list=''">
+                                                               <xsl:value-of 
select="category_name"/>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               
<xsl:call-template name="cat_select"/>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </td>
+                               </tr>
+                               <xsl:choose>
+                                       <xsl:when test="value_id!=''">
+                                               <tr>
+                                                       <td valign="top">
+                                                               <xsl:value-of 
select="lang_id"/>
+                                                       </td>
+                                                       <td>
+                                                               <xsl:value-of 
select="value_num"/>
+                                                               <input 
type="hidden" id="location_code" name="location_code" value="{location_code}"/>
+                                                               <input 
type="hidden" name="lookup_tenant" value="{lookup_tenant}"/>
+                                                               <input 
type="hidden" name="values[id]" value="{value_id}"/>
+                                                               <input 
type="hidden" name="values[num]" value="{value_num}"/>
+                                                       </td>
+                                               </tr>
+                                               <xsl:for-each 
select="value_origin">
                                                        <tr>
+                                                               <td 
class="th_text" valign="top">
+                                                                       
<xsl:value-of select="descr"/>
+                                                               </td>
                                                                <td>
-                                                                       
<xsl:value-of select="lang_ticket"/>
+                                                                       <table>
+                                                                               
<xsl:for-each select="data">
+                                                                               
        <tr>
+                                                                               
                <td class="th_text" align="left">
+                                                                               
                        <a href="{link}" title="{statustext}">
+                                                                               
                                <xsl:value-of select="id"/>
+                                                                               
                        </a>
+                                                                               
                </td>
+                                                                               
        </tr>
+                                                                               
</xsl:for-each>
+                                                                       </table>
                                                                </td>
-                                                               <td 
class="th_text" align="left">
-                                                                       
<xsl:for-each select="value_ticket_id">
-                                                                       
<xsl:variable name="link_ticket">
-                                                                               
<xsl:value-of select="//link_ticket"/>&amp;id=<xsl:value-of select="id"/>
-                                                                       
</xsl:variable>
-                                                                               
<a href="{$link_ticket}" 
onMouseover="window.status='{//lang_ticket_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>
-                                       <tr>
-                                               <td class="th_text">
-                                                       <xsl:value-of 
select="lang_entity"/>
-                                               </td>
-                                               <td class="th_text">
-                                                       <xsl:value-of 
select="entity_name"/>
-                                               </td>
-                                       </tr>
-                                       <tr>
-                                               <td class="th_text">
-                                                       <xsl:value-of 
select="lang_category"/>
-                                                       <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
-                                                       <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
-                                               </td>
-                                               <td class="th_text">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="cat_list=''">
-                                                                       
<xsl:value-of select="category_name"/>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:call-template name="cat_select"/>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </td>
-                                       </tr>
-                                       <xsl:choose>
-                                               <xsl:when test="value_id!=''">
+                                               </xsl:for-each>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <xsl:for-each 
select="value_origin">
                                                        <tr>
-                                                               <td 
valign="top">
-                                                                       
<xsl:value-of select="lang_id"/>
+                                                               <td 
class="th_text" valign="top">
+                                                                       
<xsl:value-of select="descr"/>
                                                                </td>
                                                                <td>
-                                                                       
<xsl:value-of select="value_num"/>
-                                                                       <input 
type="hidden" id="location_code" name="location_code" value="{location_code}"/>
-                                                                       <input 
type="hidden" name="lookup_tenant" value="{lookup_tenant}"/>
-                                                                       <input 
type="hidden" name="values[id]" value="{value_id}"/>
-                                                                       <input 
type="hidden" name="values[num]" value="{value_num}"/>
+                                                                       <table>
+                                                                               
<xsl:for-each select="data">
+                                                                               
        <tr>
+                                                                               
                <td class="th_text" align="left">
+                                                                               
                        <a href="{link}" title="{statustext}">
+                                                                               
                                <xsl:value-of select="id"/>
+                                                                               
                        </a>
+                                                                               
                        <xsl:text> </xsl:text>
+                                                                               
                </td>
+                                                                               
        </tr>
+                                                                               
</xsl:for-each>
+                                                                       </table>
                                                                </td>
                                                        </tr>
-                                                       <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}">
-                                                                               
                                        <xsl:value-of select="id"/>
-                                                                               
                                </a>
-                                                                               
                        </td>
-                                                                               
                </tr>
-                                                                               
        </xsl:for-each>
-                                                                               
</table>
-                                                                       </td>
-                                                               </tr>
-                                                       </xsl:for-each>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <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}">
-                                                                               
                                        <xsl:value-of select="id"/>
-                                                                               
                                </a>
-                                                                               
                                <xsl:text> </xsl:text>
-                                                                               
                        </td>
-                                                                               
                </tr>
-                                                                               
        </xsl:for-each>
-                                                                               
</table>
-                                                                       </td>
-                                                               </tr>
-                                                       </xsl:for-each>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </table>
+                                               </xsl:for-each>
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                       </table>
                                
                        <div id="tab-content">
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
-                                       <xsl:choose>
+                               <xsl:choose>
                                        <xsl:when test="location_data2!=''">
-                                                       <div id="location">
+                                               <div id="location">
                                                        <fieldset>
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="mode='edit'">
-                                                                               
        <tr>
-                                                                               
                <xsl:variable name="lang_entity_group">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'entity 
group')"/>
-                                                                               
                </xsl:variable>
-                                                                               
                <td>
-                                                                               
                        <xsl:value-of select="$lang_entity_group"/>
-                                                                               
                </td>
-                                                                               
                <td valign="top">
-                                                                               
                        <select name="values[entity_group_id]" 
title="$lang_entity_group">
-                                                                               
                                <xsl:apply-templates 
select="entity_group_list/options"/>
-                                                                               
                        </select>
-                                                                               
                        <xsl:value-of select="entity_group_name"/>
-                                                                               
                </td>
-                                                                               
        </tr>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="mode='edit'">
+                                                                               
<tr>
+                                                                               
        <xsl:variable name="lang_entity_group">
+                                                                               
                <xsl:value-of select="php:function('lang', 'entity group')"/>
+                                                                               
        </xsl:variable>
+                                                                               
        <td>
+                                                                               
                <xsl:value-of select="$lang_entity_group"/>
+                                                                               
        </td>
+                                                                               
        <td valign="top">
+                                                                               
                <select name="values[entity_group_id]" 
title="$lang_entity_group">
+                                                                               
                        <xsl:apply-templates 
select="entity_group_list/options"/>
+                                                                               
                </select>
+                                                                               
                <xsl:value-of select="entity_group_name"/>
+                                                                               
        </td>
+                                                                               
</tr>
 
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="org_unit='1'">
+                                                                               
<xsl:choose>
+                                                                               
        <xsl:when test="org_unit='1'">
                                                                                
                <div class="pure-control-group">
                                                                                
                        <label>
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'department')"/>
+                                                                               
                                <xsl:value-of select="php:function('lang', 
'department')"/>
                                                                                
                        </label>
                                                                                
                        <div class="pure-custom">
-                                                                               
                                        <div class="autocomplete">
-                                                                               
                                                <input id="org_unit_id" 
name="org_unit_id" type="hidden" value="{value_org_unit_id}">
-                                                                               
                                                </input>
-                                                                               
                                                <input id="org_unit_name" 
name="org_unit_name" type="text" value="{value_org_unit_name}" 
title="{value_org_unit_name_path}" size='60'>
-                                                                               
                                                        <xsl:choose>
-                                                                               
                                                                <xsl:when 
test="disabled!=''">
-                                                                               
                                                                        
<xsl:attribute name="disabled">
-                                                                               
                                                                                
<xsl:text>disabled</xsl:text>
-                                                                               
                                                                        
</xsl:attribute>
-                                                                               
                                                                </xsl:when>
-                                                                               
                                                        </xsl:choose>
-                                                                               
                                                </input>
-                                                                               
                                                <div id="org_unit_container"/>
-                                                                               
                                        </div>
+                                                                               
                                <div class="autocomplete">
+                                                                               
                                        <input id="org_unit_id" 
name="org_unit_id" type="hidden" value="{value_org_unit_id}">
+                                                                               
                                        </input>
+                                                                               
                                        <input id="org_unit_name" 
name="org_unit_name" type="text" value="{value_org_unit_name}" 
title="{value_org_unit_name_path}" size='60'>
+                                                                               
                                                <xsl:choose>
+                                                                               
                                                        <xsl:when 
test="disabled!=''">
+                                                                               
                                                                <xsl:attribute 
name="disabled">
+                                                                               
                                                                        
<xsl:text>disabled</xsl:text>
+                                                                               
                                                                </xsl:attribute>
+                                                                               
                                                        </xsl:when>
+                                                                               
                                                </xsl:choose>
+                                                                               
                                        </input>
+                                                                               
                                        <div id="org_unit_container"/>
+                                                                               
                                </div>
                                                                                
                        </div>
                                                                                
                </div>
-                                                                               
                </xsl:when>
-                                                                               
        </xsl:choose>
+                                                                               
        </xsl:when>
+                                                                               
</xsl:choose>
                                                                                
<xsl:call-template name="location_form2"/>
-                                                                               
</xsl:when>
-                                                                               
<xsl:otherwise>
+                                                                       
</xsl:when>
+                                                                       
<xsl:otherwise>
                                                                                
<xsl:call-template name="location_view2"/>
-                                                                               
</xsl:otherwise>
-                                                                       
</xsl:choose>
-                                                                       
<xsl:apply-templates select="attributes_general/attributes"/>
+                                                                       
</xsl:otherwise>
+                                                               </xsl:choose>
+                                                               
<xsl:apply-templates select="attributes_general/attributes"/>
                                                        </fieldset>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
-                                       <xsl:if test="controller=1">
-                                               <div id="controller">
-                                                       <script 
type="text/javascript">
+                                               </div>
+                                       </xsl:when>
+                               </xsl:choose>
+                               <xsl:if test="controller=1">
+                                       <div id="controller">
+                                               <script type="text/javascript">
                                                        
lookup_control_responsible = function()
                                                        {
-                                                               var oArgs = 
{menuaction:'property.uilookup.phpgw_user', column:'control_responsible', 
acl_app:'controller', acl_location: '.checklist', acl_required:4};
-                                                               var requestUrl 
= phpGWLink('index.php', oArgs);
+                                                       var oArgs = 
{menuaction:'property.uilookup.phpgw_user', column:'control_responsible', 
acl_app:'controller', acl_location: '.checklist', acl_required:4};
+                                                       var requestUrl = 
phpGWLink('index.php', oArgs);
                                                        
TINY.box.show({iframe:requestUrl, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
                                                        }
 
                                                        lookup_control = 
function()
                                                        {
-                                                               var oArgs = 
{menuaction:'controller.uilookup.control'};
-                                                               var requestUrl 
= phpGWLink('index.php', oArgs);
+                                                       var oArgs = 
{menuaction:'controller.uilookup.control'};
+                                                       var requestUrl = 
phpGWLink('index.php', oArgs);
                                                        
TINY.box.show({iframe:requestUrl, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
                                                        }
 
-                                                       </script>
-                                                       <div 
id="controller_receipt"></div>
+                                               </script>
+                                               <div 
id="controller_receipt"></div>
                                                <fieldset>
                                                        <legend>
                                                                <xsl:value-of 
select="php:function('lang', 'new')" />
@@ -630,7 +630,7 @@
                                                </fieldset>
                                                <div class="pure-control-group">
                                                        <label>
-                                                                       
<xsl:value-of select="php:function('lang', 'controller')" />
+                                                               <xsl:value-of 
select="php:function('lang', 'controller')" />
                                                        </label>
                                                        <xsl:for-each 
select="datatable_def">
                                                                <xsl:if 
test="container = 'datatable-container_4'">
@@ -648,18 +648,8 @@
                                                                                
                                                <div class="pure-control-group">
                                                        <label>
-                                                                               
                        <xsl:value-of select="php:function('lang', 'cases')" />
+                                                               <xsl:value-of 
select="php:function('lang', 'checklist')" />
                                                        </label>
-                                                                               
                        <select id = "cases_time_span" name="cases_time_span">
-                                                                               
                                <xsl:attribute name="title">
-                                                                               
                                <xsl:value-of select="php:function('lang', 
'select')"/>
-                                                                               
                                </xsl:attribute>
-                                                                               
                                <option value="0">
-                                                                               
                                <xsl:value-of select="php:function('lang', 
'select')"/>
-                                                                               
                                </option>
-                                                                               
                                <xsl:apply-templates 
select="cases_time_span/options"/>
-                                                                               
                        </select>
-
                                                        <xsl:for-each 
select="datatable_def">
                                                                <xsl:if 
test="container = 'datatable-container_5'">
                                                                        
<xsl:call-template name="table_setup">
@@ -673,27 +663,55 @@
                                                                </xsl:if>
                                                        </xsl:for-each>
                                                </div>
-                                                       <xsl:call-template 
name="controller_integration">
-                                                               <xsl:with-param 
name="controller" select ='controller'/>
-                                                       </xsl:call-template>
+
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'cases')" />
+                                                       </label>
+                                                       <select id = 
"cases_time_span" name="cases_time_span">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="0">
+                                                                       
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="cases_time_span/options"/>
+                                                       </select>
+
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_6'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
<xsl:with-param name="data" select ='data' />
+                                                                               
<xsl:with-param name="config" select ='config' />
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
                                                </div>
-                                       </xsl:if>
+                                               <xsl:call-template 
name="controller_integration">
+                                                       <xsl:with-param 
name="controller" select ='controller'/>
+                                               </xsl:call-template>
+                                       </div>
+                               </xsl:if>
                                        
                                <xsl:choose>
                                        <xsl:when test="attributes_group!=''">
-                                       <xsl:call-template 
name="attributes_values"/>
+                                               <xsl:call-template 
name="attributes_values"/>
                                        </xsl:when>
                                </xsl:choose>
                                        
-                                       <xsl:choose>
-                                               <xsl:when test="files!='' or 
fileupload = 1">
-                                                       <div id="files">
-                                                               <script 
type="text/javascript">
-                                                                       var 
fileuploader_action = <xsl:value-of select="fileuploader_action"/>;
-                                                               </script>
+                               <xsl:choose>
+                                       <xsl:when test="files!='' or fileupload 
= 1">
+                                               <div id="files">
+                                                       <script 
type="text/javascript">
+                                                               var 
fileuploader_action = <xsl:value-of select="fileuploader_action"/>;
+                                                       </script>
                                                        <fieldset>
                                                                <div 
class="pure-control-group">
-                                                                               
        <xsl:value-of select="//lang_files"/>
+                                                                       
<xsl:value-of select="//lang_files"/>
                                                                        
<xsl:for-each select="datatable_def">
                                                                                
<xsl:if test="container = 'datatable-container_0'">
                                                                                
        <xsl:call-template name="table_setup">
@@ -707,35 +725,35 @@
                                                                                
</xsl:if>
                                                                        
</xsl:for-each>
                                                                </div>
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="cat_list='' and fileupload = 1 and mode = 'edit'">
-                                                                               
        <xsl:call-template name="file_upload"/>
-                                                                               
</xsl:when>
-                                                                       
</xsl:choose>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="cat_list='' and fileupload = 1 and mode = 'edit'">
+                                                                               
<xsl:call-template name="file_upload"/>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>
                                                        </fieldset>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
-                                       <xsl:for-each select="integration">
-                                               <div id="{section}">
-                                                       <iframe 
id="{section}_content" width="100%" height="{height}">
-                                                               <p>Your browser 
does not support iframes.</p>
-                                                       </iframe>
                                                </div>
-                                       </xsl:for-each>
+                                       </xsl:when>
+                               </xsl:choose>
+                               <xsl:for-each select="integration">
+                                       <div id="{section}">
+                                               <iframe id="{section}_content" 
width="100%" height="{height}">
+                                                       <p>Your browser does 
not support iframes.</p>
+                                               </iframe>
+                                       </div>
+                               </xsl:for-each>
 
-                                       <xsl:choose>
-                                               <xsl:when test="documents != 
''">
-                                                       <div id="document">
-                                                               <!-- Some style 
for the expand/contract section-->
-                                                               <style>
-                                                                       
#expandcontractdiv {border:1px dotted #dedede; margin:0 0 .5em 0; 
padding:0.4em;}
-                                                                       
#treeDiv1 { background: #fff; padding:1em; margin-top:1em; }
-                                                               </style>
-                                                               <script 
type="text/javascript">
+                               <xsl:choose>
+                                       <xsl:when test="documents != ''">
+                                               <div id="document">
+                                                       <!-- Some style for the 
expand/contract section-->
+                                                       <style>
+                                                               
#expandcontractdiv {border:1px dotted #dedede; margin:0 0 .5em 0; 
padding:0.4em;}
+                                                               #treeDiv1 { 
background: #fff; padding:1em; margin-top:1em; }
+                                                       </style>
+                                                       <script 
type="text/javascript">
                                                                documents = 
<xsl:value-of select="documents"/>;
                                                                requestUrlDoc = 
<xsl:value-of select="requestUrlDoc"/>;
-                                                               </script>
+                                                       </script>
                                                        <fieldset>
                                                                <!-- markup for 
expand/contract links -->
                                                                <div 
id="treecontrol">
@@ -749,13 +767,13 @@
                                                                </div>
                                                                <div 
id="treeDiv1"></div>
                                                        </fieldset>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
+                                               </div>
+                                       </xsl:when>
+                               </xsl:choose>
 
-                                       <xsl:choose>
+                               <xsl:choose>
                                        <xsl:when test="value_id !='' and 
enable_bulk = 0">
-                                                       <div id="related">
+                                               <div id="related">
                                                        <div 
class="pure-control-group">
                                                                <xsl:for-each 
select="datatable_def">
                                                                        <xsl:if 
test="container = 'datatable-container_1'">
@@ -784,13 +802,13 @@
                                                                        
</xsl:if>
                                                                </xsl:for-each>
                                                        </div>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
+                                               </div>
+                                       </xsl:when>
+                               </xsl:choose>
 
-                                       <xsl:choose>
-                                               <xsl:when test="enable_bulk = 
1">
-                                                       <div id="inventory">
+                               <xsl:choose>
+                                       <xsl:when test="enable_bulk = 1">
+                                               <div id="inventory">
                                                        <fieldset>
                                                                <div 
class="pure-control-group">
                                                                        
<xsl:for-each select="datatable_def">
@@ -806,211 +824,211 @@
                                                                                
</xsl:if>
                                                                        
</xsl:for-each>
                                                                </div>
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="value_id!='' and mode = 'edit'">
-                                                                               
        <xsl:variable name="lang_add_inventory">
-                                                                               
                <xsl:value-of select="php:function('lang', 'add inventory')"/>
-                                                                               
        </xsl:variable>
-                                                                               
        <a 
href="javascript:showlightbox_add_inventory({value_location_id},{value_id})" 
title="{$lang_add_inventory}">
-                                                                               
                <xsl:value-of select="$lang_add_inventory"/>
-                                                                               
        </a>
-                                                                               
</xsl:when>
-                                                                       
</xsl:choose>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="value_id!='' and mode = 'edit'">
+                                                                               
<xsl:variable name="lang_add_inventory">
+                                                                               
        <xsl:value-of select="php:function('lang', 'add inventory')"/>
+                                                                               
</xsl:variable>
+                                                                               
<a href="javascript:showlightbox_add_inventory({value_location_id},{value_id})" 
title="{$lang_add_inventory}">
+                                                                               
        <xsl:value-of select="$lang_add_inventory"/>
+                                                                               
</a>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>
                                                        </fieldset>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
+                                               </div>
+                                       </xsl:when>
+                               </xsl:choose>
 
-                               </div>
-                               <xsl:choose>
-                                       <xsl:when test="mode = 'edit'">
-                                                                       
<xsl:call-template name="table_apply">
-                                                                               
<xsl:with-param name="lean" select="lean"/>
+                       </div>
+                       <xsl:choose>
+                               <xsl:when test="mode = 'edit'">
+                                       <xsl:call-template name="table_apply">
+                                               <xsl:with-param name="lean" 
select="lean"/>
                                                <xsl:with-param name="cat_list" 
select="cat_list"/>                             
-                                                                       
</xsl:call-template>
-                                       </xsl:when>
-                               </xsl:choose>
-                       </form>
+                                       </xsl:call-template>
+                               </xsl:when>
+                       </xsl:choose>
+               </form>
                <xsl:variable name="cancel_url">
                        <xsl:value-of select="cancel_url"/>
                </xsl:variable>
                <form name="cancel_form" id="cancel_form" 
action="{$cancel_url}" method="post"></form>
-                       <xsl:choose>
-                               <xsl:when test="value_id!='' and lean !=1">
+               <xsl:choose>
+                       <xsl:when test="value_id!='' and lean !=1">
                                <div class="pure-g">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="start_ticket!=''">
-                                                                               
<xsl:variable name="ticket_link">
-                                                                               
        <xsl:value-of select="ticket_link"/>
-                                                                               
</xsl:variable>
-                                                                               
<form method="post" action="{$ticket_link}">
-                                                                               
        <xsl:variable name="lang_start_ticket">
-                                                                               
                <xsl:value-of select="lang_start_ticket"/>
-                                                                               
        </xsl:variable>
+                                       <xsl:choose>
+                                               <xsl:when 
test="start_ticket!=''">
+                                                       <xsl:variable 
name="ticket_link">
+                                                               <xsl:value-of 
select="ticket_link"/>
+                                                       </xsl:variable>
+                                                       <form method="post" 
action="{$ticket_link}">
+                                                               <xsl:variable 
name="lang_start_ticket">
+                                                                       
<xsl:value-of select="lang_start_ticket"/>
+                                                               </xsl:variable>
                                                                <input 
type="submit" name="location" class="pure-button pure-button-primary" 
value="{$lang_start_ticket}">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="lang_start_ticket_statustext"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</form>
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="start_project!=''">
-                                                                               
<xsl:variable name="project_link">
-                                                                               
        <xsl:value-of select="project_link"/>
-                                                                               
</xsl:variable>
-                                                                               
<form method="post" action="{$project_link}">
-                                                                               
        <xsl:variable name="lang_start_project">
-                                                                               
                <xsl:value-of select="php:function('lang', 'generate new 
project')"/>
-                                                                               
        </xsl:variable>
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="lang_start_ticket_statustext"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
+                                               </xsl:when>
+                                       </xsl:choose>
+                                       <xsl:choose>
+                                               <xsl:when 
test="start_project!=''">
+                                                       <xsl:variable 
name="project_link">
+                                                               <xsl:value-of 
select="project_link"/>
+                                                       </xsl:variable>
+                                                       <form method="post" 
action="{$project_link}">
+                                                               <xsl:variable 
name="lang_start_project">
+                                                                       
<xsl:value-of select="php:function('lang', 'generate new project')"/>
+                                                               </xsl:variable>
                                                                <input 
type="submit" name="location" class="pure-button pure-button-primary" 
value="{$lang_start_project}">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'click this 
to generate a project with this information')"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</form>
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'click this to generate a project 
with this information')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
 
-                                                                               
<xsl:variable name="add_to_project_link">
-                                                                               
        <xsl:value-of select="add_to_project_link"/>
-                                                                               
</xsl:variable>
-                                                                               
<form method="post" action="{$add_to_project_link}">
-                                                                               
        <xsl:variable name="lang_add_to_project">
-                                                                               
                <xsl:value-of select="php:function('lang', 'add to project')"/>
-                                                                               
        </xsl:variable>
+                                                       <xsl:variable 
name="add_to_project_link">
+                                                               <xsl:value-of 
select="add_to_project_link"/>
+                                                       </xsl:variable>
+                                                       <form method="post" 
action="{$add_to_project_link}">
+                                                               <xsl:variable 
name="lang_add_to_project">
+                                                                       
<xsl:value-of select="php:function('lang', 'add to project')"/>
+                                                               </xsl:variable>
                                                                <input 
type="submit" name="location" class="pure-button pure-button-primary" 
value="{$lang_add_to_project}" onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'click this 
to add an order to an existing project')"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</form>
-                                                               </xsl:when>
-                                                       </xsl:choose>
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'click this to add an order to an 
existing project')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
+                                               </xsl:when>
+                                       </xsl:choose>
                                </div>
-                               </xsl:when>
-                       </xsl:choose>
+                       </xsl:when>
+               </xsl:choose>
+       </div>
+       <div id="lightbox-placeholder" 
style="background-color:#000000;color:#FFFFFF;display:none">
+               <div class="hd" style="background-color:#000000;color:#000000; 
border:0; text-align:center">
+                       <xsl:value-of select="php:function('lang', 
'fileuploader')"/>
                </div>
-               <div id="lightbox-placeholder" 
style="background-color:#000000;color:#FFFFFF;display:none">
-                       <div class="hd" 
style="background-color:#000000;color:#000000; border:0; text-align:center">
-                               <xsl:value-of select="php:function('lang', 
'fileuploader')"/>
-                       </div>
-                       <div class="bd" style="text-align:center;"> </div>
-               </div>
+               <div class="bd" style="text-align:center;"> </div>
+       </div>
 </xsl:template>
 
 <!-- New template-->
 <xsl:template xmlns:php="http://php.net/xsl"; name="table_apply">
-               <xsl:param name="lean" />
+       <xsl:param name="lean" />
        <xsl:param name="cat_list" />
-               <div class="proplist-col">
+       <div class="proplist-col">
                <table>
                        <tr>
-                                       <xsl:if test="$cat_list =''">
-                                               <xsl:if test="$lean!=1">
+                               <xsl:if test="$cat_list =''">
+                                       <xsl:if test="$lean!=1">
                                                <td valign="bottom">
                                                        <xsl:variable 
name="lang_save">
                                                                <xsl:value-of 
select="php:function('lang', 'save')"/>
                                                        </xsl:variable>
-                                                               <input 
type="submit" class="pure-button pure-button-primary" name="values[save]" 
value="{$lang_save}">
+                                                       <input type="submit" 
class="pure-button pure-button-primary" name="values[save]" 
value="{$lang_save}">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="php:function('lang', 'save values and exit')"/>
                                                                </xsl:attribute>
                                                        </input>
                                                </td>
-                                               </xsl:if>
                                        </xsl:if>
+                               </xsl:if>
                                <td valign="bottom">
                                        <xsl:variable name="lang_apply">
                                                <xsl:value-of 
select="php:function('lang', 'apply')"/>
                                        </xsl:variable>
-                                               <input type="submit" 
class="pure-button pure-button-primary" name="values[apply]" 
value="{$lang_apply}">
+                                       <input type="submit" class="pure-button 
pure-button-primary" name="values[apply]" value="{$lang_apply}">
                                                <xsl:attribute name="title">
                                                        <xsl:value-of 
select="php:function('lang', 'save and stay in form')"/>
                                                </xsl:attribute>
                                        </input>
                                </td>
-                                       <xsl:if test="$lean!=1">
-                                               <td align="right" 
valign="bottom">
-                                                       <xsl:variable 
name="lang_cancel">
-                                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
-                                                       </xsl:variable>
-                                                               <input 
type="button" class="pure-button pure-button-primary" name="values[cancel]" 
value="{$lang_cancel}" onMouseout="window.status='';return true;" 
onClick="document.cancel_form.submit();">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'Back to the list')"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </xsl:if>
+                               <xsl:if test="$lean!=1">
+                                       <td align="right" valign="bottom">
+                                               <xsl:variable 
name="lang_cancel">
+                                                       <xsl:value-of 
select="php:function('lang', 'cancel')"/>
+                                               </xsl:variable>
+                                               <input type="button" 
class="pure-button pure-button-primary" name="values[cancel]" 
value="{$lang_cancel}" onMouseout="window.status='';return true;" 
onClick="document.cancel_form.submit();">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'Back to the list')"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                               </xsl:if>
                        </tr>
                </table>
-               </div>
+       </div>
 
 </xsl:template>
 
 <!-- emtpy -->
 <xsl:template match="empty">
-               <xsl:apply-templates select="menu"/>
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <tr>
-                               <td>
-                                       <xsl:call-template name="cat_filter"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td colspan="4" 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_entity"/>
-               </table>
+       <xsl:apply-templates select="menu"/>
+       <table width="100%" cellpadding="2" cellspacing="2" align="center">
+               <tr>
+                       <td>
+                               <xsl:call-template name="cat_filter"/>
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan="4" 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_entity"/>
+       </table>
 </xsl:template>
 
 <!-- New template-->
 <xsl:template match="attributes_header">
-               <tr class="th">
-                       <td class="th_text" width="15%" align="left">
-                               <xsl:value-of select="lang_name"/>
-                       </td>
-                       <td class="th_text" width="55%" align="right">
-                               <xsl:value-of select="lang_value"/>
-                       </td>
-               </tr>
+       <tr class="th">
+               <td class="th_text" width="15%" align="left">
+                       <xsl:value-of select="lang_name"/>
+               </td>
+               <td class="th_text" width="55%" align="right">
+                       <xsl:value-of select="lang_value"/>
+               </td>
+       </tr>
 </xsl:template>
 
 <!-- New template-->
 <xsl:template name="target">
-               <xsl:choose>
-                       <xsl:when test="value_target!=''">
-                               <xsl:for-each select="value_target">
-                                       <tr>
-                                               <td class="th_text" 
valign="top">
-                                                       <xsl:value-of 
select="//lang_target"/>
-                                               </td>
-                                               <td>
-                                                       <table>
-                                                               <xsl:for-each 
select="data">
-                                                                       <tr>
-                                                                               
<td class="th_text" align="left">
-                                                                               
        <a href="{link}" title="{//lang_target_statustext}">
-                                                                               
                <xsl:value-of select="type"/>
-                                                                               
                <xsl:text> #</xsl:text>
-                                                                               
                <xsl:value-of select="id"/>
-                                                                               
        </a>
-                                                                               
        <xsl:text> </xsl:text>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </xsl:for-each>
-                                                       </table>
-                                               </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </xsl:when>
-               </xsl:choose>
+       <xsl:choose>
+               <xsl:when test="value_target!=''">
+                       <xsl:for-each select="value_target">
+                               <tr>
+                                       <td class="th_text" valign="top">
+                                               <xsl:value-of 
select="//lang_target"/>
+                                       </td>
+                                       <td>
+                                               <table>
+                                                       <xsl:for-each 
select="data">
+                                                               <tr>
+                                                                       <td 
class="th_text" align="left">
+                                                                               
<a href="{link}" title="{//lang_target_statustext}">
+                                                                               
        <xsl:value-of select="type"/>
+                                                                               
        <xsl:text> #</xsl:text>
+                                                                               
        <xsl:value-of select="id"/>
+                                                                               
</a>
+                                                                               
<xsl:text> </xsl:text>
+                                                                       </td>
+                                                               </tr>
+                                                       </xsl:for-each>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </xsl:for-each>
+               </xsl:when>
+       </xsl:choose>
 </xsl:template>
 
 <xsl:template name="controller_integration">
-               <xsl:param name="controller" />
+       <xsl:param name="controller" />
                
 </xsl:template>




reply via email to

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