[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9699]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [9699] |
Date: |
Thu, 28 Jun 2012 11:13:06 +0000 |
Revision: 9699
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9699
Author: vator
Date: 2012-06-28 11:13:06 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.uicontrol_location.inc.php
trunk/controller/js/controller/ajax.js
trunk/controller/templates/base/control_item/control_item.xsl
Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php 2012-06-28
10:58:27 UTC (rev 9698)
+++ trunk/controller/inc/class.uicontrol_location.inc.php 2012-06-28
11:13:06 UTC (rev 9699)
@@ -111,93 +111,7 @@
self::set_active_menu('controller::control::location_for_check_list');
}
- /*
- function index_old()
- {
- if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->query();
- }
-
- // Sigurd: START as categories
- $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
- $cats->supress_info = true;
-
- $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl'
=> $this->_category_acl));
-
- $control_areas_array = array();
- foreach($control_areas['cat_list'] as $cat_list)
- {
- $control_areas_array[] = array
- (
- 'id' => $cat_list['cat_id'],
- 'name' => $cat_list['name'],
- );
- }
- // END as categories
-
- $tabs = array
- (
- array
- (
- 'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.register_control_to_location'))
- )
- );
-
- $data = array(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
- 'view' =>
"view_locations_for_control",
- 'control_areas_array' => $control_areas_array,
- 'locations_table' => array(
- 'source' =>
self::link(array('menuaction' =>
'controller.uicontrol_location.get_locations_for_control', 'control_id' =>
$control_id ,'phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' => 'id',
- 'label' =>
lang('ControlId'),
- 'sortable' => true,
- ),
- array(
- 'key' => 'title',
- 'label' =>
lang('Control title'),
- 'sortable' =>
false
- ),
- array(
- 'key' =>
'location_code',
- 'label' =>
lang('location_code'),
- 'sortable' => false
- ),
- array(
- 'key' => 'loc1_name',
- 'label' =>
lang('Property name'),
- 'sortable' => false
- ),
- array(
- 'key' => 'actions',
- 'hidden' => true
- ),
- array(
- 'key' => 'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- 'hidden' => true
- ),array(
- 'key' => 'parameters',
- 'hidden' => true
- )
- )
- )
- );
-
- phpgwapi_yui::load_widget('paginator');
-
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
self::render_template_xsl(array('control_location/control_location_tabs',
'control_location/view_locations_for_control', 'common' ), $data);
- }
- */
+
function index()
{
$control_id = phpgw::get_var('control_id');
@@ -266,25 +180,16 @@
'name' => $cat_list['name'],
);
}
-
- $tabs = array
- (
- array
- (
- 'label' =>
lang('Add_locations_for_control')
- )
- );
$data = array(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
- 'view'
=> "register_control_to_location",
- 'control_id'
=> $control_id,
- 'control_areas_array' =>
$control_areas_array,
+ 'view'
=> "register_control_to_location",
+ 'control_id'
=> $control_id,
+ 'control_areas_array' =>
$control_areas_array,
'filter_form'
=> array(
- 'building_types'
=> $building_types,
- 'category_types'
=> $category_types,
- 'district_list'
=> $district_list,
- 'part_of_town_list'
=> $part_of_town_list
+ 'building_types'
=> $building_types,
+ 'category_types'
=> $category_types,
+ 'district_list'
=> $district_list,
+ 'part_of_town_list' =>
$part_of_town_list
),
'datatable' => array(
'source' =>
self::link(array('menuaction' => 'controller.uicontrol_location.index',
'phpgw_return_as' => 'json', 'view_type' =>
'register_control','control_id_init' => $control_id)),
@@ -461,12 +366,6 @@
$value['actions'] = array();
$value['labels'] = array();
$value['parameters'] = array();
-/*
- $value['ajax'][] = true;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'controller.uicontrol_location.register_control_to_location_2','location_code'
=> $value['location_code'], 'phpgw_return_as' => 'json')));
- $value['labels'][] = lang('add_location');
- $value['parameters'][] = "control_id";
- */
}
/*
@@ -590,27 +489,10 @@
array_unshift ($control_area_list ,array
('id'=>'','name'=>lang('select')));
- $tabs = array
- (
-/* array
- (
- 'label' =>
lang('View_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.index'))
- ),
- array
- (
- 'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.register_control_to_location'))
- ),*/
- array
- (
- 'label' => lang('add components for
control')
- )
- );
+
$data = array
(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 2),
'td_count'
=> '""',
// 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
'datatable'
=> $datavalues,
Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js 2012-06-28 10:58:27 UTC (rev
9698)
+++ trunk/controller/js/controller/ajax.js 2012-06-28 11:13:06 UTC (rev
9699)
@@ -413,15 +413,22 @@
var listValue =
$(this).parent().find("input[name=option_value]").val();
var order_nr = 1;
- if($("ul#control_item_options").children().length == 0){
+ if(listValue.length > 0){
+
+ $("#add_control_item_option_panel
.input_error_msg").remove();
+
+ if($("ul#control_item_options").children().length == 0){
order_nr = 1;
+ }else{
+ order_nr =
$("ul#control_item_options").find("li").last().find(".order_nr").text();
+ order_nr++;
+ }
+
+
$("ul#control_item_options").append("<li><label>Listeverdi<span
class='order_nr'>" + order_nr + "</span></label><input type='text'
name='option_values[]' value='" + listValue + "' /><span class='btn
delete'>Slett</span></li>")
+ $(this).parent().find("input[name=option_value]").val('');
}else{
- order_nr =
$("ul#control_item_options").find("li").last().find(".order_nr").text();
- order_nr++;
+ $(this).closest(".row").before("<div
class='input_error_msg'>Listeverdien kan ikke være tom</div>");
}
-
- $("ul#control_item_options").append("<li><label>Listeverdi<span
class='order_nr'>" + order_nr + "</span></label><input type='text'
name='option_values[]' value='" + listValue + "' /><span class='btn
delete'>Slett</span></li>")
- $(this).parent().find("input[name=option_value]").val('');
});
/* ========================= CONTROL
=============================================== */
Modified: trunk/controller/templates/base/control_item/control_item.xsl
===================================================================
--- trunk/controller/templates/base/control_item/control_item.xsl
2012-06-28 10:58:27 UTC (rev 9698)
+++ trunk/controller/templates/base/control_item/control_item.xsl
2012-06-28 11:13:06 UTC (rev 9699)
@@ -1,4 +1,4 @@
-<!-- $Id$ -->
+ <!-- $Id$ -->
<!-- item -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
@@ -18,8 +18,7 @@
<div id="control_item_details">
<form
action="index.php?menuaction=controller.uicontrol_item.save" method="post">
- <input type="hidden" name="id"
value="{control_item/id}">
- </input>
+ <input type="hidden" name="id"
value="{control_item/id}" />
<dl class="proplist">
<dt>
<label for="title">Tittel</label>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9699],
Torstein <=