[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8963] Merge 8954:8962 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8963] Merge 8954:8962 from trunk |
Date: |
Tue, 06 Mar 2012 07:38:38 +0000 |
Revision: 8963
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8963
Author: sigurdne
Date: 2012-03-06 07:38:37 +0000 (Tue, 06 Mar 2012)
Log Message:
-----------
Merge 8954:8962 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/inc/class.cat_hooks.inc.php
branches/Version-1_0-branch/controller/inc/class.menu.inc.php
branches/Version-1_0-branch/preferences/inc/class.boadmin_acl.inc.php
branches/Version-1_0-branch/property/inc/class.boresponsible.inc.php
branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
branches/Version-1_0-branch/property/inc/class.uiresponsible.inc.php
branches/Version-1_0-branch/property/inc/class.uitenant_claim.inc.php
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php
branches/Version-1_0-branch/property/setup/setup.inc.php
branches/Version-1_0-branch/property/setup/tables_current.inc.php
branches/Version-1_0-branch/property/setup/tables_update.inc.php
branches/Version-1_0-branch/property/templates/base/responsible.xsl
Added Paths:
-----------
branches/Version-1_0-branch/property/js/yahoo/responsible.edit.js
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
+
/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
Modified: branches/Version-1_0-branch/controller/inc/class.cat_hooks.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.cat_hooks.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/controller/inc/class.cat_hooks.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -60,6 +60,7 @@
}
$GLOBALS['phpgw']->locations->add("{$location}.category.{$data['cat_id']}",
$data['cat_name'], 'controller');
+/*
$this->soresponsible->add_type(array
(
'name' => $data['cat_name'],
@@ -69,6 +70,7 @@
'active' => true
)
);
+*/
}
/**
@@ -85,7 +87,7 @@
$location_info =
$GLOBALS['phpgw']->locations->get_name($data['location_id']);
$location =
"{$location_info['location']}.category.{$data['cat_id']}";
$GLOBALS['phpgw']->locations->delete('controller', $location, false);
- $this->_db->query("DELETE FROM
fm_responsibility WHERE cat_id = " . (int) $data['cat_id'], __LINE__, __FILE__);
+// $this->_db->query("DELETE FROM
fm_responsibility WHERE cat_id = " . (int) $data['cat_id'], __LINE__, __FILE__);
}
}
@@ -105,11 +107,13 @@
$location =
"{$location_info['location']}.category.{$data['cat_id']}";
$GLOBALS['phpgw']->locations->update_description($location, $data['cat_name'],
'controller');
+/*
$value_set['name'] =
$this->_db->db_addslashes($data['cat_name']);
$value_set['descr'] =
$value_set['name'];
$value_set =
$this->_db->validate_update($value_set);
$this->_db->query("UPDATE fm_responsibility SET
$value_set WHERE cat_id = " . (int) $data['cat_id'], __LINE__, __FILE__);
+*/
}
}
}
Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -162,11 +162,6 @@
'text' => lang('Control area'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'controller', 'location' =>
'.control', 'global_cats' => 'true', 'menu_selection' =>
'admin::controller::control_cats') )
),
- 'responsibility_role' => array
- (
- 'text' => lang('responsibility
role'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'responsibility_role', 'appname' =>
'controller') )
- ),
'role_at_location' => array
(
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uilocation.responsiblility_role', 'menu_selection' =>
'admin::controller::role_at_location') ),
Modified: branches/Version-1_0-branch/preferences/inc/class.boadmin_acl.inc.php
===================================================================
--- branches/Version-1_0-branch/preferences/inc/class.boadmin_acl.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/preferences/inc/class.boadmin_acl.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -174,12 +174,14 @@
{
$location_list = array();
- $grant = isset($data['grant']) &&
$data['grant'] ? $data['grant'] : false;
- $grant = isset($data['allow_c_attrib']) &&
$data['allow_c_attrib'] ? $data['allow_c_attrib'] : false;
- $acl_app = isset($data['acl_app']) &&
$data['acl_app'] ? $data['acl_app'] :
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $selected = isset($data['selected']) &&
$data['selected'] ? $data['selected'] : '';
+ $grant = isset($data['grant'])
&& $data['grant'] ? $data['grant'] : false;
+ $grant =
isset($data['allow_c_attrib']) && $data['allow_c_attrib'] ?
$data['allow_c_attrib'] : false;
+ $acl_app =
isset($data['acl_app']) && $data['acl_app'] ? $data['acl_app'] :
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $selected =
isset($data['selected']) && $data['selected'] ? $data['selected'] : '';
+ $c_function =
isset($data['$c_function']) && $data['$c_function'] ? true : false;
+ $have_categories =
isset($data['have_categories']) && $data['have_categories'] ? true : false;
- $locations =
$GLOBALS['phpgw']->locations->get_locations($grant, $acl_app, $allow_c_attrib);
+ $locations =
$GLOBALS['phpgw']->locations->get_locations($grant, $acl_app, $allow_c_attrib,
$c_function, $have_categories);
foreach ( $locations as $loc_id => $loc_descr )
{
Modified: branches/Version-1_0-branch/property/inc/class.boresponsible.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boresponsible.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.boresponsible.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -289,6 +289,27 @@
}
/**
+ * Save responsibility role
+ *
+ * @param array $values values to be stored/edited and
referencing ID if editing
+ *
+ * @return array $receip with result on the
action(failed/success)
+ */
+
+ public function save_role($values)
+ {
+ if (isset($values['id']) && $values['id'])
+ {
+ $receipt = $this->so->edit_role($values);
+ }
+ else
+ {
+ $receipt = $this->so->add_role($values);
+ }
+ return $receipt;
+ }
+
+ /**
* Save responsibility contact
*
* @param array $values values to be stored/edited and
referencing ID if editing
@@ -430,6 +451,35 @@
}
/**
+ * Read single responsibility type
+ *
+ * @param integer $id ID of responsibility type
+ *
+ * @return array holding data of responsibility type
+ */
+
+ public function read_single_role($id)
+ {
+ $values = $this->so->read_single_role($id);
+ return $values;
+ }
+
+ /**
+ * Read single responsibility
+ *
+ * @param integer $id ID of responsibility type
+ *
+ * @return array holding data of responsibility type
+ */
+
+ public function read_single($id)
+ {
+ $values = $this->so->read_single($id);
+ $values['entry_date'] =
$GLOBALS['phpgw']->common->show_date($values['created_on'], $this->dateformat);
+ return $values;
+ }
+
+ /**
* Read single contact for responsibility type at physical
location
*
* @param integer $id ID of responsibility type
Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -1937,14 +1937,15 @@
),
array
(
- 'name'
=> 'location',
- 'descr'
=> lang('location'),
+ 'name'
=> 'location_level',
+ 'descr'
=> lang('location level'),
'type'
=> 'select',
'values_def'
=> array
(
'valueset' => false,
'method' => 'preferences.boadmin_acl.get_locations',
'method_input' => array('acl_app' => 'property', 'selected' =>
'##location##')
+//
'method_input' => array('acl_app' => '$this->appname', 'selected' =>
'##location##', 'have_categories' => true)
)
),
array
@@ -1960,6 +1961,7 @@
)
)
),
+ 'edit_action' =>
'property.uiresponsible.edit_role',
'edit_msg'
=> lang('edit'),
'add_msg'
=> lang('add'),
'name'
=> lang('responsibility role'),
@@ -2259,7 +2261,14 @@
$_filter = array();
foreach ($data['filter'] as $_field => $_value)
{
- $_filter[] = "{$_field} = '{$_value}'";
+ if($data['filter_method'] == 'like')
+ {
+ $_filter[] = "{$_field}
{$this->_db->like} '%{$_value}%'";
+ }
+ else
+ {
+ $_filter[] = "{$_field} =
'{$_value}'";
+ }
}
if($_filter)
{
Modified: branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -93,7 +93,7 @@
$ordermethod = ' order by fm_responsibility.id
DESC';
}
- $where= 'AND';
+ $where= 'WHERE';
$filtermethod = '';
/*
@@ -102,23 +102,25 @@
$filtermethod .= " $where cat_id IN (" .
implode(',', $filter) . ')';
$where = 'AND';
}
- */
+
if($location)
{
- $filtermethod .= " $where
fm_responsibility.location_id =" .
$GLOBALS['phpgw']->locations->get_id($this->appname, $location);
+ $filtermethod .= " $where
fm_responsibility_module.location_id =" .
$GLOBALS['phpgw']->locations->get_id($this->appname, $location);
$where = 'AND';
}
-
+ */
$querymethod = '';
if($query)
{
- $querymethod = "$where (fm_responsibility.name
$this->like '%$query%' OR fm_responsibility.descr $this->like '%$query%')";
+ $querymethod = "$where (fm_responsibility.name
{$this->like} '%$query%' OR fm_responsibility.descr {$this->like} '%$query%')";
}
- $sql = "SELECT fm_responsibility.*,
phpgw_locations.name as location FROM fm_responsibility"
- . " {$this->join} phpgw_locations ON
fm_responsibility.location_id = phpgw_locations.location_id"
- . " {$this->join} phpgw_applications ON
phpgw_locations.app_id = phpgw_applications.app_id"
- . " WHERE app_name = '{$appname}' $filtermethod
$querymethod";
+ $sql = "SELECT fm_responsibility.* FROM
fm_responsibility"
+// . " {$this->join} fm_responsibility_module ON
fm_responsibility.id = fm_responsibility_module.responsibility_id"
+// . " {$this->join} phpgw_locations ON
fm_responsibility_module.location_id = phpgw_locations.location_id"
+// . " {$this->join} phpgw_applications ON
phpgw_locations.app_id = phpgw_applications.app_id"
+ . " {$filtermethod} {$querymethod}";
+// . " WHERE app_name = '{$appname}' $filtermethod
$querymethod";
$this->db->query($sql, __LINE__, __FILE__);
$this->total_records = $this->db->num_rows();
@@ -137,42 +139,66 @@
while ($this->db->next_record())
{
$values[] = array
- (
- 'id' =>
$this->db->f('id'),
- 'name' =>
$this->db->f('name', true),
- 'descr' =>
$this->db->f('descr', true),
- 'active' =>
$this->db->f('active'),
- 'location' =>
$this->db->f('location'),
- 'cat_id' =>
$this->db->f('cat_id'),
- 'created_by' =>
$this->db->f('created_by'),
- 'created_on' =>
$this->db->f('created_on'),
- );
+ (
+ 'id' =>
$this->db->f('id'),
+ 'name' =>
$this->db->f('name', true),
+ 'descr' =>
$this->db->f('descr', true),
+ 'active' =>
$this->db->f('active'),
+ 'location' =>
$this->db->f('location'),
+ 'cat_id' =>
$this->db->f('cat_id'),
+ 'created_by' =>
$this->db->f('created_by'),
+ 'created_on' =>
$this->db->f('created_on'),
+ );
}
+ $cats = CreateObject('phpgwapi.categories', -1);
+ foreach($values as &$entry)
+ {
+ $sql = "SELECT location_id, cat_id FROM
fm_responsibility_module WHERE responsibility_id = {$entry['id']}";
+ $this->db->query($sql, __LINE__, __FILE__);
+ $locations = array();
+ while ($this->db->next_record())
+ {
+ $location_id =
$this->db->f('location_id');
+ $cat_id = $this->db->f('cat_id');
+ $locations["{$location_id}_{$cat_id}"]
= true;
+ }
+ $__location_info = array();
+ foreach($locations as $location => $dummy)
+ {
+
+ $location_arr = explode('_', $location);
+ $_location_info =
$GLOBALS['phpgw']->locations->get_name($location_arr[0]);
+
+ $category =
$cats->return_single($location_arr[1]);
+
+ $__location_info[] =
"{$_location_info['appname']}::{$_location_info['location']}::{$category[0]['name']}({$location_arr[1]})";
+ }
+ $entry['appname'] = implode(' | ',
$__location_info);
+ }
+
+//_debug_array($values);die();
return $values;
}
/**
* Add responsibility type
*
- * @param array $values values to be stored/edited and
referencing ID if editing
+ * @param array $data values to be stored/edited and
referencing ID if editing
*
* @return array $receip with result on the
action(failed/success)
*/
- public function add_type($values)
+ public function add_type($data)
{
$receipt = array();
- $values['name'] =
$this->db->db_addslashes($values['name']);
- $values['descr'] =
$this->db->db_addslashes($values['descr']);
+ $data['name'] = $this->db->db_addslashes($data['name']);
+ $data['descr'] =
$this->db->db_addslashes($data['descr']);
$insert_values = array
(
- $values['name'],
- $values['descr'],
-
$GLOBALS['phpgw']->locations->get_id($this->appname, $values['location']),
- (int) $values['cat_id'],
- isset($values['active']) ? !!$values['active']
: '',
+ $data['name'],
+ $data['descr'],
$this->account,
time()
);
@@ -181,13 +207,38 @@
$this->db->transaction_begin();
- $this->db->query("INSERT INTO fm_responsibility (name,
descr,location_id, cat_id, active, created_by, created_on) "
+ $this->db->query("INSERT INTO fm_responsibility (name,
descr, created_by, created_on) "
. "VALUES ($insert_values)", __LINE__,
__FILE__);
+ $id =
$this->db->get_last_insert_id('fm_responsibility', 'id');
+
+ if($data['cat_id'])
+ {
+ $location_id =
$GLOBALS['phpgw']->locations->get_id( $data['appname'], $data['location']);
+
+ $this->db->query("SELECT * FROM
fm_responsibility_module WHERE location_id = " . (int) $location_id . ' AND
cat_id = ' . (int)$data['cat_id'], __LINE__, __FILE__);
+
+ if(!$this->db->next_record())
+ {
+ $value_set = array();
+
+ $value_set['responsibility_id']
= $id;
+ $value_set['location_id']
= $location_id;
+ $value_set['cat_id']
= (int) $data['cat_id'];
+ $value_set['active']
= 1;//isset($data['active']) ? !!$data['active'] : '';
+ $value_set['created_on']
= time();
+ $value_set['created_by']
= $this->account;
+
+ $cols = implode(',',
array_keys($value_set));
+ $values =
$this->db->validate_insert(array_values($value_set));
+ $this->db->query("INSERT INTO
fm_responsibility_module ({$cols}) VALUES ({$values})",__LINE__,__FILE__);
+ }
+ }
+
if($this->db->transaction_commit())
{
-
$receipt['message'][]=array('msg'=>lang('Responsibility type has been saved'));
- $receipt['id']=
$this->db->get_last_insert_id('fm_responsibility', 'id');
+ $receipt['message'][] =
array('msg'=>lang('Responsibility type has been saved'));
+ $receipt['id'] = $id;
}
else
{
@@ -200,26 +251,69 @@
/**
* Edit responsibility type
*
- * @param array $values values to be stored/edited and
referencing ID if editing
+ * @param array $data values to be stored/edited and
referencing ID if editing
*
* @return array $receip with result on the
action(failed/success)
*/
- public function edit_type($values)
+ public function edit_type($data)
{
$receipt = array();
- $value_set['name'] =
$this->db->db_addslashes($values['name']);
- $value_set['descr'] =
$this->db->db_addslashes($values['descr']);
- $value_set['cat_id'] = (int) $values['cat_id'];
- $value_set['active'] = isset($values['active']) ?
!!$values['active'] : '';
+ $value_set = array();
+ $value_set['name'] =
$this->db->db_addslashes($data['name']);
+ $value_set['descr'] =
$this->db->db_addslashes($data['descr']);
$value_set =
$this->db->validate_update($value_set);
$this->db->transaction_begin();
- $this->db->query("UPDATE fm_responsibility set
$value_set WHERE id = " . (int) $values['id'], __LINE__, __FILE__);
+ $this->db->query("UPDATE fm_responsibility SET
$value_set WHERE id = " . (int) $data['id'], __LINE__, __FILE__);
+ $this->db->query("UPDATE fm_responsibility_module SET
active = NULL WHERE responsibility_id = " . (int) $data['id'], __LINE__,
__FILE__);
- $receipt['id']= $values['id'];
+ if($data['cat_id'])
+ {
+ $location_id =
$GLOBALS['phpgw']->locations->get_id( $data['appname'], $data['location']);
+
+ $this->db->query("SELECT * FROM
fm_responsibility_module WHERE responsibility_id = " . (int) $data['id'] . '
AND location_id = ' . (int) $location_id . ' AND cat_id = ' .
(int)$data['cat_id'], __LINE__, __FILE__);
+
+ if(!$this->db->next_record())
+ {
+ $value_set = array();
+
+ $value_set['responsibility_id']
= (int) $data['id'];
+ $value_set['location_id']
= $location_id;
+ $value_set['cat_id']
= (int) $data['cat_id'];
+ $value_set['active']
= 1;//isset($data['active']) ? !!$data['active'] : '';
+ $value_set['created_on']
= time();
+ $value_set['created_by']
= $this->account;
+
+ $cols = implode(',',
array_keys($value_set));
+ $values =
$this->db->validate_insert(array_values($value_set));
+ $this->db->query("INSERT INTO
fm_responsibility_module ({$cols}) VALUES ({$values})",__LINE__,__FILE__);
+ }
+ }
+
+//_debug_array($data);die();
+ if(isset($data['delete_module']) &&
$data['delete_module'])
+ {
+ foreach($data['delete_module'] as $to_delete)
+ {
+ $_to_delete = explode('_', $to_delete);
+ $this->db->query("DELETE FROM
fm_responsibility_module WHERE location_id = " . (int) $_to_delete[0] . ' AND
cat_id = ' . (int) $_to_delete[1], __LINE__, __FILE__);
+ }
+ }
+
+ if(isset($data['set_active']) && $data['set_active'])
+ {
+ foreach($data['set_active'] as $set_active)
+ {
+ $_set_active = explode('_',
$set_active);
+ $this->db->query("UPDATE
fm_responsibility_module SET active = 1 WHERE location_id = " . (int)
$_set_active[0] . ' AND cat_id = ' . (int) $_set_active[1], __LINE__, __FILE__);
+ }
+ }
+//_debug_array($data);die();
+
+ $receipt['id']= $data['id'];
if($this->db->transaction_commit())
{
$receipt['message'][]=array('msg'=>lang('responsibility type has been edited'));
@@ -263,6 +357,120 @@
}
/**
+ * Read single responsibility role
+ *
+ * @param integer $id ID of responsibility role
+ *
+ * @return array Responsibility type
+ */
+
+ public function read_single_role($id)
+ {
+ $sql = 'SELECT * FROM fm_responsibility_role WHERE id=
' . (int) $id;
+
+ $this->db->query($sql, __LINE__, __FILE__);
+
+ $values = array();
+
+ $this->db->next_record();
+ $values = array
+ (
+ 'id' =>
$this->db->f('id'),
+ 'name' =>
$this->db->f('name', true),
+ 'remark' =>
$this->db->f('remark', true),
+ 'location_level' => explode(',',
ltrim($this->db->f('location_level'), '.location.')),
+ 'responsibility_id' =>
$this->db->f('responsibility_id'),
+ 'user_id' =>
$this->db->f('user_id'),
+ 'entry_date' =>
$this->db->f('entry_date'),
+ 'modified_date' =>
$this->db->f('modified_date'),
+ 'appname' =>
$this->db->f('appname'),
+ );
+
+ return $values;
+ }
+
+
+
+ public function edit_role($data)
+ {
+ $receipt = array();
+
+ $value_set['name']
=$this->db->db_addslashes($data['name']);
+ $value_set['remark'] =
$this->db->db_addslashes($data['remark']);
+ $value_set['responsibility_id'] =
$data['responsibility_id'];
+ $value_set['location_level']
= implode(',', $data['location_level']);
+ $value_set['modified_date'] =
time();
+
+
+ $value_set =
$this->db->validate_update($value_set);
+
+ $this->db->transaction_begin();
+
+ $this->db->query("UPDATE fm_responsibility_role set
$value_set WHERE id = " . (int) $data['id'], __LINE__, __FILE__);
+
+ if($this->db->transaction_commit())
+ {
+
$receipt['message'][]=array('msg'=>lang('Responsibility role has been
changed'));
+ }
+ else
+ {
+
$receipt['message'][]=array('msg'=>lang('Nothing changed'));
+ }
+ $receipt['id']= $data['id'];
+
+ return $receipt;
+ }
+
+
+ /**
+ * Read single responsibility type
+ *
+ * @param integer $id ID of responsibility type
+ *
+ * @return array Responsibility type
+ */
+
+ public function read_single($id)
+ {
+ $sql = 'SELECT * FROM fm_responsibility WHERE id= ' .
(int) $id;
+
+ $this->db->query($sql, __LINE__, __FILE__);
+
+ $values = array();
+
+ if( $this->db->next_record())
+ {
+ $values = array
+ (
+ 'id' =>
$this->db->f('id'),
+ 'name' =>
$this->db->f('name', true),
+ 'descr' =>
$this->db->f('descr', true),
+ 'active' =>
$this->db->f('active'),
+ 'cat_id' =>
$this->db->f('cat_id'),
+ 'created_by' =>
$this->db->f('created_by'),
+ 'created_on' =>
$this->db->f('created_on'),
+ );
+
+ $sql = 'SELECT * FROM fm_responsibility_module
WHERE responsibility_id= ' . (int) $id;
+ $this->db->query($sql, __LINE__, __FILE__);
+ while ($this->db->next_record())
+ {
+ $values['module'][] = array
+ (
+ 'location_id' =>
$this->db->f('location_id'),
+ 'cat_id'
=> $this->db->f('cat_id'),
+ 'active'
=> $this->db->f('active'),
+ 'created_on' =>
$this->db->f('created_on'),
+ 'created_by' =>
$this->db->f('created_by'),
+ );
+ }
+ }
+
+ return $values;
+ }
+
+
+ /**
* Delete responsibility type
*
* @param integer $id ID of responsibility type
@@ -273,6 +481,7 @@
function delete_type($id)
{
$this->db->transaction_begin();
+ $this->db->query('DELETE FROM fm_responsibility_module
WHERE responsibility_id=' . (int) $id, __LINE__, __FILE__);
$this->db->query('DELETE FROM fm_responsibility_contact
WHERE responsibility_id=' . (int) $id, __LINE__, __FILE__);
$this->db->query('DELETE FROM fm_responsibility WHERE
id=' . (int) $id, __LINE__, __FILE__);
$this->db->transaction_commit();
@@ -486,7 +695,7 @@
{
$sql = "SELECT fm_responsibility_contact.*,
fm_responsibility.name as responsibility_name"
. " FROM fm_responsibility_contact"
- . " $this->join fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
. ' WHERE fm_responsibility_contact.id=' .
(int) $id;
$this->db->query($sql, __LINE__, __FILE__);
@@ -546,7 +755,7 @@
$value_set['expired_on'] = time();
$value_set =
$this->db->validate_update($value_set);
$this->db->transaction_begin();
- $this->db->query("UPDATE fm_responsibility_contact set
$value_set WHERE id = " . (int) $id, __LINE__, __FILE__);
+ $this->db->query("UPDATE fm_responsibility_contact SET
{$value_set} WHERE id = " . (int) $id, __LINE__, __FILE__);
$this->db->transaction_commit();
}
@@ -565,8 +774,8 @@
$time = time() +1;
$sql = "SELECT fm_responsibility_contact.id, contact_id
FROM fm_responsibility_contact"
- . " $this->join fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
- . " $this->join fm_responsibility_role ON
fm_responsibility.id = fm_responsibility_role.responsibility_id"
+ . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility_role ON
fm_responsibility.id = fm_responsibility_role.responsibility_id"
. " WHERE fm_responsibility_role.id ={$role_id}"
. " AND fm_responsibility_contact.location_code
='{$location_code}'"
. " AND active_from < {$time} AND (active_to >
{$time} OR active_to = 0) AND expired_on IS NULL";
@@ -589,42 +798,47 @@
* Get the responsibility for a particular category conserning
a given location or item
* Locations are checked bottom up at the deepest level -
before checkin on it's parent if it is a miss.
*
- * @param array $values containing cat_id, location_code and
optional item-information
+ * @param array $data containing cat_id, location_code and
optional item-information
*
* @return contact_id
*/
- public function get_responsible($values = array())
+ public function get_responsible($data = array())
{
$location_filter = array();
$todo = false;
$item_filter = '';
- if(isset($values['ecodimb']) && $values['ecodimb'])
+ if(isset($data['ecodimb']) && $data['ecodimb'])
{
- $item_filter = " AND ecodimb =
'{$values['ecodimb']}'";
+ $item_filter = " AND ecodimb =
'{$data['ecodimb']}'";
$location_filter[] = '';
$todo = true;
}
- elseif(isset($values['extra']['p_entity_id']) &&
$values['extra']['p_entity_id'])
+ elseif(isset($data['extra']['p_entity_id']) &&
$data['extra']['p_entity_id'])
{
- $location_code = implode('-',
$values['location']);
+ $location_code = implode('-',
$data['location']);
- $item_filter = " AND p_num =
'{$values['extra']['p_num']}'"
- .' AND p_entity_id =' . (int)
$values['extra']['p_entity_id']
- .' AND p_cat_id =' . (int)
$values['extra']['p_cat_id'];
+ $item_filter = " AND p_num =
'{$data['extra']['p_num']}'"
+ .' AND p_entity_id =' . (int)
$data['extra']['p_entity_id']
+ .' AND p_cat_id =' . (int)
$data['extra']['p_cat_id'];
$location_filter[] = " AND location_code =
'{$location_code}'";
$ordermethod = '';
$todo = true;
}
- else if(isset($values['location']) &&
$values['location'])
+ else if(isset($data['location']) && $data['location'])
{
+ if(!is_array($data['location']))
+ {
+ throw new
exception('soresponsible::get_responsible(): location-input needs to be an
array');
+ }
+
$location_filter[] = ''; // when the
responsibility is generic - not located to any location
$location_code = '';
$location_array = array();
- foreach ($values['location'] as $location)
+ foreach ($data['location'] as $location)
{
$location_array[] = $location;
$location_code = implode('-',
$location_array);
@@ -644,8 +858,9 @@
}
$sql = "SELECT contact_id FROM
fm_responsibility_contact"
- . " $this->join fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
- . ' WHERE cat_id =' . (int) $values['cat_id']
+ . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility_module ON
fm_responsibility.id = fm_responsibility_module.responsibility_id"
+ . ' WHERE cat_id =' . (int) $data['cat_id']
. ' AND active = 1 AND active_from < ' . time()
. ' AND (active_to > ' . time() . ' OR active_to = 0) AND expired_on IS NULL'
. " {$item_filter}";
@@ -692,7 +907,7 @@
$responsibility_id = (int)$responsibility_id;
$now = time();
$sql = "SELECT contact_id FROM
fm_responsibility_contact"
- . " $this->join fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
. " AND active = 1 AND active_from < {$now} AND
active_to > {$now} AND expired_on IS NULL";
$this->db->query($sql, __LINE__, __FILE__);
Modified: branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -406,8 +406,8 @@
'text' =>
lang('edit'),
'action' =>
$GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction'
=> 'property.uigeneric.edit',
- 'appname'
=> $this->appname,
+ 'menuaction'
=> isset($this->location_info['edit_action']) &&
$this->location_info['edit_action'] ? $this->location_info['edit_action'] :
'property.uigeneric.edit',
+ 'appname'
=> $this->appname,
'type'
=> $this->type,
'type_id'
=> $this->type_id
)),
@@ -419,7 +419,7 @@
'text' =>
lang('open edit in new window'),
'action' =>
$GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction'
=> 'property.uigeneric.edit',
+ 'menuaction'
=> isset($this->location_info['edit_action']) &&
$this->location_info['edit_action'] ? $this->location_info['edit_action'] :
'property.uigeneric.edit',
'appname'
=> $this->appname,
'type'
=> $this->type,
'type_id'
=> $this->type_id,
@@ -458,7 +458,7 @@
'text' =>
lang('add'),
'action' =>
$GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction' =>
'property.uigeneric.edit',
+ 'menuaction' =>
isset($this->location_info['edit_action']) &&
$this->location_info['edit_action'] ? $this->location_info['edit_action'] :
'property.uigeneric.edit',
'appname'
=> $this->appname,
'type'
=> $this->type,
'type_id'
=> $this->type_id
Modified: branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -1239,9 +1239,10 @@
*/
$_role_criteria = array
(
- 'type' =>
'responsibility_role',
- 'filter' =>
array('location' => ".location.{$type_id}"),
- 'order' => 'name'
+ 'type' =>
'responsibility_role',
+ 'filter' =>
array('location_level' => $type_id),
+ 'filter_method' => 'like',
+ 'order' =>
'name'
);
$values_combo_box[4] =
execMethod('property.sogeneric.get_list',$_role_criteria);
Modified: branches/Version-1_0-branch/property/inc/class.uiresponsible.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiresponsible.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.uiresponsible.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -107,7 +107,8 @@
(
'index' => true,
'contact' => true,
- 'edit_type' => true,
+ 'edit' => true,
+ 'edit_role' => true,
'edit_contact' => true,
'no_access' => true,
'delete_type' => true
@@ -297,10 +298,10 @@
$responsible_info = $this->bo->read_type();
$uicols = array (
- 'input_type' =>
array('hidden','text','text','text','text','hidden','text','text','hidden','hidden'),
- 'name' =>
array('id','name','descr','category','created_by','created_on','app_name','active','loc','location'),
+ 'input_type' =>
array('text','text','text','hidden','hidden','hidden','text','hidden','hidden','hidden'),
+ 'name' =>
array('id','name','descr','category','created_by','created_on','appname','active','loc','location'),
'formatter' =>
array('','','','','','','','','',''),
- 'descr' =>
array('',lang('name'),lang('descr'),lang('category'),lang('user'),'',lang('application'),lang('active'),'','')
+ 'descr' =>
array(lang('id'),lang('name'),lang('descr'),lang('category'),lang('user'),'',lang('application'),lang('active'),'','')
);
$j=0;
@@ -348,6 +349,11 @@
$datatable['headers']['header'][$i]['sortable'] = true;
$datatable['headers']['header'][$i]['sort_field'] = 'name';
}
+ else if($uicols['name'][$i]=='id')
+ {
+
$datatable['headers']['header'][$i]['sortable'] = true;
+
$datatable['headers']['header'][$i]['sort_field'] = 'id';
+ }
}
else
{
@@ -417,7 +423,7 @@
'text'
=> lang('edit'),
'action'
=> $GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction'
=> 'property.uiresponsible.edit_type',
+ 'menuaction'
=> 'property.uiresponsible.edit',
'appname'
=> $this->appname
// 'location'
=> $this->location
)),
@@ -461,7 +467,7 @@
'text'
=> lang('add'),
'action'
=> $GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction'
=> 'property.uiresponsible.edit_type',
+ 'menuaction'
=> 'property.uiresponsible.edit',
'appname'
=> $this->appname,
'location'
=> $this->location
))
@@ -604,129 +610,171 @@
$this->_save_sessiondata();
}
- /**
- * Add or Edit available responsible types
- *
- * @return void
- */
- public function edit_type()
+ function edit()
{
- if(!$this->acl_add)
+ if(!$this->acl_add && !$this->acl_edit)
{
- $this->no_access();
- return;
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
}
-
if(!$GLOBALS['phpgw']->locations->get_id($this->appname, $this->location))
+ $id = phpgw::get_var('id', 'int');
+ $location = phpgw::get_var('location', 'string');
+ $values = phpgw::get_var('values');
+
+ if ((isset($values['save']) && $values['save']) ||
(isset($values['apply']) && $values['apply']))
{
- $receipt['error'][]=array('msg'=>lang('not a
valid location!'));
- }
+ if($GLOBALS['phpgw']->session->is_repost())
+ {
+ //
$receipt['error'][]=array('msg'=>lang('Hmm... looks like a repost!'));
+ }
- $id = phpgw::get_var('id', 'int');
- $values = phpgw::get_var('values', 'string', 'POST');
+ if(!isset($values['location']) ||
!$values['location'])
+ {
+//
$receipt['error'][]=array('msg'=>lang('Please select a location!'));
+ }
-
$GLOBALS['phpgw']->xslttpl->add_file(array('responsible'));
+ if(!isset($values['name']) || !$values['name'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please enter a name!'));
+ }
- if (isset($values) && is_array($values))
- {
- if(!$this->acl_edit)
+ if($id)
{
- $this->no_access();
- return;
+ $values['id']=$id;
}
+ else
+ {
+ $id = $values['id'];
+ }
- if ((isset($values['save']) && $values['save'])
|| (isset($values['apply']) && $values['apply']))
+ if(!$receipt['error'])
{
- $values['location'] = $this->location;
- if(!$values['cat_id'] ||
$values['cat_id'] == 'none')
- {
- //
$receipt['error'][]=array('msg'=>lang('Please select a category!'));
- }
- if(!$values['name'])
- {
-
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
- }
+ $receipt =
$this->bo->save_type($values);
+ $id = $receipt['id'];
- if($id)
+ if (isset($values['save']) &&
$values['save'])
{
- $values['id']=$id;
+
$GLOBALS['phpgw']->session->appsession('session_data','responsible_receipt',$receipt);
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uiresponsible.index', 'appname' => $this->appname));
}
-
- if(!isset($receipt['error']) ||
!$receipt['error'])
- {
- $receipt =
$this->bo->save_type($values);
- $id = $receipt['id'];
-
- if (isset($values['save']) &&
$values['save'])
- {
-
$GLOBALS['phpgw']->session->appsession('session_data', 'responsible_receipt',
$receipt);
-
$GLOBALS['phpgw']->redirect_link('/index.php', array
- (
-
'menuaction'=> 'property.uiresponsible.index',
-
'appname' => $this->appname,
-
'location' => $this->location
- ));
- }
- }
}
- else
- {
-
$GLOBALS['phpgw']->redirect_link('/index.php', array
- (
- 'menuaction'=>
'property.uiresponsible.index',
- 'appname' =>
$this->appname,
- 'location' =>
$this->location
- ));
- }
}
+ if (isset($values['cancel']) && $values['cancel'])
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uiresponsible.index', 'appname' => $this->appname));
+ }
if ($id)
{
- $function_msg = lang('edit responsible type');
- $values = $this->bo->read_single_type($id);
+ $values = $this->bo->read_single($id);
+ $function_msg = lang('edit responsible');
+/*
+ $this->acl->set_account_id($this->account);
+ $grants =
$this->acl->get_grants('property','.responsible');
+
if(!$this->bocommon->check_perms($grants[$values['user_id']], PHPGW_ACL_READ))
+ {
+ $values = array();
+
$receipt['error'][]=array('msg'=>lang('You are not granted sufficient rights
for this entry'));
+ }
+
+*/
}
else
{
- $function_msg = lang('add responsible type');
+ $function_msg = lang('add responsible');
}
$link_data = array
(
- 'menuaction' =>
'property.uiresponsible.edit_type',
- 'id' => $id,
- 'appname' =>
$this->appname,
- 'location' =>
$this->location
+ 'menuaction' =>
'property.uiresponsible.edit',
+ 'id' => $id,
+ 'app' => $this->appname
);
- $msgbox_data =
(isset($receipt)?$GLOBALS['phpgw']->common->msgbox_data($receipt):'');
+ $locations =
$GLOBALS['phpgw']->locations->get_locations(false, $this->appname, false,
false, true);
- $data = array
+ $selected_location = $location ? $location :
$values['location'];
+ if(isset($values['location_id']) &&
$values['location_id'] && !$selected_location)
+ {
+ $locations_info =
$GLOBALS['phpgw']->locations->get_name($values['location_id']);
+ $selected_location =
$locations_info['location'];
+ }
+
+ $location_list = array();
+ foreach ( $locations as $_location => $descr )
+ {
+ $location_list[] = array
+ (
+ 'id' => $_location,
+ 'name' =>
"{$_location} [{$descr}]",
+ 'selected' => $_location
== $selected_location
+ );
+ }
+
+ $module_def = array
+ (
+ array('key' => 'appname',
'label'=>lang('appname'),'sortable'=>true,'resizeable'=>true),
+ array('key' => 'location',
'label'=>lang('location'),'sortable'=>true,'resizeable'=>true),
+ array('key' => 'category',
'label'=>lang('category'),'sortable'=>true,'resizeable'=>true),
+ array('key' => 'active',
'label'=>lang('active'),'sortable'=>true,'resizeable'=>true),
+ array('key' =>
'delete_module','label'=>lang('delete'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')
+ );
+
+ $responsibility_module = isset($values['module']) &&
$values['module'] ? $values['module'] : array();
+
+ foreach($responsibility_module as &$module)
+ {
+ $_location_info =
$GLOBALS['phpgw']->locations->get_name($module['location_id']);
+ $module['appname'] = $_location_info['appname'];
+ $module['location'] =
$_location_info['location'];
+ $category =
$this->cats->return_single($module['cat_id']);
+ $module['category'] = $category[0]['name'];
+
+ if ($this->acl->check('admin', PHPGW_ACL_EDIT,
$module['appname']))
+ {
+ $_checked = $module['active'] ?
'checked = "checked"' : '';
+ $module['active'] = "<input
type='checkbox' name='values[set_active][]' {$_checked}
value='{$module['location_id']}_{$module['cat_id']}' title='".lang('Check to
set active')."'>";
+ $module['delete_module'] = "<input
type='checkbox' name='values[delete_module][]'
value='{$module['location_id']}_{$module['cat_id']}' title='".lang('Check to
delete')."'>";
+ }
+ }
+
+ //---datatable settings--------------------------
+ $datavalues[0] = array
(
- 'value_entry_date'
=> isset($values['entry_date']) ? $values['entry_date'] : '',
- 'value_name'
=> isset($values['name']) ? $values['name'] : '',
- 'value_descr'
=> isset($values['descr']) ? $values['descr'] : '',
- 'value_active'
=> isset($values['active']) ? $values['active'] : '',
+ 'name'
=> "0",
+ 'values'
=> json_encode($responsibility_module),
+ 'total_records' =>
count($responsibility_module),
+ 'is_paginator' => 0,
+ 'footer'
=> 0
+ );
+ $myColumnDefs[0] = array
+ (
+ 'name' => "0",
+ 'values' =>
json_encode($module_def)
+ );
+ //-----------------------------------------------
- 'lang_entry_date'
=> lang('Entry date'),
- 'lang_name'
=> lang('name'),
- 'lang_descr'
=> lang('descr'),
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($receipt);
+ $data = array
+ (
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'form_action'
=> $GLOBALS['phpgw']->link('/index.php', $link_data),
- 'lang_id'
=> lang('ID'),
- 'lang_save'
=> lang('save'),
- 'lang_cancel'
=> lang('cancel'),
+ 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'value_appname'
=> $this->appname,
+ 'value_location'
=> $location,
'value_id'
=> $id,
- 'lang_active'
=> lang('active'),
- 'lang_active_on_statustext'
=> lang('set this item inactive'),
- 'lang_active_off_statustext' =>
lang('set this item active'),
- 'lang_cancel_status_text'
=> lang('Back to the list'),
- 'lang_save_status_text'
=> lang('Save the responsible type'),
- 'lang_apply'
=> lang('apply'),
- 'lang_apply_status_text'
=> lang('Apply the values'),
-
+ 'value_name'
=> $values['name'],
+ 'value_descr'
=> $values['descr'],
+ 'value_access'
=> $values['access'],
+ 'apps_list'
=> array('options' => execMethod('property.bojasper.get_apps',
$this->appname)),
+ 'location_list'
=> array('options' => $location_list),
+ 'td_count'
=> '""',
+ 'base_java_url'
=> "{menuaction:'property.uiresponsible.edit'}",
+ 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+ 'datatable'
=> $datavalues,
+ 'myColumnDefs'
=> $myColumnDefs,
'lang_category'
=> lang('category'),
'lang_no_cat'
=> lang('no category'),
'cat_select'
=> $this->cats->formatted_xslt_list(array
@@ -736,10 +784,162 @@
)),
);
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('responsible matrix') . "::{$this->location}::{$function_msg}";
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('edit_type' => $data));
+ //---datatable settings--------------------
+ phpgwapi_yui::load_widget('dragdrop');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('loader');
+
+ $GLOBALS['phpgw']->css->validate_file('property');
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'responsible.edit', 'property' );
+ //-----------------------datatable settings---
+
+ $appname
= 'Responsible';
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . "::{$appname}::$function_msg::".lang($this->appname);
+
$GLOBALS['phpgw']->xslttpl->add_file(array('responsible'));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
}
+
+ function edit_role()
+ {
+ if(!$this->acl_add && !$this->acl_edit)
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
+ }
+
+ $id = phpgw::get_var('id', 'int');
+ $location = phpgw::get_var('location', 'string');
+ $values = phpgw::get_var('values');
+
+ if ((isset($values['save']) && $values['save']) ||
(isset($values['apply']) && $values['apply']))
+ {
+ if($GLOBALS['phpgw']->session->is_repost())
+ {
+ //
$receipt['error'][]=array('msg'=>lang('Hmm... looks like a repost!'));
+ }
+
+ if(!isset($values['location']) ||
!$values['location'])
+ {
+ //
$receipt['error'][]=array('msg'=>lang('Please select a location!'));
+ }
+
+ if(!isset($values['name']) || !$values['name'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please enter a name!'));
+ }
+
+ if($id)
+ {
+ $values['id']=$id;
+ }
+ else
+ {
+ $id = $values['id'];
+ }
+
+ if(!$receipt['error'])
+ {
+ $receipt =
$this->bo->save_role($values);
+ $id = $receipt['id'];
+
+ if (isset($values['save']) &&
$values['save'])
+ {
+
$GLOBALS['phpgw']->session->appsession('session_data','responsible_receipt',$receipt);
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uigeneric.index', 'type' => 'responsibility_role', 'appname' =>
$this->appname));
+ }
+ }
+ }
+
+ if (isset($values['cancel']) && $values['cancel'])
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uigeneric.index', 'type' => 'responsibility_role', 'appname' =>
$this->appname));
+ }
+
+ if ($id)
+ {
+ $values = $this->bo->read_single_role($id);
+ $function_msg = lang('edit role');
+/*
+ $this->acl->set_account_id($this->account);
+ $grants =
$this->acl->get_grants('property','.responsible');
+
if(!$this->bocommon->check_perms($grants[$values['user_id']], PHPGW_ACL_READ))
+ {
+ $values = array();
+
$receipt['error'][]=array('msg'=>lang('You are not granted sufficient rights
for this entry'));
+ }
+
+*/
+ }
+ else
+ {
+ $function_msg = lang('add role');
+ }
+
+
+ $link_data = array
+ (
+ 'menuaction' =>
'property.uiresponsible.edit_role',
+ 'id' => $id,
+ 'app' => $this->appname
+ );
+
+ $location_types =
execMethod('property.soadmin_location.get_location_type');
+
+ $levels = isset($values['location_level']) &&
$values['location_level'] ? $values['location_level'] : array();
+ $level_list = array();
+ foreach ( $location_types as $location_type )
+ {
+ $level_list[] = array
+ (
+ 'id' =>
$location_type['id'],
+ 'name' =>
$location_type['name'],
+ 'selected' =>
in_array($location_type['id'], $levels)
+ );
+ }
+ //-----------------------------------------------
+
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($receipt);
+
+ $data = array
+ (
+ 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+ 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'value_appname'
=> $this->appname,
+ 'value_location'
=> $location,
+ 'value_id'
=> $id,
+ 'value_name'
=> $values['name'],
+ 'value_remark'
=> $values['remark'],
+ 'value_access'
=> $values['access'],
+ 'responsibility_list'
=> array('options' => execMethod('property.boresponsible.get_responsibilities',
array('appname' => $this->appname, 'selected' =>
$values['responsibility_id']))),
+ 'level_list'
=> array('checkbox' => $level_list),
+ 'td_count'
=> '""',
+ 'base_java_url'
=> "{menuaction:'property.uiresponsible.edit'}",
+ 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+ 'datatable'
=> $datavalues,
+ 'myColumnDefs'
=> $myColumnDefs,
+ );
+
+ //---datatable settings--------------------
+ phpgwapi_yui::load_widget('dragdrop');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('loader');
+
+ $GLOBALS['phpgw']->css->validate_file('property');
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'responsible.edit', 'property' );
+ //-----------------------datatable settings---
+
+ $appname
= 'Responsible';
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . "::{$appname}::$function_msg::".lang($this->appname);
+
$GLOBALS['phpgw']->xslttpl->add_file(array('responsible'));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_role' => $data));
+ }
+
+
+
/**
* List of contacts given responsibilities within locations
*
Modified: branches/Version-1_0-branch/property/inc/class.uitenant_claim.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitenant_claim.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/inc/class.uitenant_claim.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -669,7 +669,7 @@
//_debug_array($values);
- $project_values =
$this->boproject->read_single($values['project_id']);
+ $project_values =
$this->boproject->read_single($values['project_id'], array(), true);
$soinvoice = CreateObject('property.soinvoice');
@@ -683,7 +683,9 @@
else
{
$vouchers =
$soinvoice->read_invoice(array('workorder_id' => $workorder['workorder_id'],
'user_lid' => 'all'));
+
$workorder['voucher_id'] =
isset($vouchers[0]['voucher_id']) ? $vouchers[0]['voucher_id'] : '';
+ $workorder['actual_cost'] =
isset($vouchers[0]['approved_amount']) ? $vouchers[0]['approved_amount'] : '';
}
}
@@ -823,10 +825,10 @@
'values' =>
json_encode(array( array('key' => 'workorder_id', 'label'=>'Workorder',
'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
array('key' => 'budget',
'label'=>'Budget', 'sortable'=>true,'resizeable'=>true),
array('key' => 'calculation',
'label'=>'Calculation', 'sortable'=>true,'resizeable'=>true),
+
array('key' =>
'actual_cost','label'=>lang('actual cost'),'sortable'=>true,'resizeable'=>true),
array('key' =>
'vendor_name','label'=>'Vendor','sortable'=>true,'resizeable'=>true),
array('key' =>
'charge_tenant','label'=>'Charge tenant','sortable'=>true,'resizeable'=>true),
array('key' =>
'status','label'=>'Status','sortable'=>true,'resizeable'=>true),
-
array('key' =>
'actual_cost','label'=>lang('actual cost'),'sortable'=>true,'resizeable'=>true),
array('key' =>
'voucher_id','label'=>lang('voucher'),'sortable'=>true,'resizeable'=>true),
array('key' =>
'selected','label'=>'select', 'sortable'=>false,'resizeable'=>false)))
);
Modified:
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php
===================================================================
---
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php
2012-03-05 19:21:00 UTC (rev 8962)
+++
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -1,6 +1,9 @@
<?php
// this routine will only work with the exact configuration of
Bergen Bolig og Byfornyelse - but can serve as an example
+
+ // out: 'deliver'
+ // in: 'pickup'
$export = new catch_ticket_export();
$export->export_ticket($ticket);
Copied: branches/Version-1_0-branch/property/js/yahoo/responsible.edit.js (from
rev 8962, trunk/property/js/yahoo/responsible.edit.js)
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/responsible.edit.js
(rev 0)
+++ branches/Version-1_0-branch/property/js/yahoo/responsible.edit.js
2012-03-06 07:38:37 UTC (rev 8963)
@@ -0,0 +1,28 @@
+var myPaginator_0, myDataTable_0
+
+/********************************************************************************/
+this.myParticularRenderEvent = function()
+{
+
+}
+
+/********************************************************************************/
+var FormatterCenter = function(elCell, oRecord, oColumn, oData)
+{
+ elCell.innerHTML = "<center>"+oData+"</center>";
+}
+
+
/********************************************************************************/
+
+YAHOO.util.Event.addListener(window, "load", function()
+{
+ loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone",
+ type: "js",
+ fullpath: property_js
+ });
+
+ loader.require("anyone");
+ loader.insert();
+});
Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php 2012-03-05
19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php 2012-03-06
07:38:37 UTC (rev 8963)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.634';
+ $setup_info['property']['version'] = '0.9.17.635';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -192,6 +192,7 @@
'fm_responsibility',
'fm_responsibility_role',
'fm_responsibility_contact',
+ 'fm_responsibility_module',
'fm_action_pending',
'fm_action_pending_category',
'fm_jasper',
Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -2128,9 +2128,6 @@
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
'name' => array('type' => 'varchar',
'precision' => 50,'nullable' => False),
'descr' => array('type' => 'varchar',
'precision' => 255,'nullable' => True),
- 'active' => array('type' => 'int','precision'
=> 2,'nullable' => True),
- 'location_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
- 'cat_id' => array('type' => 'int','precision'
=> 4,'nullable' => True),
'created_on' => array('type' => 'int',
'precision' => 4,'nullable' => False),
'created_by' => array('type' => 'int',
'precision' => 4,'nullable' => False),
),
@@ -2139,12 +2136,31 @@
'ix' => array(),
'uc' => array()
),
+ 'fm_responsibility_module' => array(
+ 'fd' => array(
+ 'responsibility_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'location_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'cat_id' => array('type' => 'int','precision'
=> 4,'nullable' => True),
+ 'active' => array('type' => 'int','precision'
=> 2,'nullable' => True),
+ 'created_on' => array('type' => 'int',
'precision' => 4,'nullable' => False),
+ 'created_by' => array('type' => 'int',
'precision' => 4,'nullable' => False),
+ ),
+ 'pk' => array('responsibility_id', 'location_id',
'cat_id'),
+ 'fk' => array
+ (
+ 'fm_responsibility' =>
array('responsibility_id' => 'id'),
+ 'phpgw_locations' =>
array('location_id' => 'location_id'),
+ 'phpgw_categories' =>
array('cat_id' => 'cat_id')
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'fm_responsibility_role' => array(
'fd' => array(
'id' => array('type' => 'auto', 'precision' =>
4,'nullable' => False),
'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
'remark' => array('type' => 'text','nullable'
=> True),
- 'location' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'location_level' => array('type' => 'varchar',
'precision' => 200),
'responsibility_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
'appname' => array('type' => 'varchar',
'precision' => 25,'nullable' => False),
'user_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php
2012-03-06 07:38:37 UTC (rev 8963)
@@ -5908,7 +5908,102 @@
}
}
+
/**
+ * Update property version from 0.9.17.633 to 0.9.17.634
+ * Add project budget per year
+ */
+
+ $test[] = '0.9.17.634';
+ function property_upgrade0_9_17_634()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+ $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_responsibility_module', array(
+ 'fd' => array(
+ 'responsibility_id' => array('type' =>
'int', 'precision' => 4,'nullable' => True),
+ 'location_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'cat_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'active' => array('type' =>
'int','precision' => 2,'nullable' => True),
+ 'created_on' => array('type' => 'int',
'precision' => 4,'nullable' => False),
+ 'created_by' => array('type' => 'int',
'precision' => 4,'nullable' => False),
+ ),
+ 'pk' => array('responsibility_id',
'location_id', 'cat_id'),
+ 'fk' => array
+ (
+ 'fm_responsibility' =>
array('responsibility_id' => 'id'),
+ 'phpgw_locations'
=> array('location_id' => 'location_id'),
+ 'phpgw_categories'
=> array('cat_id' => 'cat_id')
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+ $sql = 'SELECT * FROM fm_responsibility';
+ $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ $responsibilities = array();
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ if($cat_id =
$GLOBALS['phpgw_setup']->oProc->f('cat_id'))
+ {
+ $responsibilities[] = array
+ (
+ 'responsibility_id' =>
$GLOBALS['phpgw_setup']->oProc->f('id'),
+ 'location_id' =>
$GLOBALS['phpgw_setup']->oProc->f('location_id'),
+ 'cat_id' => $cat_id,
+ 'active' =>
$GLOBALS['phpgw_setup']->oProc->f('active'),
+ 'created_on' =>
$GLOBALS['phpgw_setup']->oProc->f('created_on'),
+ 'created_by' =>
$GLOBALS['phpgw_setup']->oProc->f('created_by')
+ );
+ }
+ }
+
+ foreach ($responsibilities as $value_set)
+ {
+ $cols = implode(',', array_keys($value_set));
+ $values =
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($value_set));
+ $sql = "INSERT INTO fm_responsibility_module ({$cols})
VALUES ({$values})";
+
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ }
+
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_responsibility',array(),'location_id');
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_responsibility',array(),'cat_id');
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_responsibility',array(),'active');
+
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_responsibility_role','location','location_level');
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_responsibility_role','location_level',array('type'
=> 'varchar','precision' => '200','nullable' => True));
+
+ $sql = 'SELECT * FROM fm_responsibility_role';
+ $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ $roles = array();
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $roles[] = array
+ (
+ 'id' => $GLOBALS['phpgw_setup']->oProc->f('id'),
+ 'location_level' => explode(',',
ltrim($GLOBALS['phpgw_setup']->oProc->f('location_level'), '.location.'))
+ );
+ }
+
+ foreach ($roles as $role)
+ {
+ $sql = 'UPDATE fm_responsibility_role SET
location_level = ' . implode(',', $role['location_level']) . " WHERE id =
{$role['id']}";
+
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ }
+
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.635';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
+ /**
* Update property version from 0.9.17.607 to 0.9.17.608
* Add more room for address at tickets
*
Modified: branches/Version-1_0-branch/property/templates/base/responsible.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/responsible.xsl
2012-03-05 19:21:00 UTC (rev 8962)
+++ branches/Version-1_0-branch/property/templates/base/responsible.xsl
2012-03-06 07:38:37 UTC (rev 8963)
@@ -1,8 +1,8 @@
<!-- $Id$ -->
<xsl:template name="app_data">
<xsl:choose>
- <xsl:when test="edit_type">
- <xsl:apply-templates select="edit_type"/>
+ <xsl:when test="edit">
+ <xsl:apply-templates select="edit"/>
</xsl:when>
<xsl:when test="edit_contact">
<xsl:apply-templates select="edit_contact"/>
@@ -16,169 +16,332 @@
</xsl:choose>
</xsl:template>
- <!-- New template-->
- <xsl:template match="list_type">
- <xsl:variable name="responsible_action">
- <xsl:value-of select="responsible_action"/>
+ <!-- add / edit responsibility type-->
+
+ <xsl:template xmlns:php="http://php.net/xsl" match="edit">
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
</xsl:variable>
- <table width="100%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:choose>
- <xsl:when test="msgbox_data != ''">
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <tr>
+ <td>
+ <table cellpadding="2" cellspacing="2"
align="left">
+ <xsl:choose>
+ <xsl:when
test="msgbox_data != ''">
+ <tr>
+ <td
align="left" colspan="3">
+
<xsl:call-template name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when
test="value_id != ''">
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'id')"/>
+ </td>
+ <td>
+
<xsl:value-of select="value_id"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <form name="form_app"
method="post" action="{$form_action}">
+ <tr>
+ <td>
+
<xsl:value-of select="php:function('lang', 'application')"/>
+ </td>
+ <td
align="left">
+ <select
name="appname" onChange="this.form.submit();">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'application')"/>
+
</xsl:attribute>
+
<xsl:apply-templates select="apps_list/options"/>
+
</select>
+ </td>
+ </tr>
+ </form>
+ <form name="form_location"
method="post" action="{$form_action}">
+ <tr>
+ <td>
+ <input
type="hidden" name="appname" value="{value_appname}"/>
+
<xsl:value-of select="php:function('lang', 'location')"/>
+ </td>
+ <td
align="left">
+ <select
name="location" onChange="this.form.submit();">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'Select submodule')"/>
+
</xsl:attribute>
+
<option value="">
+
<xsl:value-of select="php:function('lang', 'No location')"/>
+
</option>
+
<xsl:apply-templates select="location_list/options"/>
+
</select>
+ </td>
+ </tr>
+ </form>
+ </table>
<tr>
- <td align="left" colspan="3">
- <xsl:call-template
name="msgbox"/>
+ <td>
+ <form name="form"
method="post" action="{$form_action}">
+ <table
cellpadding="2" cellspacing="2" align="left">
+ <tr>
+
<td>
+
<input type="hidden" name="values[appname]" value="{value_appname}"/>
+
<input type="hidden" name="values[location]" value="{value_location}"/>
+
<xsl:value-of select="php:function('lang', 'category')"/>
+
</td>
+
<td>
+
<xsl:call-template name="categories"/>
+
</td>
+ </tr>
+ <tr>
+
<td>
+
<xsl:value-of select="php:function('lang', 'name')"/>
+
</td>
+
<td>
+
<input type="text" name="values[name]" value="{value_name}" size="60">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'name')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+ </tr>
+ <tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'descr')"/>
+
</td>
+
<td>
+
<textarea cols="60" rows="10" name="values[descr]">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'descr')"/>
+
</xsl:attribute>
+
<xsl:value-of select="value_descr"/>
+
</textarea>
+
</td>
+ </tr>
+ <tr>
+
<td class="th_text" valign="top">
+
<xsl:value-of select="php:function('lang', 'details')"/>
+
</td>
+
<td>
+
<table width="100%" cellpadding="2" cellspacing="2" align="center">
+
<!-- DATATABLE 0-->
+
<td>
+
<div id="paging_0"/>
+
<div id="datatable-container_0"/>
+
</td>
+
</table>
+
</td>
+ </tr>
+ <tr>
+
<td colspan="2">
+
<table cellpadding="2" cellspacing="2" width="50%" align="center">
+
<xsl:variable name="lang_save">
+
<xsl:value-of select="php:function('lang', 'save')"/>
+
</xsl:variable>
+
<xsl:variable name="lang_apply">
+
<xsl:value-of select="php:function('lang', 'apply')"/>
+
</xsl:variable>
+
<xsl:variable name="lang_cancel">
+
<xsl:value-of select="php:function('lang', 'cancel')"/>
+
</xsl:variable>
+
<tr height="50">
+
<td>
+
<input type="submit" name="values[save]"
value="{$lang_save}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'save')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
<td>
+
<input type="submit" name="values[apply]"
value="{$lang_apply}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'apply')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
<td>
+
<input type="submit" name="values[cancel]"
value="{$lang_cancel}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'cancel')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
</tr>
+
</table>
+
</td>
+ </tr>
+ </table>
+ </form>
</td>
</tr>
- </xsl:when>
- </xsl:choose>
- <tr>
- <td align="left">
- <xsl:call-template
name="filter_location"/>
</td>
- <td align="right">
- <xsl:call-template name="search_field"/>
- </td>
</tr>
- <tr>
- <td colspan="3" width="100%">
- <xsl:call-template name="nextmatchs"/>
- </td>
- </tr>
</table>
- <table width="100%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:apply-templates select="table_header_type"/>
- <xsl:choose>
- <xsl:when test="values_type != ''">
- <xsl:apply-templates
select="values_type"/>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="table_add != ''">
- <xsl:apply-templates
select="table_add"/>
- </xsl:when>
- </xsl:choose>
- </table>
+ <!-- DATATABLE DEFINITIONS-->
+ <script type="text/javascript">
+ var property_js = <xsl:value-of select="property_js"/>;
+ var base_java_url = <xsl:value-of
select="base_java_url"/>;
+ var datatable = new Array();
+ var myColumnDefs = new Array();
+ var myButtons = new Array();
+ var td_count = <xsl:value-of select="td_count"/>;
+
+ <xsl:for-each select="datatable">
+ datatable[<xsl:value-of select="name"/>] = [
+ {
+ values:<xsl:value-of
select="values"/>,
+ total_records: <xsl:value-of
select="total_records"/>,
+ is_paginator: <xsl:value-of
select="is_paginator"/>,
+ <!--permission:<xsl:value-of
select="permission"/>, -->
+ footer:<xsl:value-of
select="footer"/>
+ }
+ ]
+ </xsl:for-each>
+ <xsl:for-each select="myColumnDefs">
+ myColumnDefs[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
+ </xsl:for-each>
+ <xsl:for-each select="myButtons">
+ myButtons[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
+ </xsl:for-each>
+ </script>
</xsl:template>
- <!-- New template-->
- <xsl:template match="table_header_type">
- <xsl:variable name="sort_name">
- <xsl:value-of select="sort_name"/>
+ <!-- add / edit -->
+ <xsl:template xmlns:php="http://php.net/xsl" match="edit_role">
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
</xsl:variable>
- <tr class="th">
- <td class="th_text" width="10%" align="left">
- <a href="{$sort_name}">
- <xsl:value-of select="lang_name"/>
- </a>
- </td>
- <td class="th_text" width="30%" align="center">
- <xsl:value-of select="lang_descr"/>
- </td>
- <td class="th_text" width="10%" align="center">
- <xsl:value-of select="lang_category"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_created_by"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_app_name"/>
- </td>
- <td class="th_text" width="1%" align="center">
- <xsl:value-of select="lang_active"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_contacts"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_edit"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_delete"/>
- </td>
- </tr>
- </xsl:template>
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <tr>
+ <td>
+ <table cellpadding="2" cellspacing="2"
align="left">
+ <xsl:choose>
+ <xsl:when
test="msgbox_data != ''">
+ <tr>
+ <td
align="left" colspan="3">
+
<xsl:call-template name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ </table>
+ <tr>
+ <td>
+ <form name="form"
method="post" action="{$form_action}">
+ <table
cellpadding="2" cellspacing="2" align="left">
+
<xsl:choose>
+
<xsl:when test="value_id != ''">
+
<tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'id')"/>
+
</td>
+
<td>
+
<xsl:value-of select="value_id"/>
+
</td>
+
</tr>
+
</xsl:when>
+
</xsl:choose>
+ <tr>
+
<td>
+
<xsl:value-of select="php:function('lang', 'name')"/>
+
</td>
+
<td>
+
<input type="text" name="values[name]" value="{value_name}" size="60">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'name')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+ </tr>
+ <tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'descr')"/>
+
</td>
+
<td>
+
<textarea cols="60" rows="10" name="values[remark]">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'descr')"/>
+
</xsl:attribute>
+
<xsl:value-of select="value_remark"/>
+
</textarea>
+
</td>
+ </tr>
+ <tr>
+
<td>
+
<xsl:value-of select="php:function('lang', 'responsibility')"/>
+
</td>
+
<td align="left">
+
<select name="values[responsibility_id]">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'Select
submodule')"/>
+
</xsl:attribute>
+
<option value="">
+
<xsl:value-of select="php:function('lang', 'select')"/>
+
</option>
+
<xsl:apply-templates select="responsibility_list/options"/>
+
</select>
+
</td>
+ </tr>
- <!-- New template-->
- <xsl:template match="values_type">
- <tr>
- <xsl:attribute name="class">
- <xsl:choose>
- <xsl:when test="position() mod 2 = 0">
- <xsl:text>row_off</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>row_on</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <td align="left">
- <xsl:value-of select="name"/>
- </td>
- <td align="left">
- <xsl:value-of select="descr"/>
- </td>
- <td align="left">
- <xsl:value-of select="category"/>
- </td>
- <td align="left">
- <xsl:value-of select="created_by"/>
- </td>
- <td align="left">
- <xsl:value-of select="app_name"/>
- </td>
- <td align="center">
- <xsl:value-of select="active"/>
- </td>
- <td align="center" title="{lang_contacts_text}">
- <xsl:variable name="link_contacts">
- <xsl:value-of select="link_contacts"/>
- </xsl:variable>
- <a href="{link_contacts}">
- <xsl:value-of select="text_contacts"/>
- </a>
- </td>
- <xsl:choose>
- <xsl:when test="link_edit != ''">
- <td align="center"
title="{lang_edit_text}">
- <xsl:variable name="link_edit">
- <xsl:value-of
select="link_edit"/>
- </xsl:variable>
- <a href="{link_edit}">
- <xsl:value-of
select="text_edit"/>
- </a>
- </td>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="link_delete != ''">
- <td align="center"
title="{lang_delete_text}">
- <xsl:variable
name="link_delete">
- <xsl:value-of
select="link_delete"/>
- </xsl:variable>
- <a href="{link_delete}">
- <xsl:value-of
select="text_delete"/>
- </a>
- </td>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="lang_select != ''">
- <form>
- <td class="small_text"
valign="top">
- <input type="hidden"
name="" value="{id}"/>
- <input type="hidden"
name="" value="{name}"/>
- <input type="button"
name="select" value="{lang_select}" onClick="Exchange_values(this.form);"
onMouseout="window.status='';return true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_select_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
- </xsl:attribute>
- </input>
+ <tr>
+
<td valign = 'top'>
+
<xsl:value-of select="php:function('lang', 'location level')"/>
+
</td>
+
<td align="left">
+
<table>
+
<xsl:apply-templates select="level_list/checkbox"/>
+
</table>
+
</td>
+ </tr>
+
+ <tr>
+
<td colspan="2">
+
<table cellpadding="2" cellspacing="2" width="50%" align="center">
+
<xsl:variable name="lang_save">
+
<xsl:value-of select="php:function('lang', 'save')"/>
+
</xsl:variable>
+
<xsl:variable name="lang_apply">
+
<xsl:value-of select="php:function('lang', 'apply')"/>
+
</xsl:variable>
+
<xsl:variable name="lang_cancel">
+
<xsl:value-of select="php:function('lang', 'cancel')"/>
+
</xsl:variable>
+
<tr height="50">
+
<td>
+
<input type="submit" name="values[save]"
value="{$lang_save}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'save')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
<td>
+
<input type="submit" name="values[apply]"
value="{$lang_apply}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'apply')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
<td>
+
<input type="submit" name="values[cancel]"
value="{$lang_cancel}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'cancel')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
</tr>
+
</table>
+
</td>
+ </tr>
+ </table>
+ </form>
</td>
- </form>
- </xsl:when>
- </xsl:choose>
- </tr>
+ </tr>
+ </td>
+ </tr>
+ </table>
</xsl:template>
<!-- New template-->
@@ -387,137 +550,6 @@
</tr>
</xsl:template>
- <!-- New template-->
- <!-- add / edit responsibility type-->
- <xsl:template match="edit_type">
- <div align="left">
- <xsl:variable name="form_action">
- <xsl:value-of select="form_action"/>
- </xsl:variable>
- <form method="post" action="{$form_action}">
- <table cellpadding="2" cellspacing="2"
width="80%" align="center">
- <xsl:choose>
- <xsl:when test="msgbox_data !=
''">
- <tr>
- <td
align="left" colspan="3">
-
<xsl:call-template name="msgbox"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="value_id != ''">
- <tr>
- <td
valign="top" width="30%">
-
<xsl:value-of select="lang_id"/>
- </td>
- <td
align="left">
-
<xsl:value-of select="value_id"/>
- </td>
- </tr>
- <tr>
- <td
valign="top">
-
<xsl:value-of select="lang_entry_date"/>
- </td>
- <td>
-
<xsl:value-of select="value_entry_date"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
- <tr>
- <td>
- <xsl:value-of
select="lang_category"/>
- </td>
- <td>
- <xsl:call-template
name="categories"/>
- </td>
- </tr>
- <tr>
- <td valign="top" width="10%"
title="{lang_name_status_text}">
- <xsl:value-of
select="lang_name"/>
- </td>
- <td>
- <input type="text"
size="60" name="values[name]" value="{value_name}"
onMouseout="window.status='';return true;">
- </input>
- </td>
- </tr>
- <tr>
- <td valign="top"
title="{lang_descr_status_text}">
- <xsl:value-of
select="lang_descr"/>
- </td>
- <td>
- <textarea cols="60"
rows="10" name="values[descr]" onMouseout="window.status='';return true;">
- <xsl:value-of
select="value_descr"/>
- </textarea>
- </td>
- </tr>
- <tr>
- <td>
- <xsl:value-of
select="lang_active"/>
- </td>
- <td>
- <xsl:choose>
- <xsl:when
test="value_active = '1'">
- <input
type="checkbox" name="values[active]" value="1" checked="checked"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_active_on_statustext"/>
-
</xsl:attribute>
- </input>
- </xsl:when>
- <xsl:otherwise>
- <input
type="checkbox" name="values[active]" value="1"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_active_off_statustext"/>
-
</xsl:attribute>
- </input>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <tr height="50">
- <td colspan="2" align="center">
- <table>
- <tr>
- <td
valign="bottom">
-
<xsl:variable name="lang_save">
-
<xsl:value-of select="lang_save"/>
-
</xsl:variable>
-
<input type="submit" name="values[save]" value="{$lang_save}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_save_status_text"/>
-
</xsl:attribute>
-
</input>
- </td>
- <td
valign="bottom">
-
<xsl:variable name="lang_apply">
-
<xsl:value-of select="lang_apply"/>
-
</xsl:variable>
-
<input type="submit" name="values[apply]" value="{$lang_apply}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_apply_status_text"/>
-
</xsl:attribute>
-
</input>
- </td>
- <td
align="left" valign="bottom">
-
<xsl:variable name="lang_cancel">
-
<xsl:value-of select="lang_cancel"/>
-
</xsl:variable>
-
<input type="submit" name="values[cancel]" value="{$lang_cancel}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_cancel_status_text"/>
-
</xsl:attribute>
-
</input>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </xsl:template>
-
<!-- add / edit contact-->
<xsl:template match="edit_contact">
<div align="left">
@@ -677,3 +709,30 @@
</form>
</div>
</xsl:template>
+
+ <!-- New template-->
+ <xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected"
value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:template>
+
+ <!-- New template-->
+ <xsl:template match="checkbox">
+ <tr>
+ <td value="{id}">
+ <input type="checkbox"
name="values[location_level][]" value="{id}">
+ <xsl:attribute name="title">
+ <xsl:value-of select="name"/>
+ </xsl:attribute>
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="checked"
value="checked"/>
+ </xsl:if>
+ </input>
+ <xsl:value-of select="name"/>
+ </td>
+ </tr>
+ </xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8963] Merge 8954:8962 from trunk,
Sigurd Nes <=