fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10302] Merge 10227:10301 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [10302] Merge 10227:10301 from trunk
Date: Tue, 23 Oct 2012 09:00:30 +0000

Revision: 10302
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10302
Author:   sigurdne
Date:     2012-10-23 09:00:30 +0000 (Tue, 23 Oct 2012)
Log Message:
-----------
Merge 10227:10301 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/controller/inc/class.menu.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_component.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_component.js
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
    branches/Version-1_0-branch/logistic/inc/class.menu.inc.php
    branches/Version-1_0-branch/logistic/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/logistic/inc/class.sorequirement.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.soresource_type_requirement.inc.php
    branches/Version-1_0-branch/logistic/inc/class.uiactivity.inc.php
    branches/Version-1_0-branch/logistic/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/logistic/inc/class.uirequirement.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.uiresource_type_requirement.inc.php
    branches/Version-1_0-branch/logistic/inc/model/class.activity.inc.php
    branches/Version-1_0-branch/logistic/inc/model/class.project.inc.php
    branches/Version-1_0-branch/logistic/inc/model/class.requirement.inc.php
    
branches/Version-1_0-branch/logistic/inc/model/class.requirement_resource_allocation.inc.php
    branches/Version-1_0-branch/logistic/js/logistic/project.js
    branches/Version-1_0-branch/logistic/js/logistic/requirement.js
    branches/Version-1_0-branch/logistic/setup/phpgw_no.lang
    branches/Version-1_0-branch/logistic/setup/tables_current.inc.php
    
branches/Version-1_0-branch/logistic/templates/base/allocation/allocation_item.xsl
    branches/Version-1_0-branch/logistic/templates/base/css/base.css
    
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_item.xsl
    
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_tabs.xsl
    branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/phpgwapi/js/yahoo/common.js
    branches/Version-1_0-branch/phpgwapi/templates/portico/js/base.js
    branches/Version-1_0-branch/property/inc/class.bolocation.inc.php
    branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.solocation.inc.php
    branches/Version-1_0-branch/property/inc/class.uiadmin_entity.inc.php
    branches/Version-1_0-branch/property/inc/class.uientity.inc.php
    branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
    branches/Version-1_0-branch/property/templates/base/attributes_form.xsl
    branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php

Added Paths:
-----------
    
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_location.inc.php
    
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
    branches/Version-1_0-branch/controller/js/yahoo/register_control.js
    branches/Version-1_0-branch/logistic/inc/class.sorequirement_value.inc.php
    
branches/Version-1_0-branch/logistic/templates/base/activity/activity_item.xsl
    branches/Version-1_0-branch/logistic/templates/base/project/project_item.xsl
    
branches/Version-1_0-branch/logistic/templates/base/project/project_type_item.xsl
    
branches/Version-1_0-branch/logistic/templates/base/project/resource_type_requirement_item.xsl
    
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_values.xsl

Removed Paths:
-------------
    branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
    branches/Version-1_0-branch/controller/js/controller/jquery-ui.custom.min.js
    branches/Version-1_0-branch/controller/js/controller/jquery.js
    branches/Version-1_0-branch/controller/js/controller/yui_min_3_4_3.js
    branches/Version-1_0-branch/controller/js/yahoo/common.js
    branches/Version-1_0-branch/controller/js/yahoo/datatable.js
    
branches/Version-1_0-branch/controller/js/yahoo/register_control_to_component2.js
    branches/Version-1_0-branch/controller/templates/base/common.xsl
    branches/Version-1_0-branch/controller/templates/base/datatable.xsl
    branches/Version-1_0-branch/logistic/templates/base/activity_item.xsl
    branches/Version-1_0-branch/logistic/templates/base/project_item.xsl
    branches/Version-1_0-branch/logistic/templates/base/project_type_item.xsl
    
branches/Version-1_0-branch/logistic/templates/base/resource_type_requirement_item.xsl

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


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10301

Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2012-10-23 09:00:30 UTC (rev 10302)
@@ -61,7 +61,7 @@
                                                                                
        'location_for_check_list' => array
                                                                                
        (
                                                                                
                'text'  => lang('location_connections'),
-                                                                               
                'url'   => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'controller.uicontrol_location.index') ),
+                                                                               
                'url'   => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'controller.uicontrol_register_to_location.index') ),
                                                                                
                'image' => array('property', 'location_1')
                                                                                
        ),
                                                                                
        'component_for_check_list' => array

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-10-23 09:00:30 UTC (rev 10302)
@@ -551,58 +551,7 @@
                        }
                }
                
-               public function register_control_to_location($control_id, $data)
-               {
 
-                       $control_id = (int) $control_id;
-                       $delete_location = array();
-                       $add_location = array();
-                       foreach($data['control_location_orig'] as 
$location_code)
-                       {
-                               if(!in_array($location_code, 
$data['control_location']))
-                               {
-                                       $delete_location[] = $location_code;
-                               }
-                       }
-
-                       foreach($data['control_location'] as $location_code)
-                       {
-                               if(!in_array($location_code, 
$data['control_location_orig']))
-                               {
-                                       $add_location[] = $location_code;
-                               }
-                       }
-
-                       $this->db->transaction_begin();
-                       foreach ($delete_location as $location_code)
-                       {
-                               $sql  = "DELETE FROM 
controller_control_location_list ";
-                               $sql .= "WHERE control_id = {$control_id} ";
-                               $sql .= "AND location_code = 
'{$location_code}'";
-                               
-                               $this->db->query($sql);
-                       }
-
-                       foreach ($add_location as $location_code)
-                       {
-                               $sql  = "SELECT * ";
-                               $sql .= "FROM controller_control_location_list 
";
-                               $sql .= "WHERE control_id = {$control_id} ";
-                               $sql .= "AND location_code = '$location_code'";
-                               
-                               $this->db->query($sql, __LINE__, __FILE__);
-                       
-                               if(!$this->db->next_record())
-                               {
-                                       $sql  = "INSERT INTO 
controller_control_location_list (control_id, location_code) ";
-                                       $sql .= "VALUES ( {$control_id}, 
'{$location_code}')";
-                                       $this->db->query($sql);
-                               }
-                       }
-
-                       return $this->db->transaction_commit();
-               }
-
                public function check_control_component($control_id, 
$location_id, $component_id)
                {
                        $control_id             = (int) $control_id;
@@ -620,6 +569,77 @@
                }
 
                /**
+                * Register that a control should be carried out on a location
+                *
+                * @param $data['control_id'] control id
+                * @param $data['component_id'] component id
+                * @param $data['location_id'] component id
+                * @return true or false if the execution was successful  
+               */
+               function register_control_to_location($data)
+               {
+
+                       $delete_component = array();
+                       $add_component = array();
+                       $this->db->transaction_begin();
+
+                       if(isset($data['register_location']) && 
is_array($data['register_location']))
+                       {
+                               foreach($data['register_location'] as 
$location_info)
+                               {
+                                       $location_arr = explode('_', 
$location_info);
+                                       if(count($location_arr)!=2)
+                                       {
+                                               continue;
+                                       }
+                                       
+                                       $control_id             = (int) 
$location_arr[0];
+                                       $location_code  = $location_arr[1];
+
+                                       if(!$control_id)
+                                       {
+                                               return false;
+                                       }
+
+                                       $sql  = "SELECT * ";
+                                       $sql .= "FROM 
controller_control_location_list ";
+                                       $sql .= "WHERE control_id = 
{$control_id} ";
+                                       $sql .= "AND location_code = 
'{$location_code}' ";
+                                       
+                                       $this->db->query($sql, __LINE__, 
__FILE__);
+                       
+                                       if(!$this->db->next_record())
+                                       {
+                                               $sql =  "INSERT INTO 
controller_control_location_list (control_id, location_code) ";
+                                               $sql .= "VALUES ( 
{$control_id}, '{$location_code}')";
+                                               
+                                               $this->db->query($sql);
+                                       }
+                               }
+                       }
+
+                       if(isset($data['delete']) && is_array($data['delete']))
+                       {
+                               foreach($data['delete'] as $location_info)
+                               {
+                                       $location_arr = explode('_', 
$location_info);
+                                       if(count($location_arr)!=2)
+                                       {
+                                               continue;
+                                       }
+                                       
+                                       $control_id             = (int) 
$location_arr[0];
+                                       $location_code  = $location_arr[1];
+                               
+                                       $sql =  "DELETE FROM 
controller_control_location_list WHERE control_id = {$control_id} AND 
location_code = '{$location_code}'";
+                                       $this->db->query($sql);
+                               }
+                       }
+
+                       return $this->db->transaction_commit();
+               }
+
+               /**
                 * Register that a control should be carried out on a component
                 *
                 * @param $data['control_id'] control id
@@ -716,7 +736,7 @@
                        {
                                $ret = array
                                (
-                                       'table'                 => 'control', 
// alias
+                                       'table'                 => 
'controller_control', // alias
                                        'field'                 => 'id',
                                        'translated'    => 'id'
                                );
@@ -750,7 +770,7 @@
                                        $clauses[] = '(' . join(' OR ', 
$like_clauses) . ')';
                                }
                        }
-                       //var_dump($filters);
+
                        if(isset($filters[$this->get_id_field_name()]))
                        {
                                $filter_clauses[] = "controller_control.id = 
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
@@ -769,7 +789,6 @@
                                $clauses[] = join(' AND ', $filter_clauses);
                        }
 
-
                        $condition =  join(' AND ', $clauses);
 
                        $tables = "controller_control";
@@ -795,9 +814,8 @@
                                $sort_field = 'controller_control.id';
                        }
                        $order = $sort_field ? "ORDER BY 
{$this->marshal($sort_field, 'field')} $dir ": '';
-
+                       
                        return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
-
                }
 
                function populate(int $control_id, &$control)
@@ -911,38 +929,6 @@
                        return $ret_array;
                }
                
-/*
-               public function getAllBimItems($noOfObjects = null, $bim_type = 
null) {
-                       $filters = array();
-                       if($noOfObjects != null && is_numeric($noOfObjects))
-                       {
-                               $limit = "LIMIT {$noOfObjects}";
-                       }
-                       else
-                       {
-                               $limit = "LIMIT 10";
-                       }
-                       if($bim_type != null && is_numeric($bim_type))
-                       {
-                               $filter = " AND fm_bim_type.id = {$bim_type}";
-                       }
-                       $sql  = "SELECT fm_bim_item.id, fm_bim_type.name AS 
type, fm_bim_item.guid FROM public.fm_bim_item,  public.fm_bim_type WHERE 
fm_bim_item.type = fm_bim_type.id {$filter} {$limit}";
-                       $bimItemArray = array();
-                       $this->db->query($sql, __LINE__, __FILE__);
-                       $i=1;
-                       while($this->db->next_record())
-                       {
-                               $bimItemArray[$i]['id'] = $this->db->f('id');
-                               $bimItemArray[$i]['guid'] = 
$this->db->f('guid');
-                               $bimItemArray[$i]['type'] = 
$this->db->f('type');
-                               //$bimItemArray[$i]['xml_representation'] = 
$this->db->f('xml_representation',true);
-                               //$bimItemArray[] = $bimItem;
-                               $i++;
-                       }
-
-                       return $bimItemArray;
-               }
-*/
                public function get_control_component($noOfObjects = null, 
$bim_type = null)
                {
                        $filters = array();

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-10-23 09:00:30 UTC (rev 10302)
@@ -112,7 +112,6 @@
                                'control_area_id = ' . 
$this->marshal($control_item->get_control_area_id(), 'int')
                        );
 
-                       //var_dump('UPDATE controller_control_item SET ' . 
join(',', $values) . " WHERE id=$id");
                        $result = $this->db->query('UPDATE 
controller_control_item SET ' . join(',', $values) . " WHERE id=$id", 
__LINE__,__FILE__);
 
                        if($result)
@@ -276,7 +275,7 @@
                        {
                                $ret = array
                                (
-                                       'table'                 => 
'controller', // alias
+                                       'table'                 => 
'controller_control_item', // alias
                                        'field'                 => 'id',
                                        'translated'    => 'id'
                                );

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-10-23 09:00:30 UTC (rev 10302)
@@ -612,7 +612,6 @@
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
 //                     self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
-                       self::add_javascript('controller', 'controller', 
'yui_min_3_4_3.js');
                        self::add_javascript('controller', 'controller', 
'custom_drag_drop.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        self::render_template_xsl(array('control/control_tabs', 
'control_item/sort_check_list'), $data);

Deleted: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
2012-10-23 09:00:30 UTC (rev 10302)
@@ -1,508 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - controller: a part of a Facilities Management System.
-       *
-       * @author Erink Holm-Larsen <address@hidden>
-       * @author Torstein Vadla <address@hidden>
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
-       * @package property
-       * @subpackage controller
-       * @version $Id: class.uicheck_list.inc.php 8628 2012-01-21 10:42:05Z 
vator $
-       */
-       
-       phpgw::import_class('phpgwapi.yui');
-
-       /**
-       * Import the jQuery class
-       */
-       phpgw::import_class('phpgwapi.jquery');
-
-       phpgw::import_class('phpgwapi.uicommon');
-       
-       include_class('controller', 'check_list', 'inc/model/');
-       include_class('controller', 'date_generator', 'inc/component/');
-       include_class('controller', 'check_list_status_updater', 'inc/helper/');
-               
-       class controller_uicontrol_location extends phpgwapi_uicommon
-       {
-               var $cat_id;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $filter;
-               var $currentapp;
-               var $type_id;
-               var $location_code;
-               
-               private $so_control;
-               private $so_check_list;
-               private $so_control_item;
-               private $so_check_item;
-               private $so_procedure;
-       
-               var $public_functions = array
-               (
-                       'index'                                                 
        => true,
-                       'view_locations_for_control'            => true,
-                       'register_control_to_location'          => true,
-                       'register_control_to_location_2'        => true,
-                       'get_locations_for_control'             => true,
-                       'get_location_category'                         => true,
-                       'get_district_part_of_town'                     => true,
-                       'get_category_by_entity'                        => true,
-                       'get_entity_table_def'                          => true,
-                       'get_locations'                                         
=> true,
-                       'get_location_type_category'            => true
-               );
-
-               function __construct()
-               {
-                       parent::__construct();
-                       
-                       $this->bo                                       = 
CreateObject('property.bolocation',true);
-                       $this->bocommon                         = & 
$this->bo->bocommon;
-                       $this->so_control                       = 
CreateObject('controller.socontrol');
-                       $this->so_check_list            = 
CreateObject('controller.socheck_list');
-                       $this->so_control_item          = 
CreateObject('controller.socontrol_item');
-                       $this->so_check_item            = 
CreateObject('controller.socheck_item');
-                       $this->so_procedure                     = 
CreateObject('controller.soprocedure');
-                       
-                       $this->type_id                          = 
$this->bo->type_id;
-                       
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                                     = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->filter                           = 
$this->bo->filter;
-                       $this->cat_id                           = 
$this->bo->cat_id;
-                       $this->part_of_town_id          = 
$this->bo->part_of_town_id;
-                       $this->district_id                      = 
$this->bo->district_id;
-                       $this->status                           = 
$this->bo->status;
-                       $this->allrows                          = 
$this->bo->allrows;
-                       $this->lookup                           = 
$this->bo->lookup;
-                       $this->location_code            = 
$this->bo->location_code;
-                       
-                       
self::set_active_menu('controller::control::location_for_check_list');
-               }       
-       
-               function index()
-               {
-                       $control_id = phpgw::get_var('control_id');
-                       if(phpgw::get_var('save_location'))
-                       {
-                               $values = phpgw::get_var('values');
-                               //add component to control using component item 
ID
-                               $values['control_location'] = 
isset($values['control_location']) && $values['control_location'] ? 
array_unique($values['control_location']) : array();
-                               $values['control_location_orig'] = 
isset($values['control_location_orig']) && $values['control_location_orig'] ? 
array_unique($values['control_location_orig']) : array();
-
-                               $ok = 
$this->so_control->register_control_to_location($control_id, $values);
-
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'controller.uicontrol_location.index', 'control_id' => 
$control_id));
-                       }
-                       else
-                       {
-                               if(phpgw::get_var('phpgw_return_as') == 'json') 
{
-                                       return $this->query();
-                               }
-                               $building_types  = 
execMethod('property.soadmin_location.read',array());
-                               //$type_id=phpgw::get_var('type_id');
-                               //if(!isset($type_id))
-                               $type_id = 1;
-                               
-                               $category_types = 
$this->bocommon->select_category_list(array(
-                                                                               
                                                                        
'format'=>'filter',
-                                                                               
                                                                        
'selected' => $this->cat_id,
-                                                                               
                                                                        'type' 
=>'location',
-                                                                               
                                                                        
'type_id' =>$type_id,
-                                                                               
                                                                        
'order'=>'descr'
-                                                                               
                                                                ));
-                               $default_value = array 
('id'=>'','name'=>lang('no category selected'));
-                               array_unshift($category_types,$default_value);
-                                                                               
                                                                
-                               $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
-                               $default_value = array 
('id'=>'','name'=>lang('no district'));
-                               array_unshift($district_list,$default_value);
-                               
-                               $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
-                               $default_value = array 
('id'=>'','name'=>lang('no part of town'));
-                               
array_unshift($part_of_town_list,$default_value);
-                               
-                               $_role_criteria = array
-                                               (
-                                                       'type'          => 
'responsibility_role',
-                                                       'filter'        => 
array('location_level' => (int)$type_id),
-                                                       'order'         => 
'name'
-                                               );
-       
-                               $responsibility_roles_list = 
execMethod('property.sogeneric.get_list',$_role_criteria);
-                               $default_value = array 
('id'=>'','name'=>lang('no role'));
-                               array_unshift 
($responsibility_roles,$default_value);
-                               
-                               $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'],
-                                       );              
-                               }
-                               
-                               $control = $this->so_control->get_single( 
$control_id ); 
-                               $current_control_area_id = 
$control->get_control_area_id();
-                               $controls_array = 
$this->so_control->get_controls_by_control_area( $current_control_area_id );    
      
-                               
-                               $data = array(
-                                       'view'                                  
                                        => "register_control_to_location",
-                                       'control_areas_array'                   
=> $control_areas_array,
-                                 'controls_array'                          => 
$controls_array,
-                                 'current_control_id'                  => 
$control_id,
-                                       'current_control_area_id' => 
$current_control_area_id,
-                                       'filter_form'                           
                => array(
-                                               '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)),
-                                               'field' => array(
-                                                       array(
-                                                               'key' => 
'location_registered',
-                                                               'hidden' => true
-                                                       ),
-                                                       array(
-                                                               'key' => 
'location_code',
-                                                               'label' => 
lang('Property'),
-                                                               'sortable'      
=> true,
-                                                               'formatter' => 
'YAHOO.portico.formatLink'
-                                                       ),
-                                                       array(
-                                                               'key'   =>      
'loc1_name',
-                                                               'label' =>      
lang('Property name'),
-                                                               'sortable'      
=>      false
-                                                       ),
-                                                       array(
-                                                               'key' => 
'adresse1',
-                                                               'label' => 
lang('Address'),
-                                                               'sortable'      
=> false
-                                                       ),
-                                                       array(
-                                                               'key' => 
'postnummer',
-                                                               'label' => 
lang('Zip code'),
-                                                               'sortable'      
=> false
-                                                       ),
-                                                       array(
-                                                               'key' => 
'control_name',
-                                                               'label' => 
lang('control'),
-                                                               'sortable'      
=> false
-                                                       ),
-                                                       array(
-                                                                       'key' 
=> 'checked',
-                                                                       'label' 
=> 'Velg',
-                                                                       
'sortable' => false,
-                                                                       
'formatter' => 'formatterCheckLocation',
-                                                                       
'className' => 'mychecks'
-                                                       ),
-                                                       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');
-                               
-                               phpgwapi_jquery::load_widget('core');
-
-//                             self::add_javascript('controller', 
'controller', 'jquery.js');
-                               self::add_javascript('controller', 
'controller', 'ajax.js');
-                               self::add_javascript('controller', 'yahoo', 
'register_control_to_location.js');
-       
-                               
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/register_control_to_location', 'common'), $data);
-                       }               
-               }
-               
-               // Returns locations for a control
-               public function get_locations_for_control()
-               {
-                       $control_id = phpgw::get_var('control_id');
-                       
-                       if(is_numeric($control_id) & $control_id > 0)
-                       {
-                               $locations_for_control_array = 
$this->so_control->get_locations_for_control($control_id);
-                       
-                               foreach($locations_for_control_array as 
$location)
-                               {
-                                       $results['results'][]= $location;       
-                               }
-                               
-                               $results['total_records'] = count( 
$locations_for_control_array );
-                               $results['start'] = 1;
-                               $results['sort'] = 'location_code';
-                       }
-                       else
-                       {
-                               $results['total_records'] = 0;
-                       }                               
-                       
-                       return $this->yui_results($results);
-               }
-               
-               public function query()
-               {
-                       $type_id = phpgw::get_var('type_id', 'int');
-                       $control_id = phpgw::get_var('control_id', 'int');
-                       $control_id_init = phpgw::get_var('control_id_init', 
'int');
-                       $control_area_id = phpgw::get_var('control_area_id', 
'int');
-
-                       $control_id = $control_id ? $control_id : 
$control_id_init;
-                       
-                       if($control_area_id && 
!execMethod('controller.socontrol.get_controls_by_control_area',$control_area_id))
-                       {
-                               $control_id = 0;
-                       }
-
-                       $control_info = 
execMethod('controller.socontrol.get_single', $control_id);
-                       $control_name = '';
-                       if($control_info)
-                       {
-                               $control_name = $control_info->get_title();
-                       }
-
-                       $view_type = phpgw::get_var('view_type');
-                       $return_results = phpgw::get_var('results', 'int', 
'REQUEST', 0);
-                       
-                       $type_id = $type_id ? $type_id : 1;
-                       
-                       $location_list = array();
-
-                       $this->bo->sort = "ASC";
-                       $this->bo->start = phpgw::get_var('startIndex');
-                       
-                       $location_list = $this->bo->read(array('user_id' => 
$user_id, 'role_id' =>$role_id, 
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
-                                                                               
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run, 'results' => $return_results));
-
-                       foreach($location_list as &$location)
-                       {
-                               $location['control_name'] = $control_name;
-                               $location['location_registered'] = 
!!$this->so_control->get_control_location($control_id, 
$location['location_code']);
-                               $results['results'][]= $location;       
-                       }
-                       
-                       $results['total_records'] = $this->bo->total_records;
-                       $results['start'] = $this->start;
-                       $results['sort'] = 'location_code';
-                       $results['dir'] = "ASC";
-                                               
-                       array_walk($results['results'], array($this, 
'add_links'), array($type));
-                                                       
-                       return $this->yui_results($results);
-               }
-
-               public function register_control_to_location_2()
-               {
-                       $control_id = phpgw::get_var('control_id');
-                       $location_code = phpgw::get_var('location_code');
-                       
-                       $control_location  = null;
-                       $control_location_id = 0;
-                       
-                       $control_location = 
$this->so_control->get_control_location($control_id, $location_code);
-                       
-                       if($control_location == null ){
-                               
-                               $control_location_id = 
$this->so_control->register_control_to_location($control_id, $location_code);
-                       }
-                       
-                       if($control_location_id > 0)
-                               return json_encode( array( "status" => "saved" 
) );
-                       else
-                               return json_encode( array( "status" => 
"not_saved" ) );
-               }
-               
-               public function add_actions(&$value, $key, $params)
-               {
-                       unset($value['query_location']);
-                       
-                       $value['ajax'] = array();
-                       $value['actions'] = array();
-                       $value['labels'] = array();
-                       $value['parameters'] = array();
-               }
-               
-               /*
-                * Return categories based on chosen location
-                */
-               public function get_location_category()
-               {
-                       $type_id = phpgw::get_var('type_id');
-                       $category_types = 
$this->bocommon->select_category_list(array(
-                                                                               
                                                                
'format'=>'filter',
-                                                                               
                                                                'selected' => 0,
-                                                                               
                                                                'type' 
=>'location',
-                                                                               
                                                                'type_id' 
=>$type_id,
-                                                                               
                                                                'order'=>'descr'
-                                                                               
                                                        ));
-                       $default_value = array ('id'=>'','name'=>lang('no 
category selected'));
-                       array_unshift($category_types,$default_value);
-                       return json_encode( $category_types );
-               }
-               
-               /*
-                * Return parts of town based on chosen district
-                */
-               public function get_district_part_of_town()
-               {
-                       $district_id = phpgw::get_var('district_id');
-                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',null,$district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
-                       array_unshift($part_of_town_list,$default_value);
-
-                       return json_encode( $part_of_town_list );
-               }
-
-
-               /*
-
-                * Return parts of town based on chosen district
-                */
-               public function get_category_by_entity()
-               {
-                       $entity_id              = phpgw::get_var('entity_id');
-                       $entity                 = 
CreateObject('property.soadmin_entity');
-
-                       $category_list = 
$entity->read_category(array('allrows'=>true,'entity_id'=>$entity_id));
-
-                       return $category_list;
-               }
-
-
-               public function get_location_type_category()
-               {
-                       $location_type                  = 
phpgw::get_var('location_type', 'int');
-
-                       $values  = $this->bocommon->select_category_list(array
-                                       (
-                                               'format'=>'filter',
-                                       //      'selected' => $this->cat_id,
-                                               'type' =>'location',
-                                               'type_id' =>$location_type,
-                                               'order'=>'descr'
-                                       )
-                               );
-
-                       return $values;
-               }
-
-
-               public function get_entity_table_def()
-               {
-                       $entity_id                      = 
phpgw::get_var('entity_id', 'int');
-                       $cat_id                         = 
phpgw::get_var('cat_id', 'int');
-                       $boentity       = 
CreateObject('property.boentity',false, 'entity');
-                       $boentity->read(array('dry_run' => true));
-                       $uicols = $boentity->uicols;
-                       $columndef = array();
-
-                       $columndef[] = array
-                       (
-                               'key'           => 'select',
-                               'label'         => lang('select'),
-                               'sortable'      => false,
-                               'formatter'     => false,
-                               'hidden'        => false,
-                               'formatter' => '',
-                               'className' => ''
-                       );
-
-                       $columndef[] = array
-                       (
-                               'key'           => 'delete',
-                               'label'         => lang('delete'),
-                               'sortable'      => false,
-                               'formatter'     => false,
-                               'hidden'        => false,
-                               'formatter' => '',
-                               'className' => ''
-                       );
-
-                       $count_fields = count($uicols['name']);
-
-                       for ($i=0;$i<$count_fields;$i++)
-                       {
-                               if( $uicols['name'][$i])
-                               {
-                                       $columndef[] = array
-                                       (
-                                               'key'           => 
$uicols['name'][$i],
-                                               'label'         => 
$uicols['descr'][$i],
-                                               'sortable'      => 
$uicols['sortable'][$i],
-                                               'formatter'     => 
$uicols['formatter'][$i],
-                                               'hidden'        => 
$uicols['input_type'][$i] == 'hidden' ? true : false ,               
-                                               'className'     => 
$uicols['classname'][$i],
-                                       );
-                               }
-                       }
-
-//_debug_array($columndef);
-                       return $columndef;
-               }
-
-
-               public function get_locations()
-               {
-                       $location_code = phpgw::get_var('location_code');
-                       $child_level = phpgw::get_var('child_level', 'int', 
'REQUEST', 1);
-                       $part_of_town_id = phpgw::get_var('part_of_town_id', 
'int');
-
-                       $criteria = array
-                       (
-                               'location_code'         => $location_code,
-                               'child_level'           => $child_level,
-                               'field_name'            => 
"loc{$child_level}_name",
-                               'part_of_town_id'       => $part_of_town_id
-                       );
-       
-                       $locations = 
execMethod('property.solocation.get_children',$criteria);
-                       return $locations;
-               }
-
-       }

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_component.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_component.inc.php
    2012-10-23 08:56:37 UTC (rev 10301)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_component.inc.php
    2012-10-23 09:00:30 UTC (rev 10302)
@@ -59,11 +59,8 @@
                        'query'                                                 
        => true,
                        'edit_component'                                        
=> true,
                        'get_location_category'                         => true,
-                       'get_district_part_of_town'                     => true,
                        'get_category_by_entity'                        => true,
                        'get_entity_table_def'                          => true,
-                       'get_locations'                                         
=> true,
-                       'get_location_type_category'            => true
                );
 
                function __construct()
@@ -185,14 +182,14 @@
                                                                                
                                'part_of_town_list'             => 
array('options' => $part_of_town_list),
                                                                                
                                'location_type_list'    => array('options' => 
$location_type_list),
                                                                                
                        ),
-                               'update_action'                                 
=> self::link(array('menuaction' => 
'controller.uicontrol_location.edit_component'))
+                               'update_action'                                 
=> self::link(array('menuaction' => 
'controller.uicontrol_register_to_component.edit_component'))
                        );
 
                        phpgwapi_jquery::load_widget('core');
                        phpgwapi_jquery::load_widget('autocomplete');
 
                        self::add_javascript('controller', 'controller', 
'ajax_control_to_component.js');
-                       self::add_javascript('controller', 'yahoo', 
'register_control_to_component2.js');
+                       self::add_javascript('controller', 'yahoo', 
'register_control.js');
 
                        
self::render_template_xsl(array('control_location/register_control_to_component'
 ), $data);
                }
@@ -216,20 +213,7 @@
                        return json_encode( $category_types );
                }
                
-               /*
-                * Return parts of town based on chosen district
-                */
-               public function get_district_part_of_town()
-               {
-                       $district_id = phpgw::get_var('district_id');
-                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',null,$district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
-                       array_unshift($part_of_town_list,$default_value);
 
-                       return json_encode( $part_of_town_list );
-               }
-
-
                /*
 
                 * Return parts of town based on chosen district
@@ -245,24 +229,6 @@
                }
 
 
-               public function get_location_type_category()
-               {
-                       $location_type                  = 
phpgw::get_var('location_type', 'int');
-
-                       $values  = $this->bocommon->select_category_list(array
-                                       (
-                                               'format'=>'filter',
-                                       //      'selected' => $this->cat_id,
-                                               'type' =>'location',
-                                               'type_id' =>$location_type,
-                                               'order'=>'descr'
-                                       )
-                               );
-
-                       return $values;
-               }
-
-
                public function get_entity_table_def()
                {
                        $entity_id                      = 
phpgw::get_var('entity_id', 'int');
@@ -317,26 +283,7 @@
                }
 
 
-               public function get_locations()
-               {
-                       $location_code = phpgw::get_var('location_code');
-                       $child_level = phpgw::get_var('child_level', 'int', 
'REQUEST', 1);
-                       $part_of_town_id = phpgw::get_var('part_of_town_id', 
'int');
 
-                       $criteria = array
-                       (
-                               'location_code'         => $location_code,
-                               'child_level'           => $child_level,
-                               'field_name'            => 
"loc{$child_level}_name",
-                               'part_of_town_id'       => $part_of_town_id
-                       );
-       
-                       $locations = 
execMethod('property.solocation.get_children',$criteria);
-                       return $locations;
-               }
-
-
-
                public function query()
                {
                        $entity_id                      = 
phpgw::get_var('entity_id', 'int');
@@ -355,23 +302,48 @@
                        {
                                $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', 
".entity.{$entity_id}.{$cat_id}");
                                $boentity       = 
CreateObject('property.boentity',false, 'entity');
+
+               $boentity->sort =  phpgw::get_var('dir');
+               $boentity->order =  phpgw::get_var('sort');
+                   $boentity->start =  phpgw::get_var('startIndex', 'int', 
'REQUEST', 0);
+
                                $boentity->results = $results;
                                $values = 
$boentity->read(array('control_registered' => $control_registered, 'control_id' 
=> $control_id));
                        }               
 
-                       foreach($values as &$entry)
+                       if($control_id)
                        {
-                               $checked = '';
-                               
if($this->so_control->check_control_component($control_id,$location_id,$entry['id']))
+                               foreach($values as &$entry)
                                {
-                                       $checked =  'checked = "checked" 
disabled = "disabled"';
-                                       $entry['delete'] = "<input class 
=\"mychecks_delete\" type =\"checkbox\" name=\"values[delete][]\" 
value=\"{$control_id}_{$location_id}_{$entry['id']}\">";
+                                       $checked = '';
+                                       
if($this->so_control->check_control_component($control_id,$location_id,$entry['id']))
+                                       {
+                                               $checked =  'checked = 
"checked" disabled = "disabled"';
+                                               $entry['delete'] = "<input 
class =\"mychecks_delete\" type =\"checkbox\" name=\"values[delete][]\" 
value=\"{$control_id}_{$location_id}_{$entry['id']}\">";
+                                       }
+                                       $entry['select'] = "<input class 
=\"mychecks_add\" type =\"checkbox\" $checked 
name=\"values[register_component][]\" 
value=\"{$control_id}_{$location_id}_{$entry['id']}\">";
                                }
-                               $entry['select'] = "<input class 
=\"mychecks_add\" type =\"checkbox\" $checked 
name=\"values[register_component][]\" 
value=\"{$control_id}_{$location_id}_{$entry['id']}\">";
                        }
-
                        
                        $results = $results ? $results : 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+
+                       $data = array(
+                                'ResultSet' => array(
+                                       'totalResultsAvailable' => 
$boentity->total_records,
+                                       'startIndex' => $this->start, 
+                                       'sortKey' => 'location_code', 
+                                       'sortDir' => "ASC", 
+                                       'Result' => $values,
+                                       //FIXME: Sigurd 18 oct 2012...
+                                       'pageSize' => $results,
+                                       'activePage' => floor($this->bo->start 
/ $results) + 1
+                               )
+                       );
+
+                       return $data;
+
+
+
                        $return_data['recordsReturned'] = count($values);
                        $return_data['totalRecords'] = $boentity->total_records;
                        $return_data['startIndex'] = $this->start;
@@ -428,7 +400,7 @@
                        }
                        else
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 
'controller.uicontrol_location.register_control_to_component'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'controller.uicontrol_register_to_component.index'));
                        }
                }
        }

Copied: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_location.inc.php
 (from rev 10301, 
trunk/controller/inc/class.uicontrol_register_to_location.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_location.inc.php
                             (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicontrol_register_to_location.inc.php
     2012-10-23 09:00:30 UTC (rev 10302)
@@ -0,0 +1,448 @@
+<?php
+       /**
+       * phpGroupWare - controller: a part of a Facilities Management System.
+       *
+       * @author Erink Holm-Larsen <address@hidden>
+       * @author Torstein Vadla <address@hidden>
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage controller
+       * @version $Id: class.uicheck_list.inc.php 8628 2012-01-21 10:42:05Z 
vator $
+       */
+       
+       phpgw::import_class('phpgwapi.yui');
+
+       /**
+       * Import the jQuery class
+       */
+       phpgw::import_class('phpgwapi.jquery');
+
+       phpgw::import_class('phpgwapi.uicommon');
+               
+       class controller_uicontrol_register_to_location extends 
phpgwapi_uicommon
+       {
+               var $cat_id;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $filter;
+               var $type_id;
+               var $location_code;
+               
+               private $bo;
+               private $bocommon;
+               private $so_control;
+       
+               var $public_functions = array
+               (
+                       'index'                                                 
        => true,
+                       'query'                                                 
        => true,
+                       'edit_location'                                         
=> true,
+                       'get_location_category'                         => true,
+                       'get_district_part_of_town'                     => true,
+                       'get_category_by_entity'                        => true,
+                       'get_entity_table_def'                          => true,
+                       'get_locations'                                         
=> true,
+                       'get_location_type_category'            => true
+               );
+
+               function __construct()
+               {
+                       parent::__construct();
+                       
+                       $this->bo                                       = 
CreateObject('property.bolocation',true);
+                       $this->bocommon                         = & 
$this->bo->bocommon;
+                       $this->so_control                       = 
CreateObject('controller.socontrol');
+                       
+                       $this->type_id                          = 
$this->bo->type_id;
+                       
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                                     = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->filter                           = 
$this->bo->filter;
+                       $this->cat_id                           = 
$this->bo->cat_id;
+                       $this->part_of_town_id          = 
$this->bo->part_of_town_id;
+                       $this->district_id                      = 
$this->bo->district_id;
+                       $this->status                           = 
$this->bo->status;
+                       $this->allrows                          = 
$this->bo->allrows;
+                       $this->lookup                           = 
$this->bo->lookup;
+                       $this->location_code            = 
$this->bo->location_code;
+                       
+                       
self::set_active_menu('controller::control::location_for_check_list');
+               }       
+       
+
+
+               function index()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       $receipt = array();
+
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
+                       $msgbox_data = array();
+                       if( phpgw::get_var('phpgw_return_as') != 'json' && 
$receipt = phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+                       {
+                               phpgwapi_cache::session_clear('phpgwapi', 
'phpgw_messages');
+                               $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($receipt);
+                               $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
+                       }
+
+                       $myColumnDefs = array();
+                       $datavalues = array();
+                       $myButtons      = array();
+
+                       $datavalues[] = array
+                       (
+                               'name'                          => "0",
+                               'values'                        => 
json_encode(array()),
+                               'total_records'         => 0,
+                               'permission'            => "''",
+                               'is_paginator'          => 1,
+                               'edit_action'           => "''",
+                               'footer'                        => 0
+                       );
+
+                       $myColumnDefs[0] = array
+                       (
+                               'name'          => "0",
+                               'values'        =>      json_encode(array())
+                       );      
+
+                       $GLOBALS['phpgw']->translation->add_app('property');
+
+                       $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
+
+                       $part_of_town_list = 
execMethod('property.bogeneric.get_list', array('type'=>'part_of_town', 
'selected' => $part_of_town_id ));
+                       $location_type_list = 
execMethod('property.soadmin_location.select_location_type');
+
+                       array_unshift($district_list ,array 
('id'=>'','name'=>lang('select')));
+                       array_unshift($part_of_town_list ,array 
('id'=>'','name'=>lang('select')));
+                       array_unshift($location_type_list ,array 
('id'=>'','name'=>lang('select')));
+
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cats->supress_info     = true;
+
+                       $control_area = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
+
+                                                               
+                       $control_area_list = array();
+                       foreach($control_area['cat_list'] as $cat_list)
+                       {
+                               $control_area_list[] = array
+                               (
+                                       'id'    => $cat_list['cat_id'],
+                                       'name'  => $cat_list['name'],
+                               );              
+                       }
+
+                       array_unshift ($control_area_list ,array 
('id'=>'','name'=>lang('select')));
+
+                       
+                                       
+                       $data = array
+                       (
+                               'td_count'                                      
        => '""',
+                               'datatable'                                     
        => $datavalues,
+                               'myColumnDefs'                                  
=> $myColumnDefs,
+                               'myButtons'                                     
        => $myButtons,
+
+                               'msgbox_data'                                   
=> $msgbox_data,
+                               'control_area_list'             => 
array('options' => $control_area_list),
+                               'filter_form'                                   
=> array
+                                                                               
                        (
+                                                                               
                                'control_area_list'             => 
array('options' => $control_area_list),
+                                                                               
                                'district_list'                 => 
array('options' => $district_list),
+                                                                               
                                'part_of_town_list'             => 
array('options' => $part_of_town_list),
+                                                                               
                                'location_type_list'    => array('options' => 
$location_type_list),
+                                                                               
                        ),
+                               'update_action'                                 
=> self::link(array('menuaction' => 
'controller.uicontrol_register_to_location.edit_location'))
+                       );
+
+                       phpgwapi_jquery::load_widget('core');
+                       phpgwapi_jquery::load_widget('autocomplete');
+
+                       self::add_javascript('controller', 'controller', 
'ajax_control_to_location.js');
+                       self::add_javascript('controller', 'yahoo', 
'register_control.js');
+
+                       
self::render_template_xsl(array('control_location/register_control_to_location' 
), $data);
+               }
+
+               
+               /*
+                * Return categories based on chosen location
+                */
+               public function get_location_category()
+               {
+                       $type_id = phpgw::get_var('type_id');
+                       $category_types = 
$this->bocommon->select_category_list(array(
+                                                                               
                                                                
'format'=>'filter',
+                                                                               
                                                                'selected' => 0,
+                                                                               
                                                                'type' 
=>'location',
+                                                                               
                                                                'type_id' 
=>$type_id,
+                                                                               
                                                                'order'=>'descr'
+                                                                               
                                                        ));
+                       $default_value = array ('id'=>'','name'=>lang('no 
category selected'));
+                       array_unshift($category_types,$default_value);
+                       return json_encode( $category_types );
+               }
+               
+               /*
+                * Return parts of town based on chosen district
+                */
+               public function get_district_part_of_town()
+               {
+                       $district_id = phpgw::get_var('district_id');
+                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',null,$district_id);
+                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
+                       array_unshift($part_of_town_list,$default_value);
+
+                       return json_encode( $part_of_town_list );
+               }
+
+
+               /*
+
+                * Return parts of town based on chosen district
+                */
+               public function get_category_by_entity()
+               {
+                       $entity_id              = phpgw::get_var('entity_id');
+                       $entity                 = 
CreateObject('property.soadmin_entity');
+
+                       $category_list = 
$entity->read_category(array('allrows'=>true,'entity_id'=>$entity_id));
+
+                       return $category_list;
+               }
+
+
+               public function get_location_type_category()
+               {
+                       $location_type                  = 
phpgw::get_var('location_type', 'int');
+
+                       $values  = $this->bocommon->select_category_list(array
+                                       (
+                                               'format'=>'filter',
+                                       //      'selected' => $this->cat_id,
+                                               'type' =>'location',
+                                               'type_id' =>$location_type,
+                                               'order'=>'descr'
+                                       )
+                               );
+
+                       return $values;
+               }
+
+
+               public function get_entity_table_def()
+               {
+
+                       $location_level         = 
phpgw::get_var('location_level', 'int', 'REQUEST', 1);
+                       $solocation     = CreateObject('property.solocation');
+                       $solocation->read(array('dry_run' => true, 'type_id' 
=>$location_level));
+                       $uicols = $solocation->uicols;
+
+                       $columndef = array();
+
+                       /*This one has to defined - chokes otherwise*/
+                       $columndef[] = array
+                       (
+                               'key'           => 'id',
+                               'label'         => '',
+                               'sortable'      => false,
+                               'formatter'     => false,
+                               'hidden'        => true,
+                               'className' => false
+                       );
+
+                       $columndef[] = array
+                       (
+                               'key'           => 'select',
+                               'label'         => lang('select'),
+                               'sortable'      => false,
+                               'formatter'     => false,
+                               'hidden'        => false,
+                               'className' => ''
+                       );
+
+                       $columndef[] = array
+                       (
+                               'key'           => 'delete',
+                               'label'         => lang('delete'),
+                               'sortable'      => false,
+                               'formatter'     => false,
+                               'hidden'        => false,
+                               'className' => ''
+                       );
+
+
+                       $count_fields = count($uicols['name']);
+
+                       for ($i=0;$i<$count_fields;$i++)
+                       {
+                               if( $uicols['name'][$i])
+                               {
+                                       $columndef[] = array
+                                       (
+                                               'key'           => 
$uicols['name'][$i],
+                                               'label'         => 
$uicols['descr'][$i],
+                                               'sortable'      => 
!!$uicols['sortable'][$i],
+                                               'formatter'     => 
$uicols['formatter'][$i],
+                                               'hidden'        => 
$uicols['input_type'][$i] == 'hidden' ? true : false ,               
+                                               'className'     => 
$uicols['classname'][$i],
+                                       );
+                               }
+                       }
+
+
+//_debug_array($columndef);
+                       return $columndef;
+               }
+
+
+               public function get_locations()
+               {
+                       $location_code = phpgw::get_var('location_code');
+                       $child_level = phpgw::get_var('child_level', 'int', 
'REQUEST', 1);
+                       $part_of_town_id = phpgw::get_var('part_of_town_id', 
'int');
+
+                       $criteria = array
+                       (
+                               'location_code'         => $location_code,
+                               'child_level'           => $child_level,
+                               'field_name'            => 
"loc{$child_level}_name",
+                               'part_of_town_id'       => $part_of_town_id
+                       );
+       
+                       $locations = 
execMethod('property.solocation.get_children',$criteria);
+                       return $locations;
+               }
+
+
+               public function query()
+               {
+                       $type_id = phpgw::get_var('location_level', 'int', 
'REQUEST', 1);
+                       $district_id            = phpgw::get_var('district_id', 
'int');
+                       $part_of_town_id        = 
phpgw::get_var('part_of_town_id', 'int');
+                       $control_id                     = 
phpgw::get_var('control_id', 'int');
+                       $results                        = 
phpgw::get_var('results', 'int');
+                       $control_registered     = 
phpgw::get_var('control_registered', 'bool');
+
+                       $this->bo->results = $results;                  
+            $this->bo->sort =  phpgw::get_var('dir');
+            $this->bo->order =  phpgw::get_var('sort');
+            $this->bo->start =  phpgw::get_var('startIndex', 'int', 'REQUEST', 
0);
+
+                       $values = $this->bo->read(array('control_registered' => 
$control_registered,
+                                        'control_id' => $control_id,
+                                        'type_id'=>$type_id,
+                                        'allrows'=>$this->allrows,
+                                        'results' => $results
+                                       )
+                               );
+
+
+                       if($control_id)
+                       {
+                               foreach($values as &$entry)
+                               {
+                                       $checked = '';
+                                       if( 
$this->so_control->get_control_location($control_id, $entry['location_code']) )
+                                       {
+                                               $checked =  'checked = 
"checked" disabled = "disabled"';
+                                               $entry['delete'] = "<input 
class =\"mychecks_delete\" type =\"checkbox\" name=\"values[delete][]\" 
value=\"{$control_id}_{$entry['location_code']}\">";
+                                       }
+                                       $entry['select'] = "<input class 
=\"mychecks_add\" type =\"checkbox\" $checked 
name=\"values[register_location][]\" 
value=\"{$control_id}_{$entry['location_code']}\">";
+                               }
+                       }
+                       
+                       $results = $results ? $results : 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+
+                       $data = array(
+                                'ResultSet' => array(
+                                       'totalResultsAvailable' => 
$this->bo->total_records,
+                                       'startIndex' => $this->bo->start, 
+                                       'sortKey' => 'location_code', 
+                                       'sortDir' => "ASC", 
+                                       'Result' => $values,
+                                       //FIXME: Sigurd 18 oct 2012...
+                                       'pageSize' => $results,
+                                       'activePage' => floor($this->bo->start 
/ $results) + 1
+                               )
+                       );
+
+                       return $data;
+               }
+
+               public function edit_location()
+               {
+                       if($values = phpgw::get_var('values'))
+                       {
+                               if(!$GLOBALS['phpgw']->acl->check('.admin', 
PHPGW_ACL_EDIT, 'property'))
+                               {
+                                       $receipt['error'][]=true;
+                                       phpgwapi_cache::message_set(lang('you 
are not approved for this task'), 'error');
+                               }
+                               if(!$receipt['error'])
+                               {
+
+                                       
if($this->so_control->register_control_to_location($values))
+                                       {
+                                               $result =  array
+                                               (
+                                                       'status'        => 
'updated'
+                                               );
+                                       }
+                                       else
+                                       {
+                                               $result =  array
+                                               (
+                                                       'status'        => 
'error'
+                                               );
+                                       }
+                               }
+                       }
+
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               if( $receipt = 
phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+                               {
+                                       
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+                                       $result['receipt'] = $receipt;
+                               }
+                               else
+                               {
+                                       $result['receipt'] = array();
+                               }
+                               return $result;
+                       }
+                       else
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'controller.uicontrol_register_to_location.index'));
+                       }
+               }
+       }

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-10-23 08:56:37 UTC (rev 10301)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-10-23 09:00:30 UTC (rev 10302)
@@ -54,7 +54,7 @@
        // Update location category based on location type
        $("#type_id").change(function () {
                 var location_type_id = $(this).val();
-                var oArgs = 
{menuaction:'controller.uicontrol_location.get_location_category'};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_location_category'};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
          
          var htmlString = "";
@@ -165,7 +165,7 @@
        //update part of town category based on district
        $("#district_id").change(function () {
                var district_id = $(this).val();
-                var oArgs = 
{menuaction:'controller.uicontrol_location.get_district_part_of_town'};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_district_part_of_town'};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
          //var requestUrl = 
"index.php?menuaction=controller.uicontrol.get_controls_by_control_area&phpgw_return_as=json"
          

Modified: 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_component.js
===================================================================
--- 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_component.js
   2012-10-23 08:56:37 UTC (rev 10301)
+++ 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_component.js
   2012-10-23 09:00:30 UTC (rev 10302)
@@ -88,10 +88,10 @@
 
 
        $("#location_type").change(function () {
-                var oArgs = 
{menuaction:'controller.uicontrol_register_to_component.get_location_type_category',
 location_type: $(this).val()};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_location_type_category',
 location_type: $(this).val()};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
 
-         var htmlString = "";
+         var htmlString  = "<option value=''>Velg</option>";
 
          $.ajax({
                        type: 'POST',
@@ -167,7 +167,7 @@
        //update part of town category based on district
        $("#district_id").change(function () {
                var district_id = $(this).val();
-                var oArgs = 
{menuaction:'controller.uicontrol_register_to_component.get_district_part_of_town'};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_district_part_of_town'};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
 
          var htmlString = "";
@@ -207,7 +207,7 @@
 
        $("#part_of_town_id").change(function ()
        {
-                var oArgs = 
{menuaction:'controller.uicontrol_register_to_component.get_locations', 
child_level:1, part_of_town_id: $(this).val()};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_locations', 
child_level:1, part_of_town_id: $(this).val()};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
 
          var htmlString  = "<option value=''>Velg</option>";
@@ -244,7 +244,7 @@
 
        $("#loc1").change(function ()
        {
-                var oArgs = 
{menuaction:'controller.uicontrol_register_to_component.get_locations', 
child_level:2, location_code: $(this).val()};
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_locations', 
child_level:2, location_code: $(this).val()};
                 var requestUrl = phpGWLink('index.php', oArgs, true);
 
          var htmlString  = "<option value=''>Velg</option>";
@@ -343,7 +343,7 @@
                                {
                                        $(submitBnt).val("Lagret");
 
-                                               
YAHOO.portico.update_datatable();
+                                           
YAHOO.portico.updateinlineTableHelper('datatable-container');
                                }
                                else
                                {
@@ -509,51 +509,12 @@
        };
        var requestUrl = phpGWLink('index.php', oArgs, true);
 
-       YAHOO.portico.init_datatable(myColumnDefs,requestUrl);
+    YAHOO.portico.inlineTableHelper('datatable-container', requestUrl, 
myColumnDefs);
 }
 
 
 function update_component_table()
 {
-
-       var control_registered = 0;
-       if (typeof($($("#control_registered")).attr("checked")) != 'undefined' 
&& $($("#control_registered")).attr("checked") == 'checked')
-       {
-               control_registered = 1;
-       }
-
-       if($("#cat_id").val() != null)
-       {
-               var location_code = '';
-
-               if( $("#search-location_code").val() != null && 
$("#search-location_code").val())
-               {
-                       location_code = $("#search-location_code").val();
-               }
-               else if( $("#loc2").val() != null && $("#loc2").val())
-               {
-                       location_code = $("#loc2").val();
-               }
-               else if ( $("#loc1").val() != null && $("#loc1").val())
-               {
-                       location_code = $("#loc1").val();
-               }
-
-               var oArgs = {
-                       
menuaction:'controller.uicontrol_register_to_component.query',
-                       entity_id:$("#entity_id").val(),
-                       cat_id:$("#cat_id").val(),
-                       district_id:$("#district_id").val(),
-                       part_of_town_id:$("#part_of_town_id").val(),
-                       location_code:location_code,
-                       control_id:$("#control_id_hidden").val() != null ? 
$("#control_id_hidden").val():'',
-                       control_registered:control_registered
-               };
-
-               var requestUrl = phpGWLink('index.php', oArgs, true);
-
-               YAHOO.portico.update_datatable(requestUrl);
-       }
-//     $("#receipt").html('');
+       init_component_table();
 }
 

Copied: 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
 (from rev 10301, trunk/controller/js/controller/ajax_control_to_location.js)
===================================================================
--- 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
    2012-10-23 09:00:30 UTC (rev 10302)
@@ -0,0 +1,477 @@
+$(document).ready(function()
+{
+
+       $("#control_area_id").change(function () {
+               var control_area_id = $(this).val();
+                var oArgs = 
{menuaction:'controller.uicontrol.get_controls_by_control_area'};
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+       //      $("#hidden_control_area_id").val( control_area_id );
+    //     var control_id_init = $("#hidden_control_id").val();
+         var htmlString = "";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl + "&control_area_id=" + control_area_id,
+                       success: function(data) {
+                               if( data != null){
+                                       htmlString  = "<option>Velg 
kontroll</option>"
+                                       var obj = jQuery.parseJSON(data);
+
+                                       $.each(obj, function(i) {
+
+                                               var selected = '';
+/*
+                                               if(obj[i].id == control_id_init)
+                                               {
+                                                       selected = ' selected';
+                                               }
+*/
+                                                       htmlString  += "<option 
value='" + obj[i].id + "'" + selected + ">" + obj[i].title + "</option>";
+                                       });
+                                        
+                                       $("#control_id").html( htmlString );
+                                       }
+                                       else
+                                       {
+                                       htmlString  += "<option>Ingen 
kontroller</option>"
+                                       $("#control_id").html( htmlString );
+//                                             
$("#hidden_control_id").val(-1); //reset
+                               }
+                       }
+                       });
+
+    });
+
+
+       $("#location_type").change(function () {
+
+               get_table_def();
+
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_location_type_category',
 location_type: $(this).val()};
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+         var htmlString  = "<option value=''>Velg</option>";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       var obj = data;
+
+                                       $.each(obj, function(i)
+                                       {
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
+                                       });
+                                        
+                                       $("#location_type_category").html( 
htmlString );
+                               $("#loc1").html( "<option 
value=''>Velg</option>" );
+                               $("#loc2").html( "<option 
value=''>Velg</option>" );
+                               }
+                               else
+                               {
+                               htmlString  += "<option value=''>Velg</option>";
+                               $("#part_of_town_id").html( htmlString );
+                               $("#loc1").html( htmlString );
+                               $("#loc2").html( htmlString );
+                       }
+                       }
+         });
+    });
+
+       $("#location_type_category").change(function () {
+               var level = $("#location_type").val();
+               update_location_table();
+               update_loc(level);
+    });
+
+       var oArgs = {menuaction:'property.bolocation.get_locations_by_name'};
+       var baseUrl = phpGWLink('index.php', oArgs, true);
+
+       $("#search-location-name").autocomplete({
+               source: function( request, response ) {
+                       location_type = $("#location_type").val();
+                       $.ajax({
+                               url: baseUrl,
+                               dataType: "json",
+                               data: {
+                                       location_name: request.term,
+                                       level: location_type
+                               },
+                               success: function( data ) {
+                                       response( $.map( data, function( item ) 
{
+                                               return {
+                                                       label: item.name,
+                                                       value: 
item.location_code
+                                               }
+                                       }));
+                               }
+                       });
+               },
+               focus: function (event, ui) {
+                       $(event.target).val(ui.item.label);
+                       return false;
+               },
+               minLength: 1,
+               select: function( event, ui ) {
+//                     console.log(ui.item);
+//                     $("#search-location-name").val( ui.item.label );
+                       $("#search-location_code").val( ui.item.value );
+                       update_location_table();
+               }
+       });
+
+
+       //update part of town category based on district
+       $("#district_id").change(function () {
+               var district_id = $(this).val();
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_district_part_of_town'};
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+         var htmlString = "";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl + "&district_id=" + district_id,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       var obj = jQuery.parseJSON(data);
+
+                                       $.each(obj, function(i)
+                                       {
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
+                                       });
+                                        
+                                       $("#part_of_town_id").html( htmlString 
);
+                               $("#loc1").html( "<option 
value=''>Velg</option>" );
+                               $("#loc2").html( "<option 
value=''>Velg</option>" );
+                               }
+                               else
+                               {
+                               htmlString  += "<option value=''>Velg</option>";
+                               $("#part_of_town_id").html( htmlString );
+                               $("#loc1").html( htmlString );
+                               $("#loc2").html( htmlString );
+                       }
+                       }
+         });
+
+               $("#search-location_code").val('');
+               update_location_table();
+    });
+
+
+       $("#part_of_town_id").change(function ()
+       {
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_locations', 
child_level:1, part_of_town_id: $(this).val()};
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+         var htmlString  = "<option value=''>Velg</option>";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       var obj = data;
+
+                                       $.each(obj, function(i)
+                                       {
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>" +  obj[i].id + " " + obj[i].name + "</option>";
+                                       });
+                                        
+                                       $("#loc1").html( htmlString );
+                               $("#loc2").html( "<option 
value=''>Velg</option>" );
+                                       }
+                                       else
+                                       {
+                                       htmlString  = "<option>Ingen</option>";
+                                       $("#loc1").html( htmlString );
+                                       $("#loc2").html(htmlString);
+                               }
+                       }
+         });
+
+               $("#search-location_code").val('');
+               update_location_table();
+    });
+
+       $("#loc1").change(function ()
+       {
+                var oArgs = 
{menuaction:'controller.uicontrol_register_to_location.get_locations', 
child_level:2, location_code: $(this).val()};
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+         var htmlString  = "<option value=''>Velg</option>";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       var obj = data;
+
+                                       $.each(obj, function(i)
+                                       {
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>" +  obj[i].id + " " + obj[i].name + "</option>";
+                                       });
+                                        
+                                       $("#loc2").html( htmlString );
+                                       }
+                                       else
+                                       {
+                                       htmlString  = "<option>Ingen</option>";
+                                       $("#loc2").html( htmlString );
+                               }
+                       }
+         });
+
+               $("#search-location_code").val('');
+               update_location_table();
+
+    });
+
+
+       $("#control_registered").change(function ()
+       {
+               init_component_table();
+    });
+
+       $("#control_id").change(function ()
+       {
+               $("#control_id_hidden").val( $(this).val() );
+
+               update_location_table();
+    });
+
+       $("#loc2").change(function ()
+       {
+               $("#search-location_code").val('');
+               update_location_table();
+    });
+
+
+
+       $("#search").click(function(e)
+       {
+               update_location_table();
+    });
+
+
+       $("#acl_form").live("submit", function(e){
+               e.preventDefault();
+               var control_id = $("#control_id_hidden").val();
+
+               if(!control_id || control_id == null)
+               {
+                       alert('du må velge kontroll');
+                       return;
+               }
+
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               var requestUrl = $(thisForm).attr("action");
+               $.ajax({
+                       type: 'POST',
+                       url: requestUrl + "&phpgw_return_as=json&" + 
$(thisForm).serialize(),
+                       success: function(data) {
+                               if(data)
+                               {
+                                       if(data.sessionExpired)
+                                       {
+                                               alert('Sesjonen er utløpt - du 
må logge inn på nytt');
+                                               return;
+                                       }
+
+                               var obj = data;
+                 
+                               var submitBnt = 
$(thisForm).find("input[type='submit']");
+                               if(obj.status == "updated")
+                               {
+                                       $(submitBnt).val("Lagret");
+
+                                           
YAHOO.portico.updateinlineTableHelper('datatable-container');
+                               }
+                               else
+                               {
+                                       $(submitBnt).val("Feil ved lagring");
+                               }
+                 
+                               // Changes text on save button back to original
+                               window.setTimeout(function() {
+                                               $(submitBnt).val('Lagre');
+                                               
$(submitBnt).addClass("not_active");
+                               }, 1000);
+
+                                       var htmlString = "";
+                                       if(typeof(data['receipt']['error']) != 
'undefined')
+                                       {
+                                               for ( var i = 0; i < 
data['receipt']['error'].length; ++i )
+                                               {
+                                                       htmlString += "<div 
class=\"error\">";
+                                                       htmlString += 
data['receipt']['error'][i]['msg'];
+                                                       htmlString += '</div>';
+                                               }
+        
+                                       }
+                                       if(typeof(data['receipt']['message']) 
!= 'undefined')
+                                       {
+                                               for ( var i = 0; i < 
data['receipt']['message'].length; ++i )
+                                               {
+                                                       htmlString += "<div 
class=\"msg_good\">";
+                                                       htmlString += 
data['receipt']['message'][i]['msg'];
+                                                       htmlString += '</div>';
+                                               }
+        
+                                       }
+                                       $("#receipt").html(htmlString);
+                               }
+                       }
+               });
+       });
+});
+
+
+function update_loc(level)
+{
+       var oArgs = {
+               menuaction:'property.bolocation.read',
+               cat_id:$("#location_type_category").val(),
+               district_id:$("#district_id").val(),
+               part_of_town_id:$("#part_of_town_id").val(),
+               location_code:$("#loc1").val(),
+               type_id:level
+       };
+
+                var requestUrl = phpGWLink('index.php', oArgs, true);
+
+         var htmlString  = "<option value=''>Velg</option>";
+
+         $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       url: requestUrl,
+                       success: function(data) {
+                               if( data != null)
+                               {
+                                       var obj = data;
+
+                                       $.each(obj, function(i)
+                                       {
+                                               htmlString  += "<option 
value='" + obj[i].location_code + "'>" +  obj[i].location_code + " " + 
obj[i]["loc"+level+"_name"] + "</option>";
+                                       });
+                                        
+                                       $("#loc" + level).html( htmlString );
+                                       if(level == 1)
+                                       {
+                                       $("#loc2").html( "<option value=''>Velg 
Eiendom først</option>" );
+                               }
+                                       if(level == 2)
+                                       {
+                                       $("#loc1").html( "" );
+                               }
+                               }
+                               else
+                               {
+                               htmlString  = "<option>Ingen</option>";
+                               $("#loc1").html( htmlString );
+                               $("#loc2").html(htmlString);
+                       }
+                       }
+         });
+
+
+
+}
+
+function get_table_def()
+{
+       var oArgs = {
+               
menuaction:'controller.uicontrol_register_to_location.get_entity_table_def',
+               location_level:$("#location_type").val()
+       };
+
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+       $.ajax({
+               type: 'POST',
+               dataType: 'json',
+               url: requestUrl,
+               success: function(data) {
+                       if( data != null)
+                       {
+                               myColumnDefs = data;
+                               init_component_table();
+                       }
+                       else
+                       {
+                               alert('error');
+                       }
+               }
+       });
+
+}
+
+
+function init_component_table()
+{
+       var location_type = $("#location_type").val() != null ? 
$("#location_type").val():'';
+
+       if(!location_type)
+       {
+               return false;
+       }
+
+       var cat_id = $("#location_type_category").val() != null ? 
$("#location_type_category").val():'';
+
+       var control_registered = 0;
+       if (typeof($($("#control_registered")).attr("checked")) != 'undefined' 
&& $($("#control_registered")).attr("checked") == 'checked')
+       {
+               control_registered = 1;
+       }
+
+
+       var location_code = '';
+
+       if( $("#search-location_code").val() != null && 
$("#search-location_code").val())
+       {
+               location_code = $("#search-location_code").val();
+       }
+       else if( $("#loc2").val() != null && $("#loc2").val())
+       {
+               location_code = $("#loc2").val();
+       }
+       else if ( $("#loc1").val() != null && $("#loc1").val())
+       {
+               location_code = $("#loc1").val();
+       }
+
+       var oArgs = {
+               menuaction:'controller.uicontrol_register_to_location.query',
+               location_level:location_type,
+               district_id:$("#district_id").val(),
+               part_of_town_id:$("#part_of_town_id").val(),
+               cat_id:cat_id,
+               location_code:location_code,
+               control_id:$("#control_id_hidden").val() != null ? 
$("#control_id_hidden").val():'',
+               control_registered:control_registered
+       };
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+
+    YAHOO.portico.inlineTableHelper('datatable-container', requestUrl, 
myColumnDefs);
+}
+
+
+function update_location_table()
+{
+       init_component_table();
+}
+

Deleted: 
branches/Version-1_0-branch/controller/js/controller/jquery-ui.custom.min.js
===================================================================
--- 
branches/Version-1_0-branch/controller/js/controller/jquery-ui.custom.min.js    
    2012-10-23 08:56:37 UTC (rev 10301)
+++ 
branches/Version-1_0-branch/controller/js/controller/jquery-ui.custom.min.js    
    2012-10-23 09:00:30 UTC (rev 10302)
@@ -1,125 +0,0 @@
-/*! jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.core.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){function c(b,c){var 
e=b.nodeName.toLowerCase();if("area"===e){var 
f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function
 d(b){return!a(b).parents().andSelf().filter(function(){return 
a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.20",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return
 typeof b=="number"?this.each(function(){var 
d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var
 b;return 
a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return
 this.css("zIndex",c);if(this.length){var 
d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return
 f}d=d.parent()}}return 0},disableSelection:function(){return 
this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return
 
this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function
 h(b,c,d,f){return 
a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var
 
e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return
 
c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return
 typeof 
b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return
 c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var 
d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var 
b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in
 
c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var
 e=a.ui[b].prototype;for(var f in 
d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var
 d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var 
e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return
 
document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var
 d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return 
b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return 
a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return 
a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - 
v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.widget.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){if(a.cleanData){var 
c=a.cleanData;a.cleanData=function(b){for(var 
d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var
 d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return 
c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var
 
e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var
 g=new 
c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var
 f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return 
e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var
 
d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return
 h=f,!1}):this.each(function(){var 
b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new 
d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var
 
d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return
 
a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled
 "+"ui-state-disabled")},widget:function(){return 
this.element},option:function(c,d){var e=c;if(arguments.length===0)return 
a.extend({},this.options);if(typeof c=="string"){if(d===b)return 
this.options[c];e={},e[c]=d}return 
this._setOptions(e),this},_setOptions:function(b){var c=this;return 
a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return
 
this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+"
 "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return 
this._setOption("disabled",!1)},disable:function(){return 
this._setOption("disabled",!0)},_trigger:function(b,c,d){var 
e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e
 in f)e in c||(c[e]=f[e]);return 
this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.mouse.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){var 
c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var
 b=this;this.element.bind("mousedown."+this.widgetName,function(a){return 
b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return
 
a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var
 d=this,e=b.which==1,f=typeof 
this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return
 
b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return
 d._mouseMove(a)},this._mouseUpDelegate=function(a){return 
d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return
 
a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return
 
Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return
 
this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.position.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.ui=a.ui||{};var 
c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return
 g.apply(this,arguments);b=a.extend({},b);var 
h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" 
"):[0,0],l,m,n;return 
i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left
 
top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var
 a=(b[this]||"").split(" 
");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var
 
c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var
 
d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var
 
d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var
 
d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var
 
d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var
 
d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in
 c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var 
c=this[0];return!c||!c.ownerDocument?null:b?this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var
 
b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var
 j in 
g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position:
 absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 
201px;",h=a(c).offset(function(a,b){return 
b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.draggable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return
 
this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable
 ui-draggable-dragging 
ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var
 c=this.options;return 
this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div
 class="ui-draggable-iframeFix" style="background: 
#fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var
 c=this.options;return 
this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var
 d=this._uiHash();if(this._trigger("drag",b,d)===!1)return 
this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return
 a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var 
c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var
 
d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var
 
f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else
 
this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return
 
this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return
 
this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var
 
c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return
 
a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var
 
c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return
 
d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof
 b=="string"&&(b=b.split(" 
")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in 
b&&(this.offset.click.left=b.left+this.margins.left),"right"in 
b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in
 b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in 
b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var
 
b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var
 
a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var
 
b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var
 c=a(b.containment),d=c[0];if(!d)return;var 
e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else
 
b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var
 
d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var
 
c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var
 h;if(this.containment){if(this.relative_container){var 
i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else
 
h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var
 
j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var
 
k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return
 
d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.20"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var
 
d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var
 
c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var
 
d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var
 d=a(this).data("draggable"),e=this,f=function(b){var 
c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return
 
a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return
 
c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var
 
d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var
 
d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var
 
d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var
 
d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var
 
d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var
 
d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var
 
d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var
 
b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var
 
d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var
 k=d.snapElements.length-1;k>=0;k--){var 
l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var
 
p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var
 t=p||q||r||s;if(e.snapMode!="outer"){var 
p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var
 
d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var
 
f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var
 
d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var
 
d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.droppable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var
 
b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return
 
a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var
 b=a.ui.ddmanager.droppables[this.options.scope];for(var 
c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return 
this.element.removeClass("ui-droppable 
ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return
 
a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var
 
c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var
 
c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var
 
c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var
 
c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var
 
d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var
 e=!1;return 
this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var
 
b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return
 
e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.20"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var
 
e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return
 i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return 
i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var
 
m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return
 
o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var
 
d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var
 
h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var
 
i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue 
g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var
 d=!1;return 
a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var
 
d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var
 f;if(this.options.greedy){var 
g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.resizable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var
 
b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div
 class="ui-wrapper" style="overflow: 
hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var
 d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var 
f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle 
'+g+'"></div>');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon 
ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var
 c in 
this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var
 
d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var
 
f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var
 
a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var
 b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled 
ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var
 
c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return
 
this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var
 c=!1;for(var d in 
this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var
 
d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var
 
g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof
 
d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var
 i=a(".ui-resizable-"+this.axis).css("cursor");return 
a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var
 
c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var
 
l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return
 
l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var
 c=this.options,d=this;if(this._helper){var 
e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return
 
a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var
 
b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var
 
b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var
 c=this.options,e=this.position,f=this.size,g=this.axis;return 
d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),a},_respectSize:function(a,b){var
 
c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var
 
l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var
 p=!a.width&&!a.height;return 
p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var
 b=this.options;if(!this._proportionallyResizeElements.length)return;var 
c=this.helper||this.element;for(var 
d=0;d<this._proportionallyResizeElements.length;d++){var 
e=this._proportionallyResizeElements[d];if(!this.borderDif){var 
f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var
 c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return 
c+d})}if(!a.browser.msie||!a(c).is(":hidden")&&!a(c).parents(":hidden").length)e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0});else
 continue}},_renderProxy:function(){var 
b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div
 style="overflow:hidden;"></div>');var 
d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else
 
this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var
 
d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var
 
d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return
 
a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return
 
a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return
 
a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return
 
a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.20"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var
 d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var 
b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof
 
e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var
 
b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var
 c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof 
e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var
 
c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var
 e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h 
instanceof 
a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var
 
j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var
 
l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var
 
m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof
 
e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var
 
d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var
 
d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var
 
d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof
 e.grid=="number"?[e.grid,e.grid]:e.grid;var 
k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var
 c=function(a){return 
parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);;/*! 
jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.selectable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var
 b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var 
c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var
 
b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div
 class='ui-selectable-helper'></div>")},destroy:function(){return 
this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable
 
ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var
 c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var 
d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var
 
d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var
 d=a.data(this,"selectable-item");if(d){var 
e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return 
d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var
 c=this;this.dragged=!0;if(this.options.disabled)return;var 
d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var 
i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return 
this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var
 i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var 
j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var
 c=this;this.dragged=!1;var d=this.options;return 
a(".ui-unselecting",this.element[0]).each(function(){var 
d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var
 
d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.20"})})(jQuery);;/*!
 jQuery UI - v1.8.20 - 2012-04-30
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.sortable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */

@@ Diff output truncated at 153600 characters. @@



reply via email to

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