fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9833] Merge 9755:9832 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [9833] Merge 9755:9832 from trunk
Date: Mon, 06 Aug 2012 12:26:00 +0000

Revision: 9833
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9833
Author:   sigurdne
Date:     2012-08-06 12:25:59 +0000 (Mon, 06 Aug 2012)
Log Message:
-----------
Merge 9755:9832 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/model/class.group.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
    branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
    branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php
    branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
    
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
    
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
    branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
    branches/Version-1_0-branch/controller/inc/class.socase.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
    
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
    
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
    branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_component.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicontrol_group_component.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.month_calendar.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.year_calendar.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
    branches/Version-1_0-branch/controller/inc/hook_home.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control_area.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_year.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    branches/Version-1_0-branch/controller/templates/base/control/control.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/phpgwapi/templates/activitycalendar/css/frontend.css
    branches/Version-1_0-branch/phpgwapi/templates/activitycalendar/head.tpl
    branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.boproject.inc.php
    branches/Version-1_0-branch/property/inc/class.boworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.sobudget.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.solocation.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.uibudget.inc.php
    branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    branches/Version-1_0-branch/property/js/yahoo/invoice.consume.js
    branches/Version-1_0-branch/property/js/yahoo/project.edit.js
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/generic.xsl
    branches/Version-1_0-branch/property/templates/base/project.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/activitycalendarfrontend/images/
    
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_info.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.status_agg_month_info.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
    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_bac.js
    
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom.css
    
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom_bac.css
    
branches/Version-1_0-branch/phpgwapi/templates/activitycalendar/css/reset-fonts-grids.css
    
branches/Version-1_0-branch/phpgwapi/templates/activitycalendar/images/hjelp.gif

Removed Paths:
-------------
    branches/Version-1_0-branch/controller/inc/class.socontrol_area.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_info.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_manager.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.status_agg_month_info.inc.php
    
branches/Version-1_0-branch/controller/js/controller/jquery-ui-1.8.20.custom.min.js
    branches/Version-1_0-branch/controller/js/controller/jquery-ui.custom.min.js
    
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_checker.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui-1.8.20.custom.css
    
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom.css

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
   + 
/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

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-08-06 12:25:59 UTC (rev 9833)
@@ -162,7 +162,7 @@
                if(isset($filters['new_activities']))
                {
                        if(!isset($filters['activity_state']) || 
(isset($filters['activity_state']) && $filters['activity_state'] == 'all')){
-                               $filter_clauses[] = "activity.state=1 OR 
activity.state=2";
+                               $filter_clauses[] = "(activity.state=1 OR 
activity.state=2)";
                        }
                        if(isset($filters['activity_state']) && 
$filters['activity_state'] != 'all'){
                                $activity_state = 
$this->marshal($filters['activity_state'],'int');
@@ -268,7 +268,8 @@
                        $columns[] = 'activity.special_adaptation';
                        $columns[] = 'activity.secret';
                        $columns[] = 'activity.frontend';
-                       $columns[] = 'activity.new_org';                        
+                       $columns[] = 'activity.new_org';
+                       $columns[] = 'activity.new_group';                      
                        
                        $cols = implode(',',$columns);
                }
@@ -341,7 +342,8 @@
                        'contact_person_2_zip = '          . 
$this->marshal($activity->get_contact_person_2_zip(), 'string'),
                        'special_adaptation = '                 
.($activity->get_special_adaptation() ? "true" : "false"),
                        'frontend = '                   
.($activity->get_frontend() ? "true" : "false"),
-                       'new_org = '                    
.($activity->get_new_org() ? "true" : "false")
+                       'new_org = '                    
.($activity->get_new_org() ? "true" : "false"),
+                       'new_group = '                  
.($activity->get_new_group() ? "true" : "false")
                );
                
                //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
@@ -449,10 +451,11 @@
                        
$activity->set_contact_person_2_zip($this->unmarshal($this->db->f('contact_person_2_zip'),
 'string'));
                        
$activity->set_frontend($this->unmarshal($this->db->f('frontend', 'bool')));
                        
$activity->set_new_org($this->unmarshal($this->db->f('new_org', 'bool')));
+                       
$activity->set_new_group($this->unmarshal($this->db->f('new_group', 'bool')));
                        
                        if($activity->get_group_id() && 
$activity->get_group_id() > 0)
                        {
-                               if($activity->get_new_org())
+                               if($activity->get_new_group())
                                {
                                        $contacts = 
activitycalendar_sogroup::get_instance()->get_contacts_local($activity->get_group_id());
                                        
$activity->set_contact_persons($contacts);
@@ -482,6 +485,7 @@
                        }
                        
                }
+
                return $activity;
        }
        
@@ -1104,17 +1108,9 @@
                $email = $org_info['email'];
                $description = $org_info['description'];
                $street = $org_info['street'];
-               $zip = $org_info['zip'];
-               if($zip && strlen($zip) > 5)
-               {
-                       $zip_code = substr($zip,0,4);
-                       $city = substr($zip, 5);
-               }
-               else
-               {
-                       $zip_code = '';
-                       $city = '';
-               }
+               $streetnumber = $org_info['streetnumber'];
+               $zip_code = $org_info['zip'];
+               $city = $org_info['postaddress'];
                $district = $org_info['district'];
                $status = $org_info['status'];
                $original_org_id = $org_info['original_org_id'];
@@ -1129,8 +1125,9 @@
                $columns[] = 'email';
                $columns[] = 'description';
                $columns[] = 'address';
-               //$columns[] = 'zip_code';
-               //$columns[] = 'city';
+               $columns[] = 'addressnumber';
+               $columns[] = 'zip_code';
+               $columns[] = 'city';
                $columns[] = 'orgno';
                $columns[] = 'district';
                $columns[] = 'change_type';
@@ -1143,8 +1140,9 @@
                $values[] = "'{$email}'";
                $values[] = "'{$description}'";
                $values[] = "'{$street}'";
-               //$values[] = "'{$zip_code}'";
-               //$values[] = "'{$city}'";
+               $values[] = "'{$streetnumber}'";
+               $values[] = "'{$zip_code}'";
+               $values[] = "'{$city}'";
                $values[] = "'{$orgnr}'";
                $values[] = "'{$district}'";
                $values[] = "'{$status}'";
@@ -1344,58 +1342,23 @@
        
        function get_activities_for_update($org_id, $group = false)
        {
-               $activities = array();
+               $activity_ids = array();
                if($group)
                {
-                       $sql = "SELECT * FROM activity_activity WHERE new_org 
AND group_id={$org_id}";
+                       $sql = "SELECT id FROM activity_activity WHERE 
new_group AND group_id={$org_id}";
                }
                else
                {
-                       $sql = "SELECT * FROM activity_activity WHERE new_org 
AND organization_id={$org_id}";
+                       $sql = "SELECT id FROM activity_activity WHERE new_org 
AND organization_id={$org_id}";
                }
-               //var_dump($sql);
+
                $this->db->query($sql, __LINE__, __FILE__);
                while ($this->db->next_record())
-               {                       
-                       $activity = new activitycalendar_activity((int) 
$this->db->f('id'));
-
-                       
$activity->set_title($this->unmarshal($this->db->f('title'), 'string'));
-                       
$activity->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
-                       
$activity->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
-                       
$activity->set_district($this->unmarshal($this->db->f('district'), 'string'));
-                       
$activity->set_office($this->unmarshal($this->db->f('office'), 'int'));
-                       
$activity->set_category($this->unmarshal($this->db->f('category'), 'int'));
-                       
$activity->set_state($this->unmarshal($this->db->f('state'), 'int'));
-                       
$activity->set_target($this->unmarshal($this->db->f('target'), 'string'));
-                       
$activity->set_description($this->unmarshal($this->db->f('description'), 
'string'));
-                       
$activity->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
-                       
$activity->set_internal_arena($this->unmarshal($this->db->f('internal_arena'), 
'string'));
-                       
$activity->set_time($this->unmarshal($this->db->f('time'), 'string'));
-                       
$activity->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
-                       
$activity->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
-                       
$activity->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
-                       
$activity->set_contact_person_2_address($this->unmarshal($this->db->f('contact_person_2_address'),
 'string'));
-                       
$activity->set_contact_person_2_zip($this->unmarshal($this->db->f('contact_person_2_zip'),
 'string'));
-                       
$activity->set_frontend($this->unmarshal($this->db->f('frontend', 'bool')));
-                       
$activity->set_new_org($this->unmarshal($this->db->f('new_org', 'bool')));
-                       
-                       if($activity->get_group_id() && 
$activity->get_group_id() > 0)
-                       {
-                               $contacts = 
activitycalendar_sogroup::get_instance()->get_contacts($activity->get_group_id());
-                               $activity->set_contact_persons($contacts);
-                               $org_tmp = 
activitycalendar_sogroup::get_instance()->get_orgid_from_group($activity->get_group_id());
-                               $activity->set_organization_id($org_tmp);
-                       }
-                       else if($activity->get_organization_id() && 
$activity->get_organization_id() > 0)
-                       {
-                               $contacts = 
activitycalendar_soorganization::get_instance()->get_contacts($activity->get_organization_id());
-                               $activity->set_contact_persons($contacts);
-                       }
-                       
-                       $activities[] = $activity;
+               {
+                   $activity_ids[] = $this->db->f('id');
                }
                
-               return $activities;
+               return $activity_ids;
        }
        
        function get_connected_activities($org_id)

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2012-08-06 12:25:59 UTC (rev 9833)
@@ -127,6 +127,9 @@
                        $columns[] = 'arena.id';
                        $columns[] = 'arena.arena_name';
                        $columns[] = 'arena.address';
+                       $columns[] = 'arena.addressnumber';
+                       $columns[] = 'arena.zip_code';
+                       $columns[] = 'arena.city';
                        $columns[] = 'arena.internal_arena_id';
                        $columns[] = 'arena.active';
                        
@@ -158,6 +161,9 @@
 
                        
$arena->set_arena_name($this->unmarshal($this->db->f('arena_name'), 'string'));
                        
$arena->set_address($this->unmarshal($this->db->f('address'), 'string'));
+                       
$arena->set_addressnumber($this->unmarshal($this->db->f('addressnumber'), 
'string'));
+                       
$arena->set_zip_code($this->unmarshal($this->db->f('zip_code'), 'string'));
+                       $arena->set_city($this->unmarshal($this->db->f('city'), 
'string'));
                        
$arena->set_internal_arena_id($this->unmarshal($this->db->f('internal_arena_id'),
 'int'));
                        
$arena->set_active($this->unmarshal($this->db->f('active'), 'bool'));
                }
@@ -259,6 +265,9 @@
                $values = array(
                        'arena_name = '         . 
$this->marshal($arena->get_arena_name(), 'string'),
                        'address = '     . 
$this->marshal($arena->get_address(), 'string'),
+               'addressnumber = '     . 
$this->marshal($arena->get_addressnumber(), 'string'),
+               'zip_code = '     . $this->marshal($arena->get_zip_code(), 
'string'),
+               'city = '     . $this->marshal($arena->get_city(), 'string'),
                        'internal_arena_id =  '     . 
$this->marshal($arena->get_internal_arena_id(), 'int'),
                        'active = '     . $this->marshal(($arena->is_active() ? 
'true' : 'false'), 'bool'),
                );

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2012-08-06 12:25:59 UTC (rev 9833)
@@ -87,9 +87,9 @@
                if(isset($filters['new_groups'])){
                        $use_local_group = true;
                        unset($filter_clauses);
-                       $filter_clauses[] = "activity_group.change_type = 'new' 
OR activity_group.change_type = 'change' ";
-                       if(isset($filters[$this->get_id_field_name()])){
-                               $id = 
$this->marshal($filters[$this->get_id_field_name()],'int');
+                       $filter_clauses[] = "(activity_group.change_type = 
'new' OR activity_group.change_type = 'change') ";
+                       if(isset($filters['group_id'])){
+                               $id = 
$this->marshal($filters['group_id'],'int');
                                $filter_clauses[] = "activity_group.id = {$id}";
                        }
                }
@@ -115,6 +115,7 @@
                                $columns[] = 'activity_group.organization_id';
                                $columns[] = 'activity_group.change_type';
                                $columns[] = 'activity_group.transferred';
+                               $columns[] = 'activity_group.original_group_id';
                                
                                $dir = $ascending ? 'ASC' : 'DESC';
                                $order = "ORDER BY activity_group.id $dir";
@@ -177,18 +178,92 @@
        {
                return false;
        }
-
+       
+       function update_group_description($group_id, $desc)
+       {
+               $sql = "UPDATE bb_group SET description={$desc} WHERE 
ID={$group_id}";
+       $result = $this->db->query($sql, __LINE__, __FILE__);
+               if(isset($result))
+               {
+                       return true;
+               }
+               else
+               {
+                       return false;
+               }
+       }
+       
+       function update_group_contact($contact)
+       {
+           $id=intval($contact['id']);
+           $name=$contact['name'];
+           $phone=$contact['phone'];
+           $mail=$contact['mail'];
+           
+           $sql = "UPDATE bb_group_contact SET NAME='{$name}, 
PHONE='{$phone}', EMAIL='{$mail}' WHERE id={$id}";
+           $result = $this->db->query($sql, __LINE__, __FILE__);
+               if(isset($result))
+               {
+                       return true;
+               }
+               else
+               {
+                       return false;
+               }
+       }
+       
+    function add_group_contact_local($contact)
+       {
+               $name = $contact['name'];
+               $phone = $contact['phone'];
+               $mail = $contact['mail'];
+               $original_id = $contact['original_id'];
+               $group_id = $contact['group_id'];
+               
+               $columns[] = 'name';
+               $columns[] = 'phone';
+               $columns[] = 'email';
+               $columns[] = 'organization_id';
+               $columns[] = 'group_id';
+               $columns[] = 'address';
+               $columns[] = 'zipcode'; 
+               $columns[] = 'city';
+               $columns[] = 'original_id';
+               $cols = implode(',',$columns);
+               
+               $values[] = "'{$name}'";
+               $values[] = "'{$phone}'";
+               $values[] = "'{$mail}'";
+               $values[] = "''";
+               $values[] = $group_id;
+               $values[] = "''";
+               $values[] = "''";
+               $values[] = "''";
+               $values[] = $original_id;
+               $vals = implode(',',$values);
+               
+               //var_dump("INSERT INTO activity_contact_person ({$cols}) 
VALUES ({$vals})");
+               $sql = "INSERT INTO activity_contact_person ({$cols}) VALUES 
({$vals})";
+       $result = $this->db->query($sql, __LINE__, __FILE__);
+               return isset($result);
+       }
+       
        public function get_id_field_name($extended_info = false)
        {
                if(!$extended_info)
                {
-                       $ret = 'id';
+                       $ret = array
+                       (
+                               'table'                 => 'activity_group', // 
alias
+                               'field'                 => 'id',
+                               'translated'    => 'id'
+                       );
                }
                else
                {
                        $ret = array
                        (
-                               'table'                 => 'group', // alias
+                               'table'                 => 'activity_group', // 
alias
                                'field'                 => 'id',
                                'translated'    => 'id'
                        );
@@ -238,6 +313,20 @@
                return $result;
        }
        
+       function get_orgid_from_group_local($group_id)
+       {
+               $result = 0;
+       if(isset($group_id)){
+               $q1="SELECT organization_id FROM activity_group WHERE 
id={$group_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('organization_id');
+                       }
+       }
+               
+               return $result;
+       }
+       
        function get_contacts($group_id)
        {
                $contacts = array();
@@ -347,6 +436,7 @@
                        
$group->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'), 
'int'));
                        
$group->set_change_type($this->unmarshal($this->db->f('change_type'), 
'string'));
                        
$group->set_transferred($this->unmarshal($this->db->f('transferred'), 'bool'));
+                       
$group->set_original_group_id($this->unmarshal($this->db->f('original_group_id'),
 'int'));
                }
                return $group;
        }
@@ -383,7 +473,7 @@
                $name = $group_info['name'];
                $orgid = $group_info['organization_id'];
                $description = $group_info['description'];
-               $activity_id = 0;
+               $activity_id = 1;
                $show_in_portal = 1; 
                
                $columns[] = 'name';
@@ -396,7 +486,7 @@
                $values[] = "'{$name}'";
                $values[] = "'{$description}'";
                $values[] = "'{$orgid}'";
-               $values[] = $this->marshal($activity_id, 'int');
+               $values[] = $activity_id;
                $values[] = $show_in_portal;
                $vals = implode(',',$values);
                
@@ -420,6 +510,7 @@
                $columns[] = 'activity_group.organization_id';
                $columns[] = 'activity_group.change_type';
                $columns[] = 'activity_group.transferred';
+               $columns[] = 'activity_group.original_group_id';
                
                $dir = $ascending ? 'ASC' : 'DESC';
                $order = "ORDER BY activity_group.id $dir";
@@ -429,9 +520,9 @@
                
                $sql = "SELECT {$cols} FROM {$table} WHERE 
activity_group.id={$g_id}";
                $result = $this->db->query($sql, __LINE__, __FILE__);
-               if(isset($result))
+               while($this->db->next_record())
                {
-                       $group = new activitycalendar_group((int) $group_id);
+                       $group = new activitycalendar_group((int) $g_id);
 
                        $group->set_name($this->unmarshal($this->db->f('name'), 
'string'));
                        
$group->set_organization_id($this->unmarshal($this->db->f('organization_id'), 
'int'));
@@ -440,6 +531,7 @@
                        
$group->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'), 
'int'));
                        
$group->set_change_type($this->unmarshal($this->db->f('change_type'), 
'string'));
                        
$group->set_transferred($this->unmarshal($this->db->f('transferred'), 'bool'));
+                       
$group->set_original_group_id($this->unmarshal($this->db->f('original_group_id'),
 'int'));
                        
                        return $group;
                }

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2012-08-06 12:25:59 UTC (rev 9833)
@@ -216,7 +216,8 @@
        {
                $result = "Ingen";
        if(isset($org_id)){
-               $q1="SELECT name FROM bb_organization WHERE id={$org_id}";
+               $org_id = intval($org_id);
+           $q1="SELECT name FROM bb_organization WHERE id={$org_id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
                                $result = $this->db->f('name');
@@ -510,6 +511,9 @@
                $email = $organization->get_email();
                $description = $organization->get_description();
                $street = $organization->get_address();
+               $streetnumber = $organization->get_addressnumber();
+               $zip_code = $organization->set_zip_code();
+               $city = $organization->get_city();
                $district = $organization->get_district();
                $change_type = $organization->get_change_type();
                $transferred = ($organization->get_transferred() == 1 || 
$organization->get_transferred() == true)?'true':'false';
@@ -521,6 +525,9 @@
                $values[] = "EMAIL='{$email}'";
                $values[] = "DESCRIPTION='{$description}'";
                $values[] = "ADDRESS='{$street}'";
+               $values[] = "ADDRESSNUMBER='{$streetnumber}'";
+               $values[] = "ZIP_CODE='{$zip_code}'";
+               $values[] = "CITY='{$city}'";
                $values[] = "ORGNO='{$orgnr}'";
                $values[] = "DISTRICT='{$district}'";
                $values[] = "CHANGE_TYPE='{$change_type}'";
@@ -566,7 +573,10 @@
 
                        
$organization->set_name($this->unmarshal($this->db->f('name'), 'string'));
                        
$organization->set_organization_number($this->unmarshal($this->db->f('organization_number'),
 'int'));
-                       
$organization->set_address($this->unmarshal($this->db->f('address'), 
'string').','.$this->unmarshal($this->db->f('zip_code'), 'string').' 
'.$this->unmarshal($this->db->f('city'), 'string'));
+                       
$organization->set_address($this->unmarshal($this->db->f('address'), 'string'));
+                       
$organization->set_addressnumber($this->unmarshal($this->db->f('addressnumber'),
 'string'));
+                       
$organization->set_zip_code($this->unmarshal($this->db->f('zip_code'), 
'string'));
+                       
$organization->set_city($this->unmarshal($this->db->f('city'), 'string'));
                        
$organization->set_phone($this->unmarshal($this->db->f('phone'), 'string'));
                        
$organization->set_email($this->unmarshal($this->db->f('email'), 'string'));
                        
$organization->set_homepage($this->unmarshal($this->db->f('homepage'), 
'string'));
@@ -589,17 +599,9 @@
                $email = $organization->get_email();
                $description = $organization->get_description();
                $street = $organization->get_address();
-/*             $zip = $organization->get_();
-               if($zip && strlen($zip) > 5)
-               {
-                       $zip_code = substr($zip,0,4);
-                       $city = substr($zip, 5);
-               }
-               else
-               {
-                       $zip_code = '';
-                       $city = '';
-               }*/
+               $streetnumber = $organization->get_address_number();
+               $zip_code = $organization->get_zip_code();
+               $city = $organization->get_city();
                $district = $organization->get_district();
                if($organization->get_original_org_id() && 
$organization->get_original_org_id() != '')
                {
@@ -616,9 +618,10 @@
                $values[] = "PHONE='{$phone}'";
                $values[] = "EMAIL='{$email}'";
                $values[] = "DESCRIPTION='{$description}'";
-               $values[] = "STREET='{$street}'";
-               //$values[] = "'{$zip_code}'";
-               //$values[] = "'{$city}'";
+               $values[] = "ADDRESS='{$street}'";
+               $values[] = "ADDRESSNUMBER='{$streetnumber}'";
+               $values[] = "ZIP_CODE='{$zip_code}'";
+               $values[] = "CITY='{$city}'";
                $values[] = "ORGNO='{$orgnr}'";
                $values[] = "DISTRICT='{$district}'";
                $values[] = "ORIGINAL_ORG_ID={$original_org_id}";
@@ -645,20 +648,13 @@
                $phone = $org_info['phone'];
                $email = $org_info['email'];
                $description = $org_info['description'];
-               $street = $org_info['street'];
-               $zip = $org_info['zip'];
-               if($zip && strlen($zip) > 5)
-               {
-                       $zip_code = substr($zip,0,5);
-                       $city = substr($zip, 5);
-               }
-               else
-               {
-                       $zip_code = '';
-                       $city = '';
-               }
+               $street_1 = $org_info['street'];
+               $street_2 = $org_info['streetnumber'];
+               $street = $street_1 . ' ' . $street_2;
+               $zip_code = $org_info['zip'];
+               $city = $org_info['postaddress'];
                $district = $org_info['district'];
-               $activity_id = $org_info['activity_id'];
+               $activity_id = 1;
                $show_in_portal = 1; 
                
                $columns[] = 'name';
@@ -713,6 +709,9 @@
                        
$organization->set_name($this->unmarshal($this->db->f('name'), 'string'));
                        
$organization->set_organization_number($this->unmarshal($this->db->f('organization_number'),
 'int'));
                        
$organization->set_address($this->unmarshal($this->db->f('address'), 'string'));
+                       
$organization->set_addressnumber($this->unmarshal($this->db->f('addressnumber'),
 'string'));
+                       
$organization->set_zip_code($this->unmarshal($this->db->f('zip_code'), 
'string'));
+                       
$organization->set_city($this->unmarshal($this->db->f('city'), 'string'));
                        
$organization->set_phone($this->unmarshal($this->db->f('phone'), 'string'));
                        
$organization->set_email($this->unmarshal($this->db->f('email'), 'string'));
                        
$organization->set_homepage($this->unmarshal($this->db->f('homepage'), 
'string'));
@@ -751,22 +750,13 @@
                {
                        $description = '';
                }
-               $street = $org_info['street'];
+               $street = $org_info['street'] . ' ' . $org_info['streetnumber'];
                if(!$street)
                {
                        $street = '';
                }
-               $zip = $org_info['zip'];
-               if($zip && strlen($zip) > 5)
-               {
-                       $zip_code = substr($zip,0,4);
-                       $city = substr($zip, 5);
-               }
-               else
-               {
-                       $zip_code = '';
-                       $city = '';
-               }
+               $zip_code = $org_info['zip_code'];
+               $city = $org_info['city'];
                $district = $org_info['district'];
                if(!$district)
                {

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2012-08-06 12:25:59 UTC (rev 9833)
@@ -9,6 +9,12 @@
 
 class activitycalendar_uiactivities extends activitycalendar_uicommon
 {
+    protected $so_org;
+       protected $so_group;
+       protected $so_contact;
+       protected $so_activity;
+       protected $so_arena;
+
        public $public_functions = array
        (
                'index'                 => true,
@@ -27,6 +33,11 @@
                parent::__construct();
                $this->bo_org = CreateObject('booking.boorganization');
                $this->bo_group = CreateObject('booking.bogroup');
+               $this->so_org = activitycalendar_soorganization::get_instance();
+               $this->so_group = activitycalendar_sogroup::get_instance();
+               $this->so_contact = 
activitycalendar_socontactperson::get_instance();
+               $this->so_activity = 
activitycalendar_soactivity::get_instance();
+               $this->so_arena = activitycalendar_soarena::get_instance();
                self::set_active_menu('activitycalendar::activities');
                $config = CreateObject('phpgwapi.config','activitycalendar');
                $config->read();
@@ -75,7 +86,7 @@
                $errorMsgs = array();
                $infoMsgs = array();
 
-               $activity = 
activitycalendar_soactivity::get_instance()->get_single((int)phpgw::get_var('id'));
+               $activity = 
$this->so_activity->get_single((int)phpgw::get_var('id'));
                $cancel_link = self::link(array('menuaction' => 
'activitycalendar.uiactivities.index'));
                $saved_OK = phpgw::get_var('saved_ok');
                if($saved_OK)
@@ -109,53 +120,67 @@
                $GLOBALS['phpgw_info']['flags']['app_header'] .= 
'::'.lang('edit');
                // Get the contract part id
                $activity_id = (int)phpgw::get_var('id');
-               $so_activity = activitycalendar_soactivity::get_instance();
-               $so_arena = activitycalendar_soarena::get_instance();
-               $so_org = activitycalendar_soorganization::get_instance();
-               //var_dump($activity_id);
                $cancel_link = self::link(array('menuaction' => 
'activitycalendar.uiactivities.index'));
-               $categories = $so_activity->get_categories();
-               $targets = $so_activity->get_targets();
-               $offices = $so_activity->select_district_list();
-               $districts = $so_activity->get_districts();
-               $buildings = $so_arena->get_buildings();
-                               
+               $categories = $this->so_activity->get_categories();
+               $targets = $this->so_activity->get_targets();
+               $offices = $this->so_activity->select_district_list();
+               $districts = $this->so_activity->get_districts();
+               $buildings = $this->so_arena->get_buildings();
                // Retrieve the activity object or create a new one
                if(isset($activity_id) && $activity_id > 0)
                {       
-                       $activity = $so_activity->get_single($activity_id); 
+                       $activity = 
$this->so_activity->get_single($activity_id); 
                }
                else
                {
                        $activity = new activitycalendar_activity();
                }
+               $new_group = $activity->get_new_group();
                $g_id = phpgw::get_var('group_id');
                $o_id = phpgw::get_var('organization_id');
-               if(isset($g_id) && $g_id > 0)
+               if($new_group)
                {
-                       $persons = 
activitycalendar_sogroup::get_instance()->get_contacts($g_id);
-                       $desc = 
activitycalendar_sogroup::get_instance()->get_description($g_id);
+                   $persons = 
$this->so_group->get_contacts_local($activity->get_group_id());
+                       $desc = 
$this->so_group->get_description_local($activity->get_group_id());
                }
+               else if(isset($g_id) && $g_id > 0)
+               {
+                       $persons = $this->so_group->get_contacts($g_id);
+                       $desc = $this->so_group->get_description($g_id);
+               }
                else if(isset($o_id) && $o_id > 0)
                {
-                       $persons = $so_org->get_contacts($o_id);
-                       $desc = $so_org->get_description($o_id);
+                       $persons = $this->so_org->get_contacts($o_id);
+                       $desc = $this->so_org->get_description($o_id);
                }
                
                if(strlen($desc) > 254)
                {
                        $desc = substr($desc,0,254);
                }
-               $arenas = $so_arena->get(null, null, 'arena.arena_name', true, 
null, null, null);
+               $arenas = $this->so_arena->get(null, null, 'arena.arena_name', 
true, null, null, null);
                if($activity->get_new_org())
                {
-                       $org_name = 
$so_org->get_organization_name_local($activity->get_organization_id());
+                       $org_name = 
$this->so_org->get_organization_name_local($activity->get_organization_id());
                }
                else
                {
-                       $organizations = $so_org->get(null, null, 'org.name', 
true, null, null, null);
+                       $organizations = $this->so_org->get(null, null, 
'org.name', true, null, null, null);
                }
-               $groups = activitycalendar_sogroup::get_instance()->get(null, 
null, null, null, null, null, null);
+               if($new_group)
+               {
+                   $group_array = $this->so_group->get(null, null, null, null, 
null, null, array('group_id' => $activity->get_group_id(), 'new_groups' => 
'true'));
+                   //var_dump($group_array);
+               if(count($group_array) > 0){
+                       $keys = array_keys($group_array);
+                       $local_group = $group_array[$keys[0]];
+                       //$group_name = $local_group->get_name();
+               }  
+               }
+               else
+               {
+                   $groups = $this->so_group->get(null, null, null, null, 
null, null, null);
+               }
 
                if(isset($_POST['save_activity'])) // The user has pressed the 
save button
                {
@@ -163,7 +188,6 @@
                        {
                                $old_state = $activity->get_state();
                                $new_state = phpgw::get_var('state');
-                               
                                // ... set all parameters
                                $activity->set_title(phpgw::get_var('title'));
                                
$activity->set_organization_id(phpgw::get_var('organization_id'));
@@ -206,8 +230,67 @@
                                
                                if($target_ok && $district_ok)
                                {
-                                       if($so_activity->store($activity)) // 
... and then try to store the object
+                                       
if($this->so_activity->store($activity)) // ... and then try to store the object
                                        {
+                                       if($new_group && $new_state == 3)
+                                   {
+                                       //transfer group to booking
+                                           $group_array = 
$this->so_group->get(null, null, null, null, null, null, array('group_id' => 
$activity->get_group_id(), 'new_groups' => 'true'));
+                                       if(count($group_array) > 0){
+                                           $keys = array_keys($group_array);
+                                               $group = $group_array[$keys[0]];
+                                       } 
+                                       
+                                           $group_info = array();
+                                           $group_info['name'] = 
$group->get_name(); //new
+                                           $group_info['organization_id'] = 
$activity->get_organization_id(); 
+                                           $group_info['description'] = 
$group->get_description();
+                                           
+                                           $contacts = 
$this->so_contact->get_local_contact_persons($group->get_id(), true);
+                                           $contact_1 = $contacts[0];
+    
+                                       $new_group_id = 
$this->so_group->transfer_group($group_info);
+                                           if($new_group_id)
+                                       {
+                                               //update activity with new org 
id
+                                               //add contact persons to booking
+                                               $contact1 = array();
+                                               $contact1['name'] = 
$contact_1->get_name();
+                                               $contact1['phone'] = 
$contact_1->get_phone();
+                                               $contact1['mail'] = 
$contact_1->get_email();
+                                               $contact1['group_id'] = 
$new_group_id;
+                                               
$this->so_activity->add_contact_person_group($contact1);
+                                               
+                                               $message = 
lang('messages_saved_form'); 
+                                               
+                                               //get organization_id for the 
group:
+                                               $group_org_id = 
$this->so_group->get_orgid_from_group($new_group_id);
+                                               
+                                               //get affected activities and 
update with new org id
+                                               $update_activities = 
$this->so_activity->get_activities_for_update($group->get_id(), true);
+
+                                               foreach($update_activities as 
$act_id)
+                                               {
+                                                   $act = 
$this->so_activity->get_single($act_id);
+                                                       
$act->set_organization_id($group_org_id);
+                                                       
$act->set_group_id($new_group_id);
+                                                       
$act->set_new_org(false);
+                                                       
$act->set_new_group(false);
+                                                       
$this->so_activity->store($act);
+                                               }
+                                               
+                                               //set local group as stored
+                                               
$group->set_change_type('added');
+                                               $group->set_transferred(true);
+    
+                                               
$this->so_group->update_local($group);
+                                               $message = 
lang('messages_saved_form');
+                                               //var_dump($new_group_id);
+                                               $contact_persons = 
$this->so_contact->get_booking_contact_persons($new_group_id, true);
+                                               //var_dump(2);
+                                       $cp1 = $contact_persons[0];
+                                   }
+                                   }
                                                $message = 
lang('messages_saved_form'); 
                                        }
                                        else
@@ -217,7 +300,7 @@
        
                                        if($new_state == 3 || $new_state == 5 )
                                        {
-                                               $kontor = 
$so_activity->get_office_name($activity->get_office());
+                                               $kontor = 
$this->so_activity->get_office_name($activity->get_office());
                                                $subject = 
lang('mail_subject_update');
                                                $body = lang('mail_body_state_' 
. $new_state, $kontor);
                                                
@@ -250,6 +333,7 @@
                                                        'organizations' => 
$organizations,
                                                        'org_name' => $org_name,
                                                        'groups' => $groups,
+                                                   'local_group' => 
$local_group,
                                                        'arenas' => $arenas,
                                                        'buildings' => 
$buildings,
                                                        'categories' => 
$categories,
@@ -271,6 +355,7 @@
                        $error = lang('org_not_transferred');
                        $editable = false;
                }
+               //var_dump($local_group);
 
                return $this->render('activity.php', array
                        (
@@ -278,6 +363,7 @@
                                'organizations' => $organizations,
                                'org_name' => $org_name,
                                'groups' => $groups,
+                               'local_group' => $local_group,
                                'arenas' => $arenas,
                                'buildings' => $buildings,
                                'categories' => $categories,

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2012-08-06 12:25:59 UTC (rev 9833)
@@ -118,7 +118,10 @@
                                // ... set all parameters
                                
$arena->set_internal_arena_id(phpgw::get_var('internal_arena_id'));
                                
$arena->set_arena_name(phpgw::get_var('arena_name'));
-                               $arena->set_address(phpgw::get_var('address') . 
' ' . phpgw::get_var('address_no'));
+                               $arena->set_address(phpgw::get_var('address'));
+                               
$arena->set_addressnumber(phpgw::get_var('address_no'));
+                               
$arena->set_zip_code(phpgw::get_var('zip_code'));
+                               $arena->set_city(phpgw::get_var('city'));
                                
$arena->set_active(phpgw::get_var('arena_active') == 'yes' ? true : false);
                                
                                
if(activitycalendar_soarena::get_instance()->store($arena)) // ... and then try 
to store the object

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2012-08-06 12:25:59 UTC (rev 9833)
@@ -81,7 +81,7 @@
                unset($org_info);
                unset($contact1);
                unset($contact2);
-               if($type)
+/*             if($type)
                {
                        $sogroup = activitycalendar_sogroup::get_instance();
                        $soactivity = 
activitycalendar_soactivity::get_instance();
@@ -172,7 +172,6 @@
                                        
                                        //get affected activities and update 
with new org id
                                        $update_activities = 
$soactivity->get_activities_for_update($id, true);
-                                       var_dump($update_activities);
                                        foreach($update_activities as $act)
                                        {
                                                
$act->set_organization_id($group_org_id);
@@ -217,7 +216,7 @@
                        
                }
                else
-               {
+               {*/
                        //var_dump('org');
                        $so_org = 
activitycalendar_soorganization::get_instance();
                        $so_activity = 
activitycalendar_soactivity::get_instance();
@@ -230,7 +229,7 @@
                        //var_dump($org);
                        $districts = $so_activity->get_districts();
                        
-                       if(isset($_POST['save_organization'])) // The user has 
pressed the save button
+/*                     if(isset($_POST['save_organization'])) // The user has 
pressed the save button
                        {
                                
$org->set_organization_number(phpgw::get_var('orgno'));
                                
$org->set_district(phpgw::get_var('org_district'));
@@ -268,7 +267,8 @@
                                }
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uiorganization.show', 'id' => 
$org->get_id(), 'saved_ok' => 'yes'));
                        }
-                       else if(isset($_POST['store_organization'])) // The 
user has pressed the store button
+                       else*/
+                       if(isset($_POST['store_organization'])) // The user has 
pressed the store button
                        {
                                $orgno = phpgw::get_var('orgno');
                                $district = phpgw::get_var('org_district');
@@ -334,8 +334,9 @@
                                        //get affected activities and update 
with new org id
                                        $update_activities = 
$so_activity->get_activities_for_update($id);
                                        //var_dump($update_activities);
-                                       foreach($update_activities as $act)
+                                       foreach($update_activities as $act_id)
                                        {
+                                           $act = 
$so_activity->get_single($act_id);
                                                
$act->set_organization_id($new_org_id);
                                                $act->set_new_org(false);
                                                $so_activity->store($act);
@@ -441,7 +442,7 @@
                        );
                        
                        return $this->render('organization.php', $data);
-               }
+//             }
        }
        
        public function show()
@@ -451,7 +452,7 @@
                $type = phpgw::get_var('type');
                $cancel_link = self::link(array('menuaction' => 
'activitycalendar.uiorganization.changed_organizations'));
                $socontact = activitycalendar_socontactperson::get_instance();
-               if($type)
+/*             if($type)
                {
                        if(isset($_POST['edit_group'])) // The user has pressed 
the save button
                        {
@@ -488,7 +489,7 @@
                        return $this->render('group.php', $data);
                }
                else
-               {
+               {*/
                        //var_dump('org');
                        if(isset($_POST['edit_organization'])) // The user has 
pressed the save button
                        {
@@ -523,7 +524,7 @@
                        );
                        
                        return $this->render('organization.php', $data);
-               }
+               //}
        }
        
        

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2012-08-06 12:25:59 UTC (rev 9833)
@@ -32,6 +32,7 @@
                protected $internal_arena;
                protected $frontend;
                protected $new_org;
+               protected $new_group;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -229,6 +230,14 @@
                
                public function get_new_org() { return $this->new_org; }
                
+               public function set_new_group(bool $new_group)
+               {
+                       $this->new_group = (bool)$new_group;
+               }
+               
+               public function get_new_group() { return $this->new_group; }
+               
+               
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 
@@ -245,15 +254,23 @@
                
                public function serialize()
                {
+                   $so_org = activitycalendar_soorganization::get_instance();
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        if(isset($this->group_id) && $this->get_group_id() > 0)
                        {
-                               if($this->get_new_org())
+                               if($this->get_new_group())
                                {
                                        $group_name = 
activitycalendar_sogroup::get_instance()->get_group_name_local($this->get_group_id());
                                        
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_local_contact_persons($this->get_group_id(),
 true));
                                        $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_1()->get_id());
-                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_2()->get_id());
+                                       if($this->get_contact_person_2())
+                                       {
+                                           $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_2()->get_id());
+                                       }
+                                       else
+                                       {
+                                           $contact_2  = null;
+                                       }
                                        $desc = 
activitycalendar_sogroup::get_instance()->get_description_local($this->get_group_id());
                                }
                                else
@@ -261,10 +278,26 @@
                                        $group_name = 
activitycalendar_sogroup::get_instance()->get_group_name($this->get_group_id());
                                        
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_booking_contact_persons($this->get_group_id(),
 true));
                                        $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name($this->get_contact_person_1()->get_id());
-                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name($this->get_contact_person_2()->get_id());
+                                       if($this->get_contact_person_2())
+                                       {
+                                           $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name($this->get_contact_person_2()->get_id());
+                                       }
+                                       else
+                                       {
+                                           $contact_2  = null;
+                                       }
                                        $desc = 
activitycalendar_sogroup::get_instance()->get_description($this->get_group_id());
                                }
-                               $org_name = 
activitycalendar_soorganization::get_instance()->get_organization_name($this->get_organization_id());
+                               $o_id = $this->get_organization_id(); 
+                               if($this->get_new_org())
+                               {
+                                   $org_name = 
$so_org->get_organization_name_local($o_id);
+                               }
+                               else
+                               {
+                                   $org_name = 
$so_org->get_organization_name($o_id);
+                               }
+                               
                        }
                        else if(isset($this->organization_id) && 
$this->get_organization_id() > 0)
                        {
@@ -273,7 +306,14 @@
                                        $org_name = 
activitycalendar_soorganization::get_instance()->get_organization_name_local($this->get_organization_id());
                                        
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_local_contact_persons($this->get_organization_id()));
                                        $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_1()->get_id());
-                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_2()->get_id());
+                                       if($this->get_contact_person_2())
+                                       {
+                                           $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_2()->get_id());
+                                       }
+                                       else
+                                       {
+                                           $contact_2  = null;
+                                       }
                                        $desc = 
activitycalendar_soorganization::get_instance()->get_description_local($this->get_organization_id());
                                }
                                else
@@ -281,7 +321,14 @@
                                        $org_name = 
activitycalendar_soorganization::get_instance()->get_organization_name($this->get_organization_id());
                                        
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_booking_contact_persons($this->get_organization_id()));
                                        $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_1()->get_id());
-                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_2()->get_id());
+                                       if($this->get_contact_person_2())
+                                       {
+                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_2()->get_id());
+                               }
+                                       else
+                                       {
+                                           $contact_2  = null;
+                                       }
                                        $desc = 
activitycalendar_soorganization::get_instance()->get_description($this->get_organization_id());
                                }
                        } 

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php  
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/model/class.arena.inc.php  
2012-08-06 12:25:59 UTC (rev 9833)
@@ -10,6 +10,9 @@
                protected $arena_name;
                protected $internal_arena_id;
                protected $address;
+               protected $addressnumber;
+               protected $zip_code;
+               protected $city;
                protected $reference;
                protected $active;
                
@@ -68,6 +71,36 @@
                {
                        return $this->address;
                }
+               
+           public function set_addressnumber($addressnumber)
+               {
+                       $this->addressnumber = $addressnumber;
+               }
+       
+               public function get_addressnumber()
+               {
+                       return $this->addressnumber;
+               }
+               
+           public function set_zip_code($zip_code)
+               {
+                       $this->zip_code = $zip_code;
+               }
+       
+               public function get_zip_code()
+               {
+                       return $this->zip_code;
+               }
+               
+           public function set_city($city)
+               {
+                       $this->city = $city;
+               }
+       
+               public function get_city()
+               {
+                       return $this->city;
+               }
 
                /**
                 * Get a static reference to the storage object associated with 
this model object
@@ -89,6 +122,9 @@
                                'id' => $this->get_id(),
                                'arena_name' => $this->get_arena_name(),
                                'address' => $this->get_address(),
+                           'addressnumber' => $this->get_addressnumber(),
+                           'zip_code' => $this->get_zip_code(),
+                           'city' => $this->get_city(),
                                'active' => 
($this->is_active())?'Aktiv':'Inaktiv'
                        );
                }

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.group.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/model/class.group.inc.php  
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/inc/model/class.group.inc.php  
2012-08-06 12:25:59 UTC (rev 9833)
@@ -13,6 +13,7 @@
                protected $shortname;
                protected $change_type;
                protected $transferred;
+               protected $original_group_id;
                
                /**
                 * Constructor.  Takes an optional ID.  If a organization is 
created from outside
@@ -81,6 +82,13 @@
                
                public function get_transferred() { return $this->transferred; }
                
+           public function set_original_group_id($original_group_id)
+               {
+                       $this->original_group_id = $original_group_id;
+               }
+               
+               public function get_original_group_id() { return 
$this->original_group_id; }
+               
                public function serialize()
                {
                        return array(

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
   2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
   2012-08-06 12:25:59 UTC (rev 9833)
@@ -121,6 +121,36 @@
                
                public function get_original_org_id() { return 
$this->original_org_id; }
                
+           public function set_addressnumber($addressnumber)
+               {
+                       $this->addressnumber = $addressnumber;
+               }
+       
+               public function get_addressnumber()
+               {
+                       return $this->addressnumber;
+               }
+               
+           public function set_zip_code($zip_code)
+               {
+                       $this->zip_code = $zip_code;
+               }
+       
+               public function get_zip_code()
+               {
+                       return $this->zip_code;
+               }
+               
+           public function set_city($city)
+               {
+                       $this->city = $city;
+               }
+       
+               public function get_city()
+               {
+                       return $this->city;
+               }
+               
                public function serialize()
                {
                        $so_org = 
activitycalendar_soorganization::get_instance();
@@ -134,6 +164,9 @@
                                'email' =>      $this->get_email(),
                                'phone' =>      $this->get_phone(),
                                'address'       =>      $this->get_address(),
+                           'addressnumber'     =>      
$this->get_addressnumber(),
+                           'zip_code'  =>      $this->get_zip_code(),
+                           'city'      =>      $this->get_city(),
                                'show_in_portal' => $this->get_show_in_portal(),
                                'change_type' => lang($this->get_change_type()),
                                'transferred' => $this->get_transferred(),

Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -398,7 +398,7 @@
 inactive_arena activitycalendar        no      Inaktiv
 change_type    activitycalendar        no      Endringstype
 added  activitycalendar        no      Lagt til i organisasjonsregisteret
-store  activitycalendar        no      Overfør til organisasjonsregister
+store  activitycalendar        no      Lagre til organisasjonsregisteret
 back   activitycalendar        no      Tilbake
 arena_saved_form       activitycalendar        no      Arena ble lagret
 activity_saved_form    activitycalendar        no      Aktiviteten ble lagret
@@ -434,4 +434,4 @@
 edit_contact_info_org  activitycalendar        no      Gå til 
organisasjonsopplysninger
 edit_contact_info_group        activitycalendar        no      Gå til 
gruppeopplysninger
 arena_helptext activitycalendar        no      I feltet Navn skal det stå navn 
på arena, som det heter på folkemunne.<br/>Når du redigerer feltet 
besøksadresse, gjøres det automatisk oppslag i gatetabellen, dette for å sikre 
at adresser skrives riktig, og kan kobles mot kart.<br/>Når du har funnet rett 
gateadresse , gå til feltet Husnummer og legg inn husnummer.<br/>Trykk lagre.
-org_not_transferred    activitycalendar        no      Organisasjonen/gruppen 
som aktiviteten er tilknyttet er ikke overført til 
organisasjonsregisteret.<br/>Før aktiviteten kan redigeres, må denne overføres.
\ No newline at end of file
+org_not_transferred    activitycalendar        no      Organisasjonen som 
aktiviteten er tilknyttet er ikke overført til organisasjonsregisteret.<br/>Før 
aktiviteten kan redigeres, må denne overføres.
\ No newline at end of file

Modified: branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['activitycalendar']['name'] = 'activitycalendar';
-       $setup_info['activitycalendar']['version'] = '0.1.8';
+       $setup_info['activitycalendar']['version'] = '0.1.11';
        $setup_info['activitycalendar']['app_order'] = 60;
        $setup_info['activitycalendar']['enable'] = 1;
        $setup_info['activitycalendar']['app_group']    = 'office';
@@ -30,7 +30,7 @@
 
        $setup_info['activitycalendar']['depends'][] = array(
                'appname' => 'booking',
-               'versions' => array('0.2.05','0.2.06','0.2.07','0.2.08')
+               'versions' => 
array('0.2.05','0.2.06','0.2.07','0.2.08','0.2.09')
        );
 
        $setup_info['activitycalendar']['depends'][] = array(

Modified: 
branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php   
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php   
2012-08-06 12:25:59 UTC (rev 9833)
@@ -24,7 +24,8 @@
                                'contact_person_2_address' => array('type' => 
'varchar','precision' => '255'),
                                'contact_person_2_zip' => array('type' => 
'varchar','precision' => '255'),
                                'frontend' => array('type' => 'bool','nullable' 
=> true,'default' => 'false'),
-                               'new_org' => array('type' => 'bool','nullable' 
=> true,'default' => 'false')
+                               'new_org' => array('type' => 'bool','nullable' 
=> true,'default' => 'false'),
+                               'new_group' => array('type' => 
'bool','nullable' => true,'default' => 'false')
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -37,6 +38,9 @@
                                'internal_arena_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'arena_name' => array('type' => 
'varchar','precision' => '255','nullable' => false),
                                'address' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                       'addressnumber' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                       'zip_code' => array('type' => 'varchar','precision' => 
'255','nullable' => True),
+                       'city' => array('type' => 'varchar','precision' => 
'255','nullable' => True),
                                'active' => array('type' => 'bool','nullable' 
=> true,'default' => 'true')
                        ),
                        'pk' => array('id'),
@@ -54,6 +58,9 @@
                                'email' => array('type' => 
'varchar','precision' => '255','nullable' => false),
                                'phone' => array('type' => 
'varchar','precision' => '255','nullable' => false),
                                'address' => array('type' => 
'varchar','precision' => '255','nullable' => false),
+                               'addressnumber' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                       'zip_code' => array('type' => 'varchar','precision' => 
'255','nullable' => True),
+                       'city' => array('type' => 'varchar','precision' => 
'255','nullable' => True),
                                'orgno' => array('type' => 
'varchar','precision' => '255','nullable' => false),
                                'change_type' => array('type' => 
'varchar','precision' => '255','nullable' => false),
                                'transferred' => array('type' => 
'bool','nullable' => true,'default' => 'false'),
@@ -71,7 +78,8 @@
                                'name' => array('type' => 'varchar','precision' 
=> '255','nullable' => false),
                                'description' => array('type' => 
'text','nullable' => false),
                                'change_type' => array('type' => 
'varchar','precision' => '255','nullable' => false),
-                               'transferred' => array('type' => 
'bool','nullable' => true,'default' => 'false')
+                               'transferred' => array('type' => 
'bool','nullable' => true,'default' => 'false'),
+                               'original_group_id' => array('type' => 
'int','precision' => 4,'nullable' => true)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: 
branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -171,4 +171,72 @@
                return $GLOBALS['setup_info']['activitycalendar']['currentver'];
        }
        
+       $test[] = '0.1.8';
+       function activitycalendar_upgrade0_1_8()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_organization','addressnumber',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_organization','zip_code',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_organization','city',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_arena','addressnumber',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_arena','zip_code',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_arena','city',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.9';
+               return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+       }
+       
+       $test[] = '0.1.9';
+       function activitycalendar_upgrade0_1_9()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','new_group',array(
+                       'type' => 'bool',
+                       'default' => 'false',
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.10';
+               return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+       }
+       
+       $test[] = '0.1.10';
+       function activitycalendar_upgrade0_1_10()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_group','original_group_id',array(
+                       'type' => 'int',
+                       'precision' => 4,
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.11';
+               return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+       }
 ?>

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -179,11 +179,25 @@
                                        <?php
                                                if($activity->get_group_id())
                                                {
-                                                       echo 
activitycalendar_sogroup::get_instance()->get_description($activity->get_group_id());
+                                                   
if($activity->get_new_group())
+                                                   {
+                                                           echo 
activitycalendar_sogroup::get_instance()->get_description_local($activity->get_group_id());
+                                                   }
+                                                   else
+                                                   {
+                                                       echo 
activitycalendar_sogroup::get_instance()->get_description($activity->get_group_id());
+                                                   }
                                                }
                                                else 
if($activity->get_organization_id())
                                                {
-                                                       echo 
activitycalendar_soorganization::get_instance()->get_description($activity->get_organization_id());
+                                                   if($activity->get_new_org())
+                                                   {
+                                                           echo 
activitycalendar_soorganization::get_instance()->get_description_local($activity->get_organization_id());
+                                                   }
+                                                   else
+                                                   {
+                                                       echo 
activitycalendar_soorganization::get_instance()->get_description($activity->get_organization_id());
+                                                   }
                                                }
                                         ?>
                                </dd>
@@ -499,9 +513,16 @@
                                </dt>
                                <dd>
                                        <?php
-                                       $current_group_id = 
$activity->get_group_id();
                                        if ($editable)
                                        {
+                                           $current_group_id = 
$activity->get_group_id();
+                                           if($activity->get_new_group())
+                                           {
+                                               echo "<input type=\"hidden\" 
name=\"group_id\" id=\"group_id\" value=\"".$local_group->get_id()."\" />";
+                                               echo $local_group->get_name();
+                                           }
+                                           else
+                                           {
                                                ?>
                                                <div id="group_select">
                                                        <select name="group_id" 
id="group_id">
@@ -510,7 +531,8 @@
                                                </div>
                                                <?php if($current_group_id){?>
                                                        <br/><?php echo 
lang('edit_contact_info')?> <a 
href="index.php?menuaction=booking.uigroup.show&id=<?php echo $current_group_id 
?>"><?php echo lang('edit_contact_info_group')?></a>
-                                               <?php }?>
+                                               <?php }
+                                               }?>
                                                <?php
                                        ?>
                                        <?php
@@ -518,7 +540,14 @@
                                        else
                                        {
                                                if($activity->get_group_id()){
-                                                       echo 
activitycalendar_sogroup::get_instance()->get_group_name($activity->get_group_id());
+                                                   
if($activity->get_new_group())
+                                                   {
+                                                       echo 
activitycalendar_sogroup::get_instance()->get_group_name_local($activity->get_group_id());
+                                                   }
+                                                   else
+                                                   {
+                                                           echo 
activitycalendar_sogroup::get_instance()->get_group_name($activity->get_group_id());
+                                                   }
                                                }
                                        }
                                        ?>
@@ -535,7 +564,14 @@
                                        <?php
                                                if($activity->get_group_id())
                                                {
-                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_1());
+                                                   
if($activity->get_new_group())
+                                                   {
+                                                       echo 
$contpers_so->get_group_contact_name_local($activity->get_contact_person_1());
+                                                   }
+                                                   else
+                                                   {
+                                                           echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_1());
+                                                   }
                                                }
                                                else 
if($activity->get_organization_id())
                                                {
@@ -555,7 +591,14 @@
                                        <?php
                                                if($activity->get_group_id())
                                                {
-                                                       echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_2());
+                                                   
if($activity->get_new_group())
+                                                   {
+                                                       echo 
$contpers_so->get_group_contact_name_local($activity->get_contact_person_2());
+                                                   }
+                                                   else
+                                                   {
+                                                           echo 
$contpers_so->get_group_contact_name($activity->get_contact_person_2());
+                                                   }
                                                }
                                                else 
if($activity->get_organization_id())
                                                {

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php   
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/dashboard.php   
2012-08-06 12:25:59 UTC (rev 9833)
@@ -13,6 +13,7 @@
        $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
        include('organization_list_partial.php');
 ?>
+<?php /*?>
 <h2><?php echo lang('group')?></h2>
 <?php
        $list_form = true;
@@ -21,7 +22,7 @@
        $nosearch = true;
        $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
        include('organization_list_partial.php');
-?>
+*/?>
 <h2><?php echo lang('activities') ?></h2>
 <?php
        $list_form = true;

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php    
    2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php    
    2012-08-06 12:25:59 UTC (rev 9833)
@@ -153,7 +153,6 @@
                        <div class="form-buttons">
                                <?php
                                        if ($editable) {
-                                               echo '<input type="submit" 
name="save_organization" value="' . lang('save') . '"/>';
                                                
if($organization->get_original_org_id() && $organization->get_original_org_id() 
> 0)
                                                {
                                                        echo '<input 
type="submit" name="update_organization" value="' . lang('update_org') . '"/>';

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
   2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
   2012-08-06 12:25:59 UTC (rev 9833)
@@ -13,6 +13,7 @@
        $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
        include('organization_list_partial.php');
 ?>
+<?php /*
 <h2><?php echo lang('group')?></h2>
 <?php
        $list_form = true;
@@ -21,4 +22,4 @@
        $nosearch = true;
        $extra_cols = array(array("key" => "change_type", "label" => 
lang('change_type'), "sortable" => true, "index" => 5));
        include('organization_list_partial.php');
-?>
\ No newline at end of file
+*/?>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2012-08-06 12:25:59 UTC (rev 9833)
@@ -13,11 +13,7 @@
 
        class activitycalendarfrontend_uiactivity extends 
activitycalendar_uiactivities
        {
-               private $so_activity;
-               private $so_arena;
                private $so_organization;
-               private $so_group;
-               private $so_contact;
                
                public $public_functions = array
                (
@@ -34,11 +30,7 @@
                public function __construct()
                {
                        parent::__construct();
-                       $this->so_activity = 
activitycalendar_soactivity::get_instance();
-                       $this->so_arena = 
activitycalendar_soarena::get_instance();
                        $this->so_organization = 
activitycalendar_soorganization::get_instance();
-                       $this->so_group = 
activitycalendar_sogroup::get_instance();
-                       $this->so_contact = 
activitycalendar_socontactperson::get_instance();
                }
                
                /**
@@ -47,8 +39,7 @@
                public function add()
                {
                        
//$GLOBALS['phpgw']->redirect_link('/activitycalendarfrontend/index.php', 
array('menuaction' => 'activitycalendarfrontend.uiactivity.edit', 'action' => 
'new_activity'));
-                       $GLOBALS['phpgw']->js->validate_file( 'json', 'json', 
'phpgwapi' );
-                       
+                       $GLOBALS['phpgw']->js->validate_file( 'json', 'json', 
'phpgwapi' );                     
                        $c = 
createobject('phpgwapi.config','activitycalendarfrontend');
                        $c->read();
                        $config = $c->config_data;
@@ -65,30 +56,72 @@
                        
                        $activity = new activitycalendar_activity();
                        
-                       $g_id = phpgw::get_var('group_id');
                        $o_id = phpgw::get_var('organization_id');
+                       $o_id_new = phpgw::get_var('organization_id_hidden');
                        
                        if(isset($_POST['step_1'])) //activity shall be 
registred on a new organization
                        {
-                               if($o_id == "new_org")
+                               if($o_id_new == "new_org")
                                {
-                                       $new_org = true;
-                                       $this->render('activity_new_org.php', 
array
-                                               (
-                                                       'activity'      => 
$activity,
-                                                       'new_organization' => 
true,
-                                                       'arenas' => $arenas,
-                                                       'buildings' => 
$buildings,
-                                                       'categories' => 
$categories,
-                                                       'targets' => $targets,
-                                                       'districts' => 
$districts,
-                                                       'offices' => $offices,
-                                                       'editable' => true,
-                                                       'message' => 
isset($message) ? $message : phpgw::get_var('message'),
-                                                       'error' => 
isset($error) ? $error : phpgw::get_var('error'),
-                                                       'ajaxURL' => $ajaxUrl
-                                               )
-                                       );
+                                       //add new organization to internal 
activitycalendar organization register
+                               $org_info['name'] = phpgw::get_var('orgname');
+                               $org_info['orgnr'] = phpgw::get_var('orgno');
+                               $org_info['homepage'] = 
phpgw::get_var('homepage');
+                               $org_info['street'] = phpgw::get_var('address');
+                               $org_info['streetnumber'] = 
phpgw::get_var('number');
+                               $org_info['zip'] = phpgw::get_var('postzip');
+                               $org_info['postaddress'] = 
phpgw::get_var('postaddress');
+                               $org_info['status'] = "new";
+                               $o_id = 
$this->so_activity->add_organization_local($org_info);
+                               
+                               //add contact persons
+                               $contact1 = array();
+                               $contact1['name'] = 
phpgw::get_var('org_contact1_name');
+                               $contact1['phone'] = 
phpgw::get_var('org_contact1_phone');
+                               $contact1['mail'] = 
phpgw::get_var('org_contact1_mail');
+                               $contact1['org_id'] = $o_id;
+                               $contact1['group_id'] = 0;
+                               
$this->so_activity->add_contact_person_local($contact1);
+                               
+                               $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
+                               foreach($person_arr as $p)
+                               {
+                                       $persons[] = $p;
+                               }
+                               
+                               $person_ids = 
$this->so_organization->get_contacts_local($o_id);
+                               $desc = phpgw::get_var('org_description');
+                               $organization = 
$this->so_organization->get_organization_local($o_id);
+                               $new_org = true;
+    
+                               $organization = 
$this->so_organization->get_organization_local($o_id);
+                               $person_arr = 
$this->so_organization->get_contacts_local_as_objects($o_id);
+                               foreach($person_arr as $p)
+                               {
+                                       //var_dump($p);
+                                       $persons[] = $p;
+                               }
+                               
+                               $message = lang('organization_saved_form');
+                               
+                               $this->render('activity_new.php', array
+                                       (
+                                               'activity'      => $activity,
+                                               'new_organization' => true,
+                                               'organization' => $organization,
+                                               'contact1' => $persons[0],
+                                               'arenas' => $arenas,
+                                               'buildings' => $buildings,
+                                               'categories' => $categories,
+                                               'targets' => $targets,
+                                               'districts' => $districts,
+                                               'offices' => $offices,
+                                               'editable' => true,
+                                               'message' => isset($message) ? 
$message : phpgw::get_var('message'),
+                                               'error' => isset($error) ? 
$error : phpgw::get_var('error'),
+                                               'ajaxURL' => $ajaxUrl
+                                       )
+                               );
                                }
                                else
                                {
@@ -101,7 +134,6 @@
                                                $persons[] = $p;
                                        }
                                        
-                                       $groups = $this->so_group->get(null, 
null, null, null, null, null, array('org_id' => $o_id));
                                        
                                        $activity->set_organization_id($o_id);
                                        
$activity->set_description($organization->get_description());
@@ -113,8 +145,6 @@
                                                        'new_organization' => 
false,
                                                        'organization' => 
$organization,
                                                        'contact1' => 
$persons[0],
-                                                       'contact2' => 
$persons[1],
-                                                       'groups' => $groups,
                                                        'arenas' => $arenas,
                                                        'buildings' => 
$buildings,
                                                        'categories' => 
$categories,
@@ -128,99 +158,12 @@
                                                )
                                        );
                                }
-                       }
-                       else if(isset($_POST['save_organization']))
-                       {
-                               //add new organization to internal 
activitycalendar organization register
-                               $org_info['name'] = phpgw::get_var('orgname');
-                               $org_info['orgnr'] = phpgw::get_var('orgno');
-                               $org_info['homepage'] = 
phpgw::get_var('homepage');
-                               $org_info['phone'] = phpgw::get_var('phone');
-                               $org_info['email'] = phpgw::get_var('email');
-                               $org_info['description'] = 
phpgw::get_var('org_description');
-                               $org_info['street'] = phpgw::get_var('address') 
. ' ' . phpgw::get_var('number') . ', ' . phpgw::get_var('postaddress');
-                               //$org_info['zip'] = 
phpgw::get_var('postaddress');
-                               $org_info['district'] = 
phpgw::get_var('org_district'); 
-                               $org_info['status'] = "new";
-                               $o_id = 
$this->so_activity->add_organization_local($org_info);
-                               
-                               //add contact persons
-                               $contact1 = array();
-                               $contact1['name'] = 
phpgw::get_var('org_contact1_name');
-                               $contact1['phone'] = 
phpgw::get_var('org_contact1_phone');
-                               $contact1['mail'] = 
phpgw::get_var('org_contact1_mail');
-                               $contact1['org_id'] = $o_id;
-                               $contact1['group_id'] = 0;
-                               
$this->so_activity->add_contact_person_local($contact1);
-                               
-                               if(phpgw::get_var('org_contact2_name'))
-                               {
-                                       $contact2 = array();
-                                       $contact2['name'] = 
phpgw::get_var('org_contact2_name');
-                                       $contact2['phone'] = 
phpgw::get_var('org_contact2_phone');
-                                       $contact2['mail'] = 
phpgw::get_var('org_contact2_mail');
-                                       $contact2['org_id'] = $o_id;
-                                       $contact2['group_id'] = 0;
-                                       
$this->so_activity->add_contact_person_local($contact2);
-                               }
-                               else
-                               {
-                                       
$this->so_activity->add_contact_person_local($contact1);
-                               }
-                               
-                               //$persons = 
$this->so_organization->get_contacts_local_as_objects($o_id);
-                               //var_dump($persons);
-                               $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
-                               foreach($person_arr as $p)
-                               {
-                                       //var_dump($p);
-                                       $persons[] = $p;
-                               }
-                               
-                               $person_ids = 
$this->so_organization->get_contacts_local($o_id);
-                               $desc = phpgw::get_var('org_description');
-                               $organization = 
$this->so_organization->get_organization_local($o_id);
-                               $new_org = true;
-
-                               $organization = 
$this->so_organization->get_organization_local($o_id);
-                               $person_arr = 
$this->so_organization->get_contacts_local_as_objects($o_id);
-                               foreach($person_arr as $p)
-                               {
-                                       //var_dump($p);
-                                       $persons[] = $p;
-                               }
-                               
-                               $message = lang('organization_saved_form');
-                               
-                               $this->render('activity_new.php', array
-                                       (
-                                               'activity'      => $activity,
-                                               'new_organization' => true,
-                                               'organization' => $organization,
-                                               'contact1' => $persons[0],
-                                               'contact2' => $persons[1],
-                                               'groups' => $groups,
-                                               'arenas' => $arenas,
-                                               'buildings' => $buildings,
-                                               'categories' => $categories,
-                                               'targets' => $targets,
-                                               'districts' => $districts,
-                                               'offices' => $offices,
-                                               'editable' => true,
-                                               'message' => isset($message) ? 
$message : phpgw::get_var('message'),
-                                               'error' => isset($error) ? 
$error : phpgw::get_var('error'),
-                                               'ajaxURL' => $ajaxUrl
-                                       )
-                               );
-                       }
+                   }
                        else if(isset($_POST['save_activity']))
                        {
-                               //$persons = 
$this->so_organization->get_contacts($o_id);                               
-                               //$organization = 
$this->so_organization->get_single($o_id);
-                               
                                $get_org_from_local = false;
                                $new_org_group = false;
-                               $new_org = phpgw::get_var('new_org');
+                               $new_org = phpgw::get_var('new_organization');
                                if($new_org != null && $new_org == 'yes')
                                {
                                        $get_org_from_local = true;
@@ -229,100 +172,70 @@
                                if($get_org_from_local)
                                {
                                        $activity->set_new_org(true);
-                                       $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
+                                       //$person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
+                                       //foreach($person_arr as $p)
+                                       //{
+                                               //$persons[] = $p;
+                                       //}
+                                       //$person_ids = 
$this->so_organization->get_contacts_local($o_id);
+                                       //$desc = 
$this->so_organization->get_description_local($o_id);
+                                       $organization = 
$this->so_organization->get_organization_local($o_id);
+                                       $new_org = true;
+                                       //$new_org_group = true;
+                                       
+                                   //Add new group for the activity
+                                       $group_info['name'] = 
phpgw::get_var('title');
+                                       $group_info['organization_id'] = $o_id;
+                                       $group_info['description'] = 
phpgw::get_var('description');
+                                       $group_info['status'] = "new";
+                                       $g_id = 
$this->so_activity->add_group_local($group_info);
+                                       
+                                       //add contact persons
+                                       $contact1 = array();
+                                       $contact1['name'] = 
phpgw::get_var('contact_name');
+                                       $contact1['phone'] = 
phpgw::get_var('contact_phone');
+                                       $contact1['mail'] = 
phpgw::get_var('contact_mail');
+                                       $contact1['org_id'] = $o_id;
+                                       $contact1['group_id'] = $g_id;
+                                       
$this->so_activity->add_contact_person_local($contact1);
+                                       
+                                       $person_arr = 
$this->so_contact->get_local_contact_persons($g_id, true);
                                        foreach($person_arr as $p)
                                        {
-                                               //var_dump($p);
                                                $persons[] = $p;
                                        }
-                                       $person_ids = 
$this->so_organization->get_contacts_local($o_id);
-                                       $desc = 
$this->so_organization->get_description_local($o_id);
-                                       $organization = 
$this->so_organization->get_organization_local($o_id);
-                                       $new_org = true;
-                                       $new_org_group = true;
-                                       //var_dump($organization);
+                                       $desc = phpgw::get_var('description');
+                                       $group = 
$this->so_group->get_group_local($g_id);
+                                       $person_ids = 
$this->so_group->get_contacts_local($g_id);
+                                       $new_group = true;
                                }
                                else if(is_numeric($o_id) && $o_id > 0)
-                               {
-                                       if(isset($g_id) && $g_id == "new_group")
+                           {
+                                       $group_info['name'] = 
phpgw::get_var('title');
+                                       $group_info['organization_id'] = $o_id;
+                                       $group_info['description'] = 
phpgw::get_var('description');
+                                       $group_info['status'] = "new";
+                                       $g_id = 
$this->so_activity->add_group_local($group_info);
+                                       
+                                       //add contact persons
+                                       $contact1 = array();
+                                       $contact1['name'] = 
phpgw::get_var('contact_name');
+                                       $contact1['phone'] = 
phpgw::get_var('contact_phone');
+                                       $contact1['mail'] = 
phpgw::get_var('contact_mail');
+                                       $contact1['org_id'] = 0;
+                                       $contact1['group_id'] = $g_id;
+                                       
$this->so_activity->add_contact_person_local($contact1);
+                                       
+                                       $person_arr = 
$this->so_contact->get_local_contact_persons($g_id, true);
+                                       foreach($person_arr as $p)
                                        {
-                                               $group_info['name'] = 
phpgw::get_var('groupname');
-                                               $group_info['organization_id'] 
= $o_id;
-                                               $group_info['description'] = 
phpgw::get_var('group_description');
-                                               $group_info['status'] = "new";
-                                               $g_id = 
$this->so_activity->add_group_local($group_info);
-                                               
-                                               //add contact persons
-                                               $contact1 = array();
-                                               $contact1['name'] = 
phpgw::get_var('group_contact1_name');
-                                               $contact1['phone'] = 
phpgw::get_var('group_contact1_phone');
-                                               $contact1['mail'] = 
phpgw::get_var('group_contact1_mail');
-                                               $contact1['org_id'] = 0;
-                                               $contact1['group_id'] = $g_id;
-                                               
$this->so_activity->add_contact_person_local($contact1);
-                                               
-                                               $contact2 = array();
-                                               $contact2['name'] = 
phpgw::get_var('group_contact2_name');
-                                               $contact2['phone'] = 
phpgw::get_var('group_contact2_phone');
-                                               $contact2['mail'] = 
phpgw::get_var('group_contact2_mail');
-                                               $contact2['org_id'] = 0;
-                                               $contact2['group_id'] = $g_id;
-                                               
$this->so_activity->add_contact_person_local($contact2);
-                                               
-                                               //$persons = 
$this->so_group->get_contacts_local_as_objects($g_id);
-                                               $person_arr = 
$this->so_contact->get_local_contact_persons($g_id, true);
-                                               foreach($person_arr as $p)
-                                               {
-                                                       //var_dump($p);
-                                                       $persons[] = $p;
-                                               }
-                                               $desc = 
phpgw::get_var('group_description');
-                                               $group = 
$this->so_group->get_group_local($g_id);
-                                               $person_ids = 
$this->so_group->get_contacts_local($g_id);
-                                               $organization = 
$this->so_organization->get_single($o_id);
-                                               $new_org_group = true;
+                                               $persons[] = $p;
                                        }
-                                       else if(isset($g_id) && 
is_numeric($g_id) && $g_id > 0)
-                                       {
-                                               $person_ids = 
$this->so_group->get_contacts($g_id);
-                                               //$person_arr = 
$this->so_contact->get_local_contact_persons($g_id, true);
-                                               $person_arr = 
$this->so_contact->get_booking_contact_persons($g_id, true);
-                                               foreach($person_arr as $p)
-                                               {
-                                                       //var_dump($p);
-                                                       $persons[] = $p;
-                                               }
-                                               $desc = 
$this->so_group->get_description($g_id);
-                                               $organization = 
$this->so_organization->get_single($o_id);
-                                               $group = 
$this->so_group->get_single($g_id);
-                                       }
-                                       else if(isset($o_id) && 
is_numeric($o_id) && $o_id > 0)
-                                       {
-                                               if($get_org_from_local)
-                                               {
-                                                       $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
-                                                       foreach($person_arr as 
$p)
-                                                       {
-                                                               //var_dump($p);
-                                                               $persons[] = $p;
-                                                       }
-                                                       $person_ids = 
$this->so_organization->get_contacts_local($o_id);
-                                                       $desc = 
$this->so_organization->get_description_local($o_id);
-                                                       $organization = 
$this->so_organization->get_organization_local($o_id);
-                                               }
-                                               else
-                                               {
-                                                       $person_ids = 
$this->so_organization->get_contacts($o_id);
-                                                       $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
-                                                       foreach($person_arr as 
$p)
-                                                       {
-                                                               //var_dump($p);
-                                                               $persons[] = $p;
-                                                       }
-                                                       $desc = 
$this->so_organization->get_description($o_id);
-                                                       $organization = 
$this->so_organization->get_single($o_id);
-                                               }
-                                       }
+                                       $desc = phpgw::get_var('description');
+                                       $group = 
$this->so_group->get_group_local($g_id);
+                                       $person_ids = 
$this->so_group->get_contacts_local($g_id);
+                                       $organization = 
$this->so_organization->get_single($o_id);
+                                       $new_group = true;
                                }
                                
                                if(strlen($desc) > 254)
@@ -330,31 +243,48 @@
                                        $desc = substr($desc,0,254);
                                }
                                
-                               $arena_id = phpgw::get_var('arena_id');
-                               if($arena_id != null && $arena_id == 
'new_arena')
+                               $arena_id = phpgw::get_var('internal_arena_id');
+                               $new_arena = phpgw::get_var('new_arena_hidden');
+                               if($new_arena != null && $new_arena == 
'new_arena')
                                {                               
                                        $arena = new activitycalendar_arena();
                                        $arena_name = 
phpgw::get_var('arena_name');
-                                       $arena_address = 
phpgw::get_var('arena_address') . ' ' . phpgw::get_var('arena_number') . ', ' . 
phpgw::get_var('arena_postaddress');
+                                       $arena_address = 
phpgw::get_var('arena_address');
+                                       $arena_addressnumber = 
phpgw::get_var('arena_number');
+                                       $arena_zip_code = 
phpgw::get_var('arena_zip_code');
+                                       $arena_city = 
phpgw::get_var('arena_city');
        
                                        $arena->set_arena_name($arena_name);
                                        $arena->set_address($arena_address);
+                                       
$arena->set_addressnumber($arena_addressnumber);
+                                       $arena->set_zip_code($arena_zip_code);
+                                       $arena->set_city($arena_city);
                                        $arena->set_active(true);
                        
                                        // All is good, store arena
                                        if ($this->so_arena->store($arena)) {
                                                $arena_id = $arena->get_id();
+                                               $activity->set_arena($arena_id);
                                        }
                                }
-                               
+                               else
+                               {
+                                   $arena_arr = explode($arena_id,"_");
+                                   if($arena_arr[0] == 'i')
+                                   {
+                                       
$activity->set_internal_arena($arena_arr[1]);
+                                   }
+                                   else
+                                   {
+                                       $activity->set_arena($arena_arr[1]);
+                                   }
+                               }
+
                                //... set all parameters
                                $activity->set_title(phpgw::get_var('title'));
                                $activity->set_organization_id($o_id);
                                $activity->set_group_id($g_id);
-                               $activity->set_arena($arena_id);
-                               
$activity->set_internal_arena(phpgw::get_var('internal_arena_id'));
-                               $district_array = phpgw::get_var('district');
-                               $activity->set_district(implode(",", 
$district_array));
+                               
$activity->set_district(phpgw::get_var('district'));
                                $activity->set_office(phpgw::get_var('office'));
                                $activity->set_state(1);
                                
$activity->set_category(phpgw::get_var('category'));
@@ -362,13 +292,13 @@
                                $activity->set_target(implode(",", 
$target_array));
                                $activity->set_description($desc);
                                $activity->set_time(phpgw::get_var('time'));
-                               $activity->set_contact_persons($person_ids);
+                               $activity->set_contact_persons($persons);
                                
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
                                
$activity->set_contact_person_2_address(phpgw::get_var('contact2_address') . ", 
" . phpgw::get_var('contact2_number'));
                                
$activity->set_contact_person_2_zip(phpgw::get_var('contact2_postaddress'));
                                $activity->set_frontend(true);
-                               $activity->set_new_org($new_org_group);
-                               
+                               $activity->set_new_org($new_org);
+                               $activity->set_new_group($new_group);
                                $target_ok = false;
                                $district_ok = false;
                                if($activity->get_target() && 
$activity->get_target() != '')
@@ -400,7 +330,6 @@
                                                                        
'organization' => $organization,
                                                                        'group' 
=> $group,
                                                                        
'contact1' => $persons[0],
-                                                                       
'contact2' => $persons[1],
                                                                        
'arenas' => $arenas,
                                                                        
'buildings' => $buildings,
                                                                        
'categories' => $categories,
@@ -463,7 +392,7 @@
                {
                        $errorMsgs = array();
                        $infoMsgs = array();
-                       $activity = 
activitycalendar_soactivity::get_instance()->get_single((int)phpgw::get_var('id'));
+                       $activity = 
$this->so_activity->get_single((int)phpgw::get_var('id'));
                        
                        if($activity == null) // Not found
                        {
@@ -528,6 +457,7 @@
                                $secret_param = phpgw::get_var('secret', 'GET');
                                if(!isset($id) || $id == '')
                                {
+                                   var_dump(3);
                                        //select activity to edit
                                        $activities = 
$this->so_activity->get(null, null, 'title', true, null, null, 
array('activity_state' => 3));
                                        $organizations = 
$this->so_organization->get(null, null, 'org.name', true, null, null, 
array('edit_from_frontend' => 'yes'));
@@ -610,25 +540,35 @@
                                        {
                                                if(isset($activity)) // If an 
activity object is created
                                                {
+                                                   $act_description = 
phpgw::get_var('description');
                                                        $old_state = 
$activity->get_state();
                                                        $new_state = 
phpgw::get_var('state');
                                                        // ... set all 
parameters
                                                        
$activity->set_title(phpgw::get_var('title'));
                                                        
$activity->set_arena(phpgw::get_var('arena_id'));
                                                        
$activity->set_internal_arena(phpgw::get_var('internal_arena_id'));
-                                                       $district_array = 
phpgw::get_var('district');
-                                                       
$activity->set_district(implode(",", $district_array));
+                                                       //$district_array = 
phpgw::get_var('district');
+                                                       
$activity->set_district(phpgw::get_var('district'));
                                                        
$activity->set_office(phpgw::get_var('office'));
                                                        $activity->set_state(2);
                                                        
$activity->set_category(phpgw::get_var('category'));
                                                        $target_array = 
phpgw::get_var('target');
                                                        
$activity->set_target(implode(",", $target_array));
-                                                       
$activity->set_description($desc);
+                                                       
$activity->set_description($act_description);
                                                        
$activity->set_time(phpgw::get_var('time'));
                                                        
$activity->set_contact_persons($persons);
                                                        
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
                                                        
$activity->set_frontend(true);
-               
+                                                       
+                                                       $contact_person = 
array();
+                                                       $cp_tmp = 
$persons_array[0];
+                                                       
$contact_person['original_id'] = $cp_tmp->get_id();
+                                                       $contact_person['name'] 
= phpgw::get_var('contact_name');
+                                                       
$contact_person['phone'] = phpgw::get_var('contact_phone');
+                                                       $contact_person['mail'] 
= phpgw::get_var('contact_mail');
+                                                       
$contact_person['group_id'] = $activity->get_group_id();
+                                                       
+                                                       
                                                        $target_ok = false;
                                                        $district_ok = false;
                                                        
if($activity->get_target() && $activity->get_target() != '')
@@ -646,6 +586,12 @@
                                                                
if($this->so_activity->store($activity)) // ... and then try to store the object
                                                                {
                                                                        
$message = lang('messages_saved_form'); 
+                                                                       
//update group description
+                                                                       
if($activity->get_group_id())
+                                                                       {
+                                                                           
$this->so_group->update_group_description($activity->get_group_id(), 
$act_description);
+                                                                           
$this->so_group->update_group_contact($contact_person);
+                                                                       }
                                                                }
                                                                else
                                                                {
@@ -660,7 +606,6 @@
                                                                                
                'organization' => $organization,
                                                                                
                'group' => $group,
                                                                                
        'contact1' => $persons_array[0],
-                                                                               
        'contact2' => $persons_array[1],
                                                                                
                'arenas' => $arenas,
                                                                                
                'buildings' => $buildings,
                                                                                
                'categories' => $categories,
@@ -688,7 +633,6 @@
                                                                                
'activity'      => $activity,
                                                                                
'organization' => $organization,
                                                                            
'contact1' => $persons_array[0],
-                                                                               
'contact2' => $persons_array[1],
                                                                                
'org_name' => $org_name,
                                                                                
'group' => $group,
                                                                                
'arenas' => $arenas,
@@ -717,7 +661,6 @@
                                                                                
'organization' => $organization,
                                                                                
'group' => $group,
                                                                                
'contact1' => $persons_array[0],
-                                                                               
'contact2' => $persons_array[1],
                                                                                
'arenas' => $arenas,
                                                                                
'buildings' => $buildings,
                                                                                
'categories' => $categories,

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -1,11 +1,11 @@
 activitycalendarfrontend       common  no      Aktivitetsoversikt Frontend
 Activitycalendarfrontend       common  no      Aktivitetsoversikt Frontend
 office activitycalendarfrontend        no      Hovedansvarlig kulturkontor
-arena  activitycalendarfrontend        no      Arena
+arena  activitycalendarfrontend        no      Lokale
 description    activitycalendarfrontend        no      Beskrivelse
 date_start     activitycalendarfrontend        no      Startdato
 date_end       activitycalendarfrontend        no      Sluttdato
-special_adaptation     activitycalendarfrontend        no      Spesielt 
tilpasset for utviklingshemmede
+special_adaptation     activitycalendarfrontend        no      Ja, aktiviteten 
er spesielt tilpasset for utviklingshemmede
 target activitycalendarfrontend        no      Målgruppe
 contact_person_1       activitycalendarfrontend        no      Kontaktperson 1
 contact_person_2       activitycalendarfrontend        no      Kontaktperson 2
@@ -71,12 +71,14 @@
 who    activitycalendarfrontend        no      HVEM
 arena_helptext activitycalendarfrontend        no      Oppgi arena ved å velge 
kommunalt bygg eller eksterne bygg.<br/>Dersom ikke arena som skal benyttes 
finnes i listen, kan du registrere en ny.<br/>Velg "Ny arena" i nedtrekksmenyen 
for Eksterne bygg og oppgi deretter riktig navn og adresse på arenaen.
 new_arena      activitycalendarfrontend        no      Ny Arena
+register_new_arena     activitycalendarfrontend        no      Registrer nytt 
lokale
 external_arena activitycalendarfrontend        no      Eksterne bygg
 category_helptext      activitycalendarfrontend        no      Velg kategori
 target_helptext        activitycalendarfrontend        no      Velg 
målgruppe(r)
 district_helptext      activitycalendarfrontend        no      Velg bydel(er) 
hvor aktiviteten foregår
 adaptation_helptext    activitycalendarfrontend        no      Kryss av om 
aktiviteten er spesielt tilpasset
 time_helptext  activitycalendarfrontend        no      Oppgi tidspunkt for 
aktiviteten, f.eks. onsdag kl. 20-21
+time   activitycalendarfrontend        no      Dag og tid
 office_helptext        activitycalendarfrontend        no      Oppgi kontor 
som saksbehandler aktiviteten
 contact_info   activitycalendarfrontend        no      Kontaktinformasjon for 
kulturkontoret
 contact_info_helptext  activitycalendarfrontend        no      Hentes fra 
booking/organisasjonsregister ved lagring.
@@ -98,8 +100,14 @@
 save_organization_next activitycalendarfrontend        no      Lagre 
organisasjon og gå videre til Ny aktivitet
 new_organization       activitycalendarfrontend        no      Ny organisasjon
 organization_saved_form        activitycalendarfrontend        no      
Organisasjonen er opprettet i aktivitetsoversikten.<br/>Du kan nå registrere en 
aktivitet tilknyttet den nye organisasjonen.
-required_fields        activitycalendarfrontend        no      Felter merket 
med (*) er påkrevde felt.
+required_fields        activitycalendarfrontend        no      Felt merket med 
(*) er påkrevde felt.
 mailBaseURL    activitycalendarfrontend        no      Base-URL for e-post
 ajaxURL        activitycalendarfrontend        no      URL for AJAX-kall
 Anonymous_user activitycalendarfrontend        no      Brukernavn for frontend
-Anonymous_password     activitycalendarfrontend        no      Passord for 
frontend
\ No newline at end of file
+Anonymous_password     activitycalendarfrontend        no      Passord for 
frontend
+new_activity_helptext  activitycalendarfrontend        no      Hvem arrangerer 
aktiviteten?
+responsible    activitycalendarfrontend        no      Arrangør
+choose_org     activitycalendarfrontend        no      Velg organisasjon
+activity_title activitycalendarfrontend        no      Navn på aktiviteten
+location       activitycalendarfrontend        no      Lokale
+contact_person activitycalendarfrontend        no      Kontaktperson for 
aktiviteten
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php    
2012-08-06 07:39:23 UTC (rev 9832)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php    
2012-08-06 12:25:59 UTC (rev 9833)
@@ -21,7 +21,7 @@
 
        $setup_info['activitycalendarfrontend']['depends'][] = array(
                'appname' => 'booking',
-               'versions' => Array('0.2.00', 
'0.2.01','0.2.02','0.2.03','0.2.04','0.2.05','0.2.06','0.2.07','0.2.08')
+               'versions' => Array('0.2.00', 
'0.2.01','0.2.02','0.2.03','0.2.04','0.2.05','0.2.06','0.2.07','0.2.08','0.2.09')
        );
 
        $setup_info['activitycalendarfrontend']['depends'][] = array(
@@ -31,7 +31,7 @@
        
        $setup_info['activitycalendarfrontend']['depends'][] = array(
                'appname' => 'activitycalendar',
-               'versions' => 
Array('0.1.3','0.1.4','0.1.5','0.1.6','0.1.7','0.1.8')
+               'versions' => 
Array('0.1.3','0.1.4','0.1.5','0.1.6','0.1.7','0.1.8','0.1.9','0.1.10','0.1.11')
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    2012-08-06 12:25:59 UTC (rev 9833)
@@ -4,26 +4,28 @@
        $act_so = activitycalendar_soactivity::get_instance();
        $contpers_so = activitycalendar_socontactperson::get_instance();
 ?>
-<div class="yui-content" style="width: 100%;">
+<div class="yui-content">
        <div id="details">
-       
-       <?php if($message){?>
-       <div class="success">
-               <?php echo $message;?>
+       <?php if($message){?>
+       <div class="success">
+               <?php echo $message;?>
+       </div>
+       <?php }else if($error){?>
+       <div class="error">
+               <?php echo $error;?>
+       </div>
+       <?php }?>
        </div>
-       <?php }else if($error){?>
-       <div class="error">
-               <?php echo $error;?>
-       </div>
-       <?php }?>
-       </div>
+       <DIV class="pageTop">
                <h1><?php echo lang('activity') ?></h1>
-               <form action="#" method="post">
-                       <input type="hidden" name="id" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
-                       <dl class="proplist-col" style="width: 60%">
-                               <h2><?php echo lang('what')?></h2>
+       </DIV>
+       <form action="#" method="post">
+               <input type="hidden" name="id" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
+               <dl class="proplist-col">
+                       <FIELDSET title="Hva">
+                               <LEGEND>Hva</LEGEND>
                                <dt>
-                                       <label for="title"><?php echo 
lang('title') ?></label>
+                                       <label for="title"><?php echo 
lang('activity_title') ?></label>
                                </dt>
                                <dd>
                                        <?php echo $activity->get_title();?>
@@ -45,6 +47,8 @@
                                                }
                                        ?>
                                </dd>
+                       </FIELDSET>
+                       <FIELDSET id="hvem"><legend>For hvem</legend>
                                <dt>
                                        <label for="target"><?php echo 
lang('target') ?></label>
                                </dt>
@@ -61,50 +65,40 @@
                                        ?>
                                </dd>
                                <dt>
-                                       <label for="district"><?php echo 
lang('district') ?></label>
+                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation"<?php echo 
$activity->get_special_adaptation() ? ' checked="checked"' : '' ?> 
disabled="disabled" /><label for="special_adaptation"><?php echo 
lang('special_adaptation') ?></label>
                                </dt>
-                               <dd>
-                                       <?php
-                                       if($activity->get_district()){
-                                               $current_district_ids = 
$activity->get_district();
-                                               
$current_district_id_array=explode(",", $current_district_ids);
-                                               
foreach($current_district_id_array as $curr_district)
-                                               {
-                                                       echo 
$act_so->get_district_name($curr_district).'<br/>';
-                                               }
-                                       }
-                                       ?>
-                               </dd>
+                       </FIELDSET>
+                       <FIELDSET title="hvor">
+                               <LEGEND>Hvor og når</LEGEND>
+                               <?php if($activity->get_internal_arena()) { ?>
                                <dt>
-                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
+                                       <label for="arena"><?php echo 
lang('building') ?></label>
                                </dt>
                                <dd>
-                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation"<?php echo 
$activity->get_special_adaptation() ? ' checked="checked"' : '' ?> 
disabled="disabled" />
+                                       <?php echo 
activitycalendar_soarena::get_instance()->get_building_name($activity->get_internal_arena());
 ?>
                                </dd>
-                               <hr />
-                               <h2><?php echo lang('where_when')?></h2>
+                               <?php }?>
+                               <?php if($activity->get_arena()) { ?>
                                <dt>
-                                       <?php 
if($activity->get_internal_arena()) { ?>
-                                       <label for="arena"><?php echo 
lang('building') ?></label>
-                                       <?php }?>
+                                       <label for="arena"><?php echo 
lang('arena') ?></label>
                                </dt>
                                <dd>
-                                       <?php
-                                               
if($activity->get_internal_arena()){
-                                                       echo 
activitycalendar_soarena::get_instance()->get_building_name($activity->get_internal_arena());
-                                               }
-                                       ?>
+                                       <?php echo 
activitycalendar_soarena::get_instance()->get_arena_name($activity->get_arena());
 ?>
                                </dd>
+                               <?php  } ?>
                                <dt>
-                                       <?php if($activity->get_arena()) { ?>
-                                       <label for="arena"><?php echo 
lang('arena') ?></label>
-                                       <?php  } ?>
+                                       <label for="district"><?php echo 
lang('district') ?></label>
                                </dt>
                                <dd>
                                        <?php
-                                               if($activity->get_arena()){
-                                                       echo 
activitycalendar_soarena::get_instance()->get_arena_name($activity->get_arena());
+                                       if($activity->get_district()){
+                                               $current_district_ids = 
$activity->get_district();
+                                               
$current_district_id_array=explode(",", $current_district_ids);
+                                               
foreach($current_district_id_array as $curr_district)
+                                               {
+                                                       echo 
$act_so->get_district_name($curr_district).'<br/>';
                                                }
+                                       }
                                        ?>
                                </dd>
                                <dt>
@@ -113,40 +107,20 @@
                                <dd>
                                        <?php echo $activity->get_time();?>
                                </dd>
-                               <dt>
-                                       <label for="office"><?php echo 
lang('office') ?></label>
-                               </dt>
+                       </FIELDSET>
+                       <FIELDSET id="arr">
+                               <legend>Arrangør</legend>
                                <dd>
-                                       <?php
-                                               if($activity->get_office()){
-                                                       echo 
$act_so->get_office_name($activity->get_office());
-                                               }
-                                       ?>
-                               </dd>
-                               <hr />
-                               <h2><?php echo lang('who')?></h2>
-                               <dt>
-                                       <label for="organization_id"><?php echo 
lang('organization') ?></label>
-                               </dt>
-                               <dd>
                                        <?php echo $organization->get_name();?>
                                        <?php if(!$activity->get_new_org()){?>
                                                <a 
href="index.php?menuaction=activitycalendarfrontend.uiactivity.edit_organization_values&amp;organization_id=<?php
 echo $organization->get_id();?>"><?php echo lang('edit_organization');?></a>
                                        <?php }?>
                                </dd>
+                               <br/>
+                               <LEGEND>Kontaktperson</LEGEND>
                                <dt>
-                                       <label for="group_id" 
id="group_label"><?php echo lang('group') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php 
-                                       if($activity->get_group_id()){
-                                               echo $group->get_name();?>
-                               <?php }
-                                       ?>
-                               </dd>
-                               <dt>
                                        <?php 
if($activity->get_contact_person_1()) { ?>
-                                       <label for="contact_person_1"><?php 
echo lang('contact_person_1') ?></label>
+                                       <label for="contact_person_1"><?php 
echo lang('contact_person') ?></label>
                                        <?php  } ?>
                                </dt>
                                <dd>
@@ -155,32 +129,23 @@
                                        <label 
for="contact1_phone">Telefon</label>
                                        <?php echo 
isset($contact1)?$contact1->get_phone():''?><br/>
                                        <label 
for="contact1_mail">E-post</label>
-                                       <?php echo 
isset($contact1)?$contact1->get_email():''?><br/>
+                                       <?php echo 
isset($contact1)?$contact1->get_email():''?>
                                </dd>
-                               <dt>
-                                       <?php 
if($activity->get_contact_person_2()) { ?>
-                                       <label for="contact_person_2"><?php 
echo lang('contact_person_2') ?></label>
-                                       <?php  } ?>
+                       </FIELDSET>
+                       <FIELDSET>
+                               <BR>
+                <dt>
+                       <LABEL for="office">Kulturkontor</label>
                                </dt>
                                <dd>
-                                       <label for="contact2_name">Navn</label>
-                                       <?php echo 
isset($contact2)?$contact2->get_name():''?><br/>
-                                       <label 
for="contact2_phone">Telefon</label>
-                                       <?php echo 
isset($contact2)?$contact2->get_phone():''?><br/>
-                                       <label 
for="contact2_mail">E-post</label>
-                                       <?php echo 
isset($contact2)?$contact2->get_email():''?><br/>
+                                       <?php
+                                               if($activity->get_office()){
+                                                       echo 
$act_so->get_office_name($activity->get_office());
+                                               }
+                                       ?>
                                </dd>
-                           
-                       </dl>
-                       <div class="form-buttons">
-                               <?php
-                                       if ($editable) {
-                                               echo '<input type="submit" 
name="save_activity" value="' . lang('save') . '" onclick="return allOK();"/>';
-                                       }
-                               ?>
-                       </div>
-                       
-               </form>
-               
-       </div>
+                   </FIELDSET>
+               </dl>
+               <div class="form-buttons">&nbsp;</div>
+       </form>
 </div>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-08-06 12:25:59 UTC (rev 9833)
@@ -103,7 +103,7 @@
 function get_address_search_cp2()
 {
        var address = document.getElementById('contact2_address').value;
-       var div_address = 
document.getElementById('contact2_address_container');'
+       var div_address = document.getElementById('contact2_address_container');
        div_address.style.display="block";
 
        //url = 
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
@@ -150,25 +150,52 @@
        {
                alert("Tittel må fylles ut!");
                return false;
+       }
+       if(document.getElementById('description').value == null || 
document.getElementById('description').value == '')
+       {
+               alert("Beskrivelse må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
+       {
+               alert("Kategori må fylles ut!");
+               return false;
        } 
-       if(document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0)
+       if((document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0) && 
(document.getElementById('new_arena_hidden').value==null || 
document.getElementById('new_arena_hidden').value==''))
        {
-               if(document.getElementById('arena_id').value == null || 
document.getElementById('arena_id').value == 0)
-               {
-                       alert("Arena må fylles ut!");
-                       return false;
-               }
+               alert("Lokale må fylles ut!");
+               return false;
        }
        if(document.getElementById('time').value == null || 
document.getElementById('time').value == '')
        {
-               alert("Tid må fylles ut!");
+               alert("Dag og tid må fylles ut!");
                return false;
        }
-       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
+       if(document.getElementById('contact_name').value == null || 
document.getElementById('contact_name').value == '')
        {
-               alert("Kategori må fylles ut!");
+               alert("Navn på kontaktperson må fylles ut!");
                return false;
        }
+       if(document.getElementById('contact_phone').value == null || 
document.getElementById('contact_phone').value == '')
+       {
+               alert("Telefonnummer til kontaktperson må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('contact_mail').value == null || 
document.getElementById('contact_mail').value == '')
+       {
+               alert("E-postadresse til kontaktperson må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('contact_mail2').value == null || 
document.getElementById('contact_mail2').value == '')
+       {
+               alert("Begge felter for E-post må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('contact_mail').value != 
document.getElementById('contact_mail2').value)
+       {
+               alert("E-post må være den samme i begge felt!");
+               return false;
+       }
        if(document.getElementById('office').value == null || 
document.getElementById('office').value == 0)
        {
                alert("Hovedansvarlig kulturkontor må fylles ut!");
@@ -180,205 +207,214 @@
 
 </script>
 
-<div class="yui-content" style="width: 100%;">
+<div class="yui-content">
        <div id="details">
-       
-       <?php if($message){?>
-       <div class="success">
-               <?php echo $message;?>
-       </div>
-       <?php }else if($error){?>
-       <div class="error">
-               <?php echo $error;?>
-       </div>
-       <?php }?>
-       </div>
-               <h1><?php echo lang('activity') ?></h1>
+       
+       <?php if($message){?>
+       <div class="success">
+               <?php echo $message;?>
+       </div>
+       <?php }else if($error){?>
+       <div class="error">
+               <?php echo $error;?>
+       </div>
+       <?php }?>
+       </div>
+       <div class="pageTop">
+               <h1><?php echo lang('activity') ?></h1>
+                       <div>
+                           <?php echo lang('required_fields')?>
+                       </div>
+       </div>
                <form action="#" method="post">
                        <input type="hidden" name="id" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
-                       <dl class="proplist-col" style="width: 200%">
-                               <h2><?php echo lang('what')?></h2>
-                               <dt>
-                                       <label for="title"><?php echo 
lang('title') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php echo lang('title_helptext')?><br/>
-                                       <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" size="60"/>
-                               </dd>
-                               <dt>
-                                       <label for="category"><?php echo 
lang('category') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_category_id = 
$activity->get_category();
-                                       ?>
-                                       <select name="category" id="category">
-                                               <option value="0">Ingen 
kategori valgt</option>
-                                               <?php
-                                               foreach($categories as 
$category)
-                                               {
-                                                       echo "<option 
".($current_category_id == $category->get_id() ? 'selected="selected"' : "")." 
value=\"{$category->get_id()}\">".$category->get_name()."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label for="target"><?php echo 
lang('target') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_target_ids = 
$activity->get_target();
-                                       $current_target_id_array=explode(",", 
$current_target_ids);
-                                       foreach($targets as $t)
-                                       {
-                                       ?>
-                                               <input name="target[]" 
type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
-                                       <?php
-                                       }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <label for="district"><?php echo 
lang('district') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_district_ids = 
$activity->get_district();
-                                       $current_district_id_array=explode(",", 
$current_district_ids);
-                                       foreach($districts as $d)
-                                       {
-                                       ?>
-                                               <input name="district[]" 
type="checkbox" value="<?php echo $d['part_of_town_id']?>" <?php echo 
(in_array($d['part_of_town_id'], $current_district_id_array) ? 'checked' : 
"")?>/><?php echo $d['name']?><br/>
-                                       <?php
-                                       }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
-                               </dt>
-                               <dd>
-                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation" <?php echo 
$activity->get_special_adaptation() ? ' checked="checked"' : '' ?>/>
-                               </dd>
-                               <hr />
-                               <h2><?php echo lang('where_when')?></h2>
-                               <dt>
-                                       <label for="arena"><?php echo 
lang('arena') ?></label>
-                                       <br/><?php echo lang('arena_helptext')?>
-                               </dt>
-                               <dt>
-                                       <label for="internal_arena_id"><?php 
echo lang('building') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_internal_arena_id = 
$activity->get_internal_arena();
-                                       ?>
-                                       <select name="internal_arena_id" 
id="internal_arena_id" onchange="javascript: check_internal();">
-                                               <option value="0">Ingen 
kommunale bygg valgt</option>
-                                               <?php
-                                               foreach($buildings as 
$building_id => $building_name)
-                                               {
-                                                       echo "<option 
".($current_internal_arena_id == $building_id? 'selected="selected"' : "")." 
value=\"{$building_id}\">".$building_name."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label for="arena_id"><?php echo 
lang('external_arena') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_arena_id = 
$activity->get_arena();
-                                       ?>
-                                       <select name="arena_id" id="arena_id" 
style="width: 400px;" onchange="javascript: check_external();">
-                                               <option value="0">Ingen arena 
valgt</option>
-                                               <?php
-                                               foreach($arenas as $arena)
-                                               {
-                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label for="time"><?php echo 
lang('time') ?></label>
-                               </dt>
-                               <dd>
-                                       <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" />
-                               </dd>
-                               <dt>
-                                       <label for="office"><?php echo 
lang('office') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $selected_office = 
$activity->get_office();
-                                       ?>
-                                       <select name="office" id="office">
-                                               <option value="0">Ingen kontor 
valgt</option>
-                                               <?php
-                                               foreach($offices as $office)
-                                               {
-                                                       echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <hr />
-                               <h2><?php echo lang('who')?></h2>
-                               <dt>
-                                       <label for="organization_id"><?php echo 
lang('organization') ?></label>
-                               </dt>
-                               <input type="hidden" name="organization_id" 
id="organization_id" value="<?php echo $organization->get_id()?>" />
-                               <dd><label 
for="orgname">Organisasjonsnavn</label>:
-                               <?php echo $organization->get_name()?></dd>
-                               <dd><label 
for="orgno">Organisasjonsnummer</label>:
-                               <?php echo 
$organization->get_organization_number()?></dd>
-                               <dd><label for="homepage">Hjemmeside</label>:
-                               <?php echo $organization->get_homepage()?></dd>
-                               <dd><label for="email">E-post</label>:
-                               <?php echo $organization->get_email()?></dd>
-                               <dd><label for="phone">Telefon</label>:
-                               <?php echo $organization->get_phone()?></dd>
-                               <dd><label for="street">Adresse</label>:
-                               <?php echo $organization->get_address()?></dd>
-                               <dd><label 
for="org_description">Beskrivelse</label>:<br/>
-                               <textarea rows="10" cols="100" 
name="org_description" size="254"><?php echo 
$organization->get_description()?></textarea></dd>
-                               <dt>
-                                       <?php if($activity->get_group_id() || 
$editable) { ?>
-                                       <label for="group_id" 
id="group_label"><?php echo lang('group') ?></label>
-                                       <?php } ?>
-                               </dt>
-                               <dd>
-                                       <?php
-                                               if($activity->get_group_id()){
-                                                       echo $group->get_name();
-                                               }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <?php 
if($activity->get_contact_person_1()) { ?>
-                                       <label for="contact_person_1"><?php 
echo lang('contact_person_1') ?></label>
-                                       <?php  } ?>
-                               </dt>
-                               <dd><label 
for="contact1_name">Navn</label>:<?php echo 
isset($contact1)?$contact1->get_name():''?></dd>
-                               <dd><label 
for="contact1_phone">Telefon</label>:<?php echo 
isset($contact1)?$contact1->get_phone():''?></dd>
-                               <dd><label 
for="contact1_mail">E-post</label>:<?php echo 
isset($contact1)?$contact1->get_email():''?></dd>
-                               <dt>
-                                       <?php 
if($activity->get_contact_person_2()) { ?>
-                                       <label for="contact_person_2"><?php 
echo lang('contact_person_2') ?></label>
-                                       <?php  } ?>
-                               </dt>
-                               <dd><label 
for="contact2_name">Navn</label>:<?php echo 
isset($contact2)?$contact2->get_name():''?></dd>
-                               <dd><label 
for="contact2_phone">Telefon</label>:<?php echo 
isset($contact2)?$contact2->get_phone():''?></dd>
-                               <dd><label 
for="contact2_mail">E-post</label>:<?php echo 
isset($contact2)?$contact2->get_email():''?></dd>
-                       </dl>
-                       <div class="form-buttons">
+                       <dl class="proplist-col">
+                               <fieldset title="<?php echo lang('what')?>">
+                                       <legend>Hva</legend>
+                               <dt>
+                                       <label for="title"><?php echo 
lang('activity_title') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          
src="/aktivitetsoversikt/images/hjelp.gif"></A></label>
+                               </dt>
+                               <dd>
+                                       <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" size="83"/>
+                               </dd>
+                               <DT>
+                                       <LABEL for="org_description"><?php echo 
lang('description')?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                       
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                       target="name"><IMG alt="Hjelp" 
+                       
src="/aktivitetsoversikt/images/hjelp.gif"></A></LABEL></DT>
+                    <DD><TEXTAREA cols="80" rows="4" name="description" 
id="description"><?php echo $activity->get_description() ?></TEXTAREA></DD>
+                               <dt>
+                                       <label for="category"><?php echo 
lang('category') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                              
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                              target="name"><IMG alt="Hjelp" 
+                              
src="/aktivitetsoversikt/images/hjelp.gif"></A></label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       $current_category_id = 
$activity->get_category();
+                                       ?>
+                                       <select name="category" id="category">
+                                               <option value="0">Ingen 
kategori valgt</option>
+                                               <?php
+                                               foreach($categories as 
$category)
+                                               {
+                                                       echo "<option 
".($current_category_id == $category->get_id() ? 'selected="selected"' : "")." 
value=\"{$category->get_id()}\">".$category->get_name()."</option>";
+                                               }
+                                               ?>
+                                       </select>
+                               </dd>
+                               </fieldset>
+                               <fieldset id="hvem"><legend>For hvem</legend>
+                               <dt>
+                                       <label for="target"><?php echo 
lang('target') ?> (*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                              
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                              target="name"><IMG alt="Hjelp" 
+                              src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                        </label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       $current_target_ids = 
$activity->get_target();
+                                       $current_target_id_array=explode(",", 
$current_target_ids);
+                                       foreach($targets as $t)
+                                       {
+                                       ?>
+                                               <input name="target[]" 
type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
+                                       <?php
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation" <?php echo 
$activity->get_special_adaptation() ? ' checked="checked"' : '' ?>/>
+                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
+                                       <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                             
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                             target="name"><IMG alt="Hjelp" 
+                             src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                               </dt>
+                       </fieldset>
+                               <fieldset title="hvor">
+                                       <LEGEND>Hvor og når</LEGEND>
+                               <dt>
+                                       <br/>
+                                       <label for="arena"><?php echo 
lang('arena') ?> (*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                        </label>
+                                       <br/>
+                               </dt>
+                               <dd>
+                               <?php 
+                                   $internal_arena_id = 
$activity->get_internal_arena();
+                                   $arena_id = $activity->get_arena();
+                               ?>
+                                       <select name="internal_arena_id" 
id="internal_arena_id" style="width: 200px;">
+                                                       <option 
value="0">Lokale ikke valgt</option>
+                                                       <optgroup label="<?php 
echo lang('building') ?>">
+                                                       <?php
+                                                       foreach($buildings as 
$building_id => $building_name)
+                                                       {
+                                                           
if($internal_arena_id && $internal_arena_id == $building_id)
+                                                               $selected = 
"selected";
+                                                           else
+                                                               $selected = "";
+                                                               echo "<option 
value=\"i_{$building_id}\" {$selected}>".$building_name."</option>";
+                                                       }
+                                                       ?>
+                                                       </optgroup>
+                                                       <optgroup label="<?php 
echo lang('building') ?>">
+                                                       <?php 
+                                                       foreach($arenas as 
$arena)
+                                                       {
+                                                           if($arena_id && 
$arena_id == $arena->get_id())
+                                                               $selected = 
"selected";
+                                                           else
+                                                               $selected = "";
+                                                               echo "<option 
value=\"e_{$arena->get_id()}\" title=\"{$arena->get_arena_name()}\" 
{$selected}>".$arena->get_arena_name()."</option>";
+                                                       }
+                                                       ?>
+                                                       </optgroup>
+                                       </select>
+                                       <BR>
+                               </dd>
+                               <dt>
+                                       <label for="district"><?php echo 
lang('district') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                              
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                              target="name"><IMG alt="Hjelp" 
+                              src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                        </label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       $current_district_id = 
$activity->get_district();
+                                       
//$current_district_id_array=explode(",", $current_district_ids);
+                                       foreach($districts as $d)
+                                       {
+                                       ?>
+                                               <input name="district" 
type="radio" value="<?php echo $d['part_of_town_id']?>" <?php echo 
($d['part_of_town_id'] == $current_district_id) ? 'checked' : "" ?>/><?php echo 
$d['name']?><br/>
+                                       <?php
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <label for="time"><?php echo 
lang('time') ?> (*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                                               
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                                               target="name"><IMG alt="Hjelp" 
+                                       
src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                               </label>
+                               </dt>
+                               <dd>
+                                       <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" size="80" />
+                               </dd>
+                               </fieldset>
+                               <FIELDSET id="arr">
+                                       <LEGEND>Kontaktperson</LEGEND><BR>
+                                       Kontaktperson for aktiviteten <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                       
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                       target="name"><IMG alt="Hjelp" 
src="/aktivitetsoversikt/images/hjelp.gif"></A><BR>
+                                       <DT><LABEL for="contact_name">Navn 
(*)</LABEL></DT>
+                       <DD><INPUT name="contact_name" id="contact_name" 
size="80" type="text" value="<?php echo $contact1->get_name()?>"></DD>
+                       <DT><LABEL for="contact_phone">Telefon (*)</LABEL></DT>
+                       <DD><INPUT name="contact_phone" id="contact_phone" 
type="text" value="<?php echo $contact1->get_phone()?>"></DD>
+                       <DT><LABEL for="contact_mail">E-post (*)</LABEL></DT>
+                       <DD><INPUT name="contact_mail" id="contact_mail" 
size="50" type="text" value="<?php echo $contact1->get_email()?>"></DD>
+                       <DT><LABEL for="contact2_mail2">Gjenta e-post 
(*)</LABEL></DT>
+                       <DD><INPUT name="contact_mail2" id="contact_mail2" 
size="50" type="text" value="<?php echo $contact1->get_email()?>"></DD>
+                               </FIELDSET>
+                               <FIELDSET>
+                               <BR>
+                    <DT><LABEL for="office">Hvilket kulturkontor skal motta 
registreringen (*) <A 
+                      onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                      
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                      target="name"><IMG alt="Hjelp" 
+                      
src="/aktivitetsoversikt/images/hjelp.gif"></A></LABEL></DT>
+                               <dd>
+                                       <?php
+                                       $selected_office = 
$activity->get_office();
+                                       ?>
+                                       <select name="office" id="office">
+                                               <option value="0">Ingen kontor 
valgt</option>
+                                               <?php
+                                               foreach($offices as $office)
+                                               {
+                                                       echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
+                                               }
+                                               ?>
+                                       </select>
+                               </dd>
+                               </FIELDSET>
+                               <div class="form-buttons">
                                <?php
                                        if ($editable) {
                                                echo '<input type="submit" 
name="save_activity" value="' . lang('save') . '" onclick="return allOK();"/>';
                                        }
                                ?>
-                       </div>
-                       
+                               </div>
+                       </dl>
                </form>
-               
        </div>
 </div>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-08-06 12:25:59 UTC (rev 9833)
@@ -6,32 +6,57 @@
 ?>
 
 <script type="text/javascript">
-
-function checkNewGroup()
-{
-       var group_selected = document.getElementById('group_id').value;
-       if(group_selected == 'new_group')
-       {
-               document.getElementById('new_group_fields').style.display = 
"block";
+function toggle() {
+       var ele = document.getElementById("toggleText");
+       var text = document.getElementById("displayText");
+       var arenahidden = document.getElementById("new_arena_hidden");
+       if(ele.style.display == "block") {
+               ele.style.display = "none";
+               text.innerHTML = "Registrer nytt lokale";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "";
+               arenahidden.value="new_arena";
        }
-       else
-       {
-               document.getElementById('new_group_fields').style.display = 
"none";
+}
+function toggle2() {
+       var ele = document.getElementById("toggleText2");
+       var text = document.getElementById("displayText2");
+       if(ele.style.display == "block") {
+               ele.style.display = "none";
+               text.innerHTML = "Legg til alternativ kontaktperson";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "";
        }
 }
-
-function checkNewArena()
-{
-       var arena_selected = document.getElementById('arena_id').value;
-       if(arena_selected == 'new_arena')
-       {
-               document.getElementById('new_arena_fields').style.display = 
"block";
+function toggle3() {
+       var ele = document.getElementById("toggleText3");
+       var text = document.getElementById("displayText3");
+       if(ele.style.display == "block") {
+               ele.style.display = "none";
+               text.innerHTML = "Registrer ny organisasjon";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "(X)";
        }
-       else
-       {
-               document.getElementById('new_arena_fields').style.display = 
"none";
-       }
 }
+function showhide(id)
+{
+    if(id == "org")
+    {
+       document.getElementById('orgf').style.display = "block";
+       document.getElementById('no_orgf').style.display = "none";
+    }
+    else
+    {
+           document.getElementById('orgf').style.display = "none";
+          document.getElementById('no_orgf').style.display = "block";
+    }
+}
 
 function get_address_search()
 {
@@ -133,67 +158,59 @@
        }
 }
 
-function run_checks()
+function allOK()
 {
-       check_external();
-       checkNewArena();
-}
-
-function check_internal()
-{
-       if(document.getElementById('internal_arena_id').value != null && 
document.getElementById('internal_arena_id').value > 0)
+       alert(document.getElementById('district').value);
+       if(document.getElementById('title').value == null || 
document.getElementById('title').value == '')
        {
-               //disable external arena drop-down
-               document.getElementById('arena_id').disabled="disabled";
-               document.getElementById('new_arena_fields').style.display = 
"none";
+               alert("Tittel må fylles ut!");
+               return false;
        }
-       else
+       if(document.getElementById('description').value == null || 
document.getElementById('description').value == '')
        {
-               //enable external arena drop-down
-               document.getElementById('arena_id').disabled="";
+               alert("Beskrivelse må fylles ut!");
+               return false;
        }
-}
-
-function check_external()
-{
-       if(document.getElementById('arena_id').value != null && 
(document.getElementById('arena_id').value > 0 || 
document.getElementById('arena_id').value == 'new_arena'))
+       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
        {
-               //disable internal arena drop-down
-               
document.getElementById('internal_arena_id').disabled="disabled";
+               alert("Kategori må fylles ut!");
+               return false;
+       } 
+       if((document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0) && 
(document.getElementById('new_arena_hidden').value==null || 
document.getElementById('new_arena_hidden').value==''))
+       {
+               alert("Lokale må fylles ut!");
+               return false;
        }
-       else
+       if(document.getElementById('time').value == null || 
document.getElementById('time').value == '')
        {
-               //enable internal arena drop-down
-               document.getElementById('internal_arena_id').disabled="";
-               document.getElementById('new_arena_fields').style.display = 
"none";
+               alert("Dag og tid må fylles ut!");
+               return false;
        }
-}
-
-function allOK()
-{
-       if(document.getElementById('title').value == null || 
document.getElementById('title').value == '')
+       if(document.getElementById('contact_name').value == null || 
document.getElementById('contact_name').value == '')
        {
-               alert("Tittel må fylles ut!");
+               alert("Navn på kontaktperson må fylles ut!");
                return false;
-       } 
-       if(document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0)
+       }
+       if(document.getElementById('contact_phone').value == null || 
document.getElementById('contact_phone').value == '')
        {
-               if(document.getElementById('arena_id').value == null || 
document.getElementById('arena_id').value == 0)
-               {
-                       alert("Arena må fylles ut!");
-                       return false;
-               }
+               alert("Telefonnummer til kontaktperson må fylles ut!");
+               return false;
        }
-       if(document.getElementById('time').value == null || 
document.getElementById('time').value == '')
+       if(document.getElementById('contact_mail').value == null || 
document.getElementById('contact_mail').value == '')
        {
-               alert("Tid må fylles ut!");
+               alert("E-postadresse til kontaktperson må fylles ut!");
                return false;
        }
-       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
+       if(document.getElementById('contact_mail2').value == null || 
document.getElementById('contact_mail2').value == '')
        {
-               alert("Kategori må fylles ut!");
+               alert("Begge felter for E-post må fylles ut!");
                return false;
        }
+       if(document.getElementById('contact_mail').value != 
document.getElementById('contact_mail2').value)
+       {
+               alert("E-post må være den samme i begge felt!");
+               return false;
+       }
        if(document.getElementById('office').value == null || 
document.getElementById('office').value == 0)
        {
                alert("Hovedansvarlig kulturkontor må fylles ut!");
@@ -205,253 +222,248 @@
 
 </script>
 
-<div class="yui-content" style="width: 100%;">
+<div class="yui-content">
        <div id="details">
        
-       <?php if($message){?>
-       <div class="success">
-               <?php echo $message;?>
-       </div>
-       <?php }else if($error){?>
-       <div class="error">
-               <?php echo $error;?>
-       </div>
-       <?php }?>
-       </div>
-               <h1><?php echo lang('new_activity') ?></h1>
-               <div>
-                       <?php echo lang('required_fields')?>
+       <?php if($message){?>
+       <div class="success">
+               <?php echo $message;?>
+       </div>
+       <?php }else if($error){?>
+       <div class="error">
+               <?php echo $error;?>
+       </div>
+       <?php }?>
+       </div>
+               <div class="pageTop">
+                       <h1><?php echo lang('new_activity') ?></h1>
+                       <div>
+                           <?php echo lang('required_fields')?>
+                       </div>
                </div>
                <form action="#" method="post">
                        <input type="hidden" name="id" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
-                       <dl class="proplist-col" style="width: 200%">
-                               <h2><?php echo lang('what')?></h2>
-                               <dt>
-                                       <label for="title"><?php echo 
lang('title') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <?php echo lang('title_helptext')?><br/>
-                                       <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" size="60"/>
-                               </dd>
-                               <dt>
-                                       <label for="category"><?php echo 
lang('category') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_category_id = 
$activity->get_category();
-                                       ?>
-                                       <select name="category" id="category">
-                                               <option value="0">Ingen 
kategori valgt</option>
-                                               <?php
-                                               foreach($categories as 
$category)
-                                               {
-                                                       echo "<option 
".($current_category_id == $category->get_id() ? 'selected="selected"' : "")." 
value=\"{$category->get_id()}\">".$category->get_name()."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label for="target"><?php echo 
lang('target') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_target_ids = 
$activity->get_target();
-                                       $current_target_id_array=explode(",", 
$current_target_ids);
-                                       foreach($targets as $t)
-                                       {
-                                       ?>
-                                               <input name="target[]" 
type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
-                                       <?php
-                                       }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <label for="district"><?php echo 
lang('district') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       foreach($districts as $d)
-                                       {
-                                       ?>
-                                               <input name="district[]" 
type="checkbox" value="<?php echo $d['part_of_town_id']?>" /><?php echo 
$d['name']?><br/>
-                                       <?php
-                                       }
-                                       ?>
-                               </dd>
-                               <dt>
-                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
-                               </dt>
-                               <dd>
-                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation" />
-                               </dd>
-                               <hr />
-                               <h2><?php echo lang('where_when')?></h2>
-                               <dt>
-                                       <label for="arena"><?php echo 
lang('arena') ?> (*)</label>
-                                       <br/><?php echo lang('arena_helptext')?>
-                               </dt>
-                               <dt>
-                                       <label for="internal_arena_id"><?php 
echo lang('building') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_internal_arena_id = 
$activity->get_internal_arena();
-                                       ?>
-                                       <select name="internal_arena_id" 
id="internal_arena_id" onchange="javascript: check_internal();">
-                                               <option value="0">Ingen 
kommunale bygg valgt</option>
-                                               <?php
-                                               foreach($buildings as 
$building_id => $building_name)
-                                               {
-                                                       echo "<option 
".($current_internal_arena_id == $building_id? 'selected="selected"' : "")." 
value=\"{$building_id}\">".$building_name."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label for="arena_id"><?php echo 
lang('external_arena') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $current_arena_id = 
$activity->get_arena();
-                                       ?>
-                                       <select name="arena_id" id="arena_id" 
style="width: 400px;" onchange="javascript: run_checks();">
-                                               <option value="0">Ingen arena 
valgt</option>
-                                               <option value="new_arena">Ny 
arena</option>
-                                               <?php
-                                               foreach($arenas as $arena)
-                                               {
-                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <span id="new_arena_fields" style="display: 
none;">
+                       <input type="hidden" name="organization_id" 
value="<?php echo $organization->get_id() ?>"/>
+                       <?php if($new_organization){?>
+                               <input type="hidden" name="new_organization" 
value="yes"/>
+                       <?php }?>
+                       <input type="hidden" name="new_arena_hidden" 
id="new_arena_hidden" value=""/>
+                       <dl class="proplist-col">
+                               <fieldset title="<?php echo lang('what')?>">
+                                       <legend>Hva</legend>
+                               <dt>
+                                       <label for="title"><?php echo 
lang('activity_title') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+  href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+  target="name"><IMG alt="Hjelp" 
+  src="/aktivitetsoversikt/images/hjelp.gif"></A></label>
+                               </dt>
+                               <dd>
+                                       <input type="text" name="title" 
id="title" value="<?php echo $activity->get_title() ?>" size="83"/>
+                               </dd>
+                               <DT><LABEL for="org_description"><?php echo 
lang('description')?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                      
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                      target="name"><IMG alt="Hjelp" 
+                      
src="/aktivitetsoversikt/images/hjelp.gif"></A></LABEL></DT>
+                    <DD><TEXTAREA cols="80" rows="4" name="description" 
id="description"></TEXTAREA></DD>
+                               <dt>
+                                       <label for="category"><?php echo 
lang('category') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          
src="/aktivitetsoversikt/images/hjelp.gif"></A></label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       $current_category_id = 
$activity->get_category();
+                                       ?>
+                                       <select name="category" id="category">
+                                               <option value="0">Ingen 
kategori valgt</option>
+                                               <?php
+                                               foreach($categories as 
$category)
+                                               {
+                                                       echo "<option 
".($current_category_id == $category->get_id() ? 'selected="selected"' : "")." 
value=\"{$category->get_id()}\">".$category->get_name()."</option>";
+                                               }
+                                               ?>
+                                       </select>
+                               </dd>
+                               </fieldset>
+                               <fieldset id="hvem"><legend>For hvem</legend>
+                               <dt>
+                                       <label for="target"><?php echo 
lang('target') ?> (*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                        </label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       $current_target_ids = 
$activity->get_target();
+                                       $current_target_id_array=explode(",", 
$current_target_ids);
+                                       foreach($targets as $t)
+                                       {
+                                       ?>
+                                               <input name="target[]" 
type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
+                                       <?php
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <input type="checkbox" 
name="special_adaptation" id="special_adaptation" />
+                                       <label for="special_adaptation"><?php 
echo lang('special_adaptation') ?></label>
+                                       <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                               </dt>
+                               </fieldset>
+                               <fieldset title="hvor">
+                                       <LEGEND>Hvor og når</LEGEND>
                                        <dt>
-                                               <label for="new_arena"><?php 
echo lang('new_arena') ?></label>
-                                       </dt>
-                                       <dt><label for="arena_name"><?php echo 
lang('name') ?></label></dt>
-                                       <dd><input type="text" 
name="arena_name" id="arena_name" /></dd>
-                                       <dt><label for="arena_address"><?php 
echo lang('address') ?></label></dt>
-                                       <dd><input type="text" 
name="arena_address" id="arena_address" 
onkeyup="javascript:get_address_search_arena()"/>
-                                       <div id="arena_address_container"></div>
-                                       <label for="arena_number">Nummer</label>
-                                       <input type="text" 
name="arena_number"/><br/>
-                                       <label 
for="arena_postaddress">Postnummer og Sted</label>
-                                       <input type="text" 
name="arena_postaddress"/></dd>
-                               </span>
-                               <dt>
-                                       <label for="time"><?php echo 
lang('time') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" />
-                               </dd>
-                               <dt>
-                                       <label for="office"><?php echo 
lang('office') ?> (*)</label>
-                               </dt>
-                               <dd>
-                                       <?php
-                                       $selected_office = 
$activity->get_office();
-                                       ?>
-                                       <select name="office" id="office">
-                                               <option value="0">Ingen kontor 
valgt</option>
-                                               <?php
-                                               foreach($offices as $office)
-                                               {
-                                                       echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
-                                               }
-                                               ?>
-                                       </select>
-                               </dd>
-                               <dt>Kontaktinformasjon for kulturkontoret 
(*)</dt>
-                               <dt><label 
for="contact2_address">Adresse</label>
-                               <dd><input type="text" name="contact2_address" 
id="contact2_address" onkeyup="javascript:get_address_search_cp2()"/>
-                               <div id="contact2_address_container"></div></dd>
-                               <dt><label 
for="contact2_number">Husnummer</label></dt>
-                               <dd><input type="text" 
name="contact2_number"/></dd>
-                               <dt><label 
for="contact2_postaddress">Postnummer og Sted</label>
-                               <dd><input type="text" 
name="contact2_postaddress" size="100"/></dd>
-                               <hr />
-                               <h2><?php echo lang('who')?></h2>
-                               <dt>
-                                       <label for="organization_id"><?php echo 
lang('organization') ?> (*)</label>
-                               </dt>
-                               <?php if($new_organization){?>
-                                       <input type="hidden" name="new_org" 
id="new_org" value="yes" />
-                               <?php }?>
-                                       <input type="hidden" 
name="organization_id" id="organization_id" value="<?php echo 
$organization->get_id()?>" />
-                                       <dt><label 
for="orgname">Organisasjonsnavn</label></dt>
-                                       <dd><?php echo 
$organization->get_name()?></dd>
-                                       <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
-                                       <dd><?php echo 
$organization->get_organization_number()?></dd>
-                                       <dt><label 
for="homepage">Hjemmeside</label></dt>
-                                       <dd><?php echo 
$organization->get_homepage()?></dd>
-                                       <dt><label 
for="email">E-post</label></dt>
-                                       <dd><?php echo 
$organization->get_email()?></dd>
-                                       <dt><label 
for="phone">Telefon</label></dt>
-                                       <dd><?php echo 
$organization->get_phone()?></dd>
-                                       <dt><label 
for="street">Adresse</label></dt>
-                                       <dd><?php echo 
$organization->get_address()?></dd>
-                                       <dt><label 
for="org_description">Beskrivelse av aktiviteten</label></dt>
-                                       <dd><?php echo 
$organization->get_description()?></dd>
-                               <hr/>
-                               <dt>Kontaktperson 1</dt>
-                               <dt><label for="contact1_name">Navn</label></dt>
-                               <dd><?php echo 
isset($contact1)?$contact1->get_name():''?></dd>
-                               <dt><label 
for="contact1_phone">Telefon</label></dt>
-                               <dd><?php echo 
isset($contact1)?$contact1->get_phone():''?></dd>
-                               <dt><label 
for="contact1_mail">E-post</label></dt>
-                               <dd><?php echo 
isset($contact1)?$contact1->get_email():''?></dd>
-                               <dt>Kontaktperson 2</dt>
-                               <dt><label for="contact2_name">Navn</label></dt>
-                               <dd><?php echo 
isset($contact2)?$contact2->get_name():''?></dd>
-                               <dt><label 
for="contact2_phone">Telefon</label></dt>
-                               <dd><?php echo 
isset($contact2)?$contact2->get_phone():''?></dd>
-                               <dt><label 
for="contact2_mail">E-post</label></dt>
-                               <dd><?php echo 
isset($contact2)?$contact2->get_email():''?></dd>
-                               <hr/>
-                               <?php if(!$new_organization){?>
-                               <dt>
-                                       <label for="group_id" 
id="group_label"><?php echo lang('group') ?></label>
-                               </dt>
-                               <dd>
-                                       <?php echo lang('group_helptext')?><br/>
-                                       <select name="group_id" id="group_id" 
onchange="javascript:checkNewGroup()">
-                                               <option value="0">Ingen gruppe 
valgt</option>
-                                               <option value='new_group'>Ny 
gruppe</option>
-                                       <?php foreach($groups as $group){?>
-                                               <option value="<?php echo 
$group->get_id()?>"><?php echo $group->get_name()?></option>
-                                       <?php }?>
-                                       </select>
-                               </dd>
-                               <span id="new_group_fields" style="display: 
none;">
-                                       <dt><label for="groupname">Navn 
(*)</label></dt>
-                                       <dd><input type="text" name="groupname" 
size="100"/><br/></dd>
-                                       <dt><label 
for="group_description">Beskrivelse av aktiviteten (*)</label></dt>
-                                       <dd><textarea rows="10" cols="100" 
name="group_description"></textarea></dd>
-                                       <hr/>
-                                       <dt>Kontaktperson 1</dt>
-                                       <dt><label for="contact1_name">Navn 
(*)</label></dt>
-                                       <dd><input type="text" 
name="group_contact1_name" value="<?php echo 
isset($contact1)?$contact1->get_name():''?>"/></dd>
-                                       <dt><label for="contact1_phone">Telefon 
(*)</label></dt>
-                                       <dd><input type="text" 
name="group_contact1_phone" value="<?php echo 
isset($contact1)?$contact1->get_phone():''?>"/></dd>
-                                       <dt><label for="contact1_mail">E-post 
(*)</label></dt>
-                                       <dd><input type="text" 
name="group_contact1_mail" value="<?php echo 
isset($contact1)?$contact1->get_email():''?>"/></dd>
-                                       <dt>Kontaktperson 2</dt>
-                                       <dt><label 
for="contact2_name">Navn</label></dt>
-                                       <dd><input type="text" 
name="group_contact2_name" value="<?php echo 
isset($contact2)?$contact2->get_name():''?>"/></dd>
-                                       <dt><label 
for="contact2_phone">Telefon</label></dt>
-                                       <dd><input type="text" 
name="group_contact2_phone" value="<?php echo 
isset($contact2)?$contact2->get_phone():''?>"/></dd>
-                                       <dt><label 
for="contact2_mail">E-post</label></dt>
-                                       <dd><input type="text" 
name="group_contact2_mail" value="<?php echo 
isset($contact2)?$contact2->get_email():''?>"/></dd>
-                                       <hr/>
-                               </span>
-                               <?php }?>
+                                       <br/>
+                                       <label for="arena"><?php echo 
lang('location') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                      
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                      target="name"><IMG alt="Hjelp" 
+                      src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                    </label>
+                               </dt>
+                               <dd>
+                                       <select name="internal_arena_id" 
id="internal_arena_id" style="width: 200px;">
+                                               <option value="0">Lokale ikke 
valgt</option>
+                                               <optgroup label="<?php echo 
lang('building') ?>">
+                                               <?php
+                                               foreach($buildings as 
$building_id => $building_name)
+                                               {
+                                                       echo "<option 
value=\"i_{$building_id}\">".$building_name."</option>";
+                                               }
+                                               ?>
+                                               </optgroup>
+                                               <optgroup label="<?php echo 
lang('building') ?>">
+                                               <?php 
+                                               foreach($arenas as $arena)
+                                                       {
+                                                               echo "<option 
value=\"e_{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
+                                                       }
+                                                       ?>
+                                               </optgroup>
+                                       </select>
+                                       <BR>
+                                       <A id="displayText" 
href="javascript:toggle();">Ikke i listen? Registrer nytt lokale</A>
+                               </dd>
+                    <DIV style="overflow: auto; display: none;" 
id="toggleText">
+                       <DT>
+                               <label for="new_arena"><?php echo 
lang('register_new_arena') ?></label>
+                                       <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                                       
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                                       target="name"><IMG alt="Hjelp" 
src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                       </DT>
+                       <DT><LABEL for="arena_name"><?php echo lang('name') ?> 
(*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                              
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                              target="name"><IMG alt="Hjelp" 
+                              
src="/aktivitetsoversikt/images/hjelp.gif"></A></LABEL></DT>
+                       <DD><INPUT id="arena_name" name="arena_name" size="50" 
type="text"></DD>
+                       <DT style="margin-right: 20px; float: left;">
+                       <LABEL 
+                            for="arena_address">Gateadresse (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                            
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                            target="name"><IMG alt="Hjelp" 
+                            src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                        </LABEL><BR>
+                        <INPUT id="arena_address" 
+                            onkeyup="javascript:get_address_search_arena()" 
name="arena_address" size="50" 
+                               type="text"><BR>
+                       <DIV id="arena_address_container"></DIV></DT>
+                       <DT style="clear: right; float: left;"><LABEL 
+                               for="arena_number">Husnummer</LABEL><BR><INPUT 
name="arena_number" size="5" 
+                               type="text"></DT><BR>
+                       <DT style="clear: left; margin-right: 20px; float: 
left;"><LABEL for="postaddress">Postnummer(*)</LABEL><BR><INPUT 
+                               name="postaddress" size="5" type="text"></DT>
+                       <DT style="float: left;">
+                               <LABEL for="arena_postaddress">Poststed 
(*)</LABEL><BR>
+                               <INPUT name="arena_postaddress" size="40" 
type="text">
+                       </DT>
+                       <BR>
+                       </DIV>
+                               <dt>
+                                       <br/>
+                                       <label for="district"><?php echo 
lang('district') ?> (*) <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                          
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                          target="name"><IMG alt="Hjelp" 
+                          src="/aktivitetsoversikt/images/hjelp.gif"></A>
+                                       </label>
+                               </dt>
+                               <dd>
+                                       <?php
+                                       foreach($districts as $d)
+                                       {
+                                       ?>
+                                               <input name="district" 
type="radio" value="<?php echo $d['part_of_town_id']?>" /><?php echo 
$d['name']?><br/>
+                                       <?php
+                                       }
+                                       ?>
+                               </dd>
+                               <dt>
+                                       <br/>
+                                       <label for="time"><?php echo 
lang('time') ?> (*) <A onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+      
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+      target="name"><IMG alt="Hjelp" 
+      src="/aktivitetsoversikt/images/hjelp.gif"></A></label>
+                               </dt>
+                               <dd>
+                                       <input type="text" name="time" 
id="time" value="<?php echo $activity->get_time() ?>" size="80" />
+                               </dd>
+                               </fieldset>
+                               <FIELDSET 
id="arr"><LEGEND>Kontaktperson</LEGEND><BR>
+                               Kontaktperson for aktiviteten <A 
onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                  
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                  target="name"><IMG alt="Hjelp" 
src="/aktivitetsoversikt/images/hjelp.gif"></A><BR>
+                 <DT><LABEL for="contact_name">Navn (*)</LABEL></DT>
+                  <DD><INPUT name="contact_name" id="contact_name" size="80" 
type="text"></DD>
+                  <DT><LABEL for="contact_phone">Telefon (*)</LABEL></DT>
+                  <DD><INPUT name="contact_phone" id="contact_phone" 
type="text"></DD>
+                  <DT><LABEL for="contact_mail">E-post (*)</LABEL></DT>
+                  <DD><INPUT name="contact_mail" id="contact_mail" size="50" 
type="text"></DD>
+                  <DT><LABEL for="contact2_mail2">Gjenta e-post 
(*)</LABEL></DT>
+                  <DD><INPUT name="contact_mail2" id="contact_mail2" size="50" 
type="text"></DD><!-- <a id="displayText2" href="javascript:toggle2();">Legg 
til alternativ kontaktperson</a><br>
+                               <div id="toggleText2" style="display: none">
+                               
+                               Alternativ kontaktperson <a href="hjelp.html" 
target="name"
+onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;"
+><img src="images/hjelp.gif" alt="Hjelp"></a><br>
+                               <dt><label for="contact1_name">Navn 
(*)</label></dt>
+                               <dd><input name="org_contact1_name" size="80" 
type="text"></dd>
+                               <dt><label for="contact1_phone">Telefon 
(*)</label></dt>
+                               <dd><input name="org_contact1_phone" 
type="text"></dd>
+                               <dt><label for="contact1_mail">E-post 
(*)</label></dt>
+                               <dd><input name="org_contact1_mail" type="text" 
size="50"></dd>
+                               </div><br> -->
+                               </FIELDSET>
+                       <FIELDSET>
+                               <BR>
+                    <DT><LABEL for="office">Hvilket kulturkontor skal motta 
registreringen (*) <A 
+                      onclick="window.open('hjelp.html','name','height=255, 
width=350,toolbar=no,directories=no,status=no, 
menubar=no,scrollbars=no,resizable=no'); return false;" 
+                      
href="http://dl-web.dropbox.com/u/44022695/Aktivitetsoversikt/hjelp.html"; 
+                      target="name"><IMG alt="Hjelp" 
+                      
src="/aktivitetsoversikt/images/hjelp.gif"></A></LABEL></DT>
+                               <dd>
+                                       <?php
+                                       $selected_office = 
$activity->get_office();
+                                       ?>
+                                       <select name="office" id="office">
+                                               <option value="0">Ingen kontor 
valgt</option>
+                                               <?php
+                                               foreach($offices as $office)
+                                               {
+                                                       echo "<option 
".($selected_office == $office['id'] ? 'selected="selected"' : "")." 
value=\"{$office['id']}\">".$office['name']."</option>";
+                                               }
+                                               ?>
+                                       </select>
+                               </dd>
+                               </FIELDSET>
+                               <br/>
                                <div class="form-buttons">
                                        <input type="submit" 
name="save_activity" value="<?php echo lang('save_activity') ?>" 
onclick="return allOK();"/>
                                </div>
                        </dl>
                        
                </form>
-               
        </div>
 </div>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
 2012-08-06 07:39:23 UTC (rev 9832)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
 2012-08-06 12:25:59 UTC (rev 9833)
@@ -1,12 +1,134 @@
 <?php ?>
  <script type="text/javascript">
+ function toggle() {
+       var ele = document.getElementById("toggleText");
+       var text = document.getElementById("displayText");
+       if(ele.style.display == "block") {
+               ele.style.display = "none";
+               text.innerHTML = "Registrer nytt lokale";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "(X)";
+       }
+ }
+ function toggle2() {
+       var ele = document.getElementById("toggleText2");
+       var text = document.getElementById("displayText2");
+       if(ele.style.display == "block") {
+               ele.style.display = "none";
+               text.innerHTML = "Legg til alternativ kontaktperson";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "(X)";
+       }
+ }
+ function toggle3() {
+       var ele = document.getElementById("toggleText3");
+       var org_id = document.getElementById("organization_id_hidden");
+       var text = document.getElementById("displayText3");
+       if(ele.style.display == "block") {
+       ele.style.display = "none";
+               text.innerHTML = "Registrer ny organisasjon";
+       }
+       else {
+               ele.style.display = "block";
+               text.innerHTML = "";
+               org_id.value = "new_org";
+       }
+ }
+function showhide(id)
+{
+     if(id == "org")
+     {
+         document.getElementById('orgf').style.display = "block";
+         document.getElementById('no_orgf').style.display = "none";
+     }
+     else
+     {
+         document.getElementById('orgf').style.display = "none";
+         document.getElementById('no_orgf').style.display = "block";
+     }
+}
+
+function get_address_search()
+{
+       var address = document.getElementById('address').value;
+       var div_address = document.getElementById('address_container');
+       div_address.style.display="block";
+
+       //url = 
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
+       url = "<?php echo 
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
+
+var divcontent_start = "<select name=\"address_select\" id=\"address_select\" 
size=\"5\" onChange='setAddressValue(this)'>";
+var divcontent_end = "</select>";
+       
+       var callback = {
+               success: function(response){
+                                       div_address.innerHTML = 
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
+                               },
+               failure: function(o) {

@@ Diff output truncated at 153600 characters. @@



reply via email to

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