[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7781] Merge 7768:7780 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7781] Merge 7768:7780 from trunk |
Date: |
Mon, 03 Oct 2011 10:56:55 +0000 |
Revision: 7781
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7781
Author: sigurdne
Date: 2011-10-03 10:56:55 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
Merge 7768:7780 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
branches/Version-1_0-branch/rental/inc/model/class.party.inc.php
branches/Version-1_0-branch/rental/setup/phpgw_no.lang
branches/Version-1_0-branch/rental/setup/setup.inc.php
branches/Version-1_0-branch/rental/setup/tables_current.inc.php
branches/Version-1_0-branch/rental/setup/tables_update.inc.php
branches/Version-1_0-branch/rental/templates/base/party.php
Added Paths:
-----------
branches/Version-1_0-branch/controller/images/bg_expand.png
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
+
/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
Copied: branches/Version-1_0-branch/controller/images/bg_expand.png (from rev
7780, trunk/controller/images/bg_expand.png)
===================================================================
(Binary files differ)
Modified:
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
===================================================================
---
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
2011-10-03 10:46:40 UTC (rev 7780)
+++
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -1,15 +1,99 @@
<?php
$db = & $GLOBALS['phpgw']->db;
-
+//_debug_array($data);
+//_debug_array($id);
+ $_closed = false;
if(in_array('status', $this->fields_updated))
{
- $_status = (int) trim($data['status'],'C');
- $db->query("SELECT * from fm_tts_status WHERE id =
{$_status}",__LINE__,__FILE__);
- $this->db->next_record();
- if($db->f('closed'))
+ if($data['status'] == 'X')
{
- _debug_array($this->fields_updated);
+ $_closed = true;
}
+ else if(stripos($data['status'], 'C') === 0)
+ {
+ $_status = (int) trim($data['status'],'C');
+ $db->query("SELECT * from fm_tts_status WHERE id =
{$_status}",__LINE__,__FILE__);
+ $this->db->next_record();
+ if($db->f('closed'))
+ {
+ $_closed = true;
+ }
+ }
}
-
+ $projects = array();
+ if ($_closed) // take action
+ {
+ $interlink = CreateObject('property.interlink');
+ $targets = $interlink->get_relation('property', '.ticket', $id,
'target');
+ foreach ($targets as $target)
+ {
+ if($target['location'] == '.project')
+ {
+ foreach ($target['data'] as $_data)
+ {
+ $project =
execMethod('property.soproject.read_single', $_data['id']);
+ $projects[] = array
+ (
+ 'id' =>
$_data['id'],
+ 'coordinator' =>
$project['coordinator'],
+ 'link' =>
$_data['link'],
+ 'statustext' =>
$_data['statustext']
+ );
+ }
+ }
+ }
+
+ if (!is_object($GLOBALS['phpgw']->send))
+ {
+ $GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
+ }
+
+ $validator =
CreateObject('phpgwapi.EmailAddressValidator');
+ $socommon = CreateObject('property.socommon');
+
+ foreach ($projects as $project_info)
+ {
+ $prefs =
$socommon->create_preferences('property',$project_info['coordinator']);
+ $account_name =
$GLOBALS['phpgw']->accounts->get($project_info['coordinator'])->__toString();
+ if ($validator->check_email_address($prefs['email']))
+ {
+ // Email address is technically valid
+ // avoid problems with the delimiter in the
send class
+ if(strpos($account_name,','))
+ {
+ $_account_name = explode(',',
$account_name);
+ $account_name =
ltrim($_account_name[1]) . ' ' . $_account_name[0];
+ }
+
+ $_to = "{$account_name}<{$prefs['email']}>";
+ $from_name =
$GLOBALS['phpgw_info']['user']['fullname'];
+
+ if(strpos($from_name,','))
+ {
+ $_from_name = explode(',', $from_name);
+ $from_name = ltrim($_from_name[1]) . '
' . $_from_name[0];
+ }
+
+ $from_email =
"{$from_name}<{$GLOBALS['phpgw_info']['user']['preferences']['property']['email']}>";
+ $cc = '';
+ $bcc ='';
+ $subject = "Status er endret tor melding
tilknyttet prosjekt {$project_info['id']}";
+ $body ="<H2>{$subject}</H2>";
+ $body .= "</br><a
href='{$project_info['link']}'>{$subject}</a>";
+
+ try
+ {
+ $GLOBALS['phpgw']->send->msg('email',
$_to, $subject, stripslashes($body), '', $cc, $bcc, $from_email, $from_name,
'html', '');
+ }
+ catch (phpmailerException $e)
+ {
+ $receipt['error'][] = array('msg' =>
$e->getMessage());
+ }
+ }
+ else
+ {
+ $receipt['error'][] = array('msg'=>lang('This
user has not defined an email address !') . ' : ' . $account_name);
+ }
+ }
+ }
Modified: branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -25,8 +25,8 @@
$config = CreateObject('phpgwapi.config','rental');
$config->read();
- $db = createObject('phpgwapi.db', null, null, true);
-// $db = createObject('property.db_oci8');
+// $db = createObject('phpgwapi.db', null, null, true);
+ $db = createObject('property.db_oci8');
$db->debug =
!!$config->config_data['external_db_debug'];
$db->Host = $config->config_data['external_db_host'];
@@ -164,6 +164,7 @@
"UNIT_ID" =>
$db->f('RESULTATENHET')
);
}
+
return $result_units;
}
@@ -182,8 +183,9 @@
if($db->next_record())
{
+
$full_name = $db->f('FORNAVN')."
".$db->f('ETTERNAVN');
-
+
return array(
"ORG_UNIT_ID" =>
(int)$db->f('ORG_ENHET_ID'),
"ORG_UNIT_NAME" =>
$db->f('ORG_NAVN'),
Modified: branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -324,6 +324,7 @@
'is_inactive = ' .
$this->marshal(($party->is_inactive() ? 'true' : 'false'), 'bool'),
'comment = ' .
$this->marshal($party->get_comment(), 'string'),
'org_enhet_id = ' .
$this->marshal($party->get_org_enhet_id(), 'int'),
+ 'org_unit_leader = ' .
$this->marshal($party->get_org_unit_leader(), 'string'),
'location_id = ' . $location_id,
'result_unit_number = ' . $result_unit_number
);
@@ -377,6 +378,7 @@
$party->set_title(
$this->unmarshal($this->db->f('title'), 'string'));
$party->set_url(
$this->unmarshal($this->db->f('url'), 'string'));
$party->set_org_enhet_id(
$this->unmarshal($this->db->f('org_enhet_id'), 'string'));
+ $party->set_unit_leader(
$this->unmarshal($this->db->f('unit_leader'), 'string'));
$sync_message = $party->set_sync_data(
array(
'responsibility_id' =>
$this->unmarshal($this->db->f('responsibility_id'), 'string'),
Modified: branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -599,11 +599,14 @@
if(isset($org_unit_id) && $org_unit_id > 0)
{
- $use_fellesdata =
$config->config_data['use_fellesdata'];
- if(!$use_fellesdata){
+ $config =
CreateObject('phpgwapi.config','rental');
+ $config->read();
+
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
+ if(!$use_fellesdata){
return;
}
-
+
$bofelles = rental_bofellesdata::get_instance();
$org_unit_with_leader =
$bofelles->get_result_unit_with_leader($org_unit_id);
Modified: branches/Version-1_0-branch/rental/inc/model/class.party.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/model/class.party.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/inc/model/class.party.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -43,6 +43,7 @@
protected $sync_data;
protected $sync_problems = array();
protected $org_enhet_id;
+ protected $unit_leader;
public function __construct($id = 0)
{
@@ -119,7 +120,14 @@
{
$this->org_enhet_id = $org_enhet_id;
}
+
+ public function get_unit_leader() { return $this->unit_leader; }
+ public function set_unit_leader($unit_leader)
+ {
+ $this->unit_leader = $unit_leader;
+ }
+
public function get_sync_data() { return $this->sync_data; }
public function set_sync_data($sync_data)
@@ -388,6 +396,7 @@
'service_id' => $this->sync_data['service_id'],
'responsibility_id' =>
$this->sync_data['responsibility_id'],
'org_enhet_id' => $this->get_org_enhet_id(),
+ 'unit_leader' => $this->get_unit_leader(),
'sync_message' =>
implode('<br/>',$this->get_sync_problems())
);
Modified: branches/Version-1_0-branch/rental/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/rental/setup/phpgw_no.lang 2011-10-03
10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/setup/phpgw_no.lang 2011-10-03
10:56:55 UTC (rev 7781)
@@ -399,6 +399,7 @@
orphan_units rental no Ubrukte arealer
or rental no eller
org_enhet_id rental no Organisasjonsenhet
+org_unit_person rental no Enhetsleder
org_unit_name rental no Navn på tilsvarende enhet i Fellesdata
org_unit_exist rental no Eksisterer
other_guarantee rental no Annen garanti
@@ -567,6 +568,7 @@
upload rental no Last opp
url rental no Nettsted
Unable to get a location code for the building. rental no Klarte
ikke å hente objektnummer for bygget.
+unit_leader rental no Enhetsleder
username rental no Brukernavn
user_or_group rental no Bruker/Gruppe
vacant rental no Ledig
Modified: branches/Version-1_0-branch/rental/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/setup/setup.inc.php 2011-10-03
10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/setup/setup.inc.php 2011-10-03
10:56:55 UTC (rev 7781)
@@ -1,6 +1,6 @@
<?php
$setup_info['rental']['name'] = 'rental'; // Module
identifier
- $setup_info['rental']['version'] = '0.1.0.14'; // Current module
version
+ $setup_info['rental']['version'] = '0.1.0.15'; // Current module
version
$setup_info['rental']['app_order'] = 51; // (?)
$setup_info['rental']['tables'] = array(
'rental_party', // All
contract participants, tenants etc.
Modified: branches/Version-1_0-branch/rental/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/setup/tables_current.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/setup/tables_current.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -178,9 +178,10 @@
'url' => array('type' =>
'varchar','precision' => '255','nullable' => true),
'account_number' => array('type' =>
'varchar','precision' => '255','nullable' => true),
'reskontro' => array('type' =>
'varchar','precision' => '255','nullable' => true),
- 'location_id' => array('type' =>
'int', 'precision' => '4', 'nullable' => true),
+ 'location_id' => array('type' =>
'int', 'precision' => '4', 'nullable' => true),
'result_unit_number' => array('type' =>
'varchar','precision' => '255','nullable' => true),
- 'org_enhet_id' => array ('type'
=> 'int','precision' => 8, 'nullable' => true)
+ 'org_enhet_id' => array
('type' => 'int','precision' => 8, 'nullable' => true),
+ 'unit_leader' => array ('type'
=> 'varchar','precision' => '255', 'nullable' => true)
),
'pk' => array('id'),
'fk' => array(),
Modified: branches/Version-1_0-branch/rental/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/setup/tables_update.inc.php
2011-10-03 10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/setup/tables_update.inc.php
2011-10-03 10:56:55 UTC (rev 7781)
@@ -253,4 +253,18 @@
$GLOBALS['setup_info']['rental']['currentver'] = '0.1.0.14';
return $GLOBALS['setup_info']['rental']['currentver'];
}
+
+ $test[] = '0.1.0.14';
+ function rental_upgrade0_1_0_14()
+ {
+ // Add unit_leader column
+ $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_party',
'unit_leader', array(
+ 'type' => 'varchar',
+ 'nullable' => true,
+ 'precision' => '255'
+ ));
+
+ $GLOBALS['setup_info']['rental']['currentver'] = '0.1.0.15';
+ return $GLOBALS['setup_info']['rental']['currentver'];
+ }
?>
\ No newline at end of file
Modified: branches/Version-1_0-branch/rental/templates/base/party.php
===================================================================
--- branches/Version-1_0-branch/rental/templates/base/party.php 2011-10-03
10:46:40 UTC (rev 7780)
+++ branches/Version-1_0-branch/rental/templates/base/party.php 2011-10-03
10:56:55 UTC (rev 7781)
@@ -340,7 +340,7 @@
if ($editable)
{
?>
- <select
name="location_id" id="location_id">
+ <select
id="location_id" name="location_id">
<option
value=""><?php echo lang('no_party_location') ?></option>
<?php
$city_counsil_departments = array_reverse(location_hierarchy::get_hierarchy());
@@ -416,12 +416,35 @@
}
?>
</dd>
- </dl>
+ <dt>
+ <?php
if($party->get_unit_leader() || $editable) { ?>
+ <label for="unit_leader"><?php
echo lang('unit_leader') ?></label>
+ <?php } ?>
+ </dt>
+ <dd>
+ <?php
+ if ($editable)
+ {
+ ?>
+ <input type="text"
name="unit_leader" id="unit_leader" value="<?php echo $party->get_unit_leader()
?>" />
+ <?php
+ }
+ else
+ {
+ echo
$party->get_unit_leader();
+ }
+ ?>
+ </dd>
+ </dl>
<div class="form-buttons">
<?php
if ($editable) {
echo '<input
type="submit" name="save_party" value="' . lang('save') . '"/>';
}
+
+ if ($use_fellesdata) {
+ echo '<input
type="button" id="fetchSyncData" name="synchronize" value="' .
lang('get_synchronization_data') . '"/>';
+ }
?>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7781] Merge 7768:7780 from trunk,
Sigurd Nes <=