[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9994] Merge 9964:9993 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9994] Merge 9964:9993 from trunk |
Date: |
Tue, 11 Sep 2012 12:22:27 +0000 |
Revision: 9994
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9994
Author: sigurdne
Date: 2012-09-11 12:22:26 +0000 (Tue, 11 Sep 2012)
Log Message:
-----------
Merge 9964:9993 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.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.model.inc.php
branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php
branches/Version-1_0-branch/controller/js/controller/ajax.js
branches/Version-1_0-branch/controller/templates/base/calendar/calendar_filters.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/icon_color_map.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/select_my_locations.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
Added Paths:
-----------
branches/Version-1_0-branch/controller/templates/base/check_list/case_row.xsl
branches/Version-1_0-branch/controller/templates/base/control/control_details.xsl
branches/Version-1_0-branch/property/inc/soap_client/
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2012-09-11 12:22:26 UTC (rev 9994)
@@ -2,7 +2,7 @@
Activitycalendarfrontend common no Aktivitetsoversikt Frontend
office activitycalendarfrontend no Hovedansvarlig kulturkontor
arena activitycalendarfrontend no Lokale
-description activitycalendarfrontend no Beskrivelse
+description activitycalendarfrontend no Beskrivelse (max 255
tegn)
date_start activitycalendarfrontend no Startdato
date_end activitycalendarfrontend no Sluttdato
special_adaptation activitycalendarfrontend no Ja, aktiviteten
er spesielt tilpasset for utviklingshemmede
@@ -109,7 +109,7 @@
new_activity_helptext activitycalendarfrontend no Hvem arrangerer
aktiviteten?
responsible activitycalendarfrontend no Arrangør
choose_org activitycalendarfrontend no Velg organisasjon
-activity_title activitycalendarfrontend no Navn på aktiviteten
+activity_title activitycalendarfrontend no Navn på aktiviteten
(max 255 tegn)
location activitycalendarfrontend no Lokale
contact_person activitycalendarfrontend no Kontaktperson for
aktiviteten
activity_ok_message activitycalendarfrontend no Aktiviteten er
lagret uten endringer
@@ -121,8 +121,8 @@
help_streetaddress activitycalendarfrontend no For å unngå
feil innskriving av gateadresse, er feltet for «Gateadresse» koplet mot
kommunens gateregister med oversikt over alle gatenavn i Bergen. Begynn å fylle
ut feltet og velg rett gatenavn som løsningen foreslår.
help_homepage activitycalendarfrontend no Dersom
organisasjonen/aktiviteten har egen internettside, så kan du skrive den inn her.
help_contact_person activitycalendarfrontend no Skriv inn navn,
telefonnummer og e-postadresse til kontaktperson for
organisasjonen.\\n\\nDersom organisasjon og aktivitet har samme kontaktperson,
skal du likevel skrive inn kontaktopplysninger. Det gjør ingen ting om disse
opplysningene senere også skrives inn på aktiviteten.\\n\\nI
aktivitetsoversikten på kommunens internettsider, er det opplysningene skrevet
inn på kontaktperson for aktiviteten som vil vises, ikke kontaktperson for
organisasjonen.
-help_new_activity_title activitycalendarfrontend no Skriv
inn navnet på aktiviteten.
-help_new_activity_description activitycalendarfrontend no Gi en
KORT beskrivelse av hva aktiviteten går ut på. Skriv helst kun én setning,
maksimalt to.
+help_new_activity_title activitycalendarfrontend no Skriv
inn navnet på aktiviteten. (max 255 tegn)
+help_new_activity_description activitycalendarfrontend no Gi en
KORT beskrivelse av hva aktiviteten går ut på. Skriv helst kun én setning,
maksimalt to. (max 255 tegn)
help_new_activity_category activitycalendarfrontend no Velg
den kategorien som passer best for din aktivitet.
help_new_activity_target activitycalendarfrontend no Velg en
eller flere målgrupper.
help_new_activity_spec_adapt activitycalendarfrontend no Hak av
dersom aktiviteten passer for utviklingshemmede.
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -156,6 +156,11 @@
alert("Beskrivelse må fylles ut!");
return false;
}
+ if(document.getElementsByTagName('textarea')[0].value.length >
254)
+ {
+ alert("Beskrivelse kan maksimalt være 255 tegn!");
+ return false;
+ }
if(document.getElementById('category').value == null ||
document.getElementById('category').value == 0)
{
alert("Kategori må fylles ut!");
@@ -246,7 +251,7 @@
<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"/>
+ <input type="text" name="title"
id="title" value="<?php echo $activity->get_title() ?>" size="83"
maxlength="254"/>
</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>
@@ -350,7 +355,7 @@
</label>
</dt>
<dd>
- <input type="text" name="time"
id="time" value="<?php echo $activity->get_time() ?>" size="80" />
+ <input type="text" name="time"
id="time" value="<?php echo $activity->get_time() ?>" size="80" maxlength="254"
/>
</dd>
</fieldset>
<FIELDSET id="arr">
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -155,6 +155,11 @@
alert("Beskrivelse må fylles ut!");
return false;
}
+ if(document.getElementById('description').value.length > 254)
+ {
+ alert("Beskrivelse kan maksimalt være 255 tegn!");
+ return false;
+ }
if(document.getElementById('category').value == null ||
document.getElementById('category').value == 0)
{
alert("Kategori må fylles ut!");
@@ -280,7 +285,7 @@
<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"/>
+ <input type="text" name="title"
id="title" value="<?php echo $activity->get_title() ?>" size="83"
maxlength="254"/>
</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"></TEXTAREA></DD>
@@ -407,7 +412,7 @@
<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" />
+ <input type="text" name="time"
id="time" value="<?php echo $activity->get_time() ?>" size="80" maxlength="254"
/>
</dd>
</fieldset>
<FIELDSET id="arr"><LEGEND>Kontaktperson</LEGEND><BR>
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -215,9 +215,9 @@
<dt><label for="orgname">Organisasjonsnavn (*)</label>
<a onclick="alert('<?php echo lang('help_organization_name') ?>'); return
false;" href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a>
</dt>
-
<dd><input type="text" name="orgname" id="orgname" size="80"/></dd>
+
<dd><input type="text" name="orgname" id="orgname" size="80"
maxlength="254"/></dd>
<dt><label for="orgno">Organisasjonsnummer</label></dt>
-
<dd><input type="text" name="orgno"/></dd>
+
<dd><input type="text" name="orgno" maxlength="254"/></dd>
<DT
style="margin-right: 20px; float: left;"><label for="street">Gateadresse
<a onclick="alert('<?php echo lang('help_streetaddress') ?>'); return false;"
href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a></label><br/>
<INPUT id="address" onkeyup="javascript:get_address_search()" name="address"
size="50" type="text" autocomplete="off"><BR/>
@@ -235,11 +235,11 @@
</DIV>
<DT><LABEL
for="homepage">Hjemmeside <a onclick="alert('<?php echo lang('help_homepage')
?>'); return false;" href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a></LABEL>
</DT>
- <DD><INPUT
name="homepage" value="http://" size="80" type="text"></DD><BR/><BR/>
+ <DD><INPUT
name="homepage" value="http://" size="80" type="text"
maxlength="254"></DD><BR/><BR/>
<DIV
style="overflow: hidden;">
Kontaktperson for organisasjonen <a onclick="alert('<?php echo
lang('help_contact_person') ?>'); return false;" href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a><BR/>
<DT><LABEL for="contact1_name">Navn (*)</LABEL></DT>
-
<DD><INPUT name="org_contact1_name" id="org_contact1_name" size="80"
type="text"></DD>
+
<DD><INPUT name="org_contact1_name" id="org_contact1_name" size="80"
type="text" maxlength="254"></DD>
<DT><LABEL for="contact1_phone">Telefon (*)</LABEL></DT>
<DD><INPUT name="org_contact1_phone" id="org_contact1_phone" type="text"></DD>
<DT><LABEL for="contact1_mail">E-post (*)</LABEL></DT>
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -109,9 +109,9 @@
<dt><label
for="orgname">Organisasjonsnavn (*)</label>
<a onclick="alert('<?php echo
lang('help_organization_name') ?>'); return false;" href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a>
</dt>
- <dd><input type="text" name="orgname"
id="orgname" size="80" value="<?php echo $organization->get_name() ?>"/></dd>
+ <dd><input type="text" name="orgname"
id="orgname" size="80" value="<?php echo $organization->get_name() ?>"
maxlength="254"/></dd>
<dt><label
for="orgno">Organisasjonsnummer</label></dt>
- <dd><input type="text" name="orgno"
value="<?php echo $organization->get_organization_number() ?>"/></dd>
+ <dd><input type="text" name="orgno"
value="<?php echo $organization->get_organization_number() ?>"
maxlength="254"/></dd>
<DT style="margin-right: 20px; float:
left;"><label for="street">Gateadresse</label>
<a onclick="alert('<?php echo
lang('help_streetaddress') ?>'); return false;" href="#"><img alt="Hjelp"
src="/aktivitetsoversikt/images/hjelp.gif"></a><BR/>
<INPUT id="address"
onkeyup="javascript:get_address_search()" name="address" size="50" type="text"
value="<?php echo $organization->get_address() ?>" autocomplete="off"><BR/>
Modified: branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -362,6 +362,7 @@
* @param $location_code location code
* @return array with check list objects
*/
+ /* Tror ikke vi bruker denne: Torstein 6/9-2012
function get_open_check_lists_for_control($control_id, $location_code,
$from_date)
{
$control_id = (int) $control_id;
@@ -414,6 +415,7 @@
return null;
}
}
+ */
/**
* Get array with control id and number of open cases within time period
@@ -481,7 +483,7 @@
$sql .= "AND c.repeat_type $repeat_type_expr ";
}
- $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
+ $sql .= "AND (deadline > $from_date_ts) AND (deadline < $to_date_ts)
";
$sql .= "ORDER BY c.id;";
$this->db->query($sql);
@@ -556,7 +558,7 @@
$sql .= "AND c.repeat_type $repeat_type_expr ";
}
- $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
+ $sql .= "AND (deadline > $from_date_ts) AND (deadline <
$to_date_ts) ";
$sql .= "ORDER BY c.id;";
$this->db->query($sql);
Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -147,8 +147,9 @@
$sql .= "AND c.responsibility_id = $role_id ";
}
- $sql .= "AND (c.start_date <= $from_date AND c.end_date
IS NULL ";
- $sql .= "OR c.start_date > $from_date AND c.start_date
< $to_date)";
+ $sql .= "AND ((c.start_date <= $to_date AND c.end_date
IS NULL) ";
+ $sql .= "OR (c.start_date <= $to_date AND c.end_date >
$from_date ))";
+
$this->db->query($sql);
@@ -294,8 +295,8 @@
$sql .= "AND c.responsibility_id = $role_id ";
}
- $sql .= "AND (c.start_date <= $from_date AND c.end_date
IS NULL ";
- $sql .= "OR c.start_date > $from_date AND c.start_date
< $to_date) ";
+ $sql .= "AND ((c.start_date <= $to_date AND c.end_date
IS NULL) ";
+ $sql .= "OR (c.start_date <= $to_date AND c.end_date >
$from_date ))";
if($filter != null)
{
Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -174,7 +174,7 @@
$components_calendar_array[] = array("component" =>
$component->toArray(), "controls_calendar" =>
$controls_components_calendar_array);
}
-
+
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
$property_array =
execMethod('property.solocation.read', array('type_id' => 1, 'allrows' =>
true));
Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -730,7 +730,7 @@
'check_list'
=> $check_list->toArray()
);
- self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_open_cases'), $data );
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_open_cases',
'check_list/case_row'), $data );
}
function view_closed_cases()
@@ -739,13 +739,11 @@
$check_list = $this->so->get_single($check_list_id);
- $closed_check_items_and_cases =
$this->so_check_item->get_check_items_with_cases($check_list_id,
"control_item_type_1", 'closed', null, 'return_array');
- $closed_check_items_and_measurements =
$this->so_check_item->get_check_items_with_cases($check_list_id,
"control_item_type_2", 'closed', null, 'return_array');
+ $closed_check_items_and_cases =
$this->so_check_item->get_check_items_with_cases($check_list_id, null,
'closed', null, 'return_array');
$data = array
(
'closed_check_items_and_cases'
=> $closed_check_items_and_cases,
- 'closed_check_items_and_measurements' =>
$closed_check_items_and_measurements,
'check_list'
=>
$check_list->toArray()
);
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -68,6 +68,7 @@
'save_control_items'
=> true,
'view_check_list'
=> true,
'get_controls_by_control_area' => true,
+ 'get_control_details' =>
true
);
public function __construct()
@@ -608,6 +609,19 @@
self::render_template_xsl(array('control/control_tabs',
'control_item/sort_check_list'), $data);
}
+ public function get_control_details()
+ {
+ $control_id = phpgw::get_var('control_id');
+ $control = $this->so->get_single($control_id);
+
+ $data = array
+ (
+ 'control'
=> $control->toArray()
+ );
+
+ self::render_template_xsl('control/control_details',
$data);
+ }
+
function make_tab_menu($control_id){
$tabs = array();
Modified:
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -194,7 +194,7 @@
public function edit( $control_item = null )
{
- // NOT REDIRECT
+ // NO REDIRECT
if($control_item == null)
{
$control_item_id = phpgw::get_var('id');
@@ -208,6 +208,7 @@
else
{
$control_item = new
controller_control_item();
+ $control_item_array =
$control_item->toArray();
}
}
@@ -223,7 +224,7 @@
// Hack to fix display of char
$control_item_array['what_to_do'] =
str_replace(" ", " ",$control_item_array['what_to_do']);
$control_item_array['how_to_do'] =
str_replace(' ', ' ', $control_item_array['how_to_do']);
-
+
$data = array
(
'editable' => true,
Modified:
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_info.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_info.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,163 +1,150 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id$
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id$
- */
-class check_list_status_info {
+ class check_list_status_info
+ {
+ private $check_list_id;
+ private $control_id;
+ private $status;
+ private $status_text;
+ private $deadline_date_ts;
+ private $deadline_date_txt;
+ private $info_text;
+ private $location_code;
+ private $component_id;
+ private $location_id;
+ private $type;
+ private $num_open_cases;
+
+ public function __construct(){}
+
+ public function set_check_list_id($check_list_id)
+ {
+ $this->check_list_id = $check_list_id;
+ }
+
+ public function get_check_list_id() { return
$this->check_list_id; }
+
+ public function set_control_id($control_id)
+ {
+ $this->control_id = $control_id;
+ }
+
+ public function get_control_id() { return $this->control_id; }
+
+ public function set_status($status)
+ {
+ $this->status = $status;
+ }
+
+ public function get_status() { return $this->status; }
+
+ public function set_status_text($status_text)
+ {
+ $this->status_text = $status_text;
+ }
+
+ public function get_status_text() { return $this->status_text; }
+
+ public function set_deadline_date_ts($deadline_date_ts)
+ {
+ $this->deadline_date_ts = $deadline_date_ts;
+ }
+
+ public function get_deadline_date_ts() { return
$this->deadline_date_ts; }
- private $check_list_id;
- private $control_id;
- private $status;
- private $status_text;
- private $deadline_date_ts;
- private $deadline_date_txt;
- private $info_text;
- private $location_code;
- private $component_id;
- private $location_id;
- private $type;
- private $num_open_cases;
-
- public function __construct() {
-
- }
-
- public function set_check_list_id($check_list_id) {
- $this->check_list_id = $check_list_id;
- }
-
- public function get_check_list_id() {
- return $this->check_list_id;
- }
-
- public function set_control_id($control_id) {
- $this->control_id = $control_id;
- }
-
- public function get_control_id() {
- return $this->control_id;
- }
-
- public function set_status($status) {
- $this->status = $status;
- }
-
- public function get_status() {
- return $this->status;
- }
-
- public function set_status_text($status_text) {
- $this->status_text = $status_text;
- }
-
- public function get_status_text() {
- return $this->status_text;
- }
-
- public function set_deadline_date_ts($deadline_date_ts) {
- $this->deadline_date_ts = $deadline_date_ts;
- }
-
- public function get_deadline_date_ts() {
- return $this->deadline_date_ts;
- }
-
- public function set_deadline_date_txt($deadline_date_txt) {
- $this->deadline_date_txt = $deadline_date_txt;
- }
-
- public function get_deadline_date_txt() {
- return $this->deadline_date_txt;
- }
-
- public function set_info_text($info_text) {
- $this->info_text = $info_text;
- }
-
- public function get_info_text() {
- return $this->info_text;
- }
-
- public function set_location_code($location_code) {
- $this->location_code = $location_code;
- }
-
- public function get_location_code() {
- return $this->location_code;
- }
-
- public function set_location_id($location_id) {
- $this->location_id = $location_id;
- }
-
- public function get_location_id() {
- return $this->location_id;
- }
-
- public function set_component_id($component_id) {
- $this->component_id = $component_id;
- }
-
- public function get_component_id() {
- return $this->component_id;
- }
-
- public function get_type() {
- return $this->type;
- }
-
- public function set_type($type) {
- $this->type = $type;
- }
-
- public function set_num_open_cases($num_open_cases) {
- $this->num_open_cases = $num_open_cases;
- }
-
- public function get_num_open_cases() {
- return $this->num_open_cases;
- }
-
- public function serialize() {
- return array(
- 'check_list_id' => $this->get_check_list_id(),
- 'control_id' => $this->get_control_id(),
- 'status' => $this->get_status(),
- 'status_text' => $this->get_status_text(),
- 'deadline_date_ts' => $this->get_deadline_date_ts(),
- 'deadline_date_txt' => $this->get_deadline_date_txt(),
- 'info_text' => $this->get_info_text(),
- 'location_code' => $this->get_location_code(),
- 'location_id' => $this->get_location_id(),
- 'component_id' => $this->get_component_id(),
- 'type' => $this->get_type(),
- 'num_open_cases' => $this->get_num_open_cases()
- );
- }
-
-}
+ public function set_deadline_date_txt($deadline_date_txt)
+ {
+ $this->deadline_date_txt = $deadline_date_txt;
+ }
+
+ public function get_deadline_date_txt() { return
$this->deadline_date_txt; }
+
+ public function set_info_text($info_text)
+ {
+ $this->info_text = $info_text;
+ }
+
+ public function get_info_text() { return $this->info_text; }
+
+ public function set_location_code($location_code)
+ {
+ $this->location_code = $location_code;
+ }
+
+ public function get_location_code() { return
$this->location_code; }
+
+ public function set_location_id($location_id)
+ {
+ $this->location_id = $location_id;
+ }
+
+ public function get_location_id() { return $this->location_id; }
+
+ public function set_component_id($component_id)
+ {
+ $this->component_id = $component_id;
+ }
+
+ public function get_component_id() { return
$this->component_id; }
+
+ public function get_type() { return $this->type; }
+
+ public function set_type($type)
+ {
+ $this->type = $type;
+ }
+
+ public function set_num_open_cases($num_open_cases)
+ {
+ $this->num_open_cases = $num_open_cases;
+ }
+
+ public function get_num_open_cases() { return
$this->num_open_cases; }
+
+
+ public function serialize()
+ {
+ return array(
+ 'check_list_id' => $this->get_check_list_id(),
+ 'control_id' => $this->get_control_id(),
+ 'status' => $this->get_status(),
+ 'status_text' => $this->get_status_text(),
+ 'deadline_date_ts' =>
$this->get_deadline_date_ts(),
+ 'deadline_date_txt' =>
$this->get_deadline_date_txt(),
+ 'info_text' => $this->get_info_text(),
+ 'location_code' => $this->get_location_code(),
+ 'location_id' => $this->get_location_id(),
+ 'component_id' => $this->get_component_id(),
+ 'type' => $this->get_type(),
+ 'num_open_cases' => $this->get_num_open_cases()
+ );
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,100 +1,111 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.check_list_status_info.inc.php 8885 2012-02-16
07:41:15Z vator $
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.check_list_status_info.inc.php 8885 2012-02-16
07:41:15Z vator $
- */
-include_class('controller', 'check_list_status_info', 'inc/component/');
+ include_class('controller', 'check_list_status_info', 'inc/component/');
-class check_list_status_manager {
-
- private $check_list;
- private $type;
-
- public function __construct($check_list, $type) {
- $this->check_list = $check_list;
- $this->type = $type;
- }
-
- function get_status_for_check_list() {
- $check_list_status_info = new check_list_status_info();
-
- $todays_date_ts = $this->get_todays_date_ts();
-
- if ($this->check_list->get_id() == 0) {
-
- if ($this->check_list->get_deadline() < $todays_date_ts) {
- $status = "CONTROL_NOT_DONE";
- } else {
- $status = "CONTROL_REGISTERED";
- }
- } else {
- if ($this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_planned_date()
> 0 & $this->check_list->get_deadline() >= $todays_date_ts) {
- $status = "CONTROL_PLANNED";
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_deadline() <
$todays_date_ts) {
- $status = "CONTROL_NOT_DONE_WITH_CHECKLIST";
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_planned_date()
> 0 & $this->check_list->get_deadline() < $todays_date_ts) {
- $status = "CONTROL_NOT_DONE_WITH_PLANNED_DATE";
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_completed_date() >
$this->check_list->get_deadline() & $this->check_list->get_num_open_cases() ==
0) {
- $status = "CONTROL_DONE_OVER_TIME_WITHOUT_ERRORS";
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_completed_date() <
$this->check_list->get_deadline() & $this->check_list->get_num_open_cases() ==
0) {
- $status = "CONTROL_DONE_IN_TIME_WITHOUT_ERRORS";
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_num_open_cases() >
0) {
- $status = "CONTROL_DONE_WITH_ERRORS";
-
-
$check_list_status_info->set_num_open_cases($this->check_list->get_num_open_cases());
- } else if ($this->check_list->get_status() ==
controller_check_list::STATUS_CANCELED) {
- $status = "CONTROL_CANCELED";
- }
-
- $check_list_status_info->set_check_list_id($this->check_list->get_id());
- }
-
-
$check_list_status_info->set_control_id($this->check_list->get_control_id());
- $check_list_status_info->set_deadline_date_txt(date("d/m-Y",
$this->check_list->get_deadline()));
-
$check_list_status_info->set_deadline_date_ts($this->check_list->get_deadline());
- $check_list_status_info->set_type($this->type);
-
- if ($this->type == "component") {
-
$check_list_status_info->set_component_id($this->check_list->get_component_id());
-
$check_list_status_info->set_location_id($this->check_list->get_location_id());
- } else {
-
$check_list_status_info->set_location_code($this->check_list->get_location_code());
- }
-
- $check_list_status_info->set_status($status);
-
- return $check_list_status_info;
- }
-
- public static function get_todays_date_ts() {
- $todays_date_ts = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
-
- return $todays_date_ts;
- }
-
-}
+ class check_list_status_manager
+ {
+ private $check_list;
+ private $type;
+
+ public function __construct($check_list, $type) {
+ $this->check_list = $check_list;
+ $this->type = $type;
+ }
+
+ function get_status_for_check_list() {
+ $check_list_status_info = new check_list_status_info();
+
+ $todays_date_ts = $this->get_todays_date_ts();
+
+ if( $this->check_list->get_id() == 0){
+
+ if($this->check_list->get_deadline() <
$todays_date_ts){
+ $status = "CONTROL_NOT_DONE";
+ }else{
+ $status = "CONTROL_REGISTERED";
+ }
+ }else {
+ if($this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_planned_date()
> 0 & $this->check_list->get_deadline() >= $todays_date_ts)
+ {
+ $status = "CONTROL_PLANNED";
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_deadline() <
$todays_date_ts )
+ {
+ $status =
"CONTROL_NOT_DONE_WITH_CHECKLIST";
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_planned_date()
> 0 & $this->check_list->get_deadline() < $todays_date_ts )
+ {
+ $status =
"CONTROL_NOT_DONE_WITH_PLANNED_DATE";
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_completed_date() >
$this->check_list->get_deadline() & $this->check_list->get_num_open_cases() ==
0)
+ {
+ $status =
"CONTROL_DONE_OVER_TIME_WITHOUT_ERRORS";
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_completed_date() <
$this->check_list->get_deadline() & $this->check_list->get_num_open_cases() ==
0)
+ {
+ $status =
"CONTROL_DONE_IN_TIME_WITHOUT_ERRORS";
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_DONE & $this->check_list->get_num_open_cases() >
0){
+ $status = "CONTROL_DONE_WITH_ERRORS";
+
+
$check_list_status_info->set_num_open_cases($this->check_list->get_num_open_cases());
+ }
+ else if( $this->check_list->get_status() ==
controller_check_list::STATUS_CANCELED)
+ {
+ $status = "CONTROL_CANCELED";
+ }
+
+ $check_list_status_info->set_check_list_id(
$this->check_list->get_id() );
+ }
+
+ $check_list_status_info->set_control_id(
$this->check_list->get_control_id() );
+ $check_list_status_info->set_deadline_date_txt(
date("d/m-Y", $this->check_list->get_deadline()) );
+ $check_list_status_info->set_deadline_date_ts(
$this->check_list->get_deadline() );
+ $check_list_status_info->set_type( $this->type );
+
+ if($this->type == "component"){
+ $check_list_status_info->set_component_id(
$this->check_list->get_component_id() );
+ $check_list_status_info->set_location_id(
$this->check_list->get_location_id() );
+ }else {
+ $check_list_status_info->set_location_code(
$this->check_list->get_location_code() );
+ }
+
+ $check_list_status_info->set_status($status);
+
+ return $check_list_status_info;
+ }
+
+ public static function get_todays_date_ts(){
+ $todays_date_ts = mktime(0,0,0,date("m"), date("d"),
date("Y"));
+
+ return $todays_date_ts;
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -4,18 +4,19 @@
* repeat type(day, week, month, year) and repeat interval
*/
-class date_generator {
+class date_generator
+{
+ private $start_date;
+ private $end_date;
+ private $period_start_date;
+ private $period_end_date;
+ private $repeat_type;
+ private $repeat_interval;
+
+ private $calendar_array = array();
- private $start_date;
- private $end_date;
- private $period_start_date;
- private $period_end_date;
- private $repeat_type;
- private $repeat_interval;
- private $calendar_array = array();
-
- public function __construct($start_date, $end_date, $period_start_date,
$period_end_date, $repeat_type, $repeat_interval) {
- $this->start_date = $start_date;
+ public function __construct($start_date, $end_date, $period_start_date,
$period_end_date, $repeat_type, $repeat_interval){
+ $this->start_date = $start_date;
$this->end_date = $end_date;
$this->period_start_date = $period_start_date;
$this->period_end_date = $period_end_date;
@@ -24,96 +25,122 @@
$this->generate_calendar();
}
-
- function generate_calendar() {
- $control_start_date = $this->find_control_start_date();
- $control_end_date = $this->end_date;
-
- if ($control_end_date == null) {
- $control_end_date = $this->period_end_date;
- }
-
- $period_start_date =
$this->find_start_date_for_period($control_start_date);
-
- $interval_date = $period_start_date;
-
- while (($interval_date < $this->period_end_date) && ($interval_date <=
$control_end_date)) {
- $this->calendar_array[] = $interval_date;
-
- if ($this->repeat_type == 0) {
- $interval_date = mktime(0, 0, 0, date("m", $interval_date), date("d",
$interval_date) + $this->repeat_interval, date("Y", $interval_date));
- } else if ($this->repeat_type == 1) {
- $interval_date = mktime(0, 0, 0, date("m", $interval_date), date("d",
$interval_date) + ($this->repeat_interval * 7), date("Y", $interval_date));
- } else if ($this->repeat_type == 2) {
- $month = date("m", $interval_date) + $this->repeat_interval;
- $year = date("Y", $interval_date);
- if ($month > 12) {
- $month = $month % 12;
- $year += 1;
- }
-
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $interval_date = mktime(0, 0, 0, $month, $num_days_in_month, $year);
- } else if ($this->repeat_type == 3) {
- $interval_date = mktime(0, 0, 0, date("m", $interval_date), date("d",
$interval_date), date("Y", $interval_date) + $this->repeat_interval);
- }
- }
+
+ function generate_calendar(){
+ $control_start_date = $this->find_control_start_date();
+ $control_end_date = $this->end_date;
+
+ if($control_end_date == null)
+ {
+ $control_end_date = $this->period_end_date;
+ }
+
+ $period_start_date = $this->find_start_date_for_period(
$control_start_date );
+
+ $interval_date = $period_start_date;
+
+ while(($interval_date < $this->period_end_date) &&
($interval_date <= $control_end_date))
+ {
+ $this->calendar_array[] = $interval_date;
+
+ if($this->repeat_type == 0)
+ {
+ $interval_date = mktime(0,0,0, date("m",
$interval_date), date("d", $interval_date)+$this->repeat_interval, date("Y",
$interval_date));
+ }
+ else if($this->repeat_type == 1)
+ {
+ $interval_date = mktime(0,0,0, date("m",
$interval_date), date("d", $interval_date) + ($this->repeat_interval * 7),
date("Y", $interval_date));
+ }
+ else if($this->repeat_type == 2)
+ {
+ $month = date("m",
$interval_date)+$this->repeat_interval;
+ $year = date("Y", $interval_date);
+ if($month > 12){
+ $month = $month % 12;
+ $year += 1;
+ }
+
+ $num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ $interval_date = mktime(0,0,0, $month,
$num_days_in_month, $year);
+ }
+ else if($this->repeat_type == 3)
+ {
+ $interval_date = mktime(0,0,0, date("m",
$interval_date), date("d", $interval_date), date("Y",
$interval_date)+$this->repeat_interval);
+ }
+ }
}
-
- public function find_control_start_date() {
-
- if ($this->repeat_type == 0) {
- $control_start_date = $this->start_date;
- } else if ($this->repeat_type == 1) {
- $control_start_date = $this->start_date;
-
- while (date("l", $control_start_date) != "Sunday") {
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, date("m",
$control_start_date), date("y", $control_start_date));
-
- if ($num_days_in_month <= date("d", $control_start_date)) {
- $control_start_date = mktime(0, 0, 0, date("m", $control_start_date)
+ 1, 1, date("Y", $control_start_date));
- } else {
- $control_start_date = mktime(0, 0, 0, date("m",
$control_start_date), date("d", $control_start_date) + 1, date("Y",
$control_start_date));
- }
- }
- } else if ($this->repeat_type == 2) {
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, date("m",
$this->start_date), date("y", $this->start_date));
- $control_start_date = mktime(0, 0, 0, date("m", $this->start_date),
$num_days_in_month, date("y", $this->start_date));
- } else if ($this->repeat_type == 3) {
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, 12, date("y",
$this->start_date));
- $control_start_date = mktime(0, 0, 0, 12, $num_days_in_month, date("y",
$this->start_date));
- }
-
- return $control_start_date;
+
+ public function find_control_start_date(){
+
+ if( $this->repeat_type == 0 )
+ {
+ $control_start_date = $this->start_date;
+ }
+ else if( $this->repeat_type == 1 )
+ {
+ $control_start_date = $this->start_date;
+
+ while(date("l", $control_start_date) != "Sunday")
+ {
+ $num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, date("m", $control_start_date), date("y",
$control_start_date));
+
+ if($num_days_in_month <= date("d",
$control_start_date) )
+ {
+ $control_start_date = mktime(0,0,0,
date("m", $control_start_date)+1, 1, date("Y", $control_start_date));
+ }
+ else
+ {
+ $control_start_date = mktime(0,0,0,
date("m", $control_start_date), date("d", $control_start_date)+1, date("Y",
$control_start_date));
+ }
+ }
+ }
+ else if( $this->repeat_type == 2 ){
+ $num_days_in_month = cal_days_in_month(CAL_GREGORIAN,
date("m", $this->start_date), date("y", $this->start_date));
+ $control_start_date = mktime(0,0,0, date("m",
$this->start_date), $num_days_in_month, date("y", $this->start_date));
+ }
+ else if( $this->repeat_type == 3 ){
+ $num_days_in_month = cal_days_in_month(CAL_GREGORIAN,
12, date("y", $this->start_date));
+ $control_start_date = mktime(0,0,0, 12,
$num_days_in_month, date("y", $this->start_date));
+ }
+
+ return $control_start_date;
}
+
+ public function find_start_date_for_period( $trail_period_start_date )
+ {
+ while( $trail_period_start_date < $this->period_start_date )
+ {
+ if($this->repeat_type == 0)
+ {
+ $trail_period_start_date = mktime(0,0,0,
date("m", $trail_period_start_date), date("d", $trail_period_start_date) +
$this->repeat_interval, date("Y", $trail_period_start_date));
+ }
+ else if($this->repeat_type == 1)
+ {
+ $trail_period_start_date = mktime(0,0,0,
date("m", $trail_period_start_date), date("d", $trail_period_start_date) +
($this->repeat_interval * 7), date("Y", $trail_period_start_date));
+ }
+ else if($this->repeat_type == 2)
+ {
+ $month = date("m", $trail_period_start_date) +
$this->repeat_interval;
+ $year = date("Y", $trail_period_start_date);
+
+ if($month > 12){
+ $month = $month % 12;
+ $year += 1;
+ }
- public function find_start_date_for_period($trail_period_start_date) {
- while ($trail_period_start_date < $this->period_start_date) {
- if ($this->repeat_type == 0) {
- $trail_period_start_date = mktime(0, 0, 0, date("m",
$trail_period_start_date), date("d", $trail_period_start_date) +
$this->repeat_interval, date("Y", $trail_period_start_date));
- } else if ($this->repeat_type == 1) {
- $trail_period_start_date = mktime(0, 0, 0, date("m",
$trail_period_start_date), date("d", $trail_period_start_date) +
($this->repeat_interval * 7), date("Y", $trail_period_start_date));
- } else if ($this->repeat_type == 2) {
- $month = date("m", $trail_period_start_date) + $this->repeat_interval;
- $year = date("Y", $trail_period_start_date);
-
- if ($month > 12) {
- $month = $month % 12;
- $year += 1;
- }
-
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $trail_period_start_date = mktime(0, 0, 0, $month, $num_days_in_month,
$year);
- } else if ($this->repeat_type == 3) {
- $trail_period_start_date = mktime(0, 0, 0, date("m",
$trail_period_start_date), date("d", $trail_period_start_date), date("Y",
$trail_period_start_date) + $this->repeat_interval);
- }
- }
-
- return $trail_period_start_date;
- }
-
- public function get_dates() {
- return $this->calendar_array;
- }
-
+ $num_days_in_month =
cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ $trail_period_start_date = mktime(0,0,0,
$month, $num_days_in_month, $year);
+ }
+ else if($this->repeat_type == 3)
+ {
+ $trail_period_start_date = mktime(0,0,0,
date("m", $trail_period_start_date), date("d", $trail_period_start_date),
date("Y", $trail_period_start_date)+$this->repeat_interval);
+ }
+ }
+
+ return $trail_period_start_date;
+ }
+
+ public function get_dates(){
+ return $this->calendar_array;
+ }
}
Modified:
branches/Version-1_0-branch/controller/inc/component/class.month_calendar.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.month_calendar.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.month_calendar.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,115 +1,123 @@
<?php
-
phpgw::import_class('controller.socheck_list');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'check_list_status_info', 'inc/component/');
include_class('controller', 'check_list_status_manager', 'inc/component/');
-
+
/* This class transforms controls with checklists or controls with aggregated
number of open cases,
- * and puts these values in a calendar array for each control
- */
+* and puts these values in a calendar array for each control
+*/
class month_calendar {
-
- private $year;
- private $month;
- private $control;
- private $type;
- private $component;
- private $location_code;
- private $calendar_array = array();
-
- public function __construct($control, $year, $month, $component,
$location_code, $type) {
+ private $year;
+ private $month;
+ private $control;
+ private $type;
+ private $component;
+ private $location_code;
+ private $calendar_array = array();
+
+ public function __construct($control, $year, $month, $component,
$location_code, $type){
$this->control = $control;
- $this->year = $year;
+ $this->year = $year;
$this->month = $month;
$this->component = $component;
$this->location_code = $location_code;
$this->type = $type;
-
+
$this->init_calendar();
}
-
+
/* Initializes calendar by setting status for each month in calendar array.
- * - CONTROL_NOT_DONE if month date is in the past
- * - CONTROL_REGISTERED if month date is in the future */
-
- function init_calendar() {
- $ctr_start_date_ts = $this->control->get_start_date();
+ * - CONTROL_NOT_DONE if month date is in the past
+ * - CONTROL_REGISTERED if month date is in the future */
+ function init_calendar(){
+ $ctr_start_date_ts = $this->control->get_start_date();
$ctr_end_date_ts = $this->control->get_end_date();
$period_start_date_ts = $this->get_start_date_month_ts($this->year,
$this->month);
$period_end_date_ts = $this->get_next_start_date_month_ts($this->year,
$this->month);
$repeat_type = $this->control->get_repeat_type();
$repeat_interval = $this->control->get_repeat_interval();
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $this->month,
$this->year);
-
- for ($i = 1; $i <= $num_days_in_month; $i++) {
- $this->calendar_array[$i] = null;
- }
-
- $date_generator = new date_generator($ctr_start_date_ts, $ctr_end_date_ts,
$period_start_date_ts, $period_end_date_ts, $repeat_type, $repeat_interval);
- $dates_array = $date_generator->get_dates();
-
- // Set status for control on each date to NOT DONE or REGISTERED
- foreach ($dates_array as $date_ts) {
- $check_list = new controller_check_list();
- $check_list->set_deadline($date_ts);
- $check_list->set_control_id($this->control->get_id());
-
- if ($this->type == "component") {
- $check_list->set_component_id($this->component->get_id());
- $check_list->set_location_id($this->component->get_location_id());
- $check_list_status_manager = new
check_list_status_manager($check_list, "component");
- } else {
- $check_list->set_location_code($this->location_code);
- $check_list_status_manager = new
check_list_status_manager($check_list, "location");
- }
-
- $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
-
- $this->calendar_array[date("j", $date_ts)]["status"] =
$check_list_status_info->get_status();
- $this->calendar_array[date("j", $date_ts)]["info"] =
$check_list_status_info->serialize();
- }
- }
-
- public function build_calendar($check_lists_array) {
- foreach ($check_lists_array as $check_list) {
- $check_list_status_manager = new check_list_status_manager($check_list);
- $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
-
- $this->calendar_array[date("j", $check_list->get_deadline())]["status"]
= $check_list_status_info->get_status();
- $this->calendar_array[date("j", $check_list->get_deadline())]["info"] =
$check_list_status_info->serialize();
- }
-
- return $this->calendar_array;
- }
-
- public static function get_heading_array($year, $month) {
- $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $heading_array = array();
-
- for ($i = 1; $i <= $num_days_in_month; $i++) {
- $heading_array[$i] = "$i";
- }
-
- return $heading_array;
- }
-
- public static function get_start_date_month_ts($year, $month) {
- return strtotime("$month/01/$year");
- }
-
- public static function get_next_start_date_month_ts($year, $month) {
- if (($month + 1) > 12) {
- $to_month = 1;
- $to_year = $year + 1;
- } else {
- $to_month = $month + 1;
- $to_year = $year;
- }
-
- return strtotime("$to_month/01/$to_year");
- }
-
+ $num_days_in_month = cal_days_in_month(CAL_GREGORIAN,
$this->month, $this->year);
+
+ for($i=1;$i<=$num_days_in_month;$i++)
+ {
+ $this->calendar_array[$i] = null;
+ }
+
+ $date_generator = new date_generator($ctr_start_date_ts,
$ctr_end_date_ts, $period_start_date_ts, $period_end_date_ts, $repeat_type,
$repeat_interval);
+ $dates_array = $date_generator->get_dates();
+
+ // Set status for control on each date to NOT DONE or REGISTERED
+ foreach($dates_array as $date_ts)
+ {
+ $check_list = new controller_check_list();
+ $check_list->set_deadline( $date_ts );
+ $check_list->set_control_id( $this->control->get_id() );
+
+ if($this->type == "component")
+ {
+ $check_list->set_component_id( $this->component->get_id() );
+ $check_list->set_location_id(
$this->component->get_location_id() );
+ $check_list_status_manager = new check_list_status_manager(
$check_list, "component" );
+ }
+ else
+ {
+ $check_list->set_location_code( $this->location_code );
+ $check_list_status_manager = new check_list_status_manager(
$check_list, "location" );
+ }
+
+ $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
+
+ $this->calendar_array[ date("j", $date_ts) ]["status"] =
$check_list_status_info->get_status();
+ $this->calendar_array[ date("j", $date_ts) ]["info"] =
$check_list_status_info->serialize();
+ }
+ }
+
+ public function build_calendar( $check_lists_array )
+ {
+ foreach($check_lists_array as $check_list){
+ $check_list_status_manager = new
check_list_status_manager( $check_list );
+ $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
+
+ $this->calendar_array[ date("j",
$check_list->get_deadline()) ]["status"] =
$check_list_status_info->get_status();
+ $this->calendar_array[ date("j",
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();
+ }
+
+ return $this->calendar_array;
+ }
+
+ public static function get_heading_array($year, $month)
+ {
+ $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month,
$year);
+ $heading_array = array();
+
+ for($i=1;$i<=$num_days_in_month;$i++)
+ {
+ $heading_array[$i] = "$i";
+ }
+
+ return $heading_array;
+ }
+
+ public static function get_start_date_month_ts($year, $month){
+ return strtotime("$month/01/$year");
+ }
+
+ public static function get_next_start_date_month_ts($year, $month)
+ {
+ if(($month + 1) > 12)
+ {
+ $to_month = 1;
+ $to_year = $year + 1;
+ }
+ else
+ {
+ $to_month = $month + 1;
+ $to_year = $year;
+ }
+
+ return strtotime("$to_month/01/$to_year");
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/component/class.status_agg_month_info.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.status_agg_month_info.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.status_agg_month_info.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,63 +1,59 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.check_list_status_info.inc.php 8571 2012-01-15
13:46:27Z vator $
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.check_list_status_info.inc.php 8571 2012-01-15
13:46:27Z vator $
- */
-class status_agg_month_info {
-
- private $month_nr;
- private $agg_open_cases;
-
- public function __construct() {
-
- }
-
- public function set_month_nr($month_nr) {
- $this->month_nr = $month_nr;
- }
-
- public function get_month_nr() {
- return $this->month_nr;
- }
-
- public function set_agg_open_cases($agg_open_cases) {
- $this->agg_open_cases = $agg_open_cases;
- }
-
- public function get_agg_open_cases() {
- return $this->agg_open_cases;
- }
-
- public function serialize() {
- return array(
- 'agg_open_cases' => $this->get_agg_open_cases(),
- 'month_nr' => $this->get_month_nr()
- );
- }
-
-}
+ class status_agg_month_info
+ {
+ private $month_nr;
+ private $agg_open_cases;
+
+ public function __construct(){}
+
+ public function set_month_nr($month_nr)
+ {
+ $this->month_nr = $month_nr;
+ }
+
+ public function get_month_nr() { return $this->month_nr; }
+
+ public function set_agg_open_cases($agg_open_cases)
+ {
+ $this->agg_open_cases = $agg_open_cases;
+ }
+
+ public function get_agg_open_cases() { return
$this->agg_open_cases; }
+
+ public function serialize()
+ {
+ return array(
+ 'agg_open_cases' => $this->get_agg_open_cases(),
+ 'month_nr' => $this->get_month_nr()
+ );
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/component/class.year_calendar.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.year_calendar.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.year_calendar.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,117 +1,125 @@
<?php
-
phpgw::import_class('controller.socheck_list');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'check_list_status_info', 'inc/component/');
include_class('controller', 'check_list_status_manager', 'inc/component/');
include_class('controller', 'check_list', 'inc/model/');
+
class year_calendar {
-
- private $year;
- private $control;
- private $type;
- private $component;
- private $location_code;
- private $calendar_array = array();
-
- public function __construct($control, $year, $component, $location_code,
$type) {
+ private $year;
+ private $control;
+ private $type;
+ private $component;
+ private $location_code;
+ private $calendar_array = array();
+
+ public function __construct($control, $year, $component, $location_code,
$type)
+ {
$this->year = $year;
$this->control = $control;
$this->component = $component;
$this->location_code = $location_code;
$this->type = $type;
-
+
$this->init_calendar();
}
-
+
/* Initializes calendar by setting status for each month in calendar array.
* - CONTROL_NOT_DONE if month date is in the past
- * - CONTROL_REGISTERED if month date is in the future */
-
- function init_calendar() {
- // Sets null values for twelve months in calendar array
- for ($i = 1; $i <= 12; $i++) {
- $this->calendar_array[$i] = null;
+ * - CONTROL_REGISTERED if month date is in the future */
+ function init_calendar()
+ {
+ // Sets null values for twelve months in calendar array
+ for($i = 1;$i <= 12;$i++)
+ {
+ $this->calendar_array[$i] = null;
}
-
+
$ctr_start_date_ts = $this->control->get_start_date();
$ctr_end_date_ts = $this->control->get_end_date();
$period_start_date_ts = $this->get_start_date_year_ts($this->year);
- $period_end_date_ts = $this->get_start_date_year_ts($this->year + 1);
+ $period_end_date_ts = $this->get_start_date_year_ts($this->year+1);
$repeat_type = $this->control->get_repeat_type();
$repeat_interval = $this->control->get_repeat_interval();
-
+
// Generates dates for time period with specified interval
$date_generator = new date_generator($ctr_start_date_ts, $ctr_end_date_ts,
$period_start_date_ts, $period_end_date_ts, $repeat_type, $repeat_interval);
$dates_array = $date_generator->get_dates();
-
+
// Set status for control on each date to NOT DONE or REGISTERED
- foreach ($dates_array as $date_ts) {
- $check_list = new controller_check_list();
- $check_list->set_deadline($date_ts);
- $check_list->set_control_id($this->control->get_id());
+ foreach($dates_array as $date_ts)
+ {
+ $check_list = new controller_check_list();
+ $check_list->set_deadline( $date_ts );
+ $check_list->set_control_id( $this->control->get_id() );
+
+ if($this->type == "component")
+ {
+ $check_list->set_component_id( $this->component->get_id() );
+ $check_list->set_location_id(
$this->component->get_location_id() );
+ $check_list_status_manager = new check_list_status_manager(
$check_list, "component" );
+ }
+ else
+ {
+ $check_list->set_location_code( $this->location_code );
+ $check_list_status_manager = new check_list_status_manager(
$check_list, "location" );
+ }
+
+ $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
+
+ $month_nr = date("n", $date_ts);
+
+ $this->calendar_array[ $month_nr ]["status"] =
$check_list_status_info->get_status();
+ $this->calendar_array[ $month_nr ]["info"] =
$check_list_status_info->serialize();
+ }
+ }
+
+ public function build_calendar( $check_lists_array )
+ {
+ foreach($check_lists_array as $check_list)
+ {
+ $check_list_status_manager = new
check_list_status_manager( $check_list );
+ $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
- if ($this->type == "component") {
- $check_list->set_component_id($this->component->get_id());
- $check_list->set_location_id($this->component->get_location_id());
- $check_list_status_manager = new
check_list_status_manager($check_list, "component");
- } else {
- $check_list->set_location_code($this->location_code);
- $check_list_status_manager = new
check_list_status_manager($check_list, "location");
- }
-
- $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
-
- $month_nr = date("n", $date_ts);
-
- $this->calendar_array[$month_nr]["status"] =
$check_list_status_info->get_status();
- $this->calendar_array[$month_nr]["info"] =
$check_list_status_info->serialize();
- }
- }
-
- public function build_calendar($check_lists_array) {
- foreach ($check_lists_array as $check_list) {
- $check_list_status_manager = new check_list_status_manager($check_list);
- $check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
-
- $month_nr = date("n", $check_list_status_info->get_deadline_date_ts());
-
- $this->calendar_array[$month_nr]["status"] =
$check_list_status_info->get_status();
- $this->calendar_array[$month_nr]["info"] =
$check_list_status_info->serialize();
- }
-
- return $this->calendar_array;
- }
-
- public function build_agg_month_calendar($agg_open_cases_pr_month_array) {
-
- foreach ($agg_open_cases_pr_month_array as $status_agg_month_info) {
- $status = "CONTROLS_DONE_WITH_ERRORS";
-
- $this->calendar_array[$status_agg_month_info->get_month_nr()]["status"]
= $status;
-
$this->calendar_array[$status_agg_month_info->get_month_nr()]["info"]["agg_open_errors"]
= $status_agg_month_info->get_agg_open_cases();
- }
-
- return $this->calendar_array;
- }
-
- public static function get_heading_array() {
-
- $heading_array = array();
-
- for ($i = 1; $i <= 12; $i++) {
- $heading_array[$i] = "$i";
- }
-
- return $heading_array;
- }
-
- public static function get_start_date_year_ts($year) {
- $start_date_year_ts = strtotime("01/01/$year");
-
- return $start_date_year_ts;
- }
-
+ $month_nr = date("n",
$check_list_status_info->get_deadline_date_ts());
+
+ $this->calendar_array[ $month_nr ]["status"] =
$check_list_status_info->get_status();
+ $this->calendar_array[ $month_nr ]["info"] =
$check_list_status_info->serialize();
+ }
+
+ return $this->calendar_array;
+ }
+
+ public function build_agg_month_calendar(
$agg_open_cases_pr_month_array )
+ {
+
+ foreach($agg_open_cases_pr_month_array as
$status_agg_month_info)
+ {
+ $status = "CONTROLS_DONE_WITH_ERRORS";
+
+
$this->calendar_array[$status_agg_month_info->get_month_nr()]["status"] =
$status;
+
$this->calendar_array[$status_agg_month_info->get_month_nr()]["info"]["agg_open_errors"]
= $status_agg_month_info->get_agg_open_cases();
+ }
+
+ return $this->calendar_array;
+ }
+
+ public static function get_heading_array(){
+
+ $heading_array = array();
+
+ for($i=1;$i<=12;$i++){
+ $heading_array[$i] = "$i";
+ }
+
+ return $heading_array;
+ }
+
+ public static function get_start_date_year_ts($year){
+ $start_date_year_ts = strtotime("01/01/$year");
+
+ return $start_date_year_ts;
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,93 +1,110 @@
<?php
-
phpgw::import_class('controller.socheck_list');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'check_list_status_info', 'inc/component/');
include_class('controller', 'check_list_status_manager', 'inc/component/');
include_class('controller', 'check_list', 'inc/model/');
+
class year_calendar_agg {
-
- private $year;
- private $control;
- private $location_code;
- private $view;
- private $calendar_array = array();
-
- public function __construct($control, $year, $location_code, $view) {
+ private $year;
+ private $control;
+ private $location_code;
+ private $view;
+
+ private $calendar_array = array();
+
+ public function __construct($control, $year, $location_code, $view)
+ {
$this->year = $year;
$this->control = $control;
$this->location_code = $location_code;
$this->view = $view;
-
+
$this->init_calendar();
}
-
- function init_calendar() {
- $start_month_nr = $this->get_start_month_for_control($this->control,
$this->year);
- $end_month_nr = $this->get_end_month_for_control($this->control,
$this->year);
-
- for ($month_nr = 1; $month_nr <= 12; $month_nr++) {
- if (($month_nr < $start_month_nr) || ($month_nr > $end_month_nr)) {
- $this->calendar_array[$month_nr] = null;
- } else if (($month_nr < date("m")) && (date("Y",
$this->control->get_start_date()) == $this->year)) {
- $this->calendar_array[$month_nr]["status"] = "CONTROLS_NOT_DONE";
- $this->calendar_array[$month_nr]["info"] = array("view" =>
$this->view, "control_id" => $this->control->get_id(), "location_code" =>
$this->location_code, "year" => $this->year, "month" => $month_nr);
- } else {
- $this->calendar_array[$month_nr]["status"] = "CONTROLS_REGISTERED";
- $this->calendar_array[$month_nr]["info"] = array("view" =>
$this->view, "control_id" => $this->control->get_id(), "location_code" =>
$this->location_code, "year" => $this->year, "month" => $month_nr);
- }
+
+ function init_calendar()
+ {
+ $start_month_nr = $this->get_start_month_for_control(
$this->control, $this->year );
+ $end_month_nr = $this->get_end_month_for_control(
$this->control, $this->year );
+
+ for($month_nr = 1;$month_nr <= 12;$month_nr++)
+ {
+ if( ($month_nr < $start_month_nr) || ($month_nr > $end_month_nr) )
+ {
+ $this->calendar_array[ $month_nr ] = null;
+ }
+ else if( ($month_nr < date("m")) && (date("Y",
$this->control->get_start_date()) == $this->year) )
+ {
+ $this->calendar_array[ $month_nr ]["status"] =
"CONTROLS_NOT_DONE";
+ $this->calendar_array[ $month_nr ]["info"] = array("view" =>
$this->view, "control_id" => $this->control->get_id(), "location_code" =>
$this->location_code, "year" => $this->year, "month" => $month_nr);
+ }
+ else
+ {
+ $this->calendar_array[ $month_nr ]["status"] =
"CONTROLS_REGISTERED";
+ $this->calendar_array[ $month_nr ]["info"] = array("view" =>
$this->view, "control_id" => $this->control->get_id(), "location_code" =>
$this->location_code, "year" => $this->year, "month" => $month_nr);
+ }
}
- }
-
- public function build_calendar($agg_open_cases_pr_month_array) {
- foreach ($agg_open_cases_pr_month_array as $status_agg_month_info) {
- $status = "CONTROLS_DONE_WITH_ERRORS";
-
- $this->calendar_array[$status_agg_month_info->get_month_nr()]["status"]
= $status;
-
$this->calendar_array[$status_agg_month_info->get_month_nr()]["info"]["agg_open_errors"]
= $status_agg_month_info->get_agg_open_cases();
- }
-
- return $this->calendar_array;
- }
-
- public static function get_heading_array() {
-
- $heading_array = array();
-
- for ($i = 1; $i <= 12; $i++) {
- $heading_array[$i] = "$i";
- }
-
- return $heading_array;
- }
-
- function get_start_month_for_control($control, $year) {
- // Checks if control starts in the year that is displayed
- if (date("Y", $control->get_start_date()) == $year) {
- $from_month = date("n", $control->get_start_date());
- } else {
- $from_month = 1;
- }
-
- return $from_month;
- }
-
- function get_end_month_for_control($control, $year) {
- // Checks if control ends in the year that is displayed
- if (date("Y", $control->get_end_date()) == $year) {
- $to_month = date("n", $control->get_end_date());
- } else {
- $to_month = 12;
- }
-
- return $to_month;
- }
-
- public static function get_start_date_year_ts($year) {
- $start_date_year_ts = strtotime("01/01/$year");
-
- return $start_date_year_ts;
- }
-
+ }
+
+ public function build_calendar( $agg_open_cases_pr_month_array )
+ {
+ foreach($agg_open_cases_pr_month_array as
$status_agg_month_info)
+ {
+ $status = "CONTROLS_DONE_WITH_ERRORS";
+
+
$this->calendar_array[$status_agg_month_info->get_month_nr()]["status"] =
$status;
+
$this->calendar_array[$status_agg_month_info->get_month_nr()]["info"]["agg_open_errors"]
= $status_agg_month_info->get_agg_open_cases();
+ }
+
+ return $this->calendar_array;
+ }
+
+ public static function get_heading_array(){
+
+ $heading_array = array();
+
+ for($i=1;$i<=12;$i++){
+ $heading_array[$i] = "$i";
+ }
+
+ return $heading_array;
+ }
+
+ function get_start_month_for_control($control, $year)
+ {
+ // Checks if control starts in the year that is displayed
+ if( date("Y", $control->get_start_date()) == $year )
+ {
+ $from_month = date("n",
$control->get_start_date());
+ }
+ else
+ {
+ $from_month = 1;
+ }
+
+ return $from_month;
+ }
+
+ function get_end_month_for_control($control, $year)
+ {
+ // Checks if control ends in the year that is displayed
+ if( date("Y", $control->get_end_date()) == $year )
+ {
+ $to_month = date("n", $control->get_end_date());
+ }
+ else
+ {
+ $to_month = 12;
+ }
+
+ return $to_month;
+ }
+
+ public static function get_start_date_year_ts($year){
+ $start_date_year_ts = strtotime("01/01/$year");
+
+ return $start_date_year_ts;
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,46 +1,46 @@
<?php
+ phpgw::import_class('controller.socheck_list');
+ phpgw::import_class('controller.socheck_item');
+
+ include_class('controller', 'check_list', 'inc/model/');
+ include_class('controller', 'check_item', 'inc/model/');
-phpgw::import_class('controller.socheck_list');
-phpgw::import_class('controller.socheck_item');
-
-include_class('controller', 'check_list', 'inc/model/');
-include_class('controller', 'check_item', 'inc/model/');
-
-class check_list_status_updater {
-
- public function __construct() {
- $this->so_check_list = CreateObject('controller.socheck_list');
- $this->so_check_item = CreateObject('controller.socheck_item');
- }
-
- public function update_check_list_status($check_list_id) {
- $check_list = $this->so_check_list->get_single($check_list_id);
-
- $check_items =
$this->so_check_item->get_check_items_with_cases($check_list_id,
$control_item_type = null, $status = null, $messageStatus = null,
"return_object");
-
- $num_open_cases = 0;
- $num_pending_cases = 0;
-
- foreach ($check_items as $check_item) {
- foreach ($check_item->get_cases_array() as $case) {
-
- if ($case->get_status() == controller_check_item_case::STATUS_OPEN) {
- $num_open_cases++;
- }
-
- if ($case->get_status() == controller_check_item_case::STATUS_PENDING)
{
- $num_pending_cases++;
- }
- }
- }
-
- if ($num_open_cases > 0)
- $check_list->set_status(controller_check_list::STATUS_DONE);
-
- $check_list->set_num_open_cases($num_open_cases);
- $check_list->set_num_pending_cases($num_pending_cases);
-
- $this->so_check_list->store($check_list);
- }
-
+ class check_list_status_updater {
+
+ public function __construct()
+ {
+ $this->so_check_list =
CreateObject('controller.socheck_list');
+ $this->so_check_item =
CreateObject('controller.socheck_item');
+ }
+
+ public function update_check_list_status( $check_list_id )
+ {
+ $check_list = $this->so_check_list->get_single(
$check_list_id );
+
+ $check_items =
$this->so_check_item->get_check_items_with_cases($check_list_id,
$control_item_type = null, $status = null, $messageStatus = null,
"return_object");
+
+ $num_open_cases = 0;
+ $num_pending_cases = 0;
+
+ foreach($check_items as $check_item){
+ foreach($check_item->get_cases_array() as
$case){
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_OPEN){
+ $num_open_cases++;
+ }
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_PENDING){
+ $num_pending_cases++;
+ }
+ }
+ }
+
+ if($num_open_cases > 0)
+
$check_list->set_status(controller_check_list::STATUS_DONE);
+
+ $check_list->set_num_open_cases($num_open_cases);
+ $check_list->set_num_pending_cases($num_pending_cases);
+
+ $this->so_check_list->store($check_list);
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,28 +1,24 @@
<?php
+ class date_helper {
+
+ public function __construct(){}
+
+ public static function get_timestamp_from_date( $date_string, $format
){
+
+ if( $format == "d/m-Y" ){
+ $pos_day = strpos($date_string, "/");
+ $day = date_helper::substring($date_string, 0,
$pos_day);
+
+ $pos_month = strpos($date_string, "-");
+ $month = date_helper::substring($date_string,
$pos_day+1, $pos_month);
+
+ $year = date_helper::substring($date_string,
$pos_month+1, strlen($date_string));
-class date_helper {
-
- public function __construct() {
-
- }
-
- public static function get_timestamp_from_date($date_string, $format) {
-
- if ($format == "d/m-Y") {
- $pos_day = strpos($date_string, "/");
- $day = date_helper::substring($date_string, 0, $pos_day);
-
- $pos_month = strpos($date_string, "-");
- $month = date_helper::substring($date_string, $pos_day + 1, $pos_month);
-
- $year = date_helper::substring($date_string, $pos_month + 1,
strlen($date_string));
-
- return mktime(0, 0, 0, $month, $day, $year);
- }
- }
-
- public function substring($string, $from, $to) {
- return substr($string, $from, $to - $from);
- }
-
+ return mktime(0, 0, 0, $month, $day, $year);
+ }
+ }
+
+ public function substring($string, $from, $to){
+ return substr($string, $from, $to - $from);
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,50 +1,51 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.uicontrol_group.inc.php 8267 2011-12-11 12:27:18Z
sigurdne $
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.uicontrol_group.inc.php 8267 2011-12-11 12:27:18Z
sigurdne $
- */
-phpgw::import_class('property.solocation');
+ phpgw::import_class('property.solocation');
-class location_finder {
+ class location_finder
+ {
+ private $so;
+
+ public function __construct()
+ {
+ $this->so = CreateObject('property.solocation');
+ }
- private $so;
-
- public function __construct() {
- $this->so = CreateObject('property.solocation');
- }
-
- function get_responsibilities($data = array()) {
- $data['filter_role_on_contact'] =
$GLOBALS['phpgw']->accounts->get($data['user_id'])->person_id;
- $locations = $this->so->read($data);
-
- $total_records = $this->so->total_records;
-
- return $locations;
- }
-
-}
+ function get_responsibilities($data = array())
+ {
+ $data['filter_role_on_contact'] =
$GLOBALS['phpgw']->accounts->get($data['user_id'])->person_id;
+ $locations = $this->so->read($data);
+
+ $total_records = $this->so->total_records;
+
+ return $locations;
+ }
+ }
Modified: branches/Version-1_0-branch/controller/inc/hook_home.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -103,7 +103,6 @@
$to_date_ts = mktime(0, 0, 0, date("n"), date("j"), date("Y") );
// Fetches controls current user is responsible for
- $my_controls = array();
foreach($my_locations as $location)
{
$controls = array();
@@ -212,7 +211,7 @@
$portalbox0 = CreateObject('phpgwapi.listbox', array
(
- 'title' => "<div class='title
heading'>Lokasjonsnavn</div><div class='control-area
heading'>Kontrollområde</div><div class='control heading'>Tittel på
kontroll</div><div class='date heading'>Fristdato</div>",
+ 'title' => "<div class='control heading'>Tittel på
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div
class='control-area heading'>Kontrollområde</div><div class='date
heading'>Fristdato</div>",
'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
@@ -255,7 +254,7 @@
$location_name = $location_array["loc1_name"];
$portalbox0->data[] = array(
- 'text' => "<div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' =>
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' =>
$deadline_ts))
);
}
@@ -267,7 +266,7 @@
$short_desc_arr =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$portalbox0->data[] = array(
- 'text' => "<div
class='title'>{$short_desc_arr}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$short_desc_arr}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id'
=> $my_control['id'], 'location_id' => $location_id, 'component_id' =>
$component_id, 'deadline_ts' => $deadline_ts))
);
}
@@ -281,7 +280,7 @@
$location_name = $location_array["loc1_name"];
$portalbox0->data[] = array(
- 'text' => "<div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'controller.uicheck_list.edit_check_list',
'check_list_id' => $check_list_id))
);
}
@@ -327,7 +326,7 @@
$portalbox1 = CreateObject('phpgwapi.listbox', array
(
- 'title' => "<div class='title
heading'>Lokasjonsnavn</div><div class='control-area
heading'>Kontrollområde</div><div class='control heading'>Tittel på
kontroll</div><div class='date heading'>Fristdato</div>",
+ 'title' => "<div class='control heading'>Tittel på
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div
class='control-area heading'>Kontrollområde</div><div class='date
heading'>Fristdato</div>",
'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
@@ -371,7 +370,7 @@
$next_date = "Planlagt: " . date($dateformat,
$check_list->get_planned_date());
$portalbox1_data[] = array(
$check_list->get_planned_date(), array(
- 'text' => "<div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$current_control["title"]}</div> <div
class='date'>{$next_date}</div>",
+ 'text' => "<div
class='control'>{$current_control["title"]}</div><div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div><div
class='date'>{$next_date}</div>",
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.edit_check_list', 'check_list_id' =>
$check_list->get_id()))
));
}
@@ -397,7 +396,7 @@
$portalbox2 = CreateObject('phpgwapi.listbox', array
(
- 'title' => "<div class='title
heading'>Lokasjonsnavn</div><div class='control-area
heading'>Kontrollområde</div><div class='control heading'>Tittel på
kontroll</div><div class='date heading'>Fristdato</div>",
+ 'title' => "<div class='control heading'>Tittel på
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div
class='control-area heading'>Kontrollområde</div><div class='date
heading'>Fristdato</div>",
'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
@@ -547,7 +546,7 @@
$location_name = $location_array["loc1_name"];
$portalbox2->data[] = array(
- 'text' => "<div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' =>
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' =>
$deadline_ts))
);
}
@@ -559,7 +558,7 @@
$short_desc_arr =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$portalbox2->data[] = array(
- 'text' => "<div
class='title'>{$short_desc_arr}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$short_desc_arr}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id'
=> $my_control['id'], 'location_id' => $location_id, 'component_id' =>
$component_id, 'deadline_ts' => $deadline_ts))
);
}
@@ -573,7 +572,7 @@
$location_name = $location_array["loc1_name"];
$portalbox0->data[] = array(
- 'text' => "<div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div> <div
class='control'>{$my_control['title']}</div> <div class='date'>Fristdato
{$date_str}</div>",
+ 'text' => "<div
class='control'>{$my_control['title']}</div><div
class='title'>{$location_name}</div><div
class='control-area'>{$control_area_name}</div><div class='date'>Fristdato
{$date_str}</div>",
'link' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'controller.uicheck_list.edit_check_list',
'check_list_id' => $check_list_id))
);
}
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,108 +1,108 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id$
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id$
- */
-include_class('controller', 'model', 'inc/model/');
+ include_class('controller', 'model', 'inc/model/');
+
+ class controller_check_item extends controller_model
+ {
+ public static $so;
-class controller_check_item extends controller_model {
+ protected $id;
+ protected $control_item_id;
+ protected $check_list_id;
+
+ // Objects
+ protected $control_item;
+ protected $cases_array = array();
+
+ /**
+ * Constructor. Takes an optional ID. If a contract is
created from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this composite
+ */
+ public function __construct(int $id = null)
+ {
+ $this->id = (int)$id;
+ }
+
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
+
+ public function get_id() { return $this->id; }
- public static $so;
- protected $id;
- protected $control_item_id;
- protected $check_list_id;
- // Objects
- protected $control_item;
- protected $cases_array = array();
-
- /**
- * Constructor. Takes an optional ID. If a contract is created from outside
- * the database the ID should be empty so the database can add one according
to its logic.
- *
- * @param int $id the id of this composite
- */
- public function __construct(int $id = null) {
- $this->id = (int) $id;
- }
-
- public function set_id($id) {
- $this->id = $id;
- }
-
- public function get_id() {
- return $this->id;
- }
-
- public function set_control_item_id($control_item_id) {
- $this->control_item_id = $control_item_id;
- }
-
- public function get_control_item_id() {
- return $this->control_item_id;
- }
-
- public function set_check_list_id($check_list_id) {
- $this->check_list_id = $check_list_id;
- }
-
- public function get_check_list_id() {
- return $this->check_list_id;
- }
-
- // ================= Getters and setters for objects =================
-
- public function set_control_item($control_item) {
- $this->control_item = $control_item;
- }
-
- public function get_control_item() {
- return $this->control_item;
- }
-
- public function set_cases_array($cases_array) {
- $this->cases_array = $cases_array;
- }
-
- public function get_cases_array() {
- return $this->cases_array;
- }
-
- /**
- * Get a static reference to the storage object associated with this model
object
- *
- * @return the storage object
- */
- public static function get_so() {
- /* if (self::$so == null) {
- self::$so = CreateObject('controller.socontrol_item');
- }
-
- return self::$so; */
- }
-
-}
+ public function set_control_item_id($control_item_id)
+ {
+ $this->control_item_id = $control_item_id;
+ }
+
+ public function get_control_item_id() { return
$this->control_item_id; }
+
+ public function set_check_list_id($check_list_id)
+ {
+ $this->check_list_id = $check_list_id;
+ }
+
+ public function get_check_list_id() { return
$this->check_list_id; }
+
+
+ // ================= Getters and setters for objects
=================
+
+ public function set_control_item($control_item)
+ {
+ $this->control_item = $control_item;
+ }
+
+ public function get_control_item() { return
$this->control_item; }
+
+ public function set_cases_array($cases_array)
+ {
+ $this->cases_array = $cases_array;
+ }
+
+ public function get_cases_array() { return $this->cases_array; }
+
+
+ /**
+ * Get a static reference to the storage object associated with
this model object
+ *
+ * @return the storage object
+ */
+ public static function get_so()
+ {
+/* if (self::$so == null) {
+ self::$so =
CreateObject('controller.socontrol_item');
+ }
+
+ return self::$so;*/
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,151 +1,140 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.check_item.inc.php 8478 2012-01-03 12:36:37Z
vator $
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.check_item.inc.php 8478 2012-01-03 12:36:37Z vator $
- */
-include_class('controller', 'model', 'inc/model/');
+ include_class('controller', 'model', 'inc/model/');
+
+ class controller_check_item_case extends controller_model
+ {
+ public static $so;
-class controller_check_item_case extends controller_model {
+ const STATUS_OPEN = 0;
+ const STATUS_CLOSED = 1;
+ const STATUS_PENDING = 2;
+
+ protected $id;
+ protected $check_item_id;
+ protected $status;
+ protected $location_id; // FOREKOMST I
MELDINGSREGISTERET
+ protected $location_item_id; // MELDINGS ID
+ protected $descr;
+ protected $user_id;
+ protected $entry_date;
+ protected $modified_date;
+ protected $modified_by;
+ protected $measurement;
+
+ /**
+ * Constructor. Takes an optional ID. If a contract is
created from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this composite
+ */
+ public function __construct(int $id = null)
+ {
+ $this->id = (int)$id;
+ }
+
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
+
+ public function get_id() { return $this->id; }
- public static $so;
+ public function set_check_item_id($check_item_id)
+ {
+ $this->check_item_id = $check_item_id;
+ }
+
+ public function get_check_item_id() { return
$this->check_item_id; }
+
+ public function set_status($status)
+ {
+ $this->status = (int)$status;
+ }
+
+ public function get_status() { return (int)$this->status; }
+
+ public function get_location_id() { return
(int)$this->location_id; }
+
+ public function set_location_id($location_id)
+ {
+ $this->location_id = $location_id;
+ }
+
+ public function get_location_item_id() { return
(int)$this->location_item_id; }
+
+ public function set_location_item_id($location_item_id)
+ {
+ $this->location_item_id = $location_item_id;
+ }
- const STATUS_OPEN = 0;
- const STATUS_CLOSED = 1;
- const STATUS_PENDING = 2;
-
- protected $id;
- protected $check_item_id;
- protected $status;
- protected $location_id; // FOREKOMST I MELDINGSREGISTERET
- protected $location_item_id; // MELDINGS ID
- protected $descr;
- protected $user_id;
- protected $entry_date;
- protected $modified_date;
- protected $modified_by;
- protected $measurement;
-
- /**
- * Constructor. Takes an optional ID. If a contract is created from outside
- * the database the ID should be empty so the database can add one according
to its logic.
- *
- * @param int $id the id of this composite
- */
- public function __construct(int $id = null) {
- $this->id = (int) $id;
- }
-
- public function set_id($id) {
- $this->id = $id;
- }
-
- public function get_id() {
- return $this->id;
- }
-
- public function set_check_item_id($check_item_id) {
- $this->check_item_id = $check_item_id;
- }
-
- public function get_check_item_id() {
- return $this->check_item_id;
- }
-
- public function set_status($status) {
- $this->status = (int) $status;
- }
-
- public function get_status() {
- return (int) $this->status;
- }
-
- public function get_location_id() {
- return (int) $this->location_id;
- }
-
- public function set_location_id($location_id) {
- $this->location_id = $location_id;
- }
-
- public function get_location_item_id() {
- return (int) $this->location_item_id;
- }
-
- public function set_location_item_id($location_item_id) {
- $this->location_item_id = $location_item_id;
- }
-
- public function get_descr() {
- return $this->descr;
- }
-
- public function set_descr($descr) {
- $this->descr = $descr;
- }
-
- public function get_user_id() {
- return (int) $this->user_id;
- }
-
- public function set_user_id($user_id) {
- $this->user_id = $user_id;
- }
-
- public function get_entry_date() {
- return (int) $this->entry_date;
- }
-
- public function set_entry_date($entry_date) {
- $this->entry_date = $entry_date;
- }
-
- public function get_modified_date() {
- return (int) $this->modified_date;
- }
-
- public function set_modified_date($modified_date) {
- $this->modified_date = $modified_date;
- }
-
- public function get_modified_by() {
- return (int) $this->modified_by;
- }
-
- public function set_modified_by($modified_by) {
- $this->modified_by = $modified_by;
- }
-
- public function get_measurement() {
- return $this->measurement;
- }
-
- public function set_measurement($measurement) {
- $this->measurement = $measurement;
- }
-
-}
+ public function get_descr() { return $this->descr; }
+
+ public function set_descr($descr)
+ {
+ $this->descr = $descr;
+ }
+
+ public function get_user_id() { return (int)$this->user_id; }
+
+ public function set_user_id($user_id)
+ {
+ $this->user_id = $user_id;
+ }
+
+ public function get_entry_date() { return
(int)$this->entry_date; }
+
+ public function set_entry_date($entry_date)
+ {
+ $this->entry_date = $entry_date;
+ }
+
+ public function get_modified_date() { return
(int)$this->modified_date; }
+
+ public function set_modified_date($modified_date)
+ {
+ $this->modified_date = $modified_date;
+ }
+
+ public function get_modified_by() { return
(int)$this->modified_by; }
+
+ public function set_modified_by($modified_by)
+ {
+ $this->modified_by = $modified_by;
+ }
+
+ public function get_measurement() { return $this->measurement; }
+
+ public function set_measurement($measurement)
+ {
+ $this->measurement = $measurement;
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,249 +1,245 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id$
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id$
- */
-include_class('controller', 'model', 'inc/model/');
+ include_class('controller', 'model', 'inc/model/');
+
+ class controller_check_list extends controller_model
+ {
+ public static $so;
+
+ const STATUS_NOT_DONE = 0;
+ const STATUS_DONE = 1;
+ const STATUS_CANCELED = 3;
+
+ protected $id;
+ protected $control_id;
+ protected $status;
+ protected $comment;
+ protected $deadline;
+ protected $planned_date;
+ protected $completed_date;
+ protected $location_code;
+ protected $component_id;
+ protected $location_id;
+
+ // Aggregate fields. Fields not in a table
+ protected $num_open_cases;
+ protected $num_pending_cases;
+
+ // Objects
+ protected $check_item_array = array();
+ // Array that contains error messages. Is populted in function
validate
+ protected $error_msg_array = array();
+
+ protected $control;
+
+ /**
+ * Constructor. Takes an optional ID. If a contract is
created from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this composite
+ */
+ public function __construct(int $id = null)
+ {
+ $this->id = (int)$id;
+ }
+
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
+
+ public function get_id() { return $this->id; }
-class controller_check_list extends controller_model {
+ public function set_control_id($control_id)
+ {
+ $this->control_id = $control_id;
+ }
+
+ public function get_control_id() { return $this->control_id; }
+
+ public function set_status($status)
+ {
+ $this->status = $status;
+ }
+
+ public function get_status() { return $this->status; }
+
+ public function set_comment($comment)
+ {
+ $this->comment = $comment;
+ }
+
+ public function get_comment() { return $this->comment; }
+
+ public function set_deadline($deadline)
+ {
+ $this->deadline = $deadline;
+ }
+
+ public function get_deadline() { return $this->deadline; }
+
+ public function set_check_item_array($check_item_array)
+ {
+ $this->check_item_array = $check_item_array;
+ }
+
+ public function get_check_item_array() { return
$this->check_item_array; }
+
+ public function set_planned_date($planned_date)
+ {
+ $this->planned_date = $planned_date;
+ }
+
+ public function get_planned_date() { return
$this->planned_date; }
+
+ public function set_completed_date($completed_date)
+ {
+ $this->completed_date = $completed_date;
+ }
+
+ public function get_completed_date() { return
$this->completed_date; }
+
+ public function set_location_code($location_code)
+ {
+ $this->location_code = $location_code;
+ }
+
+ public function get_location_code() { return
$this->location_code; }
+
+ public function set_component_id($component_id)
+ {
+ $this->component_id = $component_id;
+ }
+
+ public function get_component_id() { return
$this->component_id; }
+
+ public function set_location_id($location_id)
+ {
+ $this->location_id = $location_id;
+ }
+
+ public function get_location_id() { return $this->location_id; }
- public static $so;
+ public function get_num_open_cases() { return
$this->num_open_cases; }
+
+ public function set_num_open_cases($num_open_cases)
+ {
+ $this->num_open_cases = $num_open_cases;
+ }
- const STATUS_NOT_DONE = 0;
- const STATUS_DONE = 1;
- const STATUS_CANCELED = 3;
+ public function get_num_pending_cases() { return
$this->num_pending_cases; }
+
+ public function set_num_pending_cases($num_pending_cases)
+ {
+ $this->num_pending_cases = $num_pending_cases;
+ }
+
+ public function set_control($control)
+ {
+ $this->control = $control;
+ }
+
+ public function get_control() { return $this->control; }
+
+ public function get_error_msg_array() { return
$this->error_msg_array; }
+
+ public function set_error_msg_array( $error_msg_array )
+ {
+ $this->error_msg_array = $error_msg_array;
+ }
+
+ public function serialize()
+ {
+ return array(
+ 'id'
=> $this->get_id(),
+ 'control_id' =>
$this->get_control_id(),
+ 'status'
=> $this->get_status(),
+ 'comment' =>
$this->get_comment(),
+ 'deadline' =>
$this->get_deadline(),
+ 'planned_date' =>
$this->get_planned_date(),
+ 'completed_date' =>
$this->get_completed_date(),
+ 'location_code' =>
$this->get_location_code(),
+ 'component_id' =>
$this->get_component_id(),
+ 'location_id' =>
$this->get_location_id(),
+ 'num_open_cases' =>
$this->get_num_open_cases()
+ );
+ }
+
+ public function validate()
+ {
+ $status = true;
+
+ // Validate CONTROL ID
+ if( empty( $this->control_id ) )
+ {
+ $status = false;
+ $this->error_msg_array['control_id'] = "error_msg_4";
+ }
+
+ // Validate STATUS
+ if( $this->status != 0 and $this->status != 1 )
+ {
+ $status = false;
+ $this->error_msg_array['status'] = "error_msg_2";
+ }
+
+ // Validate STATUS ON PLANNED DATE
+ if( $this->status == 0 and ( $this->planned_date == ''
or $this->planned_date == 0) )
+ {
+ $status = false;
+ $this->error_msg_array['status'] = "error_msg_7";
+ }
- protected $id;
- protected $control_id;
- protected $status;
- protected $comment;
- protected $deadline;
- protected $planned_date;
- protected $completed_date;
- protected $location_code;
- protected $component_id;
- protected $location_id;
- // Aggregate fields. Fields not in a table
- protected $num_open_cases;
- protected $num_pending_cases;
- // Objects
- protected $check_item_array = array();
- // Array that contains error messages. Is populted in function validate
- protected $error_msg_array = array();
- protected $control;
-
- /**
- * Constructor. Takes an optional ID. If a contract is created from outside
- * the database the ID should be empty so the database can add one according
to its logic.
- *
- * @param int $id the id of this composite
- */
- public function __construct(int $id = null) {
- $this->id = (int) $id;
- }
-
- public function set_id($id) {
- $this->id = $id;
- }
-
- public function get_id() {
- return $this->id;
- }
-
- public function set_control_id($control_id) {
- $this->control_id = $control_id;
- }
-
- public function get_control_id() {
- return $this->control_id;
- }
-
- public function set_status($status) {
- $this->status = $status;
- }
-
- public function get_status() {
- return $this->status;
- }
-
- public function set_comment($comment) {
- $this->comment = $comment;
- }
-
- public function get_comment() {
- return $this->comment;
- }
-
- public function set_deadline($deadline) {
- $this->deadline = $deadline;
- }
-
- public function get_deadline() {
- return $this->deadline;
- }
-
- public function set_check_item_array($check_item_array) {
- $this->check_item_array = $check_item_array;
- }
-
- public function get_check_item_array() {
- return $this->check_item_array;
- }
-
- public function set_planned_date($planned_date) {
- $this->planned_date = $planned_date;
- }
-
- public function get_planned_date() {
- return $this->planned_date;
- }
-
- public function set_completed_date($completed_date) {
- $this->completed_date = $completed_date;
- }
-
- public function get_completed_date() {
- return $this->completed_date;
- }
-
- public function set_location_code($location_code) {
- $this->location_code = $location_code;
- }
-
- public function get_location_code() {
- return $this->location_code;
- }
-
- public function set_component_id($component_id) {
- $this->component_id = $component_id;
- }
-
- public function get_component_id() {
- return $this->component_id;
- }
-
- public function set_location_id($location_id) {
- $this->location_id = $location_id;
- }
-
- public function get_location_id() {
- return $this->location_id;
- }
-
- public function get_num_open_cases() {
- return $this->num_open_cases;
- }
-
- public function set_num_open_cases($num_open_cases) {
- $this->num_open_cases = $num_open_cases;
- }
-
- public function get_num_pending_cases() {
- return $this->num_pending_cases;
- }
-
- public function set_num_pending_cases($num_pending_cases) {
- $this->num_pending_cases = $num_pending_cases;
- }
-
- public function set_control($control) {
- $this->control = $control;
- }
-
- public function get_control() {
- return $this->control;
- }
-
- public function get_error_msg_array() {
- return $this->error_msg_array;
- }
-
- public function set_error_msg_array($error_msg_array) {
- $this->error_msg_array = $error_msg_array;
- }
-
- public function serialize() {
- return array(
- 'id' => $this->get_id(),
- 'control_id' => $this->get_control_id(),
- 'status' => $this->get_status(),
- 'comment' => $this->get_comment(),
- 'deadline' => $this->get_deadline(),
- 'planned_date' => $this->get_planned_date(),
- 'completed_date' => $this->get_completed_date(),
- 'location_code' => $this->get_location_code(),
- 'component_id' => $this->get_component_id(),
- 'location_id' => $this->get_location_id(),
- 'num_open_cases' => $this->get_num_open_cases()
- );
- }
-
- public function validate() {
- $status = true;
-
- // Validate CONTROL ID
- if (empty($this->control_id)) {
- $status = false;
- $this->error_msg_array['control_id'] = "error_msg_4";
- }
-
- // Validate STATUS
- if ($this->status != 0 and $this->status != 1) {
- $status = false;
- $this->error_msg_array['status'] = "error_msg_2";
- }
-
- // Validate STATUS ON PLANNED DATE
- if ($this->status == 0 and ( $this->planned_date == '' or
$this->planned_date == 0)) {
- $status = false;
- $this->error_msg_array['status'] = "error_msg_7";
- }
-
- // Validate COMPLETED DATE when STATUS:DONE
- if (($this->status == controller_check_list::STATUS_DONE) &&
empty($this->completed_date)) {
- $status = false;
- $this->error_msg_array['completed_date'] = "error_msg_5";
- }
-
- // Validate DEADLINE
- if (empty($this->deadline)) {
- $status = false;
- $this->error_msg_array['deadline'] = "error_msg_1";
- }
-
- // Validate connection to COMPONENT/LOCATION
- if (empty($this->location_code) && empty($this->component_id)) {
- echo "FAILED: " . $this->location_code;
- $status = false;
- $this->error_msg_array['location_code'] = "error_msg_6";
- }
-
- return $status;
- }
-
-}
+ // Validate COMPLETED DATE when STATUS:DONE
+ if( ($this->status ==
controller_check_list::STATUS_DONE) && empty($this->completed_date) )
+ {
+ $status = false;
+ $this->error_msg_array['completed_date'] =
"error_msg_5";
+ }
+
+ // Validate DEADLINE
+ if( empty( $this->deadline ) )
+ {
+ $status = false;
+ $this->error_msg_array['deadline'] = "error_msg_1";
+ }
+
+ // Validate connection to COMPONENT/LOCATION
+ if( empty( $this->location_code ) && empty(
$this->component_id ) )
+ {
+ echo "FAILED: " . $this->location_code;
+ $status = false;
+ $this->error_msg_array['location_code'] = "error_msg_6";
+ }
+
+ return $status;
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,157 +1,148 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.control.inc.php 9548 2012-06-11 12:40:52Z vator $
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.control.inc.php 9548 2012-06-11 12:40:52Z vator $
- */
-include_class('controller', 'model', 'inc/model/');
-include_class('controller', 'date_helper', 'inc/helper/');
+ include_class('controller', 'model', 'inc/model/');
+ include_class('controller', 'date_helper', 'inc/helper/');
-class controller_component extends controller_model {
-
- protected $type;
- protected $id;
- protected $location_id;
- protected $guid;
- protected $xml;
- // Not a table column
- protected $xml_short_desc;
- protected $type_str;
- protected $location_code;
- protected $p_location_code;
- protected $loc_1;
- protected $address;
- // Objects
- protected $controls_array = array();
-
- /**
- * Constructor. Takes an optional ID. If a contract is created from outside
- * the database the ID should be empty so the database can add one according
to its logic.
- *
- * @param int $id the id of this composite
- */
- public function set_type($type) {
- $this->type = $type;
- }
-
- public function get_type() {
- return $this->type;
- }
-
- public function set_id($id) {
- $this->id = $id;
- }
-
- public function get_id() {
- return $this->id;
- }
-
- public function set_location_id($location_id) {
- $this->location_id = $location_id;
- }
-
- public function get_location_id() {
- return $this->location_id;
- }
-
- public function set_guid($guid) {
- $this->guid = $guid;
- }
-
- public function get_guid() {
- return $this->guid;
- }
-
- public function set_xml($xml) {
- $this->xml = $xml;
- }
-
- public function get_xml() {
- return $this->xml;
- }
-
- public function set_xml_short_desc($xml_short_desc) {
- $this->xml_short_desc = $xml_short_desc;
- }
-
- public function get_xml_short_desc() {
- return $this->xml_short_desc;
- }
-
- public function set_location_code($location_code) {
- $this->location_code = $location_code;
- }
-
- public function get_location_code() {
- return $this->location_code;
- }
-
- public function set_loc_1($loc_1) {
- $this->loc_1 = $loc_1;
- }
-
- public function get_loc_1() {
- return $this->loc_1;
- }
-
- public function set_address($address) {
- $this->address = $address;
- }
-
- public function get_address() {
- return $this->address;
- }
-
- public function set_type_str($type_str) {
- $this->type_str = $type_str;
- }
-
- public function get_type_str() {
- return $this->type_str;
- }
-
- public function set_controls_array($controls_array) {
- $this->controls_array = $controls_array;
- }
-
- public function get_controls_array() {
- return $this->controls_array;
- }
-
- public function serialize() {
- return array(
- 'type' => $this->get_type(),
- 'id' => $this->get_id(),
- 'guid' => $this->get_guid(),
- 'xml' => $this->get_xml(),
- 'location_code' => $this->get_location_code(),
- 'loc_1' => $this->get_loc_1(),
- 'address' => $this->get_address()
- );
- }
-
-}
+ class controller_component extends controller_model
+ {
+ protected $type;
+ protected $id;
+ protected $location_id;
+ protected $guid;
+ protected $xml;
+ // Not a table column
+ protected $xml_short_desc;
+ protected $type_str;
+ protected $location_code;
+ protected $p_location_code;
+ protected $loc_1;
+ protected $address;
+
+ // Objects
+ protected $controls_array = array();
+
+ /**
+ * Constructor. Takes an optional ID. If a contract is
created from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this composite
+ */
+
+ public function set_type($type)
+ {
+ $this->type = $type;
+ }
+
+ public function get_type() { return $this->type; }
+
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
+
+ public function get_id() { return $this->id; }
+
+ public function set_location_id($location_id)
+ {
+ $this->location_id = $location_id;
+ }
+
+ public function get_location_id() { return $this->location_id; }
+
+ public function set_guid($guid)
+ {
+ $this->guid = $guid;
+ }
+
+ public function get_guid() { return $this->guid; }
+
+ public function set_xml($xml)
+ {
+ $this->xml = $xml;
+ }
+
+ public function get_xml() { return $this->xml; }
+
+ public function set_xml_short_desc($xml_short_desc)
+ {
+ $this->xml_short_desc = $xml_short_desc;
+ }
+
+ public function get_xml_short_desc() { return
$this->xml_short_desc; }
+
+ public function set_location_code($location_code)
+ {
+ $this->location_code = $location_code;
+ }
+
+ public function get_location_code() { return
$this->location_code; }
+
+ public function set_loc_1($loc_1)
+ {
+ $this->loc_1 = $loc_1;
+ }
+
+ public function get_loc_1() { return $this->loc_1; }
+
+ public function set_address($address)
+ {
+ $this->address = $address;
+ }
+
+ public function get_address() { return $this->address; }
+
+ public function set_type_str($type_str)
+ {
+ $this->type_str = $type_str;
+ }
+
+ public function get_type_str() { return $this->type_str; }
+
+ public function set_controls_array($controls_array)
+ {
+ $this->controls_array = $controls_array;
+ }
+
+ public function get_controls_array() { return
$this->controls_array; }
+
+ public function serialize()
+ {
+ return array(
+ 'type' => $this->get_type(),
+ 'id' => $this->get_id(),
+ 'guid' => $this->get_guid(),
+ 'xml' => $this->get_xml(),
+ 'location_code' => $this->get_location_code(),
+ 'loc_1' => $this->get_loc_1(),
+ 'address' => $this->get_address()
+ );
+ }
+ }
Modified: branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
2012-09-11 07:51:08 UTC (rev 9993)
+++ branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
2012-09-11 12:22:26 UTC (rev 9994)
@@ -1,362 +1,360 @@
<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id$
+ */
-/**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id$
- */
-include_class('controller', 'model', 'inc/model/');
-include_class('controller', 'date_helper', 'inc/helper/');
+ include_class('controller', 'model', 'inc/model/');
+ include_class('controller', 'date_helper', 'inc/helper/');
-class controller_control extends controller_model {
+ class controller_control extends controller_model
+ {
+ public static $so;
+
+ const REPEAT_TYPE_DAY = 0;
+ const REPEAT_TYPE_WEEK = 1;
+ const REPEAT_TYPE_MONTH = 2;
+ const REPEAT_TYPE_YEAR = 3;
+
+ protected $id;
+ protected $title;
+ protected $description;
+ protected $start_date;
+ protected $end_date;
+ protected $repeat_type;
+ protected $repeat_type_label;
+ protected $repeat_interval;
+ protected $procedure_id;
+ protected $procedure_name;
+ protected $enabled;
+ protected $requirement_id;
+ protected $costresponsibility_id;
+ protected $responsibility_id;
+ protected $responsibility_name;
+ protected $control_area_id;
+ protected $control_area_name;
- public static $so;
+ // Objects
+ protected $check_lists_array = array();
+ // Array that contains open cases for a month
+ protected $agg_open_cases_pr_month_array = array();
+ // Array that contains error messages. Is populted in function
validate
+ protected $error_msg_array;
+
+ /**
+ * Constructor. Takes an optional ID. If a contract is
created from outside
+ * the database the ID should be empty so the database can add
one according to its logic.
+ *
+ * @param int $id the id of this composite
+ */
+ public function __construct(int $id = null)
+ {
+ $this->id = (int)$id;
+ }
+
+ public function set_id($id)
+ {
+ $this->id = $id;
+ }
+
+ public function get_id() { return $this->id; }
+
+ public function set_title($title)
+ {
+ $this->title = $title;
+ }
+
+ public function get_title() { return $this->title; }
+
+ public function set_description($description)
+ {
+ $this->description = $description;
+ }
+
+ public function get_description() { return $this->description; }
+
+ public function set_end_date($end_date)
+ {
+ $this->end_date = $end_date;
+ }
+
+ public function get_end_date() { return $this->end_date; }
+
+ public function set_start_date($start_date)
+ {
+ $this->start_date = $start_date;
+ }
+
+ public function get_start_date() { return $this->start_date; }
+
+ public function set_repeat_type($repeat_type)
+ {
+ $this->repeat_type = $repeat_type;
+ }
+
+ public function get_repeat_type() { return $this->repeat_type; }
+
+ public function set_repeat_type_label(int $repeat_type = null)
+ {
+ switch($repeat_type)
+ {
+ case controller_control::REPEAT_TYPE_DAY:
+ $this->repeat_type_label =
lang('repeat_type_day');
+ break;
+ case controller_control::REPEAT_TYPE_WEEK:
+ $this->repeat_type_label =
lang('repeat_type_week');
+ break;
+ case controller_control::REPEAT_TYPE_MONTH:
+ $this->repeat_type_label =
lang('repeat_type_month');
+ break;
+ case controller_control::REPEAT_TYPE_YEAR;
+ $this->repeat_type_label =
lang('repeat_type_year');
+ break;
+ default:
+ $this->repeat_type_label =
lang('repeat_type_none');
+ break;
+ }
+ }
+
+ public function get_repeat_type_label() { return
$this->repeat_type_label; }
+
+ public function set_repeat_interval($repeat_interval)
+ {
+ $this->repeat_interval = $repeat_interval;
+ }
+
+ public function get_repeat_interval() { return
$this->repeat_interval; }
+
+ public function set_procedure_id($procedure_id)
+ {
+ $this->procedure_id = $procedure_id;
+ }
+
+ public function get_procedure_id() { return
$this->procedure_id; }
+
+ public function set_procedure_name($procedure_name)
+ {
+ $this->procedure_name = $procedure_name;
+ }
+
+ public function get_procedure_name() { return
$this->procedure_name; }
+
+ public function set_enabled($enabled)
+ {
+ $this->enabled = $enabled;
+ }
+
+ public function get_enabled() { return $this->enabled; }
+
+ public function set_requirement_id($requirement_id)
+ {
+ $this->requirement_id = $requirement_id;
+ }
+
+ public function get_requirement_id() { return
$this->requirement_id; }
+
+ public function
set_costresponsibility_id($costresponsibility_id)
+ {
+ $this->costresponsibility_id = $costresponsibility_id;
+ }
+
+ public function get_costresponsibility_id() { return
$this->costresponsibility_id; }
+
+ public function set_responsibility_id($responsibility_id)
+ {
+ $this->responsibility_id = $responsibility_id;
+ }
+
+ public function get_responsibility_id() { return
$this->responsibility_id; }
+
+ public function set_responsibility_name($responsibility_name)
+ {
+ $this->responsibility_name = $responsibility_name;
+ }
+
+ public function get_responsibility_name() { return
$this->responsibility_name; }
+
+ public function set_control_area_id($control_area_id)
+ {
+ $this->control_area_id = $control_area_id;
+ }
+
+ public function get_control_area_id() { return
$this->control_area_id; }
+
+ public function set_control_area_name($control_area_name)
+ {
+ $this->control_area_name = $control_area_name;
+ }
+
+ public function get_control_area_name() { return
$this->control_area_name; }
+
+ public function set_check_lists_array($check_lists_array)
+ {
+ $this->check_lists_array = $check_lists_array;
+ }
+
+ public function get_check_lists_array() { return
$this->check_lists_array; }
+
+ public function
set_agg_open_cases_pr_month_array($agg_open_cases_pr_month_array)
+ {
+ $this->agg_open_cases_pr_month_array =
$agg_open_cases_pr_month_array;
+ }
+
+ public function get_agg_open_cases_pr_month_array() { return
$this->agg_open_cases_pr_month_array; }
+
+ public function get_error_msg_array() { return
$this->error_msg_array; }
+
+ public function set_error_msg_array( $error_msg_array )
+ {
+ $this->error_msg_array = $error_msg_array;
+ }
+
+ /**
+ * Get a static reference to the storage object associated with
this model object
+ *
+ * @return the storage object
+ */
+ public static function get_so()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('controller.socontrol');
+ }
+
+ return self::$so;
+ }
+
+ public function populate()
+ {
+
$this->set_title(phpgw::get_var('title','string'));
+
$this->set_description(phpgw::get_var('description','html'));
+
+ if(phpgw::get_var('start_date','string') != '')
+ {
+ $start_date_ts =
date_helper::get_timestamp_from_date( phpgw::get_var('start_date','string'),
"d/m-Y" );
+ $this->set_start_date($start_date_ts);
+ }else
+ $this->set_start_date(0);
+
+ if( phpgw::get_var('end_date','string') != '')
+ {
+ $end_date_ts =
date_helper::get_timestamp_from_date( phpgw::get_var('end_date','string'),
"d/m-Y" );
+ $this->set_end_date( $end_date_ts );
+ }else
+ {
+ $this->set_end_date( 0 );
+ }
+
+
$this->set_repeat_type(phpgw::get_var('repeat_type','string'));
+
$this->set_repeat_interval(phpgw::get_var('repeat_interval','string'));
+
$this->set_procedure_id(phpgw::get_var('procedure_id','int'));
+
$this->set_control_area_id(phpgw::get_var('control_area_id','int'));
+
$this->set_responsibility_id(phpgw::get_var('responsibility_id','int'));
+ }
+
+ public function serialize()
+ {
+ return array(
+ 'id' => $this->get_id(),
+ 'title' => $this->get_title(),
+ 'description' => $this->get_description(),
+ 'start_date' => $this->get_start_date(),
+ 'end_date' => $this->get_end_date(),
+ 'procedure_id' => $this->get_procedure_id(),
+ 'procedure_name' => $this->get_procedure_name(),
+ 'control_area_id' =>
$this->get_control_area_id(),
+ 'control_area_name' =>
$this->get_control_area_name(),
+ 'repeat_type' => $this->get_repeat_type(),
+ 'repeat_interval' =>
$this->get_repeat_interval(),
+ 'responsibility_name' =>
$this->get_responsibility_name()
+ );
+ }
+
+ public function validate()
+ {
+ $status = true;
+
+ // Validate CONTROL AREA
+ if( empty( $this->control_area_id ) &&
(intval($this->control_area_id) == 0) )
+ {
+ $status = false;
+ $this->error_msg_array['control_area_id'] =
"error_msg_2";
+ }
+
+ // Validate PROCEDURE
+ if( empty( $this->procedure_id ) &&
(intval($this->procedure_id) == 0) )
+ {
+ $status = false;
+ $this->error_msg_array['procedure_id'] = "error_msg_2";
+ }
+
+ // Validate TITLE
+ if( empty($this->title) )
+ {
+ $status = false;
+ $this->error_msg_array['title'] = "error_msg_1";
+ }
+
+ // Validate START DATE
+ if( empty($this->start_date) )
+ {
+ $status = false;
+ $this->error_msg_array['start_date'] = "error_msg_1";
+ }
- const REPEAT_TYPE_DAY = 0;
- const REPEAT_TYPE_WEEK = 1;
- const REPEAT_TYPE_MONTH = 2;
- const REPEAT_TYPE_YEAR = 3;
+ // Validate END DATE
+ if( !empty($this->end_date) && ($this->end_date <
$this->start_date) )
+ {
+ $status = false;
+ $this->error_msg_array['end_date'] = "error_msg_3";
+ }
+
+ // Validate REPEAT TYPE
+ if( $this->repeat_type == "" )
+ {
+ $status = false;
+ $this->error_msg_array['repeat_type'] = "error_msg_2";
+ }
- protected $id;
- protected $title;
- protected $description;
- protected $start_date;
- protected $end_date;
- protected $repeat_type;
- protected $repeat_type_label;
- protected $repeat_interval;
- protected $procedure_id;
- protected $procedure_name;
- protected $enabled;
- protected $requirement_id;
- protected $costresponsibility_id;
- protected $responsibility_id;
- protected $responsibility_name;
- protected $control_area_id;
- protected $control_area_name;
- // Objects
- protected $check_lists_array = array();
- // Array that contains open cases for a month
- protected $agg_open_cases_pr_month_array = array();
- // Array that contains error messages. Is populted in function validate
- protected $error_msg_array;
-
- /**
- * Constructor. Takes an optional ID. If a contract is created from outside
- * the database the ID should be empty so the database can add one according
to its logic.
- *
- * @param int $id the id of this composite
- */
- public function __construct(int $id = null) {
- $this->id = (int) $id;
- }
-
- public function set_id($id) {
- $this->id = $id;
- }
-
- public function get_id() {
- return $this->id;
- }
-
- public function set_title($title) {
- $this->title = $title;
- }
-
- public function get_title() {
- return $this->title;
- }
-
- public function set_description($description) {
- $this->description = $description;
- }
-
- public function get_description() {
- return $this->description;
- }
-
- public function set_end_date($end_date) {
- $this->end_date = $end_date;
- }
-
- public function get_end_date() {
- return $this->end_date;
- }
-
- public function set_start_date($start_date) {
- $this->start_date = $start_date;
- }
-
- public function get_start_date() {
- return $this->start_date;
- }
-
- public function set_repeat_type($repeat_type) {
- $this->repeat_type = $repeat_type;
- }
-
- public function get_repeat_type() {
- return $this->repeat_type;
- }
-
- public function set_repeat_type_label(int $repeat_type = null) {
- switch ($repeat_type) {
- case controller_control::REPEAT_TYPE_DAY:
- $this->repeat_type_label = lang('repeat_type_day');
- break;
- case controller_control::REPEAT_TYPE_WEEK:
- $this->repeat_type_label = lang('repeat_type_week');
- break;
- case controller_control::REPEAT_TYPE_MONTH:
- $this->repeat_type_label = lang('repeat_type_month');
- break;
- case controller_control::REPEAT_TYPE_YEAR;
- $this->repeat_type_label = lang('repeat_type_year');
- break;
- default:
- $this->repeat_type_label = lang('repeat_type_none');
- break;
- }
- }
-
- public function get_repeat_type_label() {
- return $this->repeat_type_label;
- }
-
- public function set_repeat_interval($repeat_interval) {
- $this->repeat_interval = $repeat_interval;
- }
-
- public function get_repeat_interval() {
- return $this->repeat_interval;
- }
-
- public function set_procedure_id($procedure_id) {
- $this->procedure_id = $procedure_id;
- }
-
- public function get_procedure_id() {
- return $this->procedure_id;
- }
-
- public function set_procedure_name($procedure_name) {
- $this->procedure_name = $procedure_name;
- }
-
- public function get_procedure_name() {
- return $this->procedure_name;
- }
-
- public function set_enabled($enabled) {
- $this->enabled = $enabled;
- }
-
- public function get_enabled() {
- return $this->enabled;
- }
-
- public function set_requirement_id($requirement_id) {
- $this->requirement_id = $requirement_id;
- }
-
- public function get_requirement_id() {
- return $this->requirement_id;
- }
-
- public function set_costresponsibility_id($costresponsibility_id) {
- $this->costresponsibility_id = $costresponsibility_id;
- }
-
- public function get_costresponsibility_id() {
- return $this->costresponsibility_id;
- }
-
- public function set_responsibility_id($responsibility_id) {
- $this->responsibility_id = $responsibility_id;
- }
-
- public function get_responsibility_id() {
- return $this->responsibility_id;
- }
-
- public function set_responsibility_name($responsibility_name) {
- $this->responsibility_name = $responsibility_name;
- }
-
- public function get_responsibility_name() {
- return $this->responsibility_name;
- }
-
- public function set_control_area_id($control_area_id) {
- $this->control_area_id = $control_area_id;
- }
-
- public function get_control_area_id() {
- return $this->control_area_id;
- }
-
- public function set_control_area_name($control_area_name) {
- $this->control_area_name = $control_area_name;
- }
-
- public function get_control_area_name() {
- return $this->control_area_name;
- }
-
- public function set_check_lists_array($check_lists_array) {
- $this->check_lists_array = $check_lists_array;
- }
-
- public function get_check_lists_array() {
- return $this->check_lists_array;
- }
-
- public function
set_agg_open_cases_pr_month_array($agg_open_cases_pr_month_array) {
- $this->agg_open_cases_pr_month_array = $agg_open_cases_pr_month_array;
- }
-
- public function get_agg_open_cases_pr_month_array() {
- return $this->agg_open_cases_pr_month_array;
- }
-
- public function get_error_msg_array() {
- return $this->error_msg_array;
- }
-
- public function set_error_msg_array($error_msg_array) {
- $this->error_msg_array = $error_msg_array;
- }
-
- /**
- * Get a static reference to the storage object associated with this model
object
- *
- * @return the storage object
- */
- public static function get_so() {
- if (self::$so == null) {
- self::$so = CreateObject('controller.socontrol');
- }
-
- return self::$so;
- }
-
- public function populate() {
- $this->set_title(phpgw::get_var('title', 'string'));
- $this->set_description(phpgw::get_var('description', 'html'));
-
- if (phpgw::get_var('start_date', 'string') != '') {
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9994] Merge 9964:9993 from trunk,
Sigurd Nes <=