[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8067] Merge 8042:8066 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8067] Merge 8042:8066 from trunk |
Date: |
Wed, 09 Nov 2011 08:45:50 +0000 |
Revision: 8067
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8067
Author: sigurdne
Date: 2011-11-09 08:45:50 +0000 (Wed, 09 Nov 2011)
Log Message:
-----------
Merge 8042:8066 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
branches/Version-1_0-branch/activitycalendar/templates/base/css/base.css
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
branches/Version-1_0-branch/booking/setup/tables_current.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
branches/Version-1_0-branch/controller/setup/phpgw_no.lang
branches/Version-1_0-branch/controller/setup/setup.inc.php
branches/Version-1_0-branch/controller/setup/tables_current.inc.php
branches/Version-1_0-branch/controller/setup/tables_update.inc.php
branches/Version-1_0-branch/controller/templates/base/control.xsl
branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
Added Paths:
-----------
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041
+
/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
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -450,6 +450,16 @@
return $result;
}
+ function get_district_from_id($d_id)
+ {
+ $this->db->query("SELECT name FROM fm_part_of_town where
part_of_town_id={$d_id} ", __LINE__, __FILE__);
+ while($this->db->next_record()){
+ $result = $this->db->f('name');
+ }
+ return $result;
+ }
+
+
function get_district_name($district_id)
{
//$result = "Ingen";
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -127,6 +127,11 @@
$persons = $so_org->get_contacts($o_id);
$desc = $so_org->get_description($o_id);
}
+
+ if(strlen($desc) > 254)
+ {
+ $desc = substr($desc,0,254);
+ }
$arenas = $so_arena->get(null, null, null, null, null, null,
null);
if($activity->get_new_org())
{
Modified: branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -63,7 +63,13 @@
$errorMsgs = array();
$infoMsgs = array();
+ $saved_OK = phpgw::get_var('saved_ok');
+ if($saved_OK)
+ {
+ $message = lang('arena_saved_form');
+ }
$arena =
activitycalendar_soarena::get_instance()->get_single((int)phpgw::get_var('id'));
+ $cancel_link = self::link(array('menuaction' =>
'activitycalendar.uiarena.index'));
if($arena == null) // Not found
{
@@ -72,6 +78,8 @@
$data = array
(
'arena' => $arena,
+ 'cancel_link' => $cancel_link,
+ 'message' => $message,
'errorMsgs' => $errorMsgs,
'infoMsgs' => $infoMsgs
);
@@ -83,6 +91,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] .=
'::'.lang('edit');
// Get the contract part id
$arena_id = (int)phpgw::get_var('id');
+ $cancel_link = self::link(array('menuaction' =>
'activitycalendar.uiarena.index'));
$buildings =
activitycalendar_soarena::get_instance()->get_buildings();
//var_dump($buildings);
@@ -105,7 +114,7 @@
$arena->set_internal_arena_id(phpgw::get_var('internal_arena_id'));
$arena->set_arena_name(phpgw::get_var('arena_name'));
$arena->set_address(phpgw::get_var('address') .
' ' . phpgw::get_var('address_no'));
-
$arena->set_active(phpgw::get_var('arena_active') == 'on' ? true : false);
+
$arena->set_active(phpgw::get_var('arena_active') == 'yes' ? true : false);
if(activitycalendar_soarena::get_instance()->store($arena)) // ... and then try
to store the object
{
@@ -116,6 +125,7 @@
$error = lang('messages_form_error');
}
}
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'activitycalendar.uiarena.view', 'id' =>
$arena->get_id(), 'saved_ok' => 'yes'));
}
return $this->render('arena.php', array
@@ -123,6 +133,7 @@
'arena' => $arena,
'buildings' => $buildings,
'editable' => true,
+ 'cancel_link' => $cancel_link,
'message' => isset($message) ? $message :
phpgw::get_var('message'),
'error' => isset($error) ? $error :
phpgw::get_var('error')
)
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -245,6 +245,7 @@
{
$arena->set_arena_name($arena_name);
$arena->set_address($arena_address);
+
$arena->set_active(true);
// All is good, store
notification
if
($soarena->store($arena)) {
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-11-09 08:45:50 UTC (rev 8067)
@@ -380,7 +380,7 @@
mail_body_state_5 activitycalendar no Ditt tips er behandlet,
men vil ikke bli publisert i kommuneportalen. Mvh %1 kulturkontor
send_mail activitycalendar no Send e-post
marked_as activitycalendar no Status
-address_number activitycalendar no Nummer
+address_number activitycalendar no Husnummer
changed_organizations_groups activitycalendar no Endrede
organisasjoner/grupper
changed_org_group activitycalendar no Endringer
building activitycalendar no Kommunale bygg
@@ -393,4 +393,9 @@
inactive_arena activitycalendar no Inaktiv
change_type activitycalendar no Endringstype
added activitycalendar no Lagt til i organisasjonsregisteret
-store activitycalendar no Overfør til organisasjonsregister
\ No newline at end of file
+store activitycalendar no Overfør til organisasjonsregister
+back activitycalendar no Tilbake
+arena_saved_form activitycalendar no Arena ble lagret
+activity_saved_form activitycalendar no Aktiviteten ble lagret
+organization_saved_form activitycalendar no Organisasjonen
ble lagret
+group_saved_form activitycalendar no Gruppen ble lagret
\ No newline at end of file
Modified: branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -14,10 +14,11 @@
var divcontent_start = "<select name=\"address\" id=\"address\" size\"5\">";
var divcontent_end = "</select>";
+var divcontent_number = " <label for=\"address_number\"><?php echo
lang('address_number') ?></label><input type=\"text\" name=\"address_no\"
id=\"address_no\" size=\"6\"/>"
var callback = {
success: function(response){
- div_address.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
+ div_address.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end +
divcontent_number;
},
failure: function(o) {
alert("AJAX doesn't work"); //FAILURE
@@ -27,7 +28,7 @@
}
</script>
-
+<?php echo activitycalendar_uicommon::get_page_message($message) ?>
<div class="identifier-header">
<h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH
?>images/32x32/custom/contact.png" /><?php echo lang('arena') ?></h1>
<div>
@@ -60,34 +61,6 @@
?>
</dd>
<dt>
- <?php
if($arena->get_internal_arena_id() || $editable) { ?>
- <label for="internal_arena_id"><?php
echo lang('internal_arena') ?></label>
- <?php } ?>
- </dt>
- <dd>
- <?php
- $current_building_id =
$arena->get_internal_arena_id();
- if ($editable)
- {
- ?>
- <select
name="internal_arena_id">
- <option value="0">Ingen
arena valgt</option>
- <?php
- foreach($buildings as
$building_id => $building_name)
- {
- echo "<option
".($current_building_id == $building_id? 'selected="selected"' : "")."
value=\"{$building_id}\">".$building_name."</option>";
- }
- ?>
- </select>
- <?php
- }
- else
- {
- echo
activitycalendar_soarena::get_instance()->get_building_name($arena->get_internal_arena_id());
- }
- ?>
- </dd>
- <dt>
<?php if($arena->get_address() ||
$editable) { ?>
<label for="address"><?php echo
lang('address') ?></label>
<?php } ?>
@@ -99,7 +72,6 @@
?>
<input type="text"
name="address" id="address_txt" value="<?php echo $arena->get_address() ?>"
onkeyup="javascript:get_address_search()"/>
<div
id="address_container"></div>
- <label
for="address_number"><?php echo lang('address_number') ?></label><input
type="text" name="address_no" id="address_no"/>
<?php
}
else
@@ -113,7 +85,10 @@
<label for="arena_active"><?php
echo lang('active_arena') ?></label>
</dt>
<dd>
- <input type="checkbox"
name="arena_active" id="arena_active" <?php if($arena->is_active()) { echo
"checked='checked'";} ?>/>
+ <select name="arena_active"
id="arena_active">
+ <option value="yes"
<?php if($arena->is_active()) { echo "selected";} ?>><?php echo
lang('active')?></option>
+ <option value="no"
<?php if(!$arena->is_active()) { echo "selected";} ?>><?php echo
lang('inactive')?></option>
+ </select>
</dd>
<?php
}else{
@@ -126,7 +101,12 @@
<?php
if ($editable) {
echo '<input type="submit"
name="save_arena" value="' . lang('save') . '"/>';
+ echo '<a
href="'.$cancel_link.'">' . lang('cancel') . '</a>';
}
+ else
+ {
+ echo '<a
href="'.$cancel_link.'">' . lang('back') . '</a>';
+ }
?>
</div>
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
2011-11-09 08:43:48 UTC (rev 8066)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -22,11 +22,6 @@
sortable: true
},
{
- key: "internal_arena_id",
- label: "<?php echo lang('internal_arena_id') ?>",
- sortable: true
- },
- {
key: "address",
label: "<?php echo lang('address') ?>",
sortable: true
@@ -92,7 +87,6 @@
window.location =
'index.php?menuaction=activitycalendar.uiarena.download'+
'<?php echo $url_add_on; ?>'+
'&query='+query+
- '&arena_type='+aType+
'&active='+active+
'&export=true';
}
@@ -114,12 +108,6 @@
<fieldset>
<!-- Filters -->
- <label class="toolbar_element_label"
for="ctrl_toggle_arena_type"><?php echo lang('arena_type') ?></label>
- <select name="arena_type" id="<?php echo $list_id
?>_ctrl_toggle_arena_type">
- <option value="all"><?php echo lang('all') ?></option>
- <option value="internal"><?php echo lang('internal')
?></option>
- <option value="not_internal" ><?php echo
lang('not_internal') ?></option>
- </select>
<label class="toolbar_element_label" for="<?php echo $list_id
?>_ctrl_toggle_active"><?php echo lang('marked_as') ?></label>
<select name="active" id="<?php echo $list_id
?>_ctrl_toggle_active">
<option value="all" <?php echo ($status == 'all') ?
'selected' : ''?>><?php echo lang('all') ?></option>
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/css/base.css
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/css/base.css
2011-11-09 08:45:50 UTC (rev 8067)
@@ -163,7 +163,7 @@
dl.proplist-col,
dl.form-col {
- width: 18em;
+ width: 40em;
float: left;
}
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
2011-11-09 08:43:48 UTC (rev 8066)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -36,9 +36,13 @@
<?php }else{
if($organization->get_change_type() == 'new'){?>
<?php echo
activitycalendar_soactivity::get_instance()->get_district_from_id($organization->get_district());?>
- <?php }else{?>
- <?php echo
$organization->get_district();?>
- <?php }?>
+ <?php }else{
+
if($organization->get_district() &&
is_numeric($organization->get_district())){?>
+ <?php echo
activitycalendar_soactivity::get_instance()->get_district_from_id($organization->get_district());?>
+ <?php }else{?>
+ <?php echo
$organization->get_district();?>
+ <?php }
+ }?>
<?php }?>
</dd>
<dt><label
for="homepage">Hjemmeside</label></dt>
@@ -81,6 +85,7 @@
<?php echo
$organization->get_description();?>
<?php }?>
</dd>
+ <?php if($contactperson1){?>
<dt><label>Kontaktperson 1</label></dt>
<dd><input type="hidden" name="contact1_id"
value="<?php echo $contactperson1->get_id();?>"/></dd>
<dt><label for="contact1_name">Navn</label></dt>
@@ -95,6 +100,8 @@
<dd>
<input type="text"
name="contact1_email" value="<?php echo $contactperson1->get_email();?>"/>
</dd>
+ <?php }?>
+ <?php if($contactperson2){?>
<dt><label>Kontaktperson 2</label></dt>
<dd><input type="hidden" name="contact2_id"
value="<?php echo $contactperson2->get_id();?>"/></dd>
<dt><label for="contact1_name">Navn</label></dt>
@@ -109,6 +116,7 @@
<dd>
<input type="text"
name="contact2_email" value="<?php echo $contactperson2->get_email();?>"/>
</dd>
+ <?php }?>
</dl>
<div class="form-buttons">
<?php
Modified: branches/Version-1_0-branch/booking/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/setup/tables_current.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/booking/setup/tables_current.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -769,6 +769,32 @@
'ix' => array(),
'uc' => array()
),
+ 'bb_office' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'precision' =>
4,'nullable' => False),
+ 'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'user_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'bb_office_user' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'precision' =>
4,'nullable' => False),
+ 'office' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
+ 'user_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array('bb_office' => array('office' => 'id')),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'bb_documentation' => array(
'fd' => array(
'id' => array('type' => 'auto', 'nullable' =>
false),
@@ -780,6 +806,5 @@
'fk' => array(),
'ix' => array(),
'uc' => array()
- ),
-
+ )
);
Modified: branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -45,13 +45,15 @@
return isset($result) ?
$this->db->get_last_insert_id('controller_check_item', 'id') : 0;
}
-
- function update($object){
+ function update($check_item){
+
+ $id = $check_item->get_id();
+
$values = array(
- 'control_item_id = ' .
$this->marshal($check_item->set_control_item_id(), 'int'),
- 'status = ' . $this->marshal($check_item->set_status(),
'string'),
- 'comment = ' .
$this->marshal($check_item->set_comment(), 'string'),
- 'check_list_id = ' .
$this->marshal($check_item->set_check_list_id(), 'int')
+ 'control_item_id = ' .
$this->marshal($check_item->get_control_item_id(), 'int'),
+ 'status = ' . $this->marshal($check_item->get_status(),
'string'),
+ 'comment = ' .
$this->marshal($check_item->get_comment(), 'string'),
+ 'check_list_id = ' .
$this->marshal($check_item->get_check_list_id(), 'int')
);
$result = $this->db->query('UPDATE controller_check_item SET '
. join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
@@ -63,5 +65,35 @@
}
}
+ public function get_single($check_item_id){
+ $sql = "SELECT ci.*, coi.id as coi_id, coi.* ";
+ $sql .= "FROM controller_check_item ci, controller_control_item
coi ";
+ $sql .= "WHERE ci.id = $check_item_id ";
+ $sql .= "AND ci.control_item_id=coi.id";
+
+ $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+
+ if($this->db->next_record()) {
+ $check_item = new
controller_check_item($this->unmarshal($this->db->f('id', true), 'int'));
+
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
true), 'int'));
+
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
+
$check_item->set_comment($this->unmarshal($this->db->f('comment', true),
'string'));
+
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
+
+ $control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
+ $control_item->set_title($this->db->f('title', true),
'string');
+ $control_item->set_required($this->db->f('required',
true), 'string');
+
$control_item->set_what_to_do($this->db->f('what_to_do', true), 'string');
+ $control_item->set_how_to_do($this->db->f('how_to_do',
true), 'string');
+
$control_item->set_control_group_id($this->db->f('control_group_id', true),
'string');
+
+ $check_item->set_control_item($control_item->toArray());
+
+ return $check_item;
+ }else{
+ return null;
+ }
+ }
+
function get_id_field_name(){}
}
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
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -54,8 +54,25 @@
}
}
+
+ protected $id;
+ protected $title;
+ protected $required;
+ protected $what_to_do;
+ protected $how_to_do;
+ protected $control_group_id;
+
+
public function get_single_with_control_item($check_list_id){
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id, coi.title as
control_item_title FROM controller_check_list cl, controller_check_item ci,
controller_control_item as coi WHERE cl.id = $check_list_id AND cl.id =
ci.check_list_id AND ci.control_item_id=coi.id;";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, ";
+ $sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id, ";
+ $sql .= "coi.title as coi_id, coi.title as coi_title,
coi.required as coi_required, coi.required as coi_required, ";
+ $sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as
coi_how_to_do, coi.control_group_id as coi_control_group_id ";
+ $sql .= "FROM controller_check_list cl, controller_check_item
ci, controller_control_item as coi ";
+ $sql .= "WHERE cl.id = $check_list_id ";
+ $sql .= "AND cl.id = ci.check_list_id ";
+ $sql .= "AND ci.control_item_id=coi.id;";
+
$this->db->query($sql);
$counter = 0;
@@ -75,8 +92,12 @@
$check_item->set_comment($this->unmarshal($this->db->f('ci_comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
- $control_item = new
controller_control_item($this->unmarshal($this->db->f('control_item_id', true),
'int'));
-
$control_item->set_title($this->db->f('control_item_title', true), 'string');
+ $control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
+ $control_item->set_title($this->db->f('coi_title',
true), 'string');
+
$control_item->set_required($this->db->f('coi_required', true), 'string');
+
$control_item->set_what_to_do($this->db->f('coi_what_to_do', true), 'string');
+
$control_item->set_how_to_do($this->db->f('coi_how_to_do', true), 'string');
+
$control_item->set_control_group_id($this->db->f('coi_control_group_id', true),
'string');
$check_item->set_control_item($control_item->toArray());
@@ -178,9 +199,100 @@
}
- function get_query(string $sort_field, boolean $ascending, string
$search_for, string $search_type, array $filters, boolean $return_count){}
+ function get_query(string $sort_field, boolean $ascending, string
$search_for, string $search_type, array $filters, boolean $return_count)
+ {
+ $current_time = time();
+ $buffer_in_days = 3600*24*7*5;
+ $buffer_time = $current_time - $buffer_in_days;
- function populate(int $object_id, &$object){}
+ $clauses = array('1=1');
+ $clauses[] = "{$current_time} >= p.start_date AND p.start_date
> {$buffer_time}";
+
+ $filter_clauses = array();
+
+ // Search for based on search type
+ if($search_for)
+ {
+ $search_for = $this->marshal($search_for,'field');
+ $like_pattern = "'%".$search_for."%'";
+ $like_clauses = array();
+ switch($search_type){
+ default:
+ $like_clauses[] = "p.title $this->like
$like_pattern";
+ break;
+ }
+
+ if(count($like_clauses))
+ {
+ $clauses[] = '(' . join(' OR ', $like_clauses)
. ')';
+ }
+ }
+ //var_dump($filters);
+ if(isset($filters[$this->get_id_field_name()]))
+ {
+ $filter_clauses[] = "p.id =
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
+ }
+
+ if(count($filter_clauses))
+ {
+ $clauses[] = join(' AND ', $filter_clauses);
+ }
+
+ $condition = join(' AND ', $clauses);
+
+ $tables = "controller_control p";
+ //$joins = " {$this->left_join} rental_document_types ON
(rental_document.type_id = rental_document_types.id)";
+ //$joins = " {$this->left_join} controller_control_area ON
(controller_control.control_area_id = controller_control_area.id)";
+ //$joins .= " {$this->left_join} controller_procedure ON
(controller_control.procedure_id = controller_procedure.id)";
+
+ if($return_count)
+ {
+ $cols = 'COUNT(DISTINCT(p.id)) AS count';
+ }
+ else
+ {
+ $cols = 'p.* ';
+ }
+
+ $dir = $ascending ? 'ASC' : 'DESC';
+ if($sort_field == 'id')
+ {
+ $sort_field = 'p.id';
+ }
+ $order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
+
+ return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
+ }
+
+ function populate(int $control_id, &$control)
+ {
+ $start_date = date("d.m.Y", $this->db->f('start_date'));
+ $end_date = date("d.m.Y", $this->db->f('end_date'));
+
+ if($control == null) {
+ $control = new controller_control((int) $control_id);
+
+
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
+
$control->set_description($this->unmarshal($this->db->f('description', true),
'boolean'));
+ $control->set_start_date($start_date);
+ $control->set_end_date($end_date);
+
$control->set_procedure_id($this->unmarshal($this->db->f('procedure_id', true),
'int'));
+
$control->set_procedure_name($this->unmarshal($this->db->f('procedure_name',
true), 'string'));
+
$control->set_requirement_id($this->unmarshal($this->db->f('requirement_id',
true), 'int'));
+
$control->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id',
true), 'int'));
+
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
true), 'int'));
+
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
+
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
+//
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
+
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
+
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
+
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
+
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
+ }
+
+ return $control;
+ }
function add(&$check_list)
{
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
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -20,7 +20,9 @@
'index' => true,
'view_check_lists_for_control' => true,
'save_check_list' => true,
- 'view_check_list' => true
+ 'view_check_list' => true,
+ 'edit_check_list' => true,
+ 'save_check_items' => true
);
public function __construct()
@@ -40,7 +42,7 @@
public function index()
{
- $check_list_array = $this->so->get_check_list();
+/* $check_list_array = $this->so->get_check_list();
$data = array
(
@@ -48,35 +50,143 @@
);
self::render_template_xsl('control_check_lists', $data);
+ */
+ if(phpgw::get_var('phpgw_return_as') == 'json') {
+ return $this->query();
+ }
+ self::add_javascript('controller', 'yahoo',
'datatable.js');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('paginator');
+
+ $data = array(
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ array('type' =>
'filter',
+ 'name' =>
'status',
+ 'text' => lang('Status'),
+ 'list' => array(
+ array(
+ 'id' => 'none',
+ 'name' => lang('Not selected')
+ ),
+ array(
+ 'id' => 'NEW',
+ 'name' => lang('NEW')
+ ),
+ array(
+ 'id' => 'PENDING',
+ 'name' => lang('PENDING')
+ ),
+ array(
+ 'id' => 'REJECTED',
+ 'name' => lang('REJECTED')
+ ),
+ array(
+ 'id' => 'ACCEPTED',
+ 'name' => lang('ACCEPTED')
+ )
+ )
+ ),
+ array('type' => 'text',
+ 'text' => lang('searchfield'),
+ 'name' =>
'query'
+ ),
+ array(
+ 'type' =>
'submit',
+ 'name' =>
'search',
+ 'value' =>
lang('Search')
+ ),
+ ),
+ ),
+ ),
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list.index',
'phpgw_return_as' => 'json')),
+ 'field' => array(
+ array(
+ 'key' => 'id',
+ 'label' => lang('ID'),
+ 'sortable' => true,
+ 'formatter' =>
'YAHOO.portico.formatLink'
+ ),
+ array(
+ 'key' => 'title',
+ 'label' =>
lang('Control title'),
+ 'sortable' =>
false
+ ),
+ array(
+ 'key' => 'start_date',
+ 'label' =>
lang('start_date'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'planned_date',
+ 'label' =>
lang('planned_date'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'end_date',
+ 'label' =>
lang('end_date'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'link',
+ 'hidden' => true
+ )
+ )
+ ),
+ );
+//_debug_array($data);
+
+ self::render_template_xsl('datatable', $data);
}
public function view_check_list()
{
$check_list_id = phpgw::get_var('check_list_id');
$check_list =
$this->so_check_list->get_single_with_control_item($check_list_id);
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$data = array
(
- 'check_list' => $check_list
+ 'check_list' => $check_list,
+ 'date_format' => $date_format
);
- //print_r($check_list);
-
self::render_template_xsl('view_check_list', $data);
}
+ public function edit_check_list()
+ {
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list =
$this->so_check_list->get_single_with_control_item($check_list_id);
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $data = array
+ (
+ 'check_list' => $check_list,
+ 'date_format' => $date_format
+ );
+
+ self::render_template_xsl('edit_check_list', $data);
+ }
+
public function view_check_lists_for_control()
{
$control_id = phpgw::get_var('control_id');
$control = $this->so_control->get_single($control_id);
-
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$check_list_array =
$this->so->get_check_lists_for_control( $control_id );
$data = array
(
'control_as_array' => $control->toArray(),
- 'check_list_array' =>
$check_list_array
+ 'check_list_array' => $check_list_array,
+ 'date_format' => $date_format
);
self::render_template_xsl('view_check_lists', $data);
@@ -108,6 +218,25 @@
self::render_template_xsl('view_check_list', $data);
}
+ public function save_check_items(){
+ $check_item_ids = phpgw::get_var('check_item_ids');
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ foreach($check_item_ids as $check_item_id){
+ $status = phpgw::get_var('status_' .
$check_item_id);
+ $comment = phpgw::get_var('comment_' .
$check_item_id);
+
+ $check_item =
$this->so_check_item->get_single($check_item_id);
+
+ $check_item->set_status( $status );
+ $check_item->set_comment( $comment );
+
+ $this->so_check_item->store( $check_item );
+ }
+
+ $this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list', 'check_list_id'=>$check_list_id));
+ }
+
public function save_check_list(){
$control_id = phpgw::get_var('control_id');
$control = $this->so_control->get_single($control_id);
@@ -151,5 +280,107 @@
$this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list_for_control',
'control_id'=>$control_id));
}
- public function query(){}
+ public function make_check_list_for_control(){
+ $control_id = phpgw::get_var('control_id');
+ $control = $this->so_control->get_single($control_id);
+
+ $start_date = $control->get_start_date();
+ $end_date = $control->get_end_date();
+ $repeat_type = $control->get_repeat_type();
+ $repeat_interval = $control->get_repeat_interval();
+
+ $status = true;
+ $comment = "Kommentar for sjekkliste";
+ $deadline = $start_date;
+
+ // Saving check_list
+ $new_check_list = new controller_check_list();
+ $new_check_list->set_control_id( $control_id );
+ $new_check_list->set_status( $status );
+ $new_check_list->set_comment( $comment );
+ $new_check_list->set_deadline( $deadline );
+
+ $check_list_id = $this->so_check_list->store(
$new_check_list );
+
+ $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+
+ foreach($control_items_list as $control_item){
+
+ $status = true;
+ $comment = "Kommentar for sjekk item";
+
+ // Saving check_items for a list
+ $new_check_item = new controller_check_item();
+ $new_check_item->set_check_list_id(
$check_list_id );
+
+ $new_check_item->set_control_item_id(
$control_item->get_id() );
+ $new_check_item->set_status( $status );
+ $new_check_item->set_comment( $comment );
+
+ $saved_check_item =
$this->so_check_item->store( $new_check_item );
+ }
+
+ $this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list_for_control',
'control_id'=>$control_id));
+ }
+
+ public function query()
+ {
+ $params = array(
+ 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
+ 'query' => phpgw::get_var('query'),
+ 'sort' => phpgw::get_var('sort'),
+ 'dir' => phpgw::get_var('dir'),
+ 'filters' => $filters
+ );
+
+ $search_for = phpgw::get_var('query');
+
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+ {
+ $user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ }
+ else {
+ $user_rows_per_page = 10;
+ }
+
+ // YUI variables for paging and sorting
+ $start_index = phpgw::get_var('startIndex', 'int');
+ $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
+ $sort_field = phpgw::get_var('sort');
+ if($sort_field == null)
+ {
+ $sort_field = 'control_id';
+ }
+ $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
+ //Create an empty result set
+ $records = array();
+
+ //Retrieve a contract identifier and load corresponding
contract
+/* $control_id = phpgw::get_var('control_id');
+ if(isset($control_id))
+ {
+ $control = $this->so->get_single($control_id);
+ }
+*/
+ $result_objects = $this->so->get($start_index,
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type,
$filters);
+ $object_count = $this->so->get_count($search_for,
$search_type, $filters);
+ //var_dump($result_objects);
+
+ $results = array();
+
+ foreach($result_objects as $check_list_obj)
+ {
+ $results['results'][] =
$check_list_obj->serialize();
+ }
+
+ $results['total_records'] = $object_count;
+ $results['start'] = $params['start'];
+ $results['sort'] = $params['sort'];
+ $results['dir'] = $params['dir'];
+
+ array_walk($results["results"], array($this,
"_add_links"), "controller.uicheck_list.view_check_lists_for_control");
+
+ return $this->yui_results($results);
+ }
}
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -12,7 +12,8 @@
include_class('controller', 'control_area', 'inc/model/');
include_class('controller', 'control_item_list', 'inc/model/');
include_class('controller', 'control_group_list', 'inc/model/');
-
+ include_class('controller', 'check_item', 'inc/model/');
+
class controller_uicontrol extends controller_uicommon
{
private $bo;
@@ -23,19 +24,23 @@
private $so_control_item;
private $so_control_item_list;
private $so_control_group_list;
+ private $so_check_list_list;
+ private $so_check_item;
public $public_functions = array
(
'index' => true,
'control_list' => true,
'view' => true,
- 'view_control_details' => true,
- 'save_control_details' => true,
- 'view_control_groups' => true,
- 'save_control_groups' => true,
- 'view_control_items' => true,
- 'save_control_items' => true,
- 'view_check_list' => true
+ 'view_control_details' =>
true,
+ 'save_control_details' =>
true,
+ 'view_control_groups' =>
true,
+ 'save_control_groups' =>
true,
+ 'view_control_items' =>
true,
+ 'save_control_items' =>
true,
+ 'view_check_list'
=> true,
+ 'generate_check_lists_for_control' => true,
+ 'view_check_lists_for_control' => true
);
public function __construct()
@@ -50,6 +55,8 @@
$this->so_control_item =
CreateObject('controller.socontrol_item');
$this->so_control_item_list =
CreateObject('controller.socontrol_item_list');
$this->so_control_group_list =
CreateObject('controller.socontrol_group_list');
+ $this->so_check_list =
CreateObject('controller.socheck_list');
+ $this->so_check_item =
CreateObject('controller.socheck_item');
self::set_active_menu('controller::control');
}
@@ -69,7 +76,7 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'status',
- 'text' => lang('Status').':',
+ 'text' => lang('Status'),
'list' => array(
array(
'id' => 'none',
@@ -95,7 +102,7 @@
),
array('type' =>
'filter',
'name' =>
'control_areas',
- 'text' => lang('Control_area').':',
+ 'text' => lang('Control_area'),
'list' =>
$this->so_control_area->get_control_area_select_array(),
),
array('type' => 'text',
@@ -159,7 +166,7 @@
public function view_control_details()
{
- $control_id = phpgw::get_var('control_id');
+ $control_id = phpgw::get_var('id');
if(isset($control_id) && $control_id > 0)
{
@@ -168,15 +175,17 @@
$procedures_array =
$this->so_procedure->get_procedures_as_array();
$control_areas_array =
$this->so_control_area->get_control_areas_as_array();
-
+
$tabs = array( array(
'label' => "1: " .
lang('Details')
), array(
- 'label' => "2: " .
lang('Control_groups')
+ 'label' => "2: " .
lang('Choose_control_groups')
), array(
- 'label' => "3: " .
lang('Control_items')
+ 'label' => "3: " .
lang('Choose_control_items')
), array(
- 'label' => "4: " .
lang('Check_list')
+ 'label' => "4: " .
lang('Sort_check_list')
+ ), array(
+ 'label' => "5: " .
lang('Show_check_lists')
));
$data = array
@@ -233,16 +242,19 @@
array(
'label' => "1: " .
lang('Details'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details', 'view' => "view_control_details",
-
'control_id' => $control_id))
+
'id' => $control_id))
),
array(
- 'label' => "2: " .
lang('Control_groups')
+ 'label' => "2: " .
lang('Choose_control_groups')
),
array(
- 'label' => "3: " .
lang('Control_items')
+ 'label' => "3: " .
lang('Choose_control_items')
),
array(
- 'label' => "4: " .
lang('Check_list')
+ 'label' => "4: " .
lang('Sort_check_list')
+ ),
+ array(
+ 'label' => "5: " .
lang('Show_check_lists')
)
);
@@ -286,18 +298,19 @@
array(
'label' => "1: " .
lang('Details'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details', 'view' => "view_control_details",
-
'control_id' => $control_id))
+
'id' => $control_id))
),
array(
- 'label' => "2: " .
lang('Control_groups'),
+ 'label' => "2: " .
lang('Choose_control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups', 'view' => "view_control_groups",
'control_id' => $control_id, 'control_group_ids' => $control_group_ids,
'control_area_id' => $control->get_control_area_id()))
),
- array('label' => "3: " .
lang('Control_items')),
- array('label' => "4: " .
lang('Check_list'))
+ array('label' => "3: " .
lang('Choose_control_items')),
+ array('label' => "4: " .
lang('Sort_check_list')),
+ array('label' => "5: " .
lang('Show_check_lists'))
);
-
+
$data = array
(
'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 2),
@@ -394,30 +407,28 @@
array(
'label' => "1: " .
lang('Details'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'view' => "view_control_details", 'control_id' => $control_id))
- ),
- array(
- 'label' => "2: " .
lang('Control_groups'),
+
'view' => "view_control_details", 'id' => $control_id))
+ ),array(
+ 'label' => "2: " .
lang('Choose_control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
'view' => "view_control_groups", 'control_id' => $control_id,
'control_group_ids' => $control_group_ids,
'control_area_id' => $control->get_control_area_id()))
- ),
- array(
- 'label' => "3: " .
lang('Control_items'),
+ ),array(
+ 'label' => "3: " .
lang('Choose_control_items'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
'view' => "view_control_items", 'control_id' => $control_id,
'control_group_ids' => $control_group_ids))
- ),
- array(
- 'label' => "4: " .
lang('Check_list')
+ ),array('label' => "4: " .
lang('Sort_check_list')
+ ),array('label' => "5: " .
lang('Show_check_lists')
)
+
);
$data = array
(
'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 3),
- 'view' =>
"check_list",
+ 'view' =>
"sort_check_list",
'control_id' => $control_id,
'control_title' =>
$control_title,
'saved_groups_with_items_array' =>
$saved_groups_with_items_array
@@ -432,6 +443,95 @@
self::render_template_xsl(array('control_tabs',
'sort_check_list'), $data);
}
+ public function generate_check_lists_for_control(){
+ $control_id = phpgw::get_var('control_id');
+ $control = $this->so->get_single($control_id);
+
+ $start_date = $control->get_start_date();
+ $end_date = $control->get_end_date();
+ $repeat_type = $control->get_repeat_type();
+ $repeat_interval = $control->get_repeat_interval();
+
+ $status = false;
+ $comment = "Kommentar for sjekkliste";
+ $deadline = $start_date;
+
+ // Saving check_list
+ $new_check_list = new controller_check_list();
+ $new_check_list->set_control_id( $control_id );
+ $new_check_list->set_status( $status );
+ $new_check_list->set_comment( $comment );
+ $new_check_list->set_deadline( $deadline );
+
+ $check_list_id = $this->so_check_list->store(
$new_check_list );
+
+ $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+
+ foreach($control_items_list as $control_item){
+
+ $status = true;
+ $comment = "Kommentar for sjekk item";
+
+ // Saving check_items for a list
+ $new_check_item = new controller_check_item();
+ $new_check_item->set_check_list_id(
$check_list_id );
+
+ $new_check_item->set_control_item_id(
$control_item->get_id() );
+ $new_check_item->set_status( $status );
+ $new_check_item->set_comment( $comment );
+
+ $saved_check_item =
$this->so_check_item->store( $new_check_item );
+ }
+
+ $this->redirect(array('menuaction' =>
'controller.uicontrol.view_check_lists_for_control', 'control_id'=>$control_id
));
+ }
+
+ public function view_check_lists_for_control()
+ {
+ $control_id = phpgw::get_var('control_id');
+ $control = $this->so->get_single($control_id);
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $check_list_array =
$this->so_check_list->get_check_lists_for_control( $control_id );
+
+ $tabs = array(
+ array(
+ 'label' => "1: " .
lang('Details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
+
'view' => "view_control_details", 'id' => $control_id))
+ ),array(
+ 'label' => "2: " .
lang('Choose_control_groups'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
+
'view' => "view_control_groups", 'control_id' => $control_id,
+
'control_group_ids' => $control_group_ids,
+
'control_area_id' => $control->get_control_area_id()))
+ ),array(
+ 'label' => "3: " .
lang('Choose_control_items'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
+
'view' => "view_control_items", 'control_id' => $control_id,
+
'control_group_ids' => $control_group_ids))
+ ),array('label' => "4: " .
lang('Sort_check_list')
+ ),array('label' => "5: " .
lang('Show_check_lists')
+ )
+
+ );
+
+ $data = array
+ (
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 4),
+ 'view' =>
"view_check_lists",
+ 'control_as_array' => $control->toArray(),
+ 'check_list_array' => $check_list_array,
+ 'date_format' => $date_format
+ );
+
+ self::render_template_xsl(array('control_tabs',
'tab_view_check_lists'), $data);
+ self::add_javascript('controller', 'yahoo',
'control_tabs.js');
+ }
+
+
+
public function query()
{
$params = array(
@@ -494,7 +594,7 @@
$results['sort'] = $params['sort'];
$results['dir'] = $params['dir'];
- array_walk($results["results"], array($this,
"_add_links"), "controller.uicontrol.view_control");
+ array_walk($results["results"], array($this,
"_add_links"), "controller.uicontrol.view_control_details");
return $this->yui_results($results);
}
Modified:
branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/inc/model/class.control_item.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -11,7 +11,6 @@
protected $what_to_do;
protected $how_to_do;
protected $control_group_id;
- protected $control_area_id;
/**
* Constructor. Takes an optional ID. If a contract is
created from outside
@@ -72,21 +71,6 @@
}
public function get_control_group_name() { return
$this->control_group_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; }
-
/**
* Get a static reference to the storage object associated with
this model object
@@ -111,7 +95,6 @@
$result['what_to_do'] = $this->get_what_to_do();
$result['how_to_do'] = $this->get_how_to_do();
$result['control_group'] =
$this->get_control_group_name();
- $result['control_area'] =
$this->get_control_area_name();
return $result;
}
Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang 2011-11-09
08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang 2011-11-09
08:45:50 UTC (rev 8067)
@@ -1,5 +1,11 @@
control controller no Kontroll
control_helptext controller no Her kommer hjelpetekst for å
opprette en kontroll
+Check_list controller no Sjekkliste
+Check_lists controller no Sjekklister
+Choose_control_groups controller no Velg kontrollgrupper
+Choose_control_items controller no Velg kontrollpunkt
+Sort_check_list controller no Sorter sjekkliste
+Show_check_lists controller no Vis sjekklister
title controller no kontroll
close controller no Lukk
clear controller no Nullstill
@@ -261,4 +267,8 @@
Procedure revision date controller no Revisjonsdato
Font Style controller no Font stil
Lists controller no Lister
-Insert Item controller no Sett inn
\ No newline at end of file
+Insert Item controller no Sett inn
+Control title controller no Tittel
+start_date controller no Start dato
+planned_date controller no Planlagt dato
+end_date controller no Slutt dato
\ No newline at end of file
Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php 2011-11-09
08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php 2011-11-09
08:45:50 UTC (rev 8067)
@@ -1,6 +1,6 @@
<?php
$setup_info['controller']['name'] = 'controller';
- $setup_info['controller']['version'] = '0.1.6';
+ $setup_info['controller']['version'] = '0.1.7';
$setup_info['controller']['app_order'] = 100;
$setup_info['controller']['enable'] = 1;
$setup_info['controller']['app_group'] = 'office';
Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -72,7 +72,9 @@
'comment' => array('type' =>
'varchar','precision' => '255','nullable' => false),
'deadline' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
'planned_date' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
- 'completed_date' => array('type' => 'int',
'precision' => 8, 'nullable' => True)
+ 'completed_date' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
+ 'equipment_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'location_code' => array('type' => 'int',
'precision' => 4, 'nullable' => True)
),
'pk' => array('id'),
'fk' => array(),
Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -108,4 +108,25 @@
$GLOBALS['setup_info']['controller']['currentver'] = '0.1.6';
return $GLOBALS['setup_info']['controller']['currentver'];
}
+
+ /* Update Controller from v 0.1.6 to 0.1.7 */
+
+ $test[] = '0.1.6';
+ function controller_upgrade0_1_6()
+ {
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_check_list','location_code',array(
+ 'type' => 'int',
+ 'precision' => 4,
+ 'nullable' => True
+ ));
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_check_list','equipment_id',array(
+ 'type' => 'int',
+ 'precision' => 4,
+ 'nullable' => True
+ ));
+
+ $GLOBALS['setup_info']['controller']['currentver'] = '0.1.7';
+ return $GLOBALS['setup_info']['controller']['currentver'];
+ }
?>
\ No newline at end of file
Modified: branches/Version-1_0-branch/controller/templates/base/control.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control.xsl
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/control.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -72,27 +72,14 @@
<dd>
<xsl:choose>
<xsl:when test="editable">
- <input type="text" name="title"
id="title" value="{control/title}" />
+ <input type="text" name="title"
id="title" value="{control/title}" size="80"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="control/title" />
</xsl:otherwise>
</xsl:choose>
</dd>
- <dt>
- <label
for="description">Beskrivelse</label>
- </dt>
- <dd>
- <xsl:choose>
- <xsl:when test="editable">
- <textarea cols="70" rows="5"
name="description" id="description"><xsl:value-of select="control/description"
/></textarea>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="control/description" disable-output-escaping="yes"/>
- </xsl:otherwise>
- </xsl:choose>
- </dd>
- <dt>
+<dt>
<label
for="start_date">Startdato</label>
</dt>
<dd>
@@ -129,6 +116,19 @@
</xsl:otherwise>
</xsl:choose>
</dd>
+ <dt>
+ <label
for="description">Beskrivelse</label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea cols="70" rows="5"
name="description" id="description"><xsl:value-of select="control/description"
/></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="control/description" disable-output-escaping="yes"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
</dl>
<div class="form-buttons">
Modified: branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -4,7 +4,7 @@
<div class="yui-navset yui-navset-top" id="control_tabview">
<xsl:choose>
<xsl:when test="view = 'control_details'">
- <xsl:call-template name="yui_booking_i18n"/>
+ <xsl:call-template name="yui_booking_i18n"/>
<div class="identifier-header">
<h1><xsl:value-of select="php:function('lang',
'Control')"/></h1>
</div>
@@ -39,13 +39,20 @@
<xsl:value-of disable-output-escaping="yes"
select="tabs" />
<xsl:call-template name="control_items" />
</xsl:when>
- <xsl:when test="view = 'check_list'">
+ <xsl:when test="view = 'sort_check_list'">
<div class="identifier-header">
<h1><xsl:value-of select="php:function('lang',
'Check_list')"/> for <xsl:value-of select="control_title" /></h1>
</div>
<xsl:value-of disable-output-escaping="yes"
select="tabs" />
<xsl:call-template name="sort_check_list" />
</xsl:when>
+ <xsl:when test="view = 'view_check_lists'">
+ <div class="identifier-header">
+ <h1><xsl:value-of select="php:function('lang',
'Check_list')"/> for <xsl:value-of select="control_title" /></h1>
+ </div>
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="tab_view_check_lists" />
+ </xsl:when>
</xsl:choose>
</div>
Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2011-11-09 08:45:50 UTC (rev 8067)
@@ -388,7 +388,7 @@
h1 img, li img {
vertical-align: middle;
}
-
+/*
fieldset h3 {
display:block;
float:left;
@@ -396,7 +396,7 @@
margin:0;
width:120px;
}
-
+*/
/* Set up common form styles. TODO: needs refinement. */
legend, label, input, select {
margin: 0 13px 0 0;
@@ -699,21 +699,34 @@
margin-top:0;
}
-.check_list li div{
- margin:3px;
- width:200px;
- float:left;
- padding:2px;
- text-align:center;
+.check_list li div {
+ float: left;
+ margin: 5px;
+ padding: 2px;
+ text-align: center;
+ width: 190px;
}
-.check_list li.heading{
- font-weight:bold;
- padding-left:25px;
- background:
url("../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png") repeat-x
scroll 0 -100px #D8D8DA;
+#main_content fieldset.check_list_details{
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #243356;
+ padding: 15px;
}
-.check_list li.heading div{
- padding:1px;
+
+#main_content fieldset.check_item_details{
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #243356;
+ padding: 15px;
}
+
+.check_list li.heading {
+ background: url("/pe/phpgwapi/js/yahoo/assets/skins/sam/sprite.png")
repeat-x scroll 0 0 #D8D8D8;
+ height: 20px;
+ padding-left: 25px;
+}
+.check_list li.heading div {
+ margin: 0 5px;
+ padding: 2px;
+}
.check_list li div.order_nr{
width:15px;
}
@@ -731,10 +744,82 @@
.check_list li{
overflow:hidden;
}
-fieldset.control_details label{
+fieldset.check_list_details{
+ clear: both;
+}
+fieldset.check_list_details label{
font-weight:bold;
+ width:150px;
}
+fieldset.check_list_details div{
+ clear:left;
+ margin:5px 0;
+}
+
+fieldset.tab_check_list_details label {
+ display: inline-block;
+ font-weight: bold;
+ width: 100px;
+}
+fieldset.tab_check_list_details {
+ padding: 0 0 10px 0;
+}
+
+
+fieldset.check_list_details textarea{
+ width:400px;
+ height:100px;
+}
+fieldset.check_item_details label{
+ font-weight:normal;
+ vertical-align:top;
+ float:left;
+}
+fieldset.check_item_details h3 {
+ font-size: 15px;
+ font-weight: bold;
+ margin: 10px 0;
+}
+fieldset.check_list_details label{
+ display: inline-block;
+ font-weight: bold;
+ width: 100px;
+}
+.check_item{
+ margin: 25px 0;
+}
+.check_item div{
+ margin: 5px 0;
+ clear:left;
+}
+h2.check_item_details{
+ margin-bottom:5px;
+}
+.check_item textarea{
+ width:400px;
+ height:100px;
+}
+.check_item label{
+ width:150px;
+}
.new_item a#innertoolbar-button{
background: grey;
font-weight: bold;
+}
+#frm_save_check_items input[type="submit"]{
+ padding: 3px 30px;
}
+.form-buttons-top{
+ float: right;
+ margin-bottom:5px;
+}
+.form-buttons-top input[type="submit"]{
+ margin:0;
+}
+#frm_save_check_items h1 {
+ float: left;
+ margin: 5px 0;
+}
+ul.check_list {
+ width: 925px;
+}
\ No newline at end of file
Copied:
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl (from
rev 8066, trunk/controller/templates/base/edit_check_list.xsl)
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
(rev 0)
+++ branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -0,0 +1,91 @@
+<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<div id="main_content">
+
+ <!-- =========================== SHOWS CONTROL ITEMS RECEIPT
=============================== -->
+
+ <form id="frm_save_check_items"
action="index.php?menuaction=controller.uicheck_list.save_check_items"
method="post">
+ <h1>Sjekkliste</h1>
+ <div class="form-buttons-top">
+ <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <input type="submit" name="save_control"
value="{$lang_save}" title = "{$lang_save}" />
+ </div>
+ <fieldset class="check_list_details">
+ <div>
+ <label>Tittel</label>
+ <input>
+ <xsl:attribute
name="name">check_list_status</xsl:attribute>
+ <xsl:attribute name="value"><xsl:value-of
select="check_list/status"/></xsl:attribute>
+ </input>
+ </div>
+ <div>
+ <label>Skal utføres innen</label>
+ <xsl:if test="check_list/deadline != ''">
+ <xsl:value-of
select="php:function('date', $date_format, number(check_list/deadline))"/><br/>
+ </xsl:if>
+ </div>
+ <div>
+ <label>Kommentar</label>
+ <textarea>
+ <xsl:attribute
name="name">check_list_comment</xsl:attribute>
+ <xsl:value-of select="check_list/comment"/>
+ </textarea>
+ </div>
+
+ </fieldset>
+
+ <h2 class="check_item_details">Sjekkpunkter</h2>
+
+ <fieldset class="check_item_details">
+ <xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
+ <input type="hidden" name="check_list_id"
value="{$check_list_id}" />
+
+ <xsl:for-each select="check_list/check_item_array">
+ <xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+ <input type="hidden" name="check_item_ids[]"
value="{$check_item_id}" />
+ </xsl:for-each>
+
+ <xsl:choose>
+ <xsl:when
test="check_list/check_item_array/child::node()">
+ <xsl:for-each
select="check_list/check_item_array">
+ <xsl:variable
name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+
+ <div class="check_item">
+ <h3
class="order_nr"><xsl:number/>. <xsl:value-of select="control_item/title"/></h3>
+ <div>
+ <label>Status</label>
+ <span>
+ <select
name="status_{$check_item_id}">
+
<option value="true">Utført</option>
+
<option value="false">Ikke utført</option>
+ </select>
+ </span>
+ </div>
+ <div>
+ <label>Kommentar</label>
+ <span>
+ <textarea
name="comment_{$check_item_id}">
+
<xsl:value-of select="comment"/>
+ </textarea>
+ </span>
+ </div>
+ <div>
+ <label>Hva skal
gjøres</label><span><xsl:value-of select="control_item/what_to_do"/></span>
+ </div>
+ <div>
+
<label>Utførelsesbeskrivelse</label><span><xsl:value-of
select="control_item/what_to_do"/></span>
+ </div>
+ </div>
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+
+ <div class="form-buttons">
+ <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <input type="submit" name="save_control"
value="{$lang_save}" title = "{$lang_save}" />
+ </div>
+ </fieldset>
+ </form>
+</div>
+</xsl:template>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -54,6 +54,15 @@
</form>
</li>
</xsl:for-each>
- </ul>
+ </ul>
+
+ <a>
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicontrol.generate_check_lists_for_control</xsl:text>
+ <xsl:text>&control_id=</xsl:text>
+ <xsl:value-of select="//control_id"/>
+ </xsl:attribute>
+ <div>Vis sjekklister</div>
+ </a>
</div>
</xsl:template>
\ No newline at end of file
Copied:
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
(from rev 8066, trunk/controller/templates/base/tab_view_check_lists.xsl)
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
(rev 0)
+++
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -0,0 +1,79 @@
+<xsl:template name="tab_view_check_lists" xmlns:php="http://php.net/xsl">
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<div class="yui-content tab_content">
+
+ <!-- =========================== SHOWS CONTROL ITEMS RECEIPT
=============================== -->
+ <xsl:variable name="control_id"><xsl:value-of
select="control_id"/></xsl:variable>
+ <input type="hidden" id="control_id" name="control_id"
value="{control_id}" />
+
+ <fieldset class="tab_check_list_details">
+ <label>Startdato</label>
+ <xsl:if test="control_as_array/start_date != ''">
+ <xsl:value-of select="php:function('date',
$date_format, number(control_as_array/start_date))"/><br/>
+ </xsl:if>
+ <label>Sluttdato</label>
+ <xsl:if test="control_as_array/end_date != ''">
+ <xsl:value-of select="php:function('date',
$date_format, number(control_as_array/end_date))"/><br/>
+ </xsl:if>
+ <label>Syklustype</label><xsl:value-of
select="control_as_array/repeat_type"/><br/>
+ <label>Syklusfrekvens</label><xsl:value-of
select="control_as_array/repeat_interval"/><br/>
+ </fieldset>
+
+ <ul class="check_list">
+ <li class="heading">
+ <div class="status">Status</div>
+ <div>Skal utføres innen dato</div>
+ <div>Planlagt utført dato</div>
+ <div>Ble utført dato</div>
+ <div>Kommentar</div>
+ </li>
+ <xsl:choose>
+ <xsl:when test="check_list_array/child::node()">
+ <xsl:for-each select="check_list_array">
+ <li>
+ <div
class="order_nr"><xsl:number/>.</div>
+ <div class="status">
+ <xsl:variable
name="status"><xsl:value-of select="status"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when
test="status = 1">
+ <img
height="15" src="controller/images/status_icon_light_green.png" />
+ </xsl:when>
+ <xsl:otherwise>
+ <img
height="15" src="controller/images/status_icon_red.png" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ <div>
+ <a>
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
+
<xsl:text>&check_list_id=</xsl:text>
+
<xsl:value-of select="id"/>
+
</xsl:attribute>
+ <xsl:if
test="deadline != ''">
+
<xsl:value-of select="php:function('date', $date_format, number(deadline))"/>
+ </xsl:if>
+ </a>
+ </div>
+ <div>
+ <xsl:if
test="planned_date != ''">
+ <xsl:value-of
select="php:function('date', $date_format, number(planned_date))"/>
+ </xsl:if>
+ </div>
+ <div>
+ <xsl:if
test="completed_date != ''">
+ <xsl:value-of
select="php:function('date', $date_format, number(completed_date))"/>
+ </xsl:if>
+ </div>
+ <div><xsl:value-of
select="comment"/></div>
+ </li>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ Ingen sjekklister for denne kontrollen
+ </xsl:otherwise>
+ </xsl:choose>
+ </ul>
+</div>
+</xsl:template>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -1,4 +1,5 @@
<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
<div id="main_content">
@@ -7,8 +8,11 @@
<h1>Sjekkliste</h1>
<fieldset class="control_details">
<label>Tittel</label><xsl:value-of
select="check_list/status"/><br/>
- <label>Startdato</label><xsl:value-of
select="check_list/comment"/><br/>
- <label>Sluttdato</label><xsl:value-of
select="check_list/deadline"/><br/>
+ <label>Kommentar</label><xsl:value-of
select="check_list/comment"/><br/>
+ <label>Skal utføres innen</label>
+ <xsl:if test="check_list/deadline != ''">
+ <xsl:value-of select="php:function('date',
$date_format, number(check_list/deadline))"/><br/>
+ </xsl:if>
</fieldset>
<h2>Sjekkpunkter</h2>
@@ -30,6 +34,9 @@
<xsl:when
test="status = 1">
<img
height="15" src="controller/images/status_icon_light_green.png" />
</xsl:when>
+ <xsl:otherwise>
+ <img
height="15" src="controller/images/status_icon_red.png" />
+ </xsl:otherwise>
</xsl:choose>
</div>
<div class="title"><xsl:value-of
select="control_item/title"/></div>
@@ -42,5 +49,15 @@
</xsl:otherwise>
</xsl:choose>
</ul>
+
+ <a>
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
+ <xsl:text>&check_list_id=</xsl:text>
+ <xsl:value-of select="check_list/id"/>
+ </xsl:attribute>
+ <div>Registrer sjekkliste</div>
+ </a>
+
</div>
</xsl:template>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
2011-11-09 08:45:50 UTC (rev 8067)
@@ -1,4 +1,5 @@
-<xsl:template match="data" name="view_check_list"
xmlns:php="http://php.net/xsl">
+<xsl:template match="data" name="view_check_lists"
xmlns:php="http://php.net/xsl">
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
<div id="main_content">
@@ -7,10 +8,16 @@
<input type="hidden" id="control_id" name="control_id"
value="{control_id}" />
<h1>Sjekklister for kontroll</h1>
- <fieldset class="control_details">
+ <fieldset class="check_list_details">
<label>Tittel</label><xsl:value-of
select="control_as_array/title"/><br/>
- <label>Startdato</label><xsl:value-of
select="control_as_array/start_date"/><br/>
- <label>Sluttdato</label><xsl:value-of
select="control_as_array/end_date"/><br/>
+ <label>Startdato</label>
+ <xsl:if test="control_as_array/start_date != ''">
+ <xsl:value-of select="php:function('date',
$date_format, number(control_as_array/start_date))"/><br/>
+ </xsl:if>
+ <label>Sluttdato</label>
+ <xsl:if test="control_as_array/end_date != ''">
+ <xsl:value-of select="php:function('date',
$date_format, number(control_as_array/end_date))"/><br/>
+ </xsl:if>
<label>Syklustype</label><xsl:value-of
select="control_as_array/repeat_type"/><br/>
<label>Syklusfrekvens</label><xsl:value-of
select="control_as_array/repeat_interval"/><br/>
</fieldset>
@@ -36,7 +43,7 @@
<img
height="15" src="controller/images/status_icon_light_green.png" />
</xsl:when>
<xsl:otherwise>
- Ingen
sjekklister for denne kontrollen
+ <img
height="15" src="controller/images/status_icon_red.png" />
</xsl:otherwise>
</xsl:choose>
</div>
@@ -47,11 +54,21 @@
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="id"/>
</xsl:attribute>
-
<xsl:value-of select="deadline"/>
+ <xsl:if
test="deadline != ''">
+
<xsl:value-of select="php:function('date', $date_format, number(deadline))"/>
+ </xsl:if>
</a>
</div>
- <div><xsl:value-of
select="planned_date"/></div>
- <div><xsl:value-of
select="completed_date"/></div>
+ <div>
+ <xsl:if
test="planned_date != ''">
+ <xsl:value-of
select="php:function('date', $date_format, number(planned_date))"/>
+ </xsl:if>
+ </div>
+ <div>
+ <xsl:if
test="completed_date != ''">
+ <xsl:value-of
select="php:function('date', $date_format, number(completed_date))"/>
+ </xsl:if>
+ </div>
<div><xsl:value-of
select="comment"/></div>
</li>
</xsl:for-each>
Modified: branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-11-09 08:43:48 UTC (rev 8066)
+++ branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-11-09 08:45:50 UTC (rev 8067)
@@ -2390,10 +2390,32 @@
$_keys[] =
$_substitute;
$_values[] =
urlencode($values[trim($_substitute, '_')]);
}
- $integration_src .= '&'
. str_replace($_keys, $_values, $_config_section_data['location_data']);
+ //$integration_src .=
'&' . str_replace($_keys, $_values, $_config_section_data['location_data']);
+ $integration_src .=
'ctittel=5374.019%';
}
$integration_src .=
"&{$_config_section_data['auth_key_name']}={$response}";
+
+ //FIXME NOT WORKING!! test for
webservice, auth...
+
if(isset($_config_section_data['method']) && $_config_section_data['method'] ==
'POST')
+ {
+ $aContext = array
+ (
+ 'http' => array
+ (
+
'method' => 'POST',
+
'request_fulluri' => true,
+ ),
+ );
+
+
if(isset($GLOBALS['phpgw_info']['server']['httpproxy_server']))
+ {
+
$aContext['http']['proxy'] =
"{$GLOBALS['phpgw_info']['server']['httpproxy_server']}:{$GLOBALS['phpgw_info']['server']['httpproxy_port']}";
+ }
+
+ $cxContext =
stream_context_create($aContext);
+ $response =
trim(file_get_contents($integration_src, False, $cxContext));
+ }
//_debug_array($values);
//_debug_array($integration_src);die();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8067] Merge 8042:8066 from trunk,
Sigurd Nes <=