[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9953] Merge 9929:9952 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9953] Merge 9929:9952 from trunk |
Date: |
Fri, 31 Aug 2012 11:06:27 +0000 |
Revision: 9953
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9953
Author: sigurdne
Date: 2012-08-31 11:06:27 +0000 (Fri, 31 Aug 2012)
Log Message:
-----------
Merge 9929:9952 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.menu.inc.php
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
branches/Version-1_0-branch/activitycalendarfrontend/index.php
branches/Version-1_0-branch/activitycalendarfrontend/setup/default_records.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/setup/tables_current.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_edit_step_1.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_org.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_reciept.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
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.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.status_agg_month_info.inc.php
branches/Version-1_0-branch/controller/inc/component/class.year_calendar.inc.php
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
branches/Version-1_0-branch/controller/inc/hook_home.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.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_group.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_group_list.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_item_list.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_item_option.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_location.inc.php
branches/Version-1_0-branch/controller/inc/model/class.document.inc.php
branches/Version-1_0-branch/controller/inc/model/class.model.inc.php
branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/templates/base/tts.xsl
branches/Version-1_0-branch/sms/inc/class.sms.inc.php
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/README
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/SMSReceive.php
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/get.php
branches/Version-1_0-branch/sms/setup/default_records.inc.php
branches/Version-1_0-branch/sms/setup/setup.inc.php
branches/Version-1_0-branch/sms/setup/tables_current.inc.php
branches/Version-1_0-branch/sms/setup/tables_update.inc.php
Added Paths:
-----------
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/Receive.wdsl
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/soap.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952
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-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -233,7 +233,7 @@
{
if($this->so_activity->store($activity)) // ... and then try to store the object
{
- if($new_group && $new_state == 3)
+ if($new_group)
{
//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'));
@@ -298,12 +298,14 @@
{
$error =
lang('messages_form_error');
}
+
+ $activity =
$this->so_activity->get_single($activity_id);
- if($new_state == 3 || $new_state == 5 )
+ if($old_state != $new_state &&
($new_state == 3 || $new_state == 5))
{
$kontor =
$this->so_activity->get_office_name($activity->get_office());
$subject =
lang('mail_subject_update');
- $body = lang('mail_body_state_'
. $new_state, $kontor);
+ $body = lang('mail_body_state_'
. $new_state, $activity->get_title(), $kontor);
if($activity->get_group_id() &&
$activity->get_group_id() > 0)
{
@@ -544,11 +546,11 @@
$office_footer =
activitycalendar_soactivity::get_instance()->get_office_description($office_id_new);
if($activity->get_state() == 2)
{
- $body = lang('mail_body_update_frontend',
$activity->get_title(), $link_text, $office_name) . '<br/><br/>'.$office_footer;
+ $body = lang('mail_body_update_frontend',
$activity->get_title(), $link_text, $office_footer, $office_name);
}
else
{
- $body = lang('mail_body_update',
$activity->get_title(), $link_text, $office_name) . '<br/><br/>'.$office_footer;
+ $body = lang('mail_body_update',
$activity->get_title(), $link_text, $office_footer, $office_name);
}
//var_dump($subject);
@@ -607,7 +609,7 @@
else
$office_id_new = (int)$office_id;
$office_footer =
activitycalendar_soactivity::get_instance()->get_office_description($office_id_new);
- $body = lang('mail_body_update', $activity->get_title(),
$link_text, $office_name) . $office_footer;
+ $body = lang('mail_body_update', $activity->get_title(),
$link_text, $office_footer, $office_name);
}
else
{
@@ -758,8 +760,12 @@
$gr_id = (int)$group_id;
if($gr_id ==
(int)$group->get_id())
{
- $selected_group = "
selected";
+ $selected_group = "
selected='selected'";
}
+ else
+ {
+ $selected_group = "";
+ }
}
$group_html[] = "<option value='" .
$group->get_id() . "'". $selected_group . ">" . $group->get_name() .
"</option>";
}
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2012-08-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2012-08-31 11:06:27 UTC (rev 9953)
@@ -378,11 +378,11 @@
office activitycalendar no Hovedansvarlig kulturkontor
activity_helptext activitycalendar no Aktivitetsoversikten
henter kontaktinformasjon og beskrivelse fra bookingmodulen.<br/>Før ny
aktivitet kan registreres må du sjekke at organisasjon/gruppe finnes og er
oppdatert,<br/>og at arena finnes og er oppdatert. Feltet vis i portal skal
være satt til JA, i organisasjonsregisteret og evt. lag/gruppe. For nye
aktiviteter vil dette bli satt automatisk.
mail_subject_update activitycalendar no Melding fra AktivBy -
Aktivitetsoversikt
-mail_body_update activitycalendar no Dette er en melding fra
Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger i
kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Ber om at du kontrollerer at data er korrekt, og eventuelt
endrer.<br/>%2<br/><br/><br/> Mvh %3 kulturkontor
-mail_body_update_frontend activitycalendar no Dette er en
melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger
i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/><br/> Mvh %3
kulturkontor
-mail_body_state_3 activitycalendar no Informasjon om din
aktivitet er registrert og vil bli publisert i kommuneportalen i løpet av
dagen.<br/>De som er registrert som kontaktpersoner får endre informasjonen,
dette gjøres via nettsiden:
https://www.bergen.kommune.no/tjenestetilbud/aktivitetsoversikt/<br/><br/><br/>
Mvh %1 kulturkontor
-mail_body_state_4 activitycalendar no Ditt tips er behandlet
og publisert i kommuneportalen.<br/><br/>Mvh %1 kulturkontor
-mail_body_state_5 activitycalendar no Ditt forslag til
aktivitet er behandlet, men vil ikke bli publisert i
kommuneportalen.<br/><br/>Mvh %1 kulturkontor
+mail_body_update activitycalendar no Dette er en melding fra
Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger i
kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Ber om at du kontrollerer at data er korrekt, og eventuelt
endrer.<br/>%2<br/><br/>%3<br/><br/> Mvh %4 kulturkontor
+mail_body_update_frontend activitycalendar no Dette er en
melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger
i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/>%3<br/><br/>
Mvh %4 kulturkontor
+mail_body_state_3 activitycalendar no Informasjon om din
aktivitet %1 er registrert og vil bli publisert i kommuneportalen i løpet av
dagen.<br/>De som er registrert som kontaktpersoner får endre informasjonen,
dette gjøres via nettsiden:
https://www.bergen.kommune.no/tjenestetilbud/aktivitetsoversikt/<br/><br/><br/>
Mvh %2 kulturkontor
+mail_body_state_4 activitycalendar no Ditt forslag til ny
aktivitet: %1 er behandlet og vil bli publisert i
kommuneportalen.<br/><br/>Mvh %2 kulturkontor
+mail_body_state_5 activitycalendar no Ditt forslag til ny
aktivitet: %1 er behandlet, men vil ikke bli publisert i
kommuneportalen.<br/>Dersom du har spørsmål, ta gjerne kontakt med
oss.<br/><br/>Mvh %2 kulturkontor
send_mail activitycalendar no Send e-post
marked_as activitycalendar no Status
address_number activitycalendar no Husnummer
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/inc/class.menu.inc.php
2012-08-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendarfrontend/inc/class.menu.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,27 +1,27 @@
<?php
- class activitycalendarfrontend_menu
- {
- function get_menu()
- {
- $incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $GLOBALS['phpgw_info']['flags']['currentapp'] =
'activitycalendarfrontend';
- $menus = array();
+class activitycalendarfrontend_menu {
- if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin')
- || $GLOBALS['phpgw']->acl->check('admin',
phpgwapi_acl::ADD, 'activitycalendarfrontend'))
- {
- $menus['admin'] = array
+ function get_menu() {
+ $incoming_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
+ $GLOBALS['phpgw_info']['flags']['currentapp'] =
'activitycalendarfrontend';
+
+ $menus = array();
+
+ if ($GLOBALS['phpgw']->acl->check('run', phpgwapi_acl::READ,
'admin')
+ || $GLOBALS['phpgw']->acl->check('admin',
phpgwapi_acl::ADD, 'activitycalendarfrontend')) {
+ $menus['admin'] = array
(
- 'index' => array
+ 'index' => array
(
- 'text' =>
lang('Configuration'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index', 'appname' => 'activitycalendarfrontend') )
- ),
- );
- }
+ 'text' => lang('Configuration'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index', 'appname' => 'activitycalendarfrontend'))
+ ),
+ );
+ }
- $GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
- return $menus;
- }
+ $GLOBALS['phpgw_info']['flags']['currentapp'] = $incoming_app;
+ return $menus;
}
+
+}
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-31 11:03:24 UTC (rev 9952)
+++
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,367 +1,335 @@
<?php
- phpgw::import_class('activitycalendar.uiactivities');
- phpgw::import_class('activitycalendar.soactivity');
- phpgw::import_class('activitycalendar.sogroup');
- phpgw::import_class('activitycalendar.soarena');
- phpgw::import_class('activitycalendar.soorganization');
- phpgw::import_class('activitycalendar.socontactperson');
-
- include_class('activitycalendar', 'activity', 'inc/model/');
- include_class('activitycalendar', 'group', 'inc/model/');
- include_class('activitycalendar', 'organization', 'inc/model/');
- include_class('activitycalendar', 'arena', 'inc/model/');
- class activitycalendarfrontend_uiactivity extends
activitycalendar_uiactivities
- {
- private $so_organization;
-
- public $public_functions = array
+phpgw::import_class('activitycalendar.uiactivities');
+phpgw::import_class('activitycalendar.soactivity');
+phpgw::import_class('activitycalendar.sogroup');
+phpgw::import_class('activitycalendar.soarena');
+phpgw::import_class('activitycalendar.soorganization');
+phpgw::import_class('activitycalendar.socontactperson');
+
+include_class('activitycalendar', 'activity', 'inc/model/');
+include_class('activitycalendar', 'group', 'inc/model/');
+include_class('activitycalendar', 'organization', 'inc/model/');
+include_class('activitycalendar', 'arena', 'inc/model/');
+
+class activitycalendarfrontend_uiactivity extends
activitycalendar_uiactivities {
+
+ private $so_organization;
+ public $public_functions = array
(
- 'add' => true,
- 'edit' => true,
- 'view' => true,
- 'index' => true,
- 'get_organization_groups' => true,
- 'get_address_search' => true,
- 'edit_organization_values' => true,
- 'get_organization_activities' => true
- );
-
- public function __construct()
- {
- parent::__construct();
- $this->so_organization =
activitycalendar_soorganization::get_instance();
- }
-
- /**
- * Public method. Add new activity.
- */
- 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' );
- $c =
createobject('phpgwapi.config','activitycalendarfrontend');
- $c->read();
- $config = $c->config_data;
-
- $ajaxUrl = $c->config_data['AJAXURL'];
+ 'add' => true,
+ 'edit' => true,
+ 'view' => true,
+ 'index' => true,
+ 'get_organization_groups' => true,
+ 'get_address_search' => true,
+ 'edit_organization_values' => true,
+ 'get_organization_activities' => true
+ );
- $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();
- $arenas = $this->so_arena->get(null, null,
'arena.arena_name', true, null, null, null);
- $organizations = $this->so_organization->get(null,
null, 'org.name', true, null, null, null);
-
- $activity = new activitycalendar_activity();
-
- $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 == "new_org")
- {
- //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
- )
- );
+ public function __construct() {
+ parent::__construct();
+ $this->so_organization =
activitycalendar_soorganization::get_instance();
+ }
+
+ /**
+ * Public method. Add new activity.
+ */
+ 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');
+ $c = createobject('phpgwapi.config',
'activitycalendarfrontend');
+ $c->read();
+ $config = $c->config_data;
+
+ $ajaxUrl = $c->config_data['AJAXURL'];
+
+ $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();
+ $arenas = $this->so_arena->get(null, null, 'arena.arena_name',
true, null, null, null);
+ $organizations = $this->so_organization->get(null, null,
'org.name', true, null, null, null);
+
+ $activity = new activitycalendar_activity();
+
+ $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 == "new_org") {
+ //add new organization to internal
activitycalendar organization register
+ $org_homepage = phpgw::get_var('homepage');
+ if ($org_homepage == 'http://') {
+ $org_homepage = "";
}
- else
- {
- $new_org = false;
- $organization =
$this->so_organization->get_single($o_id);
- $person_arr =
$this->so_contact->get(null, null, null, null, null, null,
array('organization_id' => $o_id));
- foreach($person_arr as $p)
- {
- //var_dump($p);
- $persons[] = $p;
- }
-
-
- $activity->set_organization_id($o_id);
-
$activity->set_description($organization->get_description());
- $activity->set_contact_persons($pers);
-
- $this->render('activity_new.php', array
- (
- 'activity' =>
$activity,
- 'new_organization' =>
false,
- '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
- )
- );
+ $org_info['name'] = phpgw::get_var('orgname');
+ $org_info['orgnr'] = phpgw::get_var('orgno');
+ $org_info['homepage'] = $org_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;
}
- }
- else if(isset($_POST['save_activity']))
- {
- $get_org_from_local = false;
- $new_org_group = false;
- $new_org = phpgw::get_var('new_organization');
- if($new_org != null && $new_org == 'yes')
- {
- $get_org_from_local = true;
+
+ $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;
}
-
- if($get_org_from_local)
- {
- $activity->set_new_org(true);
- //$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)
- {
- $persons[] = $p;
- }
- $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;
+
+ $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 {
+ $new_org = false;
+ $organization =
$this->so_organization->get_single($o_id);
+ $person_arr = $this->so_contact->get(null,
null, null, null, null, null, array('organization_id' => $o_id));
+ foreach ($person_arr as $p) {
+ //var_dump($p);
+ $persons[] = $p;
}
- else if(is_numeric($o_id) && $o_id > 0)
- {
- $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)
- {
- $persons[] = $p;
- }
- $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;
+
+
+ $activity->set_organization_id($o_id);
+
$activity->set_description($organization->get_description());
+ $activity->set_contact_persons($pers);
+
+ $this->render('activity_new.php', array
+ (
+ 'activity' => $activity,
+ 'new_organization' => false,
+ '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 if (isset($_POST['save_activity'])) {
+ $get_org_from_local = false;
+ $new_org_group = false;
+ $new_org = phpgw::get_var('new_organization');
+ if ($new_org != null && $new_org == 'yes') {
+ $get_org_from_local = true;
+ }
+
+ if ($get_org_from_local) {
+ $activity->set_new_org(true);
+ //$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) {
+ $persons[] = $p;
}
-
- if(strlen($desc) > 254)
- {
- $desc = substr($desc,0,254);
+ $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) {
+ $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) {
+ $persons[] = $p;
}
-
- $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');
- $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);
- }
+ $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) {
+ $desc = substr($desc, 0, 254);
+ }
+
+ $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');
+ $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]);
- }
+ } 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_district(phpgw::get_var('district'));
- $activity->set_office(phpgw::get_var('office'));
- $activity->set_state(1);
-
$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_time(phpgw::get_var('time'));
- $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);
- $activity->set_new_group($new_group);
- $target_ok = false;
- $district_ok = false;
-
- if($get_org_from_local)
- {
- //update new organization with district-id
from activity.
-
$this->so_organization->update_org_district_local($organization->get_id(),
$activity->get_district());
- }
-
- if($activity->get_target() &&
$activity->get_target() != '')
- {
- $target_ok = true;
+ //... set all parameters
+ $activity->set_title(phpgw::get_var('title'));
+ $activity->set_organization_id($o_id);
+ $activity->set_group_id($g_id);
+ $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'));
+ $target_array = phpgw::get_var('target');
+ $activity->set_target(implode(",", $target_array));
+ $activity->set_description($desc);
+ $activity->set_time(phpgw::get_var('time'));
+ $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);
+ $activity->set_new_group($new_group);
+ $target_ok = false;
+ $district_ok = false;
+
+ if ($get_org_from_local) {
+ //update new organization with district-id from
activity.
+
$this->so_organization->update_org_district_local($organization->get_id(),
$activity->get_district());
+ }
+
+ if ($activity->get_target() && $activity->get_target()
!= '') {
+ $target_ok = true;
+ }
+ if ($activity->get_district() &&
$activity->get_district() != '') {
+ $district_ok = true;
+ }
+
+ if ($target_ok && $district_ok) {
+ if ($this->so_activity->store($activity)) { //
... and then try to store the object
+ $message = lang('messages_saved_form');
+ } else {
+ $error = lang('messages_form_error');
}
- if($activity->get_district() &&
$activity->get_district() != '')
- {
- $district_ok = true;
- }
-
- if($target_ok && $district_ok)
- {
-
if($this->so_activity->store($activity)) // ... and then try to store the object
- {
- $message =
lang('messages_saved_form');
- }
- else
- {
- $error =
lang('messages_form_error');
- }
- //$org_info_edit_url =
self::link('/index.php' ,array('menuaction' =>
'activitycalendarfrontend.uiactivity.edit_organization_values'));
+ //$org_info_edit_url = self::link('/index.php'
,array('menuaction' =>
'activitycalendarfrontend.uiactivity.edit_organization_values'));
-
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+ $GLOBALS['phpgw_info']['flags']['noframework']
= true;
- $this->render('activity.php', array
- (
-
'activity' => $activity,
-
'organization' => $organization,
- 'group'
=> $group,
-
'contact1' => $persons[0],
-
'arenas' => $arenas,
-
'buildings' => $buildings,
-
'categories' => $categories,
-
'targets' => $targets,
-
'districts' => $districts,
-
'offices' => $offices,
-
'message' => isset($message) ? $message : phpgw::get_var('message'),
- 'error'
=> isset($error) ? $error : phpgw::get_var('error'),
-
'ajaxURL' => $ajaxUrl
- )
- );
+ $this->render('activity.php', array
+ (
+ 'activity' => $activity,
+ 'organization' => $organization,
+ 'group' => $group,
+ 'contact1' => $persons[0],
+ 'arenas' => $arenas,
+ 'buildings' => $buildings,
+ 'categories' => $categories,
+ 'targets' => $targets,
+ 'districts' => $districts,
+ 'offices' => $offices,
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error'),
+ 'ajaxURL' => $ajaxUrl
+ )
+ );
+ } else {
+ if (!$target_ok) {
+ $error .= "<br/>" .
lang('target_not_selected');
}
- else
- {
- if(!$target_ok)
- {
- $error .= "<br/>" .
lang('target_not_selected');
- }
- if(!$district_ok)
- {
- $error .= "<br/>" .
lang('district_not_selected');
- }
- return
$this->render('activity_new.php', array
- (
- 'activity' =>
$activity,
+ if (!$district_ok) {
+ $error .= "<br/>" .
lang('district_not_selected');
+ }
+ return $this->render('activity_new.php', array
+ (
+ 'activity' => $activity,
'organizations' =>
$organizations,
'organization' =>
$organization,
'contact1' =>
$persons[0],
@@ -380,593 +348,524 @@
'message' =>
isset($message) ? $message : phpgw::get_var('message'),
'error' =>
isset($error) ? $error : phpgw::get_var('error'),
'ajaxURL' => $ajaxUrl
- )
- );
- }
+ )
+ );
}
- else
- {
- return $this->render('activity_new_step_1.php',
array
+ } else {
+ return $this->render('activity_new_step_1.php', array
(
- 'organizations' =>
$organizations,
- 'ajaxURL' => $ajaxUrl
- )
- );
- }
- }
-
- function view()
- {
- $errorMsgs = array();
- $infoMsgs = array();
- $activity =
$this->so_activity->get_single((int)phpgw::get_var('id'));
-
- if($activity == null) // Not found
- {
- $errorMsgs[] = lang('Could not find specified
activity.');
- }
-
- $data = array
- (
- 'activity' => $activity,
- 'errorMsgs' => $errorMsgs,
- 'infoMsgs' => $infoMsgs
+ 'organizations' =>
$organizations,
+ 'ajaxURL' => $ajaxUrl
+ )
);
-
- $GLOBALS['phpgw_info']['flags']['noframework'] = true;
- $this->render('activity.php', $data);
- //self::render_template('activity_tmp',
array('activity' => $activity, 'frontend'=>'true'));
}
+ }
- function edit()
- {
- $GLOBALS['phpgw']->js->validate_file( 'json', 'json',
'phpgwapi' );
+ function view() {
+ $errorMsgs = array();
+ $infoMsgs = array();
+ $activity = $this->so_activity->get_single((int)
phpgw::get_var('id'));
- $c =
createobject('phpgwapi.config','activitycalendarfrontend');
- $c->read();
- $config = $c->config_data;
-
- $ajaxUrl = $c->config_data['AJAXURL'];
-
- $id = intval(phpgw::get_var('id', 'GET'));
+ if ($activity == null) { // Not found
+ $errorMsgs[] = lang('Could not find specified
activity.');
+ }
- $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();
- $arenas = $this->so_arena->get(null, null,
'arena.arena_name', true, null, null, null);
-
- if(isset($_POST['step_1'])) //change_request
- {
- $activity_id = phpgw::get_var('activity_id');
- $activity =
$this->so_activity->get_single($activity_id);
- $org =
$this->so_organization->get_single($activity->get_organization_id());
-
-
- //store update-request
- //$activity->set_state(2);
- //if($this->so_activity->store($activity))
- //{
-
$this->send_email_to_selection(array($activity));
- $message = lang('update_request_sent',
$activity->get_title(), $org->get_name());
- return
$this->render('activity_edit_step_1.php', array
+ $data = array
+ (
+ 'activity' => $activity,
+ 'errorMsgs' => $errorMsgs,
+ 'infoMsgs' => $infoMsgs
+ );
+
+ $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+ $this->render('activity.php', $data);
+ //self::render_template('activity_tmp', array('activity' =>
$activity, 'frontend'=>'true'));
+ }
+
+ function edit() {
+ $GLOBALS['phpgw']->js->validate_file('json', 'json',
'phpgwapi');
+
+ $c = createobject('phpgwapi.config',
'activitycalendarfrontend');
+ $c->read();
+ $config = $c->config_data;
+
+ $ajaxUrl = $c->config_data['AJAXURL'];
+
+ $id = intval(phpgw::get_var('id', 'GET'));
+
+ $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();
+ $arenas = $this->so_arena->get(null, null, 'arena.arena_name',
true, null, null, null);
+
+ if (isset($_POST['step_1'])) { //change_request
+ $activity_id = phpgw::get_var('activity_id');
+ $activity =
$this->so_activity->get_single($activity_id);
+ $org =
$this->so_organization->get_single($activity->get_organization_id());
+
+
+ //store update-request
+ //$activity->set_state(2);
+ //if($this->so_activity->store($activity))
+ //{
+ $this->send_email_to_selection(array($activity));
+ $message = lang('update_request_sent',
$activity->get_title(), $org->get_name());
+ return $this->render('activity_edit_step_1.php', array
(
+ 'activities' => $activities,
+ 'message' => $message,
+ 'ajaxURL' => $ajaxUrl
+ )
+ );
+ //}
+ } else {
+ $secret_param = phpgw::get_var('secret', 'GET');
+ if (!isset($id) || $id == '') {
+ //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'));
+ return
$this->render('activity_edit_step_1.php', array
+ (
'activities' =>
$activities,
- 'message' => $message,
+ 'organizations' =>
$organizations,
'ajaxURL' => $ajaxUrl
- )
- );
- //}
+ )
+ );
}
- else
- {
- $secret_param = phpgw::get_var('secret', 'GET');
- if(!isset($id) || $id == '')
- {
- //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'));
- return
$this->render('activity_edit_step_1.php', array
- (
+ if (!isset($secret_param) || $secret_param == '') {
+ //select activity to edit
+ $activities = $this->so_activity->get(null,
null, 'title', true, null, null, array('activity_state' => 3));
+ return
$this->render('activity_edit_step_1.php', array
+ (
'activities' =>
$activities,
- 'organizations' =>
$organizations,
'ajaxURL' => $ajaxUrl
- )
+ )
+ );
+ } else {
+ // Retrieve the activity object or create a new
one
+ if (isset($id) && $id > 0) {
+ $activity =
$this->so_activity->get_single($id);
+ } else {
+ $activities =
$this->so_activity->get(null, null, 'title', true, null, null,
array('activity_state' => 3));
+ return
$this->render('activity_edit_step_1.php', array
+ (
+ 'activities' =>
$activities,
+ 'ajaxURL' =>
$ajaxUrl
+ )
);
}
- if(!isset($secret_param) || $secret_param ==
''){
+
+ if ($activity->get_secret() !=
phpgw::get_var('secret', 'GET')) {
//select activity to edit
$activities =
$this->so_activity->get(null, null, 'title', true, null, null,
array('activity_state' => 3));
return
$this->render('activity_edit_step_1.php', array
- (
- 'activities' =>
$activities,
- 'ajaxURL' => $ajaxUrl
- )
+ (
+ 'activities' =>
$activities,
+ 'ajaxURL' =>
$ajaxUrl
+ )
);
}
- else
- {
- // Retrieve the activity object or
create a new one
- if(isset($id) && $id > 0)
- {
- $activity =
$this->so_activity->get_single($id);
+
+ if ($activity->get_group_id()) {
+ $person_arr =
$this->so_contact->get_booking_contact_persons($activity->get_group_id(), true);
+ foreach ($person_arr as $p) {
+ $persons_array[] = $p;
}
- else
- {
- $activities =
$this->so_activity->get(null, null, 'title', true, null, null,
array('activity_state' => 3));
- return
$this->render('activity_edit_step_1.php', array
- (
- 'activities' =>
$activities,
- 'ajaxURL' =>
$ajaxUrl
- )
- );
+ $desc =
$this->so_group->get_description($activity->get_group_id());
+ $group =
$this->so_group->get_single($activity->get_group_id());
+ $person_ids =
$this->so_group->get_contacts($activity->get_group_id());
+ } else if ($activity->get_organization_id()) {
+ $person_arr =
$this->so_contact->get_booking_contact_persons($activity->get_organization_id());
+ foreach ($person_arr as $p) {
+ $persons_array[] = $p;
}
-
- if($activity->get_secret() !=
phpgw::get_var('secret', 'GET'))
- {
- //select activity to edit
- $activities =
$this->so_activity->get(null, null, 'title', true, null, null,
array('activity_state' => 3));
- return
$this->render('activity_edit_step_1.php', array
- (
- 'activities' =>
$activities,
- 'ajaxURL' =>
$ajaxUrl
- )
- );
- }
-
- if($activity->get_group_id())
- {
- $person_arr =
$this->so_contact->get_booking_contact_persons($activity->get_group_id(), true);
- foreach($person_arr as $p)
- {
- $persons_array[] = $p;
+ $desc =
$this->so_organization->get_description($activity->get_organization_id());
+ $person_ids =
$this->so_organization->get_contacts($activity->get_organization_id());
+ }
+ if (strlen($desc) > 254) {
+ $desc = substr($desc, 0, 254);
+ }
+ $organization =
$this->so_organization->get_single($activity->get_organization_id());
+
+ $change_activity_request = FALSE;
+ if (isset($_POST['save_activity'])) { // The
user has pressed the save button
+ 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_state(2);
+
$activity->set_title(phpgw::get_var('title'));
+ $arena_id =
phpgw::get_var('internal_arena_id');
+ $arena_arr = explode("_",
$arena_id);
+ if ($arena_arr[0] == 'i') {
+
$activity->set_internal_arena($arena_arr[1]);
+ $activity->set_arena(0);
+ } else {
+
$activity->set_internal_arena(0);
+
$activity->set_arena($arena_arr[1]);
}
- $desc =
$this->so_group->get_description($activity->get_group_id());
- $group =
$this->so_group->get_single($activity->get_group_id());
- $person_ids =
$this->so_group->get_contacts($activity->get_group_id());
- }
- else
if($activity->get_organization_id())
- {
- $person_arr =
$this->so_contact->get_booking_contact_persons($activity->get_organization_id());
- foreach($person_arr as $p)
- {
- $persons_array[] = $p;
- }
- $desc =
$this->so_organization->get_description($activity->get_organization_id());
- $person_ids =
$this->so_organization->get_contacts($activity->get_organization_id());
- }
- if(strlen($desc) > 254)
- {
- $desc = substr($desc,0,254);
- }
- $organization =
$this->so_organization->get_single($activity->get_organization_id());
-
- $change_activity_request = FALSE;
- if(isset($_POST['save_activity'])) //
The user has pressed the save button
- {
- 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_state(2);
-
$activity->set_title(phpgw::get_var('title'));
- $arena_id =
phpgw::get_var('internal_arena_id');
- $arena_arr =
explode("_",$arena_id);
- if($arena_arr[0] == 'i')
- {
-
$activity->set_internal_arena($arena_arr[1]);
-
$activity->set_arena(0);
- }
- else
- {
-
$activity->set_internal_arena(0);
-
$activity->set_arena($arena_arr[1]);
- }
- //$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($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);
+ //$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($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();
+ $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() != '')
- {
- $target_ok = true;
- }
-
if($activity->get_district() && $activity->get_district() != '')
- {
- $district_ok =
true;
- }
+ $target_ok = false;
+ $district_ok = false;
+ if ($activity->get_target() &&
$activity->get_target() != '') {
+ $target_ok = true;
+ }
+ if ($activity->get_district()
&& $activity->get_district() != '') {
+ $district_ok = true;
+ }
- if($target_ok &&
$district_ok)
- {
+ if ($target_ok && $district_ok)
{
-
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);
-
-
$person_arr_tmp =
$this->so_contact->get_booking_contact_persons($activity->get_group_id(), true);
-
foreach($person_arr_tmp as $p_t)
- {
-
$persons_array_tmp[] = $p_t;
- }
- }
- }
- else
- {
- $error =
lang('messages_form_error');
- }
+ 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);
-
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
$person_arr_tmp =
$this->so_contact->get_booking_contact_persons($activity->get_group_id(), true);
+ foreach
($person_arr_tmp as $p_t) {
+
$persons_array_tmp[] = $p_t;
+ }
+ }
+ } else {
+ $error =
lang('messages_form_error');
+ }
-
$this->render('activity.php', array
-
(
-
'activity' => $activity,
-
'organization' => $organization,
-
'group' => $group,
-
'contact1' => $persons_array_tmp[0],
-
'arenas' => $arenas,
-
'buildings' => $buildings,
-
'categories' => $categories,
-
'targets' => $targets,
-
'districts' => $districts,
-
'offices' => $offices,
-
'message' => isset($message) ? $message :
phpgw::get_var('message'),
-
'error' => isset($error) ? $error : phpgw::get_var('error'),
-
'ajaxURL' => $ajaxUrl
-
)
- );
- }
- else
- {
- if(!$target_ok)
- {
- $error .=
"<br/>" . lang('target_not_selected');
- }
- if(!$district_ok)
- {
- $error .=
"<br/>" . lang('district_not_selected');
- }
- return
$this->render('activity_edit.php', array
- (
-
'activity' => $activity,
-
'organization' => $organization,
-
'contact1' => $persons_array[0],
-
'org_name' => $org_name,
-
'group' => $group,
-
'arenas' => $arenas,
-
'buildings' => $buildings,
-
'categories' => $categories,
-
'targets' => $targets,
-
'districts' => $districts,
-
'offices' => $offices,
-
'editable' => true,
-
'cancel_link' => $cancel_link,
-
'message' => isset($message) ? $message : phpgw::get_var('message'),
-
'error' => isset($error) ? $error : phpgw::get_var('error'),
-
'ajaxURL' => $ajaxUrl
- )
- );
- }
- }
- }
- else if(isset($_POST['change_request']))
- {
-
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
- $this->render('activity_edit.php',
array
- (
-
'activity' => $activity,
-
'organization' => $organization,
-
'group' => $group,
-
'contact1' => $persons_array[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 if(isset($_POST['activity_ok'])) //
The user has pressed the save button
- {
- if(isset($activity)) // If an activity
object is created
- {
- $activity->set_frontend(true);
+
$this->render('activity.php', array
+ (
+ 'activity' =>
$activity,
+ 'organization'
=> $organization,
+ 'group' =>
$group,
+ 'contact1' =>
$persons_array_tmp[0],
+ 'arenas' =>
$arenas,
+ 'buildings' =>
$buildings,
+ 'categories' =>
$categories,
+ 'targets' =>
$targets,
+ 'districts' =>
$districts,
+ 'offices' =>
$offices,
+ 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
+ 'error' =>
isset($error) ? $error : phpgw::get_var('error'),
+ 'ajaxURL' =>
$ajaxUrl
+ )
+ );
+ } else {
+ if (!$target_ok) {
+ $error .=
"<br/>" . lang('target_not_selected');
+ }
+ if (!$district_ok) {
+ $error .=
"<br/>" . lang('district_not_selected');
+ }
+ return
$this->render('activity_edit.php', array
+
(
+
'activity' => $activity,
+
'organization' => $organization,
+
'contact1' => $persons_array[0],
+
'org_name' => $org_name,
+
'group' => $group,
+
'arenas' => $arenas,
+
'buildings' => $buildings,
+
'categories' => $categories,
+
'targets' => $targets,
+
'districts' => $districts,
+
'offices' => $offices,
+
'editable' => true,
+
'cancel_link' => $cancel_link,
+
'message' => isset($message) ? $message : phpgw::get_var('message'),
+
'error' => isset($error) ? $error : phpgw::get_var('error'),
+
'ajaxURL' => $ajaxUrl
+
)
+ );
+ }
+ }
+ } else if (isset($_POST['change_request'])) {
+
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
-
if($this->so_activity->save_with_no_changes($activity)) // ... and then try to
store the object
- {
- $message =
lang('activity_ok_message');
- }
-
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
-
- $this->render('activity.php', array
- (
-
'activity' => $activity,
-
'organization' => $organization,
-
'group' => $group,
-
'contact1' => $persons_array[0],
-
'arenas' => $arenas,
-
'buildings' => $buildings,
-
'categories' => $categories,
-
'targets' => $targets,
-
'districts' => $districts,
-
'offices' => $offices,
-
'message' => isset($message) ? $message : phpgw::get_var('message'),
-
'error' => isset($error) ? $error : phpgw::get_var('error'),
-
'ajaxURL' => $ajaxUrl
- )
- );
- }
- }
- else
- {
-
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+ $this->render('activity_edit.php', array
+ (
+ 'activity' => $activity,
+ 'organization' => $organization,
+ 'group' => $group,
+ 'contact1' => $persons_array[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 if (isset($_POST['activity_ok'])) { //
The user has pressed the save button
+ if (isset($activity)) { // If an
activity object is created
+ $activity->set_frontend(true);
- $this->render('activity.php', array
- (
-
'activity' => $activity,
-
'organization' => $organization,
-
'group' => $group,
-
'contact1' => $persons_array[0],
-
'arenas' => $arenas,
-
'buildings' => $buildings,
-
'categories' => $categories,
-
'targets' => $targets,
-
'districts' => $districts,
-
'offices' => $offices,
-
'editable' => false,
-
'change_request' => true,
-
'message' => isset($message) ? $message : phpgw::get_var('message'),
-
'error' => isset($error) ? $error : phpgw::get_var('error'),
-
'ajaxURL' => $ajaxUrl
- )
- );
- }
+ if
($this->so_activity->save_with_no_changes($activity)) { // ... and then try to
store the object
+ $message =
lang('activity_ok_message');
+ }
+
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
+ $this->render('activity.php',
array
+ (
+ 'activity' => $activity,
+ 'organization' =>
$organization,
+ 'group' => $group,
+ 'contact1' =>
$persons_array[0],
+ 'arenas' => $arenas,
+ 'buildings' =>
$buildings,
+ 'categories' =>
$categories,
+ 'targets' => $targets,
+ 'districts' =>
$districts,
+ 'offices' => $offices,
+ 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
+ 'error' =>
isset($error) ? $error : phpgw::get_var('error'),
+ 'ajaxURL' => $ajaxUrl
+ )
+ );
+ }
+ } else {
+
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
+ $this->render('activity.php', array
+ (
+ 'activity' => $activity,
+ 'organization' => $organization,
+ 'group' => $group,
+ 'contact1' => $persons_array[0],
+ 'arenas' => $arenas,
+ 'buildings' => $buildings,
+ 'categories' => $categories,
+ 'targets' => $targets,
+ 'districts' => $districts,
+ 'offices' => $offices,
+ 'editable' => false,
+ 'change_request' => true,
+ 'message' => isset($message) ?
$message : phpgw::get_var('message'),
+ 'error' => isset($error) ?
$error : phpgw::get_var('error'),
+ 'ajaxURL' => $ajaxUrl
+ )
+ );
}
}
}
-
- function index()
- {
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'activitycalendarfrontend.uiactivity.add'));
- }
-
- function get_organization_groups()
- {
- $GLOBALS['phpgw_info']['flags']['noheader'] = true;
- $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-
- $org_id = phpgw::get_var('orgid');
- $group_id = phpgw::get_var('groupid');
- $returnHTML = "<option value='0'>Ingen gruppe
valgt</option>";
- if($org_id)
- {
- $group_html[] = "<option value='new_group'>Ny
gruppe</option>";
- $groups =
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null,
null, array('org_id' => $org_id));
- foreach ($groups as $group) {
- if(isset($group))
- {
- //$res_g = $group->serialize();
- $selected = "";
- if($group_id && $group_id > 0)
- {
- $gr_id =
(int)$group_id;
- if($gr_id ==
(int)$group->get_id())
- {
- $selected_group
= " selected";
- }
+ }
+
+ function index() {
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'activitycalendarfrontend.uiactivity.add'));
+ }
+
+ function get_organization_groups() {
+ $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+ $org_id = phpgw::get_var('orgid');
+ $group_id = phpgw::get_var('groupid');
+ $returnHTML = "<option value='0'>Ingen gruppe valgt</option>";
+ if ($org_id) {
+ $group_html[] = "<option value='new_group'>Ny
gruppe</option>";
+ $groups =
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null,
null, array('org_id' => $org_id));
+ foreach ($groups as $group) {
+ if (isset($group)) {
+ //$res_g = $group->serialize();
+ $selected = "";
+ if ($group_id && $group_id > 0) {
+ $gr_id = (int) $group_id;
+ if ($gr_id == (int)
$group->get_id()) {
+ $selected_group = "
selected";
}
- $group_html[] = "<option
value='" . $group->get_id() . "'". $selected_group . ">" . $group->get_name() .
"</option>";
}
+ $group_html[] = "<option value='" .
$group->get_id() . "'" . $selected_group . ">" . $group->get_name() .
"</option>";
}
- $html = implode(' ' , $group_html);
- $returnHTML = $returnHTML . ' ' . $html;
}
-
-
- return $returnHTML;
- //return "<option>Ingen gruppe valgt</option>";
+ $html = implode(' ', $group_html);
+ $returnHTML = $returnHTML . ' ' . $html;
}
-
- /**
- * Public method.
- */
- function get_address_search()
- {
- $search_string = phpgw::get_var('search');
- //var_dump($search_string);
- return
activitycalendar_soarena::get_instance()->get_address($search_string);
- }
-
- function edit_organization_values()
- {
- $org_id = phpgw::get_var('organization_id');
- if(isset($org_id))
- {
- if(isset($_POST['save_org'])) //save updated
organization info
- {
- $organization =
$this->so_organization->get_single($org_id);
-
- $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['district'] =
$organization->get_district();
- $org_info['status'] = "change";
- $org_info['original_org_id'] = $org_id;
- $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);
-
- $message = lang('change_request_ok',
$org_info['name']);
-
-
$this->render('organization_reciept.php', array
- (
- 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
- 'error' =>
isset($error) ? $error : phpgw::get_var('error')
+
+
+ return $returnHTML;
+ //return "<option>Ingen gruppe valgt</option>";
+ }
+
+ /**
+ * Public method.
+ */
+ function get_address_search() {
+ $search_string = phpgw::get_var('search');
+ //var_dump($search_string);
+ return
activitycalendar_soarena::get_instance()->get_address($search_string);
+ }
+
+ function edit_organization_values() {
+ $org_id = phpgw::get_var('organization_id');
+ if (isset($org_id)) {
+ if (isset($_POST['save_org'])) { //save updated
organization info
+ $organization =
$this->so_organization->get_single($org_id);
+
+ $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['district'] =
$organization->get_district();
+ $org_info['status'] = "change";
+ $org_info['original_org_id'] = $org_id;
+ $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);
+
+ $message = lang('change_request_ok',
$org_info['name']);
+
+ $this->render('organization_reciept.php', array
+ (
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error')
)
- );
-
+ );
+ } else {
+ $c = createobject('phpgwapi.config',
'activitycalendarfrontend');
+ $c->read();
+ $config = $c->config_data;
+
+ $ajaxUrl = $c->config_data['AJAXURL'];
+ $organization =
$this->so_organization->get_single($org_id);
+ $person_arr = $this->so_contact->get(null,
null, null, null, null, null, array('organization_id' => $org_id));
+ foreach ($person_arr as $p) {
+ $persons[] = $p;
}
- else
- {
- $c =
createobject('phpgwapi.config','activitycalendarfrontend');
- $c->read();
- $config = $c->config_data;
- $ajaxUrl = $c->config_data['AJAXURL'];
- $organization =
$this->so_organization->get_single($org_id);
- $person_arr =
$this->so_contact->get(null, null, null, null, null, null,
array('organization_id' => $org_id));
- foreach($person_arr as $p)
- {
- $persons[] = $p;
- }
-
- $this->render('organization_edit.php',
array
- (
- 'organization' =>
$organization,
- 'contact1' =>
$persons[0],
- 'editable' => true,
- 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
- 'error' =>
isset($error) ? $error : phpgw::get_var('error'),
- 'ajaxURL' => $ajaxUrl
+ $this->render('organization_edit.php', array
+ (
+ 'organization' => $organization,
+ 'contact1' => $persons[0],
+ 'editable' => true,
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error'),
+ 'ajaxURL' => $ajaxUrl
)
- );
- }
+ );
}
}
-
- function edit_group_values()
- {
- $group_id = phpgw::get_var('group_id');
- if(isset($group_id))
- {
- if(isset($_POST['save_group'])) //save updated
organization info
- {
- $group =
$this->so_group->get_single($group_id);
-
- $group_info['name'] =
phpgw::get_var('groupname');
- $group_info['organization_id'] =
phpgw::get_var('orgid');
- $group_info['description'] =
phpgw::get_var('org_description');
- $group_info['status'] = "change";
- $group_info['original_group_id'] =
$group_id;
- $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_email');
- $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_email');
- $contact2['org_id'] = 0;
- $contact2['group_id'] = $g_id;
-
$this->so_activity->add_contact_person_local($contact2);
-
- $message = lang('change_request_ok',
$group_info['name']);
-
- $this->render('group_reciept.php', array
- (
- 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
- 'error' =>
isset($error) ? $error : phpgw::get_var('error')
+ }
+
+ function edit_group_values() {
+ $group_id = phpgw::get_var('group_id');
+ if (isset($group_id)) {
+ if (isset($_POST['save_group'])) { //save updated
organization info
+ $group = $this->so_group->get_single($group_id);
+
+ $group_info['name'] =
phpgw::get_var('groupname');
+ $group_info['organization_id'] =
phpgw::get_var('orgid');
+ $group_info['description'] =
phpgw::get_var('org_description');
+ $group_info['status'] = "change";
+ $group_info['original_group_id'] = $group_id;
+ $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_email');
+ $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_email');
+ $contact2['org_id'] = 0;
+ $contact2['group_id'] = $g_id;
+
$this->so_activity->add_contact_person_local($contact2);
+
+ $message = lang('change_request_ok',
$group_info['name']);
+
+ $this->render('group_reciept.php', array
+ (
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error')
)
- );
-
+ );
+ } else {
+ $group = $this->so_group->get_single($group_id);
+ $person_arr = $this->so_contact->get(null,
null, null, null, null, null, array('group_id' => $group_id));
+ foreach ($person_arr as $p) {
+ $persons[] = $p;
}
- else
- {
- $group =
$this->so_group->get_single($group_id);
- $person_arr =
$this->so_contact->get(null, null, null, null, null, null, array('group_id' =>
$group_id));
- foreach($person_arr as $p)
- {
- $persons[] = $p;
- }
-
- $this->render('group_edit.php', array
- (
- 'group' => $group,
- 'contact1' =>
$persons[0],
- 'contact2' =>
$persons[1],
- 'editable' => true,
- 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
- 'error' =>
isset($error) ? $error : phpgw::get_var('error')
+
+ $this->render('group_edit.php', array
+ (
+ 'group' => $group,
+ 'contact1' => $persons[0],
+ 'contact2' => $persons[1],
+ 'editable' => true,
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error')
)
- );
- }
+ );
}
}
-
- public function get_organization_activities()
- {
- $GLOBALS['phpgw_info']['flags']['noheader'] = true;
- $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-
- $org_id = phpgw::get_var('orgid');
- $returnHTML = "<option value='0'>Ingen aktivitet
valgt</option>";
- if($org_id)
- {
- $activities = $this->so_activity->get(null,
null, 'title', true, null, null, array('activity_state' => 3, 'activity_org' =>
$org_id));
- foreach ($activities as $act) {
- if(isset($act))
- {
- //$res_g = $group->serialize();
- $activity_html[] = "<option
value='" . $act->get_id() . "'>" . $act->get_title() . "</option>";
- }
+ }
+
+ public function get_organization_activities() {
+ $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+ $org_id = phpgw::get_var('orgid');
+ $returnHTML = "<option value='0'>Ingen aktivitet
valgt</option>";
+ if ($org_id) {
+ $activities = $this->so_activity->get(null, null,
'title', true, null, null, array('activity_state' => 3, 'activity_org' =>
$org_id));
+ foreach ($activities as $act) {
+ if (isset($act)) {
+ //$res_g = $group->serialize();
+ $activity_html[] = "<option value='" .
$act->get_id() . "'>" . $act->get_title() . "</option>";
}
- $html = implode(' ' , $activity_html);
- $returnHTML = $returnHTML . ' ' . $html;
}
-
-
- return $returnHTML;
+ $html = implode(' ', $activity_html);
+ $returnHTML = $returnHTML . ' ' . $html;
}
+
+
+ return $returnHTML;
}
+
+}
Modified: branches/Version-1_0-branch/activitycalendarfrontend/index.php
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/index.php
2012-08-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendarfrontend/index.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,242 +1,171 @@
<?php
- $GLOBALS['phpgw_info']['flags'] = array(
- 'noheader' => true,
- 'nonavbar' => true,
- 'currentapp' => 'login'
- );
-
- $GLOBALS['phpgw_info']['flags']['session_name'] =
'activitycalendarfrontendsession';
- $GLOBALS['phpgw_remote_user_fallback'] = 'sql';
- include_once('../header.inc.php');
- // Make sure we're always logged in
- if (!phpgw::get_var(session_name()) ||
!$GLOBALS['phpgw']->session->verify())
- {
-
- $c = createobject('phpgwapi.config','activitycalendarfrontend');
- $c->read();
- $config = $c->config_data;
+$GLOBALS['phpgw_info']['flags'] = array(
+ 'noheader' => true,
+ 'nonavbar' => true,
+ 'currentapp' => 'login'
+);
- $login = $c->config_data['anonymous_user'];
- $passwd = $c->config_data['anonymous_pass'];
- $_POST['submitit'] = "";
-
-/* $login = "activitycalendar_guest";
- $passwd = "bkactivities";
- $_POST['submitit'] = "";
-*/
- $GLOBALS['sessionid'] =
$GLOBALS['phpgw']->session->create($login, $passwd);
- if(!$GLOBALS['sessionid'])
- {
- $lang_denied = lang('Anonymous access not correctly
configured');
- if($GLOBALS['phpgw']->session->reason)
- {
- $lang_denied =
$GLOBALS['phpgw']->session->reason;
- }
- echo <<<HTML
+$GLOBALS['phpgw_info']['flags']['session_name'] =
'activitycalendarfrontendsession';
+$GLOBALS['phpgw_remote_user_fallback'] = 'sql';
+include_once '../header.inc.php';
+
+// Make sure we're always logged in
+if (!phpgw::get_var(session_name()) || !$GLOBALS['phpgw']->session->verify()) {
+
+ $c = createobject('phpgwapi.config', 'activitycalendarfrontend');
+ $c->read();
+ $config = $c->config_data;
+
+ $login = $c->config_data['anonymous_user'];
+ $passwd = $c->config_data['anonymous_pass'];
+ $_POST['submitit'] = "";
+
+ /* $login = "activitycalendar_guest";
+ $passwd = "bkactivities";
+ $_POST['submitit'] = "";
+ */
+ $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login, $passwd);
+ if (!$GLOBALS['sessionid']) {
+ $lang_denied = lang('Anonymous access not correctly configured');
+ if ($GLOBALS['phpgw']->session->reason) {
+ $lang_denied = $GLOBALS['phpgw']->session->reason;
+ }
+ echo <<<HTML
<div class="error">$lang_denied</div>
HTML;
- $GLOBALS['phpgw']->common->phpgw_exit(True);
- }
- }
- $GLOBALS['phpgw_info']['flags']['currentapp'] =
'activitycalendarfrontend';
-
-
/////////////////////////////////////////////////////////////////////////////
+ $GLOBALS['phpgw']->common->phpgw_exit(True);
+ }
+}
+$GLOBALS['phpgw_info']['flags']['currentapp'] = 'activitycalendarfrontend';
+
+/////////////////////////////////////////////////////////////////////////////
// BEGIN Stuff copied from functions.inc.php
/////////////////////////////////////////////////////////////////////////////
-
if(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] !='en')
- {
-
$GLOBALS['phpgw']->translation->set_userlang($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'],
true);
- }
+if (isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] != 'en') {
+
$GLOBALS['phpgw']->translation->set_userlang($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'],
true);
+}
- /* A few hacker resistant constants that will be used throught
the program */
- define('PHPGW_TEMPLATE_DIR',
ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
- define('PHPGW_IMAGES_DIR',
ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi'));
- define('PHPGW_IMAGES_FILEDIR',
ExecMethod('phpgwapi.phpgw.common.get_image_dir', 'phpgwapi'));
- define('PHPGW_APP_ROOT',
ExecMethod('phpgwapi.phpgw.common.get_app_dir'));
- define('PHPGW_APP_INC',
ExecMethod('phpgwapi.phpgw.common.get_inc_dir'));
- define('PHPGW_APP_TPL',
ExecMethod('phpgwapi.phpgw.common.get_tpl_dir'));
- define('PHPGW_IMAGES',
ExecMethod('phpgwapi.phpgw.common.get_image_path'));
- define('PHPGW_APP_IMAGES_DIR',
ExecMethod('phpgwapi.phpgw.common.get_image_dir'));
+/* A few hacker resistant constants that will be used throught the program */
+define('PHPGW_TEMPLATE_DIR', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir',
'phpgwapi'));
+define('PHPGW_IMAGES_DIR', ExecMethod('phpgwapi.phpgw.common.get_image_path',
'phpgwapi'));
+define('PHPGW_IMAGES_FILEDIR',
ExecMethod('phpgwapi.phpgw.common.get_image_dir', 'phpgwapi'));
+define('PHPGW_APP_ROOT', ExecMethod('phpgwapi.phpgw.common.get_app_dir'));
+define('PHPGW_APP_INC', ExecMethod('phpgwapi.phpgw.common.get_inc_dir'));
+define('PHPGW_APP_TPL', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir'));
+define('PHPGW_IMAGES', ExecMethod('phpgwapi.phpgw.common.get_image_path'));
+define('PHPGW_APP_IMAGES_DIR',
ExecMethod('phpgwapi.phpgw.common.get_image_dir'));
-
/************************************************************************\
- * Load the menuaction
*
-
\************************************************************************/
- $GLOBALS['phpgw_info']['menuaction'] =
phpgw::get_var('menuaction');
- if(!$GLOBALS['phpgw_info']['menuaction'])
- {
- unset($GLOBALS['phpgw_info']['menuaction']);
- }
+/* * **********************************************************************\
+ * Load the menuaction *
+ \*********************************************************************** */
+$GLOBALS['phpgw_info']['menuaction'] = phpgw::get_var('menuaction');
+if (!$GLOBALS['phpgw_info']['menuaction']) {
+ unset($GLOBALS['phpgw_info']['menuaction']);
+}
- /********* This sets the user variables *********/
- $GLOBALS['phpgw_info']['user']['private_dir'] =
$GLOBALS['phpgw_info']['server']['files_dir']
- . '/users/'.$GLOBALS['phpgw_info']['user']['userid'];
+/* * ******* This sets the user variables ******** */
+$GLOBALS['phpgw_info']['user']['private_dir'] =
$GLOBALS['phpgw_info']['server']['files_dir']
+ . '/users/' . $GLOBALS['phpgw_info']['user']['userid'];
- /* This will make sure that a user has the basic default prefs.
If not it will add them */
- $GLOBALS['phpgw']->preferences->verify_basic_settings();
+/* This will make sure that a user has the basic default prefs. If not it will
add them */
+$GLOBALS['phpgw']->preferences->verify_basic_settings();
- /********* Optional classes, which can be disabled for
performance increases *********/
- while ($phpgw_class_name =
each($GLOBALS['phpgw_info']['flags']))
- {
- if (ereg('enable_', $phpgw_class_name[0]))
- {
- $enable_class = str_replace('enable_', '',
$phpgw_class_name[0]);
- $enable_class = str_replace('_class', '',
$enable_class);
- $GLOBALS['phpgw']->$enable_class =
createObject("phpgwapi.{$enable_class}");
- }
- }
- unset($enable_class);
- reset($GLOBALS['phpgw_info']['flags']);
+/* * ******* Optional classes, which can be disabled for performance increases
******** */
+while ($phpgw_class_name = each($GLOBALS['phpgw_info']['flags'])) {
+ if (ereg('enable_', $phpgw_class_name[0])) {
+ $enable_class = str_replace('enable_', '', $phpgw_class_name[0]);
+ $enable_class = str_replace('_class', '', $enable_class);
+ $GLOBALS['phpgw']->$enable_class =
createObject("phpgwapi.{$enable_class}");
+ }
+}
+unset($enable_class);
+reset($GLOBALS['phpgw_info']['flags']);
-
/*************************************************************************\
- * These lines load up the templates class
*
-
\*************************************************************************/
- if (
!isset($GLOBALS['phpgw_info']['flags']['disable_Template_class'])
- ||
!$GLOBALS['phpgw_info']['flags']['disable_Template_class'] )
- {
- $GLOBALS['phpgw']->template =
createObject('phpgwapi.Template',PHPGW_APP_TPL);
- $GLOBALS['phpgw']->xslttpl =
createObject('phpgwapi.xslttemplates',PHPGW_APP_TPL);
- }
+/* * ***********************************************************************\
+ * These lines load up the templates class *
+ \************************************************************************ */
+if (!isset($GLOBALS['phpgw_info']['flags']['disable_Template_class'])
+ || !$GLOBALS['phpgw_info']['flags']['disable_Template_class']) {
+ $GLOBALS['phpgw']->template = createObject('phpgwapi.Template',
PHPGW_APP_TPL);
+ $GLOBALS['phpgw']->xslttpl = createObject('phpgwapi.xslttemplates',
PHPGW_APP_TPL);
+}
-
/*************************************************************************\
- * Verify that the users session is still active otherwise kick
them out *
-
\*************************************************************************/
- if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'about')
- {
- if (!$GLOBALS['phpgw']->acl->check('run',
PHPGW_ACL_READ, $GLOBALS['phpgw_info']['flags']['currentapp']))
- {
- $GLOBALS['phpgw']->common->phpgw_header(true);
-
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access
%1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
+/* * ***********************************************************************\
+ * Verify that the users session is still active otherwise kick them out *
+ \************************************************************************ */
+if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'about') {
+ if (!$GLOBALS['phpgw']->acl->check('run', PHPGW_ACL_READ,
$GLOBALS['phpgw_info']['flags']['currentapp'])) {
+ $GLOBALS['phpgw']->common->phpgw_header(true);
+ $GLOBALS['phpgw']->log->write(array('text' => 'W-Permissions, Attempted to
access %1', 'p1' => $GLOBALS['phpgw_info']['flags']['currentapp']));
- $lang_denied = lang('Access not permitted');
- echo <<<HTML
+ $lang_denied = lang('Access not permitted');
+ echo <<<HTML
<div class="error">$lang_denied</div>
HTML;
- $GLOBALS['phpgw']->common->phpgw_exit(True);
- }
- }
+ $GLOBALS['phpgw']->common->phpgw_exit(True);
+ }
+}
- // Already called from sessions::verify
- // $GLOBALS['phpgw']->applications->read_installed_apps(); // to
get translated app-titles
+// Already called from sessions::verify
+// $GLOBALS['phpgw']->applications->read_installed_apps(); // to get
translated app-titles
-
/*************************************************************************\
- * Load the header unless the developer turns it off
*
-
\*************************************************************************/
- if ( !isset($GLOBALS['phpgw_info']['flags']['noheader']) ||
!$GLOBALS['phpgw_info']['flags']['noheader'] )
- {
- $inc_navbar =
!isset($GLOBALS['phpgw_info']['flags']['nonavbar']) ||
!$GLOBALS['phpgw_info']['flags']['nonavbar'];
- $GLOBALS['phpgw']->common->phpgw_header($inc_navbar);
- unset($inc_navbar);
- }
+/* * ***********************************************************************\
+ * Load the header unless the developer turns it off *
+ \************************************************************************ */
+if (!isset($GLOBALS['phpgw_info']['flags']['noheader']) ||
!$GLOBALS['phpgw_info']['flags']['noheader']) {
+ $inc_navbar = !isset($GLOBALS['phpgw_info']['flags']['nonavbar']) ||
!$GLOBALS['phpgw_info']['flags']['nonavbar'];
+ $GLOBALS['phpgw']->common->phpgw_header($inc_navbar);
+ unset($inc_navbar);
+}
-
/*************************************************************************\
- * Load the app include files if the exists
*
-
\*************************************************************************/
- /* Then the include file */
- if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) &&
file_exists(PHPGW_APP_INC . '/functions.inc.php') &&
!isset($GLOBALS['phpgw_info']['menuaction']))
- {
- include_once(PHPGW_APP_INC . '/functions.inc.php');
- }
- if (address@hidden'phpgw_info']['flags']['noheader'] &&
- address@hidden'phpgw_info']['flags']['noappheader'] &&
- file_exists(PHPGW_APP_INC . '/header.inc.php') &&
!isset($GLOBALS['phpgw_info']['menuaction']))
- {
- include_once(PHPGW_APP_INC . '/header.inc.php');
- }
+/* * ***********************************************************************\
+ * Load the app include files if the exists *
+ \************************************************************************ */
+/* Then the include file */
+if (!preg_match("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC .
'/functions.inc.php') && !isset($GLOBALS['phpgw_info']['menuaction'])) {
+ include_once PHPGW_APP_INC . '/functions.inc.php';
+}
+if (address@hidden'phpgw_info']['flags']['noheader'] &&
+ address@hidden'phpgw_info']['flags']['noappheader'] &&
+ file_exists(PHPGW_APP_INC . '/header.inc.php') &&
!isset($GLOBALS['phpgw_info']['menuaction'])) {
+ include_once PHPGW_APP_INC . '/header.inc.php';
+}
/////////////////////////////////////////////////////////////////////////////
// END Stuff copied from functions.inc.php
/////////////////////////////////////////////////////////////////////////////
- if (isset($_GET['menuaction']))
- {
- list($app,$class,$method) = explode('.',$_GET['menuaction']);
- }
- else
- {
- //
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' =>
'activitycalendarfrontend.uiactivity.add'));
- $app = 'activitycalendarfrontend';
- $class = 'uiactivity';
- $method = 'add';
- }
- $GLOBALS[$class] = CreateObject("{$app}.{$class}");
+if (isset($_GET['menuaction'])) {
+ list($app, $class, $method) = explode('.', $_GET['menuaction']);
+} else {
+ // $GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' =>
'activitycalendarfrontend.uiactivity.add'));
+ $app = 'activitycalendarfrontend';
+ $class = 'uiactivity';
+ $method = 'add';
+}
+$GLOBALS[$class] = CreateObject("{$app}.{$class}");
- $invalid_data = false; //FIXME consider whether this should be computed
as in the main index.php
- if ( !$invalid_data
- && is_object($GLOBALS[$class])
- && isset($GLOBALS[$class]->public_functions)
- && is_array($GLOBALS[$class]->public_functions)
- && isset($GLOBALS[$class]->public_functions[$method])
- && $GLOBALS[$class]->public_functions[$method] )
-
- {
- if ( phpgw::get_var('X-Requested-With', 'string', 'SERVER') ==
'XMLHttpRequest'
- // deprecated
- || phpgw::get_var('phpgw_return_as', 'string', 'GET')
== 'json' )
- {
- // comply with RFC 4627
- header('Content-Type: application/json');
- $return_data = $GLOBALS[$class]->$method();
- echo json_encode($return_data);
- $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
- $GLOBALS['phpgw']->common->phpgw_exit();
- }
- else
- {
- $GLOBALS[$class]->$method();
- $GLOBALS['phpgw']->common->phpgw_footer();
- }
- }
-
- //$GLOBALS['phpgw_info']['flags']['noframework'] = true;
-
-/*
-
- if (isset($_GET['menuaction']))
- {
- //list($app,$class,$method) = explode('.',$_GET['menuaction']);
- $GLOBALS['phpgw']->redirect_link('/index.php',$_GET);
- }
- else
- {
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' =>
'activitycalendarfrontend.uiactivity.index'));
- //$app = 'activitycalendarfrontend';
- //$class = 'uiactivity';
- //$method = 'index';
- }*/
- /*
- $GLOBALS[$class] = CreateObject("{$app}.{$class}");
-
- $invalid_data = false; //FIXME consider whether this should be computed
as in the main index.php
- if ( !$invalid_data
- && is_object($GLOBALS[$class])
- && isset($GLOBALS[$class]->public_functions)
- && is_array($GLOBALS[$class]->public_functions)
- && isset($GLOBALS[$class]->public_functions[$method])
- && $GLOBALS[$class]->public_functions[$method] )
-
- {
- if ( phpgw::get_var('X-Requested-With', 'string', 'SERVER') ==
'XMLHttpRequest'
- // deprecated
- || phpgw::get_var('phpgw_return_as', 'string', 'GET')
== 'json' )
- {
- // comply with RFC 4627
- header('Content-Type: application/json');
- $return_data = $GLOBALS[$class]->$method();
- echo json_encode($return_data);
- $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
- $GLOBALS['phpgw']->common->phpgw_exit();
- }
- else
- {
- $GLOBALS[$class]->$method();
- $GLOBALS['phpgw']->common->phpgw_footer();
- }
- }*/
-
-
-// include_once('../header.inc.php');
-
-
+$invalid_data = false; //FIXME consider whether this should be computed as in
the main index.php
+if (!$invalid_data
+ && is_object($GLOBALS[$class])
+ && isset($GLOBALS[$class]->public_functions)
+ && is_array($GLOBALS[$class]->public_functions)
+ && isset($GLOBALS[$class]->public_functions[$method])
+ && $GLOBALS[$class]->public_functions[$method]) {
+ if (phpgw::get_var('X-Requested-With', 'string', 'SERVER') ==
'XMLHttpRequest'
+ // deprecated
+ || phpgw::get_var('phpgw_return_as', 'string', 'GET') == 'json') {
+ // comply with RFC 4627
+ header('Content-Type: application/json');
+ $return_data = $GLOBALS[$class]->$method();
+ echo json_encode($return_data);
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ } else {
+ $GLOBALS[$class]->$method();
+ $GLOBALS['phpgw']->common->phpgw_footer();
+ }
+}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/default_records.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/setup/default_records.inc.php
2012-08-31 11:03:24 UTC (rev 9952)
+++
branches/Version-1_0-branch/activitycalendarfrontend/setup/default_records.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,32 +1,13 @@
<?php
// Default user
-$GLOBALS['phpgw']->accounts = createObject('phpgwapi.accounts');
-$GLOBALS['phpgw']->acl = CreateObject('phpgwapi.acl');
+$GLOBALS['phpgw']->accounts = createObject('phpgwapi.accounts');
+$GLOBALS['phpgw']->acl = CreateObject('phpgwapi.acl');
$modules = array
-(
- 'activitycalendarfrontend',
+ (
+ 'activitycalendarfrontend',
// 'preferences'
);
-$aclobj =& $GLOBALS['phpgw']->acl;
-/*
-if (!$GLOBALS['phpgw']->accounts->exists('bookingguest') ) // no guest account
already exists
-{
- $GLOBALS['phpgw_info']['server']['password_level'] = '8CHAR';
- $account = new phpgwapi_user();
- $account->lid = 'bookingguest';
- $account->firstname = 'booking';
- $account->lastname = 'Guest';
- $account->passwd = 'bkbooking';
- $account->enabled = true;
- $account->expires = -1;
- $bookingguest = $GLOBALS['phpgw']->accounts->create($account,
array(), array(), $modules);
-
- $preferences = createObject('phpgwapi.preferences');
- $preferences->set_account_id($bookingguest);
- $preferences->add('bookingfrontend','template_set','bkbooking');
- $preferences->save_repository(true,$GLOBALS['type']);
-}
-*/
\ No newline at end of file
+$aclobj = & $GLOBALS['phpgw']->acl;
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2012-08-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2012-08-31 11:06:27 UTC (rev 9953)
@@ -95,8 +95,8 @@
edit_organization activitycalendarfrontend no Rediger
organisasjonsinformasjon
address activitycalendarfrontend no Adresse
activity_edit_helptext_step1 activitycalendarfrontend no Skal du
endre opplysninger knyttet til en aktivitet må du være registrert som
kontaktperson for aktiviteten.<br/>Du velger først organisasjon og deretter
aktivitet i bildet under, og får en e-post i retur med en lenke til
endringsskjema.
-mail_body_update_frontend activitycalendarfrontend no Dette
er en melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som
ligger i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/><br/> Mvh %3
kulturkontor
-mail_body_update activitycalendarfrontend no Dette er en
melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger
i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/><br/> Mvh %3
kulturkontor
+mail_body_update_frontend activitycalendarfrontend no Dette
er en melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som
ligger i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/>%3<br><br/> Mvh
%4 kulturkontor
+mail_body_update activitycalendarfrontend no Dette er en
melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som ligger
i kommuneportalen på internett, står du registrert som kontaktperson for
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/>%3<br/><br/>
Mvh %4 kulturkontor
mail_subject_update activitycalendarfrontend no Melding fra
AktivBy - Aktivitetsoversikt
save_organization_next activitycalendarfrontend no Lagre
organisasjon og gå videre til Ny aktivitet
new_organization activitycalendarfrontend no Ny organisasjon
@@ -134,4 +134,5 @@
help_new_activity_time activitycalendarfrontend no Skriv inn dag
og klokkeslett når aktiviteten foregår, f.eks. slik «Mandag kl. 20 – 21» eller
slik «Hver andre tirsdag kl. 19 – 21».
help_new_activity_contact_person activitycalendarfrontend no
Skriv inn navn, telefonnummer og e-postadresse til kontaktperson for
aktiviteten.
help_new_activity_office activitycalendarfrontend no Det
kommunale kulturkontoret mottar registreringen. Velg kulturkontoret i den
bydelen hvor aktiviteten foregår.
-help_edit_activity_location activitycalendarfrontend no Du må
spesifisere hvor aktiviteten foregår.\\n\\nListen er sortert i «Kommunale bygg»
og «Eksterne bygg», dvs. bygg som brukere av løsningen har registrert tidligere.
\ No newline at end of file
+help_edit_activity_location activitycalendarfrontend no Du må
spesifisere hvor aktiviteten foregår.\\n\\nListen er sortert i «Kommunale bygg»
og «Eksterne bygg», dvs. bygg som brukere av løsningen har registrert tidligere.
+help_edit_activity_org activitycalendarfrontend no Her kan du
endre opplysninger som tidligere er registrert for din organisasjon.
\ 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-31 11:03:24 UTC (rev 9952)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,43 +1,44 @@
<?php
- $setup_info['activitycalendarfrontend']['name'] =
'activitycalendarfrontend';
- $setup_info['activitycalendarfrontend']['version'] = '0.1';
- $setup_info['activitycalendarfrontend']['app_order'] = 61;
- $setup_info['activitycalendarfrontend']['enable'] = 1;
- $setup_info['activitycalendarfrontend']['app_group'] = 'office';
- $setup_info['activitycalendarfrontend']['description'] = 'Bergen
kommune activitycalendarfrontend';
+$setup_info['activitycalendarfrontend']['name'] = 'activitycalendarfrontend';
+$setup_info['activitycalendarfrontend']['version'] = '0.1';
+$setup_info['activitycalendarfrontend']['app_order'] = 61;
+$setup_info['activitycalendarfrontend']['enable'] = 1;
+$setup_info['activitycalendarfrontend']['app_group'] = 'office';
- $setup_info['activitycalendarfrontend']['author'][] = array
- (
- 'name' => 'Bouvet ASA',
- 'email' => 'address@hidden'
- );
+$setup_info['activitycalendarfrontend']['description'] = 'Bergen kommune
activitycalendarfrontend';
- /* Dependencies for this app to work */
- $setup_info['activitycalendarfrontend']['depends'][] = array(
- 'appname' => 'phpgwapi',
- 'versions' => Array('0.9.17', '0.9.18')
- );
+$setup_info['activitycalendarfrontend']['author'][] = array
+ (
+ 'name' => 'Bouvet ASA',
+ 'email' => 'address@hidden'
+);
- $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','0.2.09')
- );
+/* Dependencies for this app to work */
+$setup_info['activitycalendarfrontend']['depends'][] = array(
+ 'appname' => 'phpgwapi',
+ 'versions' => Array('0.9.17', '0.9.18')
+);
- $setup_info['activitycalendarfrontend']['depends'][] = array(
- 'appname' => 'property',
- 'versions' => Array('0.9.17')
- );
-
- $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','0.1.9','0.1.10','0.1.11')
- );
+$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', '0.2.09')
+);
- /* The hooks this app includes, needed for hooks registration */
- $setup_info['activitycalendarfrontend']['hooks'] = array
- (
- 'menu' => 'activitycalendarfrontend.menu.get_menu',
- 'config'
- );
+$setup_info['activitycalendarfrontend']['depends'][] = array(
+ 'appname' => 'property',
+ 'versions' => Array('0.9.17')
+);
+
+$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',
'0.1.9', '0.1.10', '0.1.11')
+);
+
+/* The hooks this app includes, needed for hooks registration */
+$setup_info['activitycalendarfrontend']['hooks'] = array
+ (
+ 'menu' => 'activitycalendarfrontend.menu.get_menu',
+ 'config'
+);
?>
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/tables_current.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/setup/tables_current.inc.php
2012-08-31 11:03:24 UTC (rev 9952)
+++
branches/Version-1_0-branch/activitycalendarfrontend/setup/tables_current.inc.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,3 +1,4 @@
<?php
- $phpgw_baseline = array();
+
+$phpgw_baseline = array();
?>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2012-08-31 11:03:24 UTC (rev 9952)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,42 +1,47 @@
<?php
- //include common logic for all templates
+//include common logic for all templates
// include("common.php");
$act_so = activitycalendar_soactivity::get_instance();
$contpers_so = activitycalendar_socontactperson::get_instance();
?>
<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 }?>
+ <?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>
<form action="#" method="post">
- <input type="hidden" name="id" value="<?php
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; } ?>"/>
+ <input type="hidden" name="id" value="<?php
+ if ($activity->get_id()) {
+ echo $activity->get_id();
+ } else {
+ echo '0';
+ }
+ ?>"/>
<dl class="proplist-col">
- <div class="form-buttons">
- <?php
- if ($change_request) {?>
- <input type="submit" name="activity_ok"
value="<?php echo lang('activity_ok')?>" />
- <input type="submit" name="change_request"
value="<?php echo lang('change_activity')?>" />
- <?php }
- ?>
- </div>
+ <div class="form-buttons">
+ <?php if ($change_request) { ?>
+ <input type="submit" name="activity_ok"
value="<?php echo lang('activity_ok') ?>" />
+ <input type="submit"
name="change_request" value="<?php echo lang('change_activity') ?>" />
+<?php }
+?>
+ </div>
<FIELDSET title="Hva">
<LEGEND>Hva</LEGEND>
<dt>
<label for="title"><?php echo
lang('activity_title') ?></label>
</dt>
<dd>
- <?php echo $activity->get_title();?>
+ <?php echo $activity->get_title(); ?>
</dd>
<dt>
<label for="description"><?php echo
lang('description') ?></label>
@@ -44,15 +49,15 @@
<dd>
<?php echo
$activity->get_description(); ?>
</dd>
-
+
<dt>
<label for="category"><?php echo
lang('category') ?></label>
</dt>
<dd>
<?php
- if($activity->get_category()){
- echo
$act_so->get_category_name($activity->get_category());
- }
+ if ($activity->get_category()) {
+ echo
$act_so->get_category_name($activity->get_category());
+ }
?>
</dd>
</FIELDSET>
@@ -62,49 +67,47 @@
</dt>
<dd>
<?php
- if($activity->get_target()){
- $current_target_ids =
$activity->get_target();
-
$current_target_id_array=explode(",", $current_target_ids);
-
foreach($current_target_id_array as $curr_target)
- {
- echo
$act_so->get_target_name($curr_target).'<br/>';
- }
+ if ($activity->get_target()) {
+ $current_target_ids =
$activity->get_target();
+ $current_target_id_array =
explode(",", $current_target_ids);
+ foreach
($current_target_id_array as $curr_target) {
+ echo
$act_so->get_target_name($curr_target) . '<br/>';
}
+ }
?>
</dd>
<dt>
- <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>
+ <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>
</FIELDSET>
<FIELDSET title="hvor">
<LEGEND>Hvor og når</LEGEND>
- <?php if($activity->get_internal_arena()) { ?>
+<?php if ($activity->get_internal_arena()) { ?>
+ <dt>
+ <label for="arena"><?php echo
lang('building') ?></label>
+ </dt>
+ <dd>
+ <?php echo
activitycalendar_soarena::get_instance()->get_building_name($activity->get_internal_arena());
?>
+ </dd>
+<?php } ?>
+<?php if ($activity->get_arena()) { ?>
+ <dt>
+ <label for="arena"><?php echo
lang('arena') ?></label>
+ </dt>
+ <dd>
+ <?php echo
activitycalendar_soarena::get_instance()->get_arena_name($activity->get_arena());
?>
+ </dd>
+<?php } ?>
<dt>
- <label for="arena"><?php echo
lang('building') ?></label>
- </dt>
- <dd>
- <?php echo
activitycalendar_soarena::get_instance()->get_building_name($activity->get_internal_arena());
?>
- </dd>
- <?php }?>
- <?php if($activity->get_arena()) { ?>
- <dt>
- <label for="arena"><?php echo
lang('arena') ?></label>
- </dt>
- <dd>
- <?php echo
activitycalendar_soarena::get_instance()->get_arena_name($activity->get_arena());
?>
- </dd>
- <?php } ?>
- <dt>
<label for="district"><?php echo
lang('district') ?></label>
</dt>
<dd>
<?php
- if($activity->get_district()){
+ 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/>';
+ $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/>';
}
}
?>
@@ -113,58 +116,60 @@
<label for="time"><?php echo
lang('time') ?></label>
</dt>
<dd>
- <?php echo $activity->get_time();?>
+<?php echo $activity->get_time(); ?>
</dd>
</FIELDSET>
<FIELDSET id="arr">
<legend>Arrangør</legend>
<dd>
- <?php echo $organization->get_name();?>
- <?php if(!$change_request)
- {
- if(!$activity->get_new_org()){?>
- <a
href="index.php?menuaction=activitycalendarfrontend.uiactivity.edit_organization_values&organization_id=<?php
echo $organization->get_id();?>" target="_blank"><?php echo
lang('edit_organization');?></a>
- <?php }
- }?>
+ <?php echo $organization->get_name(); ?>
+ <?php
+ if (!$change_request) {
+ if (!$activity->get_new_org()) {
+ ?>
+ <a
href="index.php?menuaction=activitycalendarfrontend.uiactivity.edit_organization_values&organization_id=<?php
echo $organization->get_id(); ?>" target="_blank"><?php echo
lang('edit_organization'); ?></a>
+ <?php
+ }
+ }
+ ?>
</dd>
<br/>
<LEGEND>Kontaktperson</LEGEND>
<dt>
- <?php
if($activity->get_contact_person_1()) { ?>
+<?php if ($activity->get_contact_person_1()) { ?>
<label for="contact_person_1"><?php
echo lang('contact_person') ?></label>
- <?php } ?>
+ <?php } ?>
</dt>
<dd>
<label for="contact1_name">Navn</label>
- <?php echo
isset($contact1)?$contact1->get_name():''?><br/>
+ <?php echo isset($contact1) ?
$contact1->get_name() : '' ?><br/>
<label
for="contact1_phone">Telefon</label>
- <?php echo
isset($contact1)?$contact1->get_phone():''?><br/>
+<?php echo isset($contact1) ? $contact1->get_phone() : '' ?><br/>
<label
for="contact1_mail">E-post</label>
- <?php echo
isset($contact1)?$contact1->get_email():''?>
+<?php echo isset($contact1) ? $contact1->get_email() : '' ?>
</dd>
</FIELDSET>
<FIELDSET>
<BR>
- <dt>
- <LABEL for="office">Kulturkontor</label>
+ <dt>
+ <LABEL for="office">Kulturkontor</LABEL>
</dt>
<dd>
<?php
- if($activity->get_office()){
- echo
$act_so->get_office_name($activity->get_office());
- }
+ if ($activity->get_office()) {
+ echo
$act_so->get_office_name($activity->get_office());
+ }
?>
</dd>
- </FIELDSET>
- <br/><br/>
- <div class="form-buttons">
- <?php
- if ($change_request) {?>
- <input type="submit" name="activity_ok"
value="<?php echo lang('activity_ok')?>" />
- <input type="submit" name="change_request"
value="<?php echo lang('change_activity')?>" />
- <?php }
- ?>
- </div>
- </dl>
+ </FIELDSET>
+ <br/><br/>
+ <div class="form-buttons">
+ <?php if ($change_request) { ?>
+ <input type="submit" name="activity_ok"
value="<?php echo lang('activity_ok') ?>" />
+ <input type="submit"
name="change_request" value="<?php echo lang('change_activity') ?>" />
+<?php }
+?>
+ </div>
+ </dl>
</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-31 11:03:24 UTC (rev 9952)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
2012-08-31 11:06:27 UTC (rev 9953)
@@ -1,5 +1,5 @@
<?php
- //include common logic for all templates
+//include common logic for all templates
// include("common.php");
$act_so = activitycalendar_soactivity::get_instance();
$contpers_so = activitycalendar_socontactperson::get_instance();
@@ -7,389 +7,388 @@
<script type="text/javascript">
-function get_available_groups()
-{
- var org_id = document.getElementById('organization_id').value;
- var div_select = document.getElementById('group_select');
+ function get_available_groups()
+ {
+ var org_id = document.getElementById('organization_id').value;
+ var div_select = document.getElementById('group_select');
-<?php if($activity->get_group_id()){?>
- //url =
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id();?>;
- url = "<?php echo
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id();?>;
-<?php }else{?>
- //url =
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
- url = "<?php echo
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
-<?php }?>
+<?php if ($activity->get_group_id()) { ?>
+ //url =
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id(); ?>;
+ url = "<?php echo $ajaxURL
?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id(); ?>;
+<?php } else { ?>
+ //url =
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
+ url = "<?php echo $ajaxURL
?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
+<?php } ?>
- if(org_id != null && org_id == 'new_org')
- {
- //alert('new_org');
- document.getElementById('new_org').style.display = "block";
- document.getElementById('new_org_fields').style.display =
"block";
- document.getElementById('group_label').style.display = "none";
- document.getElementById('group_select').style.display = "none";
+ if(org_id != null && org_id == 'new_org')
+ {
+ //alert('new_org');
+ document.getElementById('new_org').style.display =
"block";
+ document.getElementById('new_org_fields').style.display
= "block";
+ document.getElementById('group_label').style.display =
"none";
+ document.getElementById('group_select').style.display =
"none";
+ }
+ else if(org_id != null && org_id == 'change_org')
+ {
+ document.getElementById('new_org').style.display =
"block";
+ document.getElementById('new_org_fields').style.display
= "none";
+
document.getElementById('change_org_fields').style.display = "block";
+ document.getElementById('group_label').style.display =
"none";
+ document.getElementById('group_select').style.display =
"none";
+ }
+ else
+ {
+ document.getElementById('new_org').style.display =
"none";
+ document.getElementById('new_org_fields').style.display
= "none";
+
document.getElementById('change_org_fields').style.display = "none";
+ var divcontent_start = "<select name=\"group_id\"
id=\"group_id\" onchange=\"javascript:checkNewGroup()\">";
+ var divcontent_end = "</select>";
+
+ var callback = {
+ success: function(response){
+ div_select.innerHTML = divcontent_start
+ JSON.parse(response.responseText) + divcontent_end;
+ },
+ failure: function(o) {
+ alert("AJAX doesn't work"); //FAILURE
+ }
+ }
+ var trans = YAHOO.util.Connect.asyncRequest('GET', url,
callback, null);
+ }
}
- else if(org_id != null && org_id == 'change_org')
+
+ YAHOO.util.Event.onDOMReady(function()
{
- document.getElementById('new_org').style.display = "block";
- document.getElementById('new_org_fields').style.display =
"none";
- document.getElementById('change_org_fields').style.display =
"block";
- document.getElementById('group_label').style.display = "none";
- document.getElementById('group_select').style.display = "none";
+ get_available_groups();
+ });
+
+ function checkNewGroup()
+ {
+ var group_selected = document.getElementById('group_id').value;
+ if(group_selected == 'new_group')
+ {
+ document.getElementById('new_group').style.display =
"block";
+
document.getElementById('new_group_fields').style.display = "block";
+ }
+ else
+ {
+ document.getElementById('new_group').style.display =
"none";
+
document.getElementById('new_group_fields').style.display = "none";
+ }
}
- else
+
+ function get_address_search()
{
- document.getElementById('new_org').style.display = "none";
- document.getElementById('new_org_fields').style.display =
"none";
- document.getElementById('change_org_fields').style.display =
"none";
- var divcontent_start = "<select name=\"group_id\"
id=\"group_id\" onchange=\"javascript:checkNewGroup()\">";
+ 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&phpgw_return_as=json&search="
+ address;
+ url = "<?php echo $ajaxURL
?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
+
+ var divcontent_start = "<select name=\"address_select\"
id=\"address\" size=\"5\" onChange='setAddressValue(this)'>";
var divcontent_end = "</select>";
-
+
var callback = {
success: function(response){
- div_select.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
- },
+ div_address.innerHTML = divcontent_start +
JSON.parse(response.responseText) + divcontent_end;
+ },
failure: function(o) {
- alert("AJAX doesn't work");
//FAILURE
- }
+ alert("AJAX doesn't work"); //FAILURE
+ }
}
var trans = YAHOO.util.Connect.asyncRequest('GET', url,
callback, null);
+
}
-}
-YAHOO.util.Event.onDOMReady(function()
-{
- get_available_groups();
-});
-
-function checkNewGroup()
-{
- var group_selected = document.getElementById('group_id').value;
- if(group_selected == 'new_group')
+ function get_address_search_cp2()
{
- document.getElementById('new_group').style.display = "block";
- document.getElementById('new_group_fields').style.display =
"block";
- }
- else
- {
- document.getElementById('new_group').style.display = "none";
- document.getElementById('new_group_fields').style.display =
"none";
- }
-}
+ var address = document.getElementById('contact2_address').value;
+ var div_address =
document.getElementById('contact2_address_container');
+ div_address.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&phpgw_return_as=json&search="
+ address;
+ url = "<?php echo $ajaxURL
?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
- //url =
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
- url = "<?php echo
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
-
- var divcontent_start = "<select name=\"address_select\" id=\"address\"
size=\"5\" onChange='setAddressValue(this)'>";
- var divcontent_end = "</select>";
+ var divcontent_start = "<select
name=\"contact2_address_select\" id=\"address_cp2\" 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) {
- alert("AJAX doesn't work"); //FAILURE
- }
- }
- var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+ var callback = {
+ success: function(response){
+ div_address.innerHTML = divcontent_start +
JSON.parse(response.responseText) + divcontent_end;
+ },
+ failure: function(o) {
+ alert("AJAX doesn't work"); //FAILURE
+ }
+ }
+ var trans = YAHOO.util.Connect.asyncRequest('GET', url,
callback, null);
-}
-
-function get_address_search_cp2()
-{
- var address = document.getElementById('contact2_address').value;
- 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&phpgw_return_as=json&search="
+ address;
- url = "<?php echo
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
-
- var divcontent_start = "<select name=\"contact2_address_select\"
id=\"address_cp2\" 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) {
- alert("AJAX doesn't work"); //FAILURE
- }
}
- var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
-
-}
-function setAddressValue(field)
-{
- if(field.name == 'contact2_address_select')
+ function setAddressValue(field)
{
- var address = document.getElementById('contact2_address');
- var div_address = document.getElementById('contact2_address_container');
+ if(field.name == 'contact2_address_select')
+ {
+ var address =
document.getElementById('contact2_address');
+ var div_address =
document.getElementById('contact2_address_container');
- address.value=field.value;
- div_address.style.display="none";
- }
- else
- {
- var address = document.getElementById('address');
- var div_address = document.getElementById('address_container');
+ address.value=field.value;
+ div_address.style.display="none";
+ }
+ else
+ {
+ var address = document.getElementById('address');
+ var div_address =
document.getElementById('address_container');
- address.value=field.value;
- div_address.style.display="none";
+ address.value=field.value;
+ div_address.style.display="none";
+ }
}
-}
-function allOK()
-{
- if(document.getElementById('title').value == null ||
document.getElementById('title').value == '')
+ function allOK()
{
- alert("Tittel må fylles ut!");
- return false;
+ if(document.getElementById('title').value == null ||
document.getElementById('title').value == '')
+ {
+ alert("Tittel må fylles ut!");
+ return false;
+ }
+ if(document.getElementsByTagName('textarea')[0].value == null
|| document.getElementsByTagName('textarea')[0].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))
+ {
+ alert("Lokale må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('time').value == null ||
document.getElementById('time').value == '')
+ {
+ alert("Dag og tid må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('contact_name').value == null ||
document.getElementById('contact_name').value == '')
+ {
+ 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_phone').value != null &&
document.getElementById('contact_phone').value.length < 8)
+ {
+ alert("Telefonnummer må inneholde minst 8 siffer!");
+ 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!");
+ return false;
+ }
+ else
+ return true;
}
- if(document.getElementsByTagName('textarea')[0].value == null ||
document.getElementsByTagName('textarea')[0].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))
- {
- alert("Lokale må fylles ut!");
- return false;
- }
- if(document.getElementById('time').value == null ||
document.getElementById('time').value == '')
- {
- alert("Dag og tid må fylles ut!");
- return false;
- }
- if(document.getElementById('contact_name').value == null ||
document.getElementById('contact_name').value == '')
- {
- 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_phone').value != null &&
document.getElementById('contact_phone').value.length < 8)
- {
- alert("Telefonnummer må inneholde minst 8 siffer!");
- 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!");
- return false;
- }
- else
- return true;
-}
</script>
<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>
- <div class="pageTop">
- <h1><?php echo lang('activity') ?></h1>
- <div>
- <?php echo lang('required_fields')?>
+
+ <?php if ($message) { ?>
+ <div class="success">
+ <?php echo $message; ?>
</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">
- <fieldset title="<?php echo lang('what')?>">
- <legend>Hva</legend>
- <dt>
- <label for="title"><?php echo
lang('activity_title') ?> (*) <a onclick="alert('<?php echo
lang('help_new_activity_title')?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_description')?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_category')?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_target')?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_spec_adapt')?>'); return false;" href="#"><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('location') ?> (*) <a onclick="alert('<?php echo
lang('help_edit_activity_location')?>'); return false;" href="#"><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('external_arena') ?>">
- <?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="alert('<?php echo
lang('help_new_activity_district')?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_time')?>'); return false;" href="#"><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="alert('<?php echo lang('help_new_activity_contact_person')?>'); return
false;" href="#"><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="alert('<?php echo
lang('help_new_activity_office')?>'); return false;" href="#"><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) {?>
- <input type="submit"
name="save_activity" value="<?php echo lang('save')?>" onclick="return
allOK();"/>
- <?php }
- ?>
- </div>
- </dl>
- </form>
+ <?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">
+ <fieldset title="<?php echo lang('what') ?>">
+ <legend>Hva</legend>
+ <dt>
+ <label for="title"><?php echo
lang('activity_title') ?> (*) <a onclick="alert('<?php echo
lang('help_new_activity_title') ?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_description') ?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_category') ?>'); return false;" href="#"><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="alert('<?php echo
lang('help_new_activity_target') ?>'); return false;" href="#"><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) {
+ ?>
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9953] Merge 9929:9952 from trunk,
Sigurd Nes <=