[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8163] Merge 8155:8162 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8163] Merge 8155:8162 from trunk |
Date: |
Tue, 22 Nov 2011 12:14:30 +0000 |
Revision: 8163
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8163
Author: sigurdne
Date: 2011-11-22 12:14:27 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
Merge 8155:8162 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
branches/Version-1_0-branch/property/inc/export/default/Basware_X114
Added Paths:
-----------
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_reciept.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154
+
/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
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -974,6 +974,11 @@
}
$district = $org_info['district'];
$status = $org_info['status'];
+ $original_org_id = $org_info['original_org_id'];
+ if(!isset($original_org_id) || $original_org_id == '')
+ {
+ $original_org_id = 0;
+ }
$columns[] = 'name';
$columns[] = 'homepage';
@@ -986,6 +991,7 @@
$columns[] = 'orgno';
$columns[] = 'district';
$columns[] = 'change_type';
+ $columns[] = 'original_org_id';
$cols = implode(',',$columns);
$values[] = "'{$name}'";
@@ -999,6 +1005,7 @@
$values[] = "'{$orgnr}'";
$values[] = "'{$district}'";
$values[] = "'{$status}'";
+ $values[] = $original_org_id;
$vals = implode(',',$values);
//var_dump("INSERT INTO activity_organization ({$cols}) VALUES
({$vals})");
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -153,6 +153,7 @@
$columns[] = 'org.district';
$columns[] = 'org.change_type';
$columns[] = 'org.transferred';
+ $columns[] = 'org.original_org_id';
$columns[] = 'org.orgno AS organization_number';
$cols = implode(',',$columns);
@@ -175,7 +176,7 @@
$columns[] = 'org.email';
$columns[] = 'org.description';
$columns[] = 'org.active';
- $columns[] = 'org.street';
+ $columns[] = 'org.street AS address';
$columns[] = 'org.zip_code';
$columns[] = 'org.city';
$columns[] = 'org.district';
@@ -379,6 +380,7 @@
$district = $organization->get_district();
$change_type = $organization->get_change_type();
$transferred = ($organization->get_transferred() == 1 ||
$organization->get_transferred() == true)?'true':'false';
+ $original_org_id = ($organization->get_original_org_id() &&
$organization->get_original_org_id() !=
'')?$organization->get_original_org_id():0;
$values[] = "NAME='{$name}'";
$values[] = "HOMEPAGE='{$homepage}'";
@@ -390,6 +392,7 @@
$values[] = "DISTRICT='{$district}'";
$values[] = "CHANGE_TYPE='{$change_type}'";
$values[] = "TRANSFERRED={$transferred}";
+ $values[] = "ORIGINAL_ORG_ID={$original_org_id}";
$vals = implode(',',$values);
$sql = "UPDATE activity_organization SET {$vals} WHERE
ID={$organization->get_id()}";
@@ -430,7 +433,7 @@
$organization->set_name($this->unmarshal($this->db->f('name'), 'string'));
$organization->set_organization_number($this->unmarshal($this->db->f('organization_number'),
'int'));
-
$organization->set_address($this->unmarshal($this->db->f('address'), 'string'));
+
$organization->set_address($this->unmarshal($this->db->f('address'),
'string').','.$this->unmarshal($this->db->f('zip_code'), 'string').'
'.$this->unmarshal($this->db->f('city'), 'string'));
$organization->set_phone($this->unmarshal($this->db->f('phone'), 'string'));
$organization->set_email($this->unmarshal($this->db->f('email'), 'string'));
$organization->set_homepage($this->unmarshal($this->db->f('homepage'),
'string'));
@@ -439,6 +442,7 @@
$organization->set_change_type($this->unmarshal($this->db->f('change_type'),
'string'));
$organization->set_transferred($this->unmarshal($this->db->f('transferred'),
'bool'));
$organization->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'),
'int'));
+
$organization->set_original_org_id($this->unmarshal($this->db->f('original_org_id'),
'int'));
}
return $organization;
}
@@ -464,7 +468,16 @@
$city = '';
}*/
$district = $organization->get_district();
+ if($organization->get_original_org_id() &&
$organization->get_original_org_id() != '')
+ {
+ $original_org_id =
$organization->get_original_org_id();
+ }
+ else
+ {
+ $original_org_id = 0;
+ }
+
$values[] = "NAME='{$name}'";
$values[] = "HOMEPAGE='{$homepage}'";
$values[] = "PHONE='{$phone}'";
@@ -475,6 +488,7 @@
//$values[] = "'{$city}'";
$values[] = "ORGNO='{$orgnr}'";
$values[] = "DISTRICT='{$district}'";
+ $values[] = "ORIGINAL_ORG_ID={$original_org_id}";
$vals = implode(',',$values);
//var_dump("INSERT INTO activity_organization ({$cols}) VALUES
({$vals})");
@@ -574,11 +588,77 @@
$organization->set_change_type($this->unmarshal($this->db->f('change_type'),
'string'));
$organization->set_transferred($this->unmarshal($this->db->f('transferred'),
'bool'));
$organization->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'),
'int'));
+
$organization->set_original_org_id($this->unmarshal($this->db->f('original_org_id'),
'int'));
return $organization;
}
}
+ function update_organization($org_info)
+ {
+ $name = $org_info['name'];
+ $orgid = (int)$org_info['orgid'];
+ $homepage = $org_info['homepage'];
+ if(!$homepage)
+ {
+ $homepage = '';
+ }
+ $phone = $org_info['phone'];
+ if(!$phone)
+ {
+ $phone = '';
+ }
+ $email = $org_info['email'];
+ if(!$email)
+ {
+ $email = '';
+ }
+ $description = $org_info['description'];
+ if(!$description)
+ {
+ $description = '';
+ }
+ $street = $org_info['street'];
+ if(!$street)
+ {
+ $street = '';
+ }
+ $zip = $org_info['zip'];
+ if($zip && strlen($zip) > 5)
+ {
+ $zip_code = substr($zip,0,4);
+ $city = substr($zip, 5);
+ }
+ else
+ {
+ $zip_code = '';
+ $city = '';
+ }
+ $district = $org_info['district'];
+ if(!$district)
+ {
+ $district = '';
+ }
+ $activity_id = $org_info['activity_id'];
+ $show_in_portal = 1;
+
+ $values = array(
+ 'name = ' . $this->marshal($name, 'string'),
+ 'homepage = ' . $this->marshal($homepage, 'string'),
+ 'phone = ' . $this->marshal($phone, 'string'),
+ 'email = ' . $this->marshal($email, 'string'),
+ 'description = ' . $this->marshal($description,
'string'),
+ 'street = ' . $this->marshal($street, 'string'),
+ 'zip_code = ' . $this->marshal($zip_code, 'string'),
+ 'city = ' . $this->marshal($city, 'string'),
+ 'district = ' . $this->marshal($district),
+ 'activity_id = ' . $this->marshal($activity_id, 'int'),
+ 'show_in_portal = 1'
+ );
+
+ $result = $this->db->query('UPDATE bb_organization SET ' .
join(',', $values) . " WHERE id=$orgid", __LINE__,__FILE__);
+ }
+
function update($organization)
{
return false;
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -9,6 +9,11 @@
class activitycalendar_uiorganization extends activitycalendar_uicommon
{
+ protected $so_org;
+ protected $so_group;
+ protected $so_contact;
+ protected $so_activity;
+
public $public_functions = array
(
'index' => true,
@@ -22,6 +27,10 @@
public function __construct()
{
parent::__construct();
+ $so_org = activitycalendar_soorganization::get_instance();
+ $so_group = activitycalendar_sogroup::get_instance();
+ $so_contact = activitycalendar_socontactperson::get_instance();
+ $so_activity = activitycalendar_soactivity::get_instance();
self::set_active_menu('activitycalendar::organizationList');
$config = CreateObject('phpgwapi.config','activitycalendar');
$config->read();
@@ -32,7 +41,7 @@
if(phpgw::get_var('phpgw_return_as') == 'json') {
return $this->index_json();
}
-
+
$this->render('organization_list.php');
}
@@ -74,10 +83,7 @@
if($type)
{
//var_dump($type);
- $so = activitycalendar_sogroup::get_instance();
- $so_contact =
activitycalendar_socontactperson::get_instance();
- $so_activity =
activitycalendar_soactivity::get_instance();
- $group_array = $so->get(null, null, null, null, null,
null, array('id' => $id, 'changed_groups' => 'true'));
+ $group_array = $so_group->get(null, null, null, null,
null, null, array('id' => $id, 'changed_groups' => 'true'));
if(count($group_array) > 0){
$keys = array_keys($group_array);
$group = $group_array[$keys[0]];
@@ -103,7 +109,7 @@
$contact2['org_id'] = 0;
$contact2['group_id'] = $group->get_id();
- if($so->update_local($group))
+ if($so_group->update_local($group))
{
$so_contact->update_local_contact_person($contact1);
$so_contact->update_local_contact_person($contact2);
@@ -137,7 +143,7 @@
$contact2_email =
phpgw::get_var('contact2_email');
- $new_group_id =
$so->transfer_group($group_info);
+ $new_group_id =
$so_group->transfer_group($group_info);
if($new_group_id)
{
//update activity with new org id
@@ -170,7 +176,7 @@
//set local group as stored
$group->set_change_type('added');
$group->set_transferred(true);
- $so->update_local($group);
+ $so_group->update_local($group);
}
else
{
@@ -196,10 +202,10 @@
else
{
//var_dump('org');
- $so = activitycalendar_soorganization::get_instance();
+ $so_org =
activitycalendar_soorganization::get_instance();
$so_activity =
activitycalendar_soactivity::get_instance();
$so_contact =
activitycalendar_socontactperson::get_instance();
- $org_array = $so->get(null, null, null, null, null,
null, array('id' => $id, 'changed_orgs' => 'true'));
+ $org_array = $so_org->get(null, null, null, null, null,
null, array('id' => $id, 'changed_orgs' => 'true'));
if(count($org_array)>0){
$keys = array_keys($org_array);
$org = $org_array[$keys[0]];
@@ -233,7 +239,7 @@
$contact2['org_id'] = $org->get_id();
$contact2['group_id'] = 0;
- if($so->update_local($org))
+ if($so_org->update_local($org))
{
$so_contact->update_local_contact_person($contact1);
$so_contact->update_local_contact_person($contact2);
@@ -286,7 +292,7 @@
$contact2_email =
phpgw::get_var('contact2_email');
- $new_org_id =
$so->transfer_organization($org_info);
+ $new_org_id =
$so_org->transfer_organization($org_info);
if($new_org_id)
{
//update activity with new org id
@@ -319,7 +325,7 @@
//set local organization as stored
$org->set_change_type("added");
$org->set_transferred(true);
- $so->update_local($org);
+ $so_org->update_local($org);
}
else
{
@@ -327,6 +333,75 @@
}
}
+ else if(isset($_POST['update_organization'])) // The
user has pressed the store button
+ {
+ $original_org_id =
phpgw::get_var('original_org_id');
+ $org_info['orgid'] = $original_org_id;
+ $orgno = phpgw::get_var('orgno');
+ $district = phpgw::get_var('org_district');
+ $homepage = phpgw::get_var('homepage');
+ $email = phpgw::get_var('email');
+ $phone = phpgw::get_var('phone');
+ $address_tmp = phpgw::get_var('address');
+ //phpgw::get_var('address') . ' ' .
phpgw::get_var('number') . ', ' . phpgw::get_var('postaddress');
+ $address_array = explode(",",$address_tmp);
+ $desc = phpgw::get_var('org_description');
+
+ $org_info = array();
+ $org_info['name'] = $org->get_name(); //new
+ $orgno_tmp = $orgno;
+ if(strlen($orgno_tmp) > 9)
+ {
+ $orgno_tmp = NULL;
+ }
+ $org_info['orgnr'] = $orgno_tmp;
+
+ $org_info['homepage'] = $homepage;
+ $org_info['phone'] = $phone;
+ $org_info['email'] = $email;
+ $org_info['description'] = $desc;
+ $org_info['street'] = $address_array[0];
+ $org_info['zip'] = $address_array[1];
+ $org_info['activity_id'] = '';
+ $org_info['district'] = $district;
+
+ $contact1_id = phpgw::get_var('contact1_id');
+ $contact2_id = phpgw::get_var('contact2_id');
+
+ $contact1_name =
phpgw::get_var('contact1_name');
+ $contact1_phone =
phpgw::get_var('contact1_phone');
+ $contact1_email =
phpgw::get_var('contact1_email');
+
+ $contact2_name =
phpgw::get_var('contact2_name');
+ $contact2_phone =
phpgw::get_var('contact2_phone');
+ $contact2_email =
phpgw::get_var('contact2_email');
+
+
+ $so_org->update_organization($org_info);
+
$so_activity->delete_contact_persons($original_org_id);
+
+ //add contact persons to booking
+ $contact1 = array();
+ $contact1['name'] = $contact1_name;
+ $contact1['phone'] = $contact1_phone;
+ $contact1['mail'] = $contact1_email;
+ $contact1['org_id'] = $original_org_id;
+ $so_activity->add_contact_person_org($contact1);
+
+ $contact2 = array();
+ $contact2['name'] = $contact2_name;
+ $contact2['phone'] = $contact2_phone;
+ $contact2['mail'] = $contact_mail_2;
+ $contact2['org_id'] = $original_org_id;
+ $so_activity->add_contact_person_org($contact2);
+
+ $message = lang('messages_saved_form');
+
+ //set local organization as stored
+ $org->set_change_type("added");
+ $org->set_transferred(true);
+ $so_org->update_local($org);
+ }
$contact_persons =
$so_contact->get_local_contact_persons($org->get_id());
$cp1 = $contact_persons[0];
Modified:
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -17,6 +17,7 @@
protected $address;
protected $change_type;
protected $transferred;
+ protected $original_org_id;
/**
* Constructor. Takes an optional ID. If a organization is
created from outside
@@ -113,6 +114,13 @@
public function get_transferred() { return $this->transferred; }
+ public function set_original_org_id($original_org_id)
+ {
+ $this->original_org_id = $original_org_id;
+ }
+
+ public function get_original_org_id() { return
$this->original_org_id; }
+
public function serialize()
{
$so_org =
activitycalendar_soorganization::get_instance();
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-11-22 12:14:27 UTC (rev 8163)
@@ -423,4 +423,5 @@
time_helptext activitycalendar no Oppgi tidspunkt for
aktiviteten, f.eks. onsdag kl. 20-21
office_helptext activitycalendar no Oppgi kontor som
saksbehandler aktiviteten
contact_info activitycalendar no Kontaktinformasjon for
kulturkontoret
-contact_info_helptext activitycalendar no Hentes fra
booking/organisasjonsregister ved lagring.
\ No newline at end of file
+contact_info_helptext activitycalendar no Hentes fra
booking/organisasjonsregister ved lagring.
+update_org activitycalendar no Oppdater organisasjonsregister
\ No newline at end of file
Modified: branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -1,6 +1,6 @@
<?php
$setup_info['activitycalendar']['name'] = 'activitycalendar';
- $setup_info['activitycalendar']['version'] = '0.1.7';
+ $setup_info['activitycalendar']['version'] = '0.1.8';
$setup_info['activitycalendar']['app_order'] = 60;
$setup_info['activitycalendar']['enable'] = 1;
$setup_info['activitycalendar']['app_group'] = 'office';
Modified:
branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -56,7 +56,8 @@
'address' => array('type' =>
'varchar','precision' => '255','nullable' => false),
'orgno' => array('type' =>
'varchar','precision' => '255','nullable' => false),
'change_type' => array('type' =>
'varchar','precision' => '255','nullable' => false),
- 'transferred' => array('type' =>
'bool','nullable' => true,'default' => 'false')
+ 'transferred' => array('type' =>
'bool','nullable' => true,'default' => 'false'),
+ 'original_org_id' => array('type' =>
'int','precision' => 4,'nullable' => true)
),
'pk' => array('id'),
'fk' => array(),
Modified:
branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -158,4 +158,17 @@
return $GLOBALS['setup_info']['activitycalendar']['currentver'];
}
+ $test[] = '0.1.7';
+ function activitycalendar_upgrade0_1_7()
+ {
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_organization','original_org_id',array(
+ 'type' => 'int',
+ 'precision' => 4,
+ 'nullable' => true
+ ));
+
+ $GLOBALS['setup_info']['activitycalendar']['currentver'] =
'0.1.8';
+ return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+ }
+
?>
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -9,6 +9,7 @@
<div id="details">
<form action="#" method="post">
<input type="hidden" name="id" value="<?php
if($organization->get_id()){ echo $organization->get_id(); } else { echo '0'; }
?>"/>
+ <input type="hidden" name="original_org_id"
value="<?php if($organization->get_original_org_id()){ echo
$organization->get_original_org_id(); } else { echo '0'; } ?>"/>
<dl class="proplist-col">
<dt><label
for="orgname">Organisasjonsnavn</label></dt>
<dd><?php echo $organization->get_name();?></dd>
@@ -25,7 +26,12 @@
<dt><label for="district">Bydel</label></dt>
<dd>
<?php if($editable){?>
- <?php $curr_district =
$organization->get_district();?>
+ <?php $curr_district =
$organization->get_district();
+ if(!is_numeric($curr_district))
+ {
+ $curr_district =
activitycalendar_soactivity::get_instance()->get_district_from_name($organization->get_district());
+ }
+ ?>
<select name="org_district">
<option value="0">Ingen bydel
valgt</option>
<?php
@@ -122,7 +128,14 @@
<?php
if ($editable) {
echo '<input type="submit"
name="save_organization" value="' . lang('save') . '"/>';
- echo '<input type="submit"
name="store_organization" value="' . lang('store') . '"/>';
+
if($organization->get_original_org_id() && $organization->get_original_org_id()
> 0)
+ {
+ echo '<input
type="submit" name="update_organization" value="' . lang('update_org') . '"/>';
+ }
+ else
+ {
+ echo '<input
type="submit" name="store_organization" value="' . lang('store') . '"/>';
+ }
}
?>
</div>
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -25,7 +25,8 @@
'view' => true,
'index' => true,
'get_organization_groups' => true,
- 'get_address_search' => true
+ 'get_address_search' => true,
+ 'edit_organization_values' => true
);
public function __construct()
@@ -274,6 +275,7 @@
{
$error =
lang('messages_form_error');
}
+ //$org_info_edit_url =
self::link('/index.php' ,array('menuaction' =>
'activitycalendarfrontend.uiactivity.edit_organization_values'));
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
@@ -634,4 +636,77 @@
//var_dump($search_string);
return
activitycalendar_soarena::get_instance()->get_address($search_string);
}
+
+ function edit_organization_values()
+ {
+ $org_id = phpgw::get_var('organization_id');
+ if(isset($org_id))
+ {
+ if(isset($_POST['save_org'])) //save updated
organization info
+ {
+ $organization =
$this->so_organization->get_single($org_id);
+
+ $org_info['name'] =
phpgw::get_var('orgname');
+ $org_info['orgnr'] =
phpgw::get_var('orgno');
+ $org_info['homepage'] =
phpgw::get_var('homepage');
+ $org_info['phone'] =
phpgw::get_var('phone');
+ $org_info['email'] =
phpgw::get_var('email');
+ $org_info['description'] =
phpgw::get_var('org_description');
+ $org_info['street'] =
phpgw::get_var('address');
+ //$org_info['zip'] =
phpgw::get_var('postaddress');
+ $org_info['district'] =
$organization->get_district();
+ $org_info['status'] = "change";
+ $org_info['original_org_id'] = $org_id;
+ $o_id =
$this->so_activity->add_organization_local($org_info);
+
+ //add contact persons
+ $contact1 = array();
+ $contact1['name'] =
phpgw::get_var('org_contact1_name');
+ $contact1['phone'] =
phpgw::get_var('org_contact1_phone');
+ $contact1['mail'] =
phpgw::get_var('org_contact1_email');
+ $contact1['org_id'] = $o_id;
+ $contact1['group_id'] = 0;
+
$this->so_activity->add_contact_person_local($contact1);
+
+ $contact2 = array();
+ $contact2['name'] =
phpgw::get_var('org_contact2_name');
+ $contact2['phone'] =
phpgw::get_var('org_contact2_phone');
+ $contact2['mail'] =
phpgw::get_var('org_contact2_email');
+ $contact2['org_id'] = $o_id;
+ $contact2['group_id'] = 0;
+
$this->so_activity->add_contact_person_local($contact2);
+
+ $message = lang('change_request_ok',
$org_info['name']);
+
+
$this->render('organization_reciept.php', array
+ (
+ 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
+ 'error' =>
isset($error) ? $error : phpgw::get_var('error')
+ )
+ );
+
+ }
+ else
+ {
+ $organization =
$this->so_organization->get_single($org_id);
+ $person_arr =
$this->so_contact->get(null, null, null, null, null, null,
array('organization_id' => $org_id));
+ foreach($person_arr as $p)
+ {
+ $persons[] = $p;
+ }
+
+ $this->render('organization_edit.php',
array
+ (
+ 'organization' =>
$organization,
+ 'contact1' =>
$persons[0],
+ 'contact2' =>
$persons[1],
+ 'districts' =>
$districts,
+ 'editable' => true,
+ 'message' =>
isset($message) ? $message : phpgw::get_var('message'),
+ 'error' =>
isset($error) ? $error : phpgw::get_var('error')
+ )
+ );
+ }
+ }
+ }
}
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
2011-11-22 12:14:27 UTC (rev 8163)
@@ -87,4 +87,5 @@
update_request_sent activitycalendarfrontend no
Oppdateringsforespørsel er sendt for aktiviteten "%1"
edit_activity activitycalendarfrontend no Endre aktivitet
activity_edit_helptext activitycalendarfrontend no Velg
aktiviteten du ønsker å endre fra listen under.
-send_change_request activitycalendarfrontend no Send inn
endringsønske
\ No newline at end of file
+send_change_request activitycalendarfrontend no Send inn
endringsønske
+edit_organization activitycalendarfrontend no Rediger
organisasjonsinformasjon
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -31,7 +31,7 @@
$setup_info['activitycalendarfrontend']['depends'][] = array(
'appname' => 'activitycalendar',
- 'versions' => Array('0.1.3','0.1.4','0.1.5','0.1.6','0.1.7')
+ 'versions' =>
Array('0.1.3','0.1.4','0.1.5','0.1.6','0.1.7','0.1.8')
);
/* The hooks this app includes, needed for hooks registration */
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -131,6 +131,7 @@
</dt>
<dd>
<?php echo $organization->get_name();?>
+ <a
href="index.php?menuaction=activitycalendarfrontend.uiactivity.edit_organization_values&organization_id=<?php
echo $organization->get_id();?>"><?php echo lang('edit_organization');?></a>
</dd>
<dt>
<label for="group_id"
id="group_label"><?php echo lang('group') ?></label>
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -343,7 +343,7 @@
<dd><?php echo
$organization->get_phone()?></dd>
<dt><label
for="street">Adresse</label></dt>
<dd><?php echo
$organization->get_address()?></dd>
- <dt><label
for="org_description">Beskrivelse</label></dt>
+ <dt><label
for="org_description">Beskrivelse av aktiviteten</label></dt>
<dd><?php echo
$organization->get_description()?></dd>
<hr/>
<dt>Kontaktperson 1</dt>
Copied:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
(from rev 8162,
trunk/activitycalendarfrontend/templates/base/organization_edit.php)
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
(rev 0)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -0,0 +1,123 @@
+<?php
+ //include common logic for all templates
+// include("common.php");
+?>
+
+<script type="text/javascript">
+function get_address_search()
+{
+ var address = document.getElementById('address_txt').value;
+ var div_address = document.getElementById('address_container');
+
+ url =
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
+
+var divcontent_start = "<select name=\"address\" id=\"address\" size\"5\">";
+var divcontent_end = "</select>";
+
+ var callback = {
+ success: function(response){
+ div_address.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
+ },
+ failure: function(o) {
+ alert("AJAX doesn't work"); //FAILURE
+ }
+ }
+ var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+
+}
+
+function allOK()
+{
+ if(document.getElementById('title').value == null ||
document.getElementById('title').value == '')
+ {
+ alert("Tittel må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('internal_arena_id').value == null ||
document.getElementById('internal_arena_id').value == 0)
+ {
+ if(document.getElementById('arena_id').value == null ||
document.getElementById('arena_id').value == 0)
+ {
+ alert("Arena må fylles ut!");
+ return false;
+ }
+ }
+ if(document.getElementById('time').value == null ||
document.getElementById('time').value == '')
+ {
+ alert("Tid må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('category').value == null ||
document.getElementById('category').value == 0)
+ {
+ alert("Kategori må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('office').value == null ||
document.getElementById('office').value == 0)
+ {
+ alert("Hovedansvarlig kulturkontor må fylles ut!");
+ return false;
+ }
+ else
+ return true;
+}
+
+</script>
+
+<div class="yui-content" style="width: 100%;">
+ <div id="details">
+
+ <?php if($message){?>
+ <div class="success">
+ <?php echo $message;?>
+ </div>
+ <?php }else if($error){?>
+ <div class="error">
+ <?php echo $error;?>
+ </div>
+ <?php }?>
+ </div>
+ <h1><?php echo lang('edit_organization') ?></h1>
+ <form action="#" method="post">
+ <input type="hidden" name="organization_id"
id="organization_id" value="<?php echo $organization->get_id()?>" />
+ <dl class="proplist-col" style="width: 200%">
+ <dt>
+ <label for="organization_id"><?php echo
lang('organization') ?></label>
+ </dt>
+ <dt><label
for="orgname">Organisasjonsnavn</label></dt>
+ <dd><input type="text"
name="orgname" value="<?php echo $organization->get_name()?>"/></dd>
+ <dt><label
for="orgno">Organisasjonsnummer</label></dt>
+ <dd><input type="text"
name="orgno" value="<?php echo
$organization->get_organization_number()?>"/></dd>
+ <dt><label
for="homepage">Hjemmeside</label></dt>
+ <dd><input type="text"
name="homepage" value="<?php echo $organization->get_homepage()?>"/></dd>
+ <dt><label
for="email">E-post</label></dt>
+ <dd><input type="text"
name="email" value="<?php echo $organization->get_email()?>"/></dd>
+ <dt><label
for="phone">Telefon</label></dt>
+ <dd><input type="text"
name="phone" value="<?php echo $organization->get_phone()?>"/></dd>
+ <dt><label
for="street">Gate</label></dt>
+ <dd><input type="text"
name="address" id="address" value="<?php echo $organization->get_address()?>"/>
+ <dt><label
for="org_description">Beskrivelse</label></dt>
+ <dd><textarea rows="10"
cols="100" name="org_description"><?php echo
$organization->get_description()?></textarea></dd>
+ <hr/>
+ <b>Kontaktperson 1</b><br/>
+ <dt><label
for="contact1_name">Navn</label>
+ <input type="text"
name="org_contact1_name" value="<?php echo
isset($contact1)?$contact1->get_name():''?>"/><br/>
+ <dt><label
for="contact1_phone">Telefon</label>
+ <input type="text"
name="org_contact1_phone" value="<?php echo
isset($contact1)?$contact1->get_phone():''?>"/><br/>
+ <dt><label
for="contact1_mail">E-post</label>
+ <input type="text"
name="org_contact1_email" value="<?php echo
isset($contact1)?$contact1->get_email():''?>"/><br/>
+ <b>Kontaktperson 2</b><br/>
+ <dt><label
for="contact2_name">Navn</label>
+ <input type="text"
name="org_contact2_name" value="<?php echo
isset($contact2)?$contact2->get_name():''?>"/><br/>
+ <dt><label
for="contact2_phone">Telefon</label>
+ <input type="text"
name="org_contact2_phone" value="<?php echo
isset($contact2)?$contact2->get_phone():''?>"/><br/>
+ <dt><label
for="contact2_mail">E-post</label>
+ <input type="text"
name="org_contact2_email" value="<?php echo
isset($contact2)?$contact2->get_email():''?>"/><br/>
+ </dt>
+ <div class="form-buttons">
+ <input type="submit" name="save_org"
value="<?php echo lang('send_change_request') ?>"/>
+ </div>
+ </dl>
+
+ </form>
+
+ </div>
+</div>
\ No newline at end of file
Copied:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_reciept.php
(from rev 8162,
trunk/activitycalendarfrontend/templates/base/organization_reciept.php)
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_reciept.php
(rev 0)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_reciept.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -0,0 +1,80 @@
+<?php
+ //include common logic for all templates
+// include("common.php");
+?>
+
+<script type="text/javascript">
+function get_address_search()
+{
+ var address = document.getElementById('address_txt').value;
+ var div_address = document.getElementById('address_container');
+
+ url =
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&phpgw_return_as=json&search="
+ address;
+
+var divcontent_start = "<select name=\"address\" id=\"address\" size\"5\">";
+var divcontent_end = "</select>";
+
+ var callback = {
+ success: function(response){
+ div_address.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
+ },
+ failure: function(o) {
+ alert("AJAX doesn't work"); //FAILURE
+ }
+ }
+ var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+
+}
+
+function allOK()
+{
+ if(document.getElementById('title').value == null ||
document.getElementById('title').value == '')
+ {
+ alert("Tittel må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('internal_arena_id').value == null ||
document.getElementById('internal_arena_id').value == 0)
+ {
+ if(document.getElementById('arena_id').value == null ||
document.getElementById('arena_id').value == 0)
+ {
+ alert("Arena må fylles ut!");
+ return false;
+ }
+ }
+ if(document.getElementById('time').value == null ||
document.getElementById('time').value == '')
+ {
+ alert("Tid må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('category').value == null ||
document.getElementById('category').value == 0)
+ {
+ alert("Kategori må fylles ut!");
+ return false;
+ }
+ if(document.getElementById('office').value == null ||
document.getElementById('office').value == 0)
+ {
+ alert("Hovedansvarlig kulturkontor må fylles ut!");
+ return false;
+ }
+ else
+ return true;
+}
+
+</script>
+
+<div class="yui-content" style="width: 100%;">
+ <h1><?php echo lang('edit_organization') ?></h1>
+ <div id="details">
+
+ <?php if($message){?>
+ <div class="success">
+ <?php echo $message;?>
+ </div>
+ <?php }else if($error){?>
+ <div class="error">
+ <?php echo $error;?>
+ </div>
+ <?php }?>
+ </div>
+ </div>
+</div>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
---
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
2011-11-22 11:52:53 UTC (rev 8162)
+++
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
2011-11-22 12:14:27 UTC (rev 8163)
@@ -379,6 +379,11 @@
$kidnr = $_data['KIDNO'];
+ if($order_id)
+ {
+ $buffer[$i]['project_id'] =
$this->soXport->get_project($order_id);
+ }
+
$buffer[$i]['external_ref']
= $_data['SCANNINGNO'];
$buffer[$i]['pmwrkord_code'] =
$order_id;
$buffer[$i]['fakturanr']
= $fakturanr;
Modified: branches/Version-1_0-branch/property/inc/export/default/Basware_X114
===================================================================
--- branches/Version-1_0-branch/property/inc/export/default/Basware_X114
2011-11-22 11:52:53 UTC (rev 8162)
+++ branches/Version-1_0-branch/property/inc/export/default/Basware_X114
2011-11-22 12:14:27 UTC (rev 8163)
@@ -668,9 +668,9 @@
'ACCOUNTLINK.CODE' =>
$line['spbudact_code'], // 4180
'AMOUNT'
=> $amount, // 312500
'APPROVER.FULLNAME' =>
$GLOBALS['phpgw_info']['user']['fullname'], //Batch 04 - 14
- 'DIMENSION.D1.CODE' =>
$line['dima'], // 1111
- 'DIMENSION.D2.CODE' =>
$line['dimb'], // 62000
- 'DIMENSION.D3.CODE' =>
$dim3, // dummy
+ 'DIMENSION.D1.CODE' =>
$line['dimb'], // 1111
+ 'DIMENSION.D2.CODE' =>
'',//$line['dima'], // 62000
+ 'DIMENSION.D3.CODE' =>
$line['project_id'], // dummy
'DIMENSION.D4.CODE' =>
$dim4, // dummy
'DIMENSION.D5.CODE' =>
$dim5, // dummy
'DIMENSION.D6.CODE' =>
$dim6, // dummy
@@ -807,6 +807,7 @@
'kidnr'
=> $this->db->f('kidnr'),
'typeid'
=> $this->db->f('typeid'),
'kildeid'
=> $this->db->f('kildeid'),
+ 'project_id' =>
$this->db->f('project_id'),
'order_id'
=> $this->db->f('pmwrkord_code'),
'belop'
=> $this->db->f('belop'),
'fakturadato' =>
$this->db->f('fakturadato'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8163] Merge 8155:8162 from trunk,
Sigurd Nes <=