[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7508] Merge 7505:7507 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7508] Merge 7505:7507 from trunk |
Date: |
Wed, 17 Aug 2011 09:11:46 +0000 |
Revision: 7508
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7508
Author: sigurdne
Date: 2011-08-17 09:11:46 +0000 (Wed, 17 Aug 2011)
Log Message:
-----------
Merge 7505:7507 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.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/activity.php
branches/Version-1_0-branch/property/inc/class.boevent.inc.php
branches/Version-1_0-branch/property/inc/class.soevent.inc.php
branches/Version-1_0-branch/property/inc/class.uievent.inc.php
branches/Version-1_0-branch/property/js/yahoo/event.index.js
Added Paths:
-----------
branches/Version-1_0-branch/activitycalendar/templates/base/group.php
branches/Version-1_0-branch/activitycalendar/templates/base/organization.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
+
/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
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -194,6 +194,8 @@
$columns[] = 'activity.last_change_date';
$columns[] = 'activity.contact_person_1';
$columns[] = 'activity.contact_person_2';
+ $columns[] = 'activity.contact_person_2_address';
+ $columns[] = 'activity.contact_person_2_zip';
$columns[] = 'activity.special_adaptation';
$columns[] = 'activity.secret';
@@ -264,6 +266,8 @@
'last_change_date = ' . $this->marshal($ts_now,
'int'),
'contact_person_1 = ' .
$this->marshal($activity->get_contact_person_1(), 'int'),
'contact_person_2 = ' .
$this->marshal($activity->get_contact_person_2(), 'int'),
+ 'contact_person_2_address = ' .
$this->marshal($activity->get_contact_person_2_address(), 'string'),
+ 'contact_person_2_zip = ' .
$this->marshal($activity->get_contact_person_2_zip(), 'string'),
'special_adaptation = '
.($activity->get_special_adaptation() ? "true" : "false")
);
@@ -295,6 +299,8 @@
'create_date',
'contact_person_1',
'contact_person_2',
+ 'contact_person_2_address',
+ 'contact_person_2_zip',
'secret',
'special_adaptation'
);
@@ -316,6 +322,8 @@
$this->marshal($ts_now, 'int'),
$this->marshal($activity->get_contact_person_1(),
'int'),
$this->marshal($activity->get_contact_person_2(),
'int'),
+
$this->marshal($activity->get_contact_person_2_address(), 'string'),
+ $this->marshal($activity->get_contact_person_2_zip(),
'string'),
$this->marshal($this->generate_secret(),'string'),
($activity->get_special_adaptation() ? "true" : "false")
);
@@ -364,11 +372,15 @@
$activity->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
'int'));
$activity->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
'bool')));
$activity->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
+
$activity->set_contact_person_2_address($this->unmarshal($this->db->f('contact_person_2_address'),
'string'));
+
$activity->set_contact_person_2_zip($this->unmarshal($this->db->f('contact_person_2_zip'),
'string'));
if($activity->get_group_id() &&
$activity->get_group_id() > 0)
{
$contacts =
activitycalendar_sogroup::get_instance()->get_contacts($activity->get_group_id());
$activity->set_contact_persons($contacts);
+ $org_tmp =
activitycalendar_sogroup::get_instance()->get_orgid_from_group($activity->get_group_id());
+ $activity->set_organization_id($org_tmp);
}
else if($activity->get_organization_id() &&
$activity->get_organization_id() > 0)
{
@@ -782,10 +794,30 @@
$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)
{
@@ -855,17 +887,17 @@
$columns[] = 'show_in_portal';
$cols = implode(',',$columns);
- $values[] = "{$name}";
- $values[] = "{$homepage}";
- $values[] = "{$phone}";
- $values[] = "{$email}";
- $values[] = "{$description}";
- $values[] = "{$street}";
- $values[] = "{$zip_code}";
- $values[] = "{$city}";
- $values[] = "{$district}";
- $values[] = "{$orgnr}";
- $values[] = $activity_id;
+ $values[] = "'{$name}'";
+ $values[] = "'{$homepage}'";
+ $values[] = "'{$phone}'";
+ $values[] = "'{$email}'";
+ $values[] = "'{$description}'";
+ $values[] = "'{$street}'";
+ $values[] = "'{$zip_code}'";
+ $values[] = "'{$city}'";
+ $values[] = "'{$district}'";
+ $values[] = "'{$orgnr}'";
+ $values[] = $this->marshal($activity_id, 'int');
$values[] = $show_in_portal;
$vals = implode(',',$values);
@@ -958,7 +990,7 @@
$values[] = "'{$name}'";
$values[] = "'{$description}'";
$values[] = "'{$orgid}'";
- $values[] = $activity_id;
+ $values[] = $this->marshal($activity_id, 'int');
$values[] = $show_in_portal;
$vals = implode(',',$values);
Modified: branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.sogroup.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -79,6 +79,10 @@
if(isset($filters['changed_groups'])){
$use_local_group = true;
unset($filter_clauses);
+ if(isset($filters[$this->get_id_field_name()])){
+ $id =
$this->marshal($filters[$this->get_id_field_name()],'int');
+ $filter_clauses[] = "activity_group.id = {$id}";
+ }
}
if(count($filter_clauses))
@@ -195,6 +199,20 @@
return $result;
}
+ function get_orgid_from_group($group_id)
+ {
+ $result = 0;
+ if(isset($group_id)){
+ $q1="SELECT organization_id FROM bb_group WHERE id={$group_id}";
+ $this->db->query($q1, __LINE__, __FILE__);
+ while($this->db->next_record()){
+ $result = $this->db->f('organization_id');
+ }
+ }
+
+ return $result;
+ }
+
function get_contacts($group_id)
{
$contacts = array();
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -88,6 +88,10 @@
//$id =
$this->marshal($filters[$this->get_id_field_name()],'int');
//$filter_clauses[] = "org.id = {$id}";
unset($filter_clauses);
+ if(isset($filters[$this->get_id_field_name()])){
+ $id =
$this->marshal($filters[$this->get_id_field_name()],'int');
+ $filter_clauses[] = "org.id = {$id}";
+ }
}
/*
@@ -125,7 +129,7 @@
$columns[] = 'org.description';
$columns[] = 'org.address';
$columns[] = 'org.district';
- $columns[] = 'org.orgno';
+ $columns[] = 'org.orgno AS organization_number';
$cols = implode(',',$columns);
}
@@ -303,6 +307,10 @@
$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_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'));
$organization->set_district($this->unmarshal($this->db->f('district'),
'string'));
$organization->set_description($this->unmarshal($this->db->f('description'),
'string'));
$organization->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'),
'int'));
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -162,6 +162,8 @@
$activity->set_description($desc);
$activity->set_time(phpgw::get_var('time'));
$activity->set_contact_persons($persons);
+
$activity->set_contact_person_2_address(phpgw::get_var('contact_person_2_address'));
+
$activity->set_contact_person_2_zip(phpgw::get_var('contact_person_2_zip'));
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
if($so_activity->store($activity)) // ... and
then try to store the object
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -218,42 +218,93 @@
unset($contact3);
unset($contact4);
- $arena = new activitycalendar_arena();
- //8: sted, 9:adresse
- $arena_name = $this->decode($data[8]);
- $arena_address = $this->decode($data[9]);
- $curr_arena_id = 0;
-
- if($arena_name){
- $arena->set_arena_name($arena_name);
- $arena->set_address($arena_address);
+ $internal_arena = $this->decode($data[9]);
+ if($internal_arena)
+ {
+ $internal_arena_id = $internal_arena;
+ $curr_arena_id = "";
+ }
+ else
+ {
+ $arena = new activitycalendar_arena();
+ //8: sted, 10:adresse
+ $arena_name = $this->decode($data[8]);
+ $arena_address =
$this->decode($data[10]);
+ $curr_arena_id = 0;
+ $internal_arena_id = "";
- // All is good, store notification
- if ($soarena->store($arena)) {
- $this->messages[] =
"Successfully imported arena: Name ({$arena_name})";
- $curr_arena_id =
$arena->get_id();
- } else {
- $this->errors[] = "Error
importing arena: Name ({$arena_name})";
+ if($arena_name){
+
$arena->set_arena_name($arena_name);
+
$arena->set_address($arena_address);
+
+ // All is good, store
notification
+ if ($soarena->store($arena)) {
+ $this->messages[] =
"Successfully imported arena: Name ({$arena_name})";
+ $curr_arena_id =
$arena->get_id();
+ } else {
+ $this->errors[] =
"Error importing arena: Name ({$arena_name})";
+ $curr_arena_id = 0;
+ $arenaOK = false;
+ }
+ }
+ else
+ {
+ $this->errors[] = "Error
importing arena: Name not supplied";
$curr_arena_id = 0;
- $arenaOK = false;
}
}
- else
- {
- $this->errors[] = "Error importing
arena: Name not supplied";
- $curr_arena_id = 0;
- }
$activity = new activitycalendar_activity();
$activity_title = $this->decode($data[1]);
$activity_group = $this->decode($data[2]);
$activity_org = $this->decode($data[3]);
$activity_category = $this->decode($data[5]);
+ $org_name_tmp = $this->decode($data[1]);
+ if(strlen($org_name_tmp) > 50)
+ {
+ $org_name_tmp =
substr($org_name_tmp,0,49);
+ }
+ $org_email = $this->decode($data[15]);
+ if(strlen($org_email) > 50)
+ {
+ $org_email = substr($org_email,0,49);
+ }
+ $org_phone = $this->decode($data[14]);
+ if(strlen($org_phone) > 50)
+ {
+ $org_phone = substr($org_phone,0,49);
+ }
+ $contact_mail_2 = $this->decode($data[21]);
+ if(strlen($contact_mail_2) > 50)
+ {
+ $contact_mail_2 =
substr($contact_mail_2,0,49);
+ }
if($activity_category)
{
$activity_category =
$soactivity->get_category_from_name($activity_category);
}
+ $contact1_name = $this->decode($data[13]);
+ if(strlen($contact1_name) > 50)
+ {
+ $contact1_name =
substr($contact1_name,0,49);
+ }
+ $contact1_phone = $this->decode($data[14]);
+ if(strlen($contact1_phone) > 50)
+ {
+ $contact1_phone =
substr($contact1_phone,0,49);
+ }
+ $contact2_name = $this->decode($data[17]);
+ if(strlen($contact2_name) > 50)
+ {
+ $contact2_name =
substr($contact2_name,0,49);
+ }
+ $contact2_phone = $this->decode($data[20]);
+ if(strlen($contact2_phone) > 50)
+ {
+ $contact2_phone =
substr($contact2_phone,0,49);
+ }
+
if($activity_org)
{
$activity_org =
$soactivity->get_orgid_from_orgno($activity_org);
@@ -262,31 +313,31 @@
//update the organization found
$org_info = array();
$org_info['orgid'] =
$activity_org;
- $org_info['name'] =
$this->decode($data[2]); //new
- $org_info['homepage'] =
$this->decode($data[15]);
- $org_info['phone'] =
$this->decode($data[13]);
- $org_info['email'] =
$this->decode($data[12]);
+ $org_info['name'] =
$org_name_tmp; //new
+ $org_info['homepage'] =
$this->decode($data[16]);
+ $org_info['phone'] = $org_phone;
+ $org_info['email'] = $org_email;
$org_info['description'] =
$this->decode($data[6]);
- $org_info['street'] =
$this->decode($data[9]);
- $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['street'] =
$this->decode($data[10]);
+ $org_info['zip'] =
$this->decode($data[19]);
$org_info['activity_id'] =
$activity_category;
- $org_info['district'] =
$this->decode($data[22]);
+ $org_info['district'] =
$this->decode($data[23]);
$soactivity->update_organization($org_info);
//$new_org_id = $activity_org;
$soactivity->delete_contact_persons($activity_org);
$contact1 = array();
- $contact1['name'] =
$this->decode($data[12]);
- $contact1['phone'] =
$this->decode($data[13]);
- $contact1['mail'] =
$this->decode($data[14]);
+ $contact1['name'] =
$contact1_name;
+ $contact1['phone'] =
$contact1_phone;
+ $contact1['mail'] = $org_email;
$contact1['org_id'] =
$this->decode($activity_org);
$soactivity->add_contact_person_org($contact1);
$contact2 = array();
- $contact2['name'] =
$this->decode($data[16]);
- $contact2['phone'] =
$this->decode($data[19]);
- $contact2['mail'] =
$this->decode($data[20]);
+ $contact2['name'] =
$contact2_name;
+ $contact2['phone'] =
$contact2_phone;
+ $contact2['mail'] =
$contact_mail_2;
$contact2['org_id'] =
$this->decode($activity_org);
$soactivity->add_contact_person_org($contact2);
@@ -301,16 +352,16 @@
$new_group_id =
$soactivity->add_group($group_info);
$contact3 = array();
- $contact3['name'] =
$this->decode($data[12]);
- $contact3['phone'] =
$this->decode($data[13]);
- $contact3['mail'] =
$this->decode($data[14]);
+ $contact3['name'] =
$contact1_name;
+ $contact3['phone'] =
$contact1_phone;
+ $contact3['mail'] =
$org_email;
$contact3['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact3);
$contact4 = array();
- $contact4['name'] =
$this->decode($data[16]);
- $contact4['phone'] =
$this->decode($data[19]);
- $contact4['mail'] =
$this->decode($data[20]);
+ $contact4['name'] =
$contact2_name;
+ $contact4['phone'] =
$contact2_phone;
+ $contact4['mail'] =
$contact_mail_2;
$contact4['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact4);
@@ -351,29 +402,35 @@
else //add org unit
{
$org_info = array();
- $org_info['name'] =
$this->decode($data[2]); //new
- $org_info['orgnr'] =
$this->decode($data[3]);
- $org_info['homepage'] =
$this->decode($data[15]);
- $org_info['phone'] =
$this->decode($data[13]);
- $org_info['email'] =
$this->decode($data[14]);
+ $org_info['name'] =
$org_name_tmp; //new
+ $orgno_tmp =
$this->decode($data[3]);
+ if(strlen($orgno_tmp) > 9)
+ {
+ $orgno_tmp = NULL;
+ }
+ $org_info['orgnr'] =
$orgno_tmp;
+
+ $org_info['homepage'] =
$this->decode($data[16]);
+ $org_info['phone'] = $org_phone;
+ $org_info['email'] = $org_email;
$org_info['description'] =
$this->decode($data[6]);
- $org_info['street'] =
$this->decode($data[9]);
- $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['street'] =
$this->decode($data[10]);
+ $org_info['zip'] =
$this->decode($data[19]);
$org_info['activity_id'] =
$activity_category;
- $org_info['district'] =
$this->decode($data[22]);
+ $org_info['district'] =
$this->decode($data[23]);
$new_org_id =
$soactivity->add_organization($org_info);
$contact1 = array();
- $contact1['name'] =
$this->decode($data[12]);
- $contact1['phone'] =
$this->decode($data[13]);
- $contact1['mail'] =
$this->decode($data[14]);
+ $contact1['name'] =
$contact1_name;
+ $contact1['phone'] =
$contact1_phone;
+ $contact1['mail'] = $org_email;
$contact1['org_id'] =
$this->decode($new_org_id);
$soactivity->add_contact_person_org($contact1);
$contact2 = array();
- $contact2['name'] =
$this->decode($data[16]);
- $contact2['phone'] =
$this->decode($data[19]);
- $contact2['mail'] =
$this->decode($data[20]);
+ $contact2['name'] =
$contact2_name;
+ $contact2['phone'] =
$contact2_phone;
+ $contact2['mail'] =
$contact_mail_2;
$contact2['org_id'] =
$this->decode($new_org_id);
$soactivity->add_contact_person_org($contact2);
@@ -388,16 +445,16 @@
$new_group_id =
$soactivity->add_group($group_info);
$contact3 = array();
- $contact3['name'] =
$this->decode($data[12]);
- $contact3['phone'] =
$this->decode($data[13]);
- $contact3['mail'] =
$this->decode($data[14]);
+ $contact3['name'] =
$contact1_name;
+ $contact3['phone'] =
$contact1_phone;
+ $contact3['mail'] =
$org_email;
$contact3['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact3);
$contact4 = array();
- $contact4['name'] =
$this->decode($data[16]);
- $contact4['phone'] =
$this->decode($data[19]);
- $contact4['mail'] =
$this->decode($data[20]);
+ $contact4['name'] =
$contact2_name;
+ $contact4['phone'] =
$contact2_phone;
+ $contact4['mail'] =
$contact_mail_2;
$contact4['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact4);
@@ -418,31 +475,31 @@
}
else
{
- $org_info['name'] =
$this->decode($data[1]);
+ $org_info['name'] =
$org_name_tmp;
}
//$org_info['orgnr'] =
$this->decode($data[2]);
- $org_info['homepage'] =
$this->decode($data[15]);
- $org_info['phone'] =
$this->decode($data[13]);
- $org_info['email'] =
$this->decode($data[14]);
+ $org_info['homepage'] =
$this->decode($data[16]);
+ $org_info['phone'] = $org_phone;
+ $org_info['email'] = $org_email;
$org_info['description'] =
$this->decode($data[6]);
- $org_info['street'] =
$this->decode($data[9]);
- $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['street'] =
$this->decode($data[10]);
+ $org_info['zip'] =
$this->decode($data[19]);
$org_info['activity_id'] =
$activity_category;
- $org_info['district'] =
$this->decode($data[22]);
+ $org_info['district'] =
$this->decode($data[23]);
$new_org_id =
$soactivity->add_organization($org_info);
$contact1 = array();
- $contact1['name'] =
$this->decode($data[12]);
- $contact1['phone'] =
$this->decode($data[13]);
- $contact1['mail'] =
$this->decode($data[14]);
+ $contact1['name'] = $contact1_name;
+ $contact1['phone'] = $contact1_phone;
+ $contact1['mail'] = $org_email;
$contact1['org_id'] =
$this->decode($new_org_id);
$soactivity->add_contact_person_org($contact1);
$contact2 = array();
- $contact2['name'] =
$this->decode($data[16]);
- $contact2['phone'] =
$this->decode($data[19]);
- $contact2['mail'] =
$this->decode($data[20]);
+ $contact2['name'] = $contact2_name;
+ $contact2['phone'] = $contact2_phone;
+ $contact2['mail'] = $contact_mail_2;
$contact2['org_id'] =
$this->decode($new_org_id);
$soactivity->add_contact_person_org($contact2);
@@ -450,23 +507,23 @@
if($activity_group)
{
$group_info = array();
- $group_info['organization_id']
= $org_id;
+ $group_info['organization_id']
= $new_org_id;
$group_info['description'] =
$this->decode($data[6]);
$group_info['name'] =
$this->decode($data[1]);
$group_info['activity_id'] =
$activity_category;
$new_group_id =
$soactivity->add_group($group_info);
$contact3 = array();
- $contact3['name'] =
$this->decode($data[12]);
- $contact3['phone'] =
$this->decode($data[13]);
- $contact3['mail'] =
$this->decode($data[14]);
+ $contact3['name'] =
$contact1_name;
+ $contact3['phone'] =
$contact1_phone;
+ $contact3['mail'] = $org_email;
$contact3['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact3);
$contact4 = array();
- $contact4['name'] =
$this->decode($data[16]);
- $contact4['phone'] =
$this->decode($data[19]);
- $contact4['mail'] =
$this->decode($data[20]);
+ $contact4['name'] =
$contact2_name;
+ $contact4['phone'] =
$contact2_phone;
+ $contact4['mail'] =
$contact_mail_2;
$contact4['group_id'] =
$this->decode($new_group_id);
$soactivity->add_contact_person_group($contact4);
@@ -491,9 +548,9 @@
$activity_target = implode(",",
$act_targets);
}
- $activity_day = $this->decode($data[10]);
- $activity_time = $this->decode($data[11]);
- $activity_update_date =
$this->decode($data[21]);
+ $activity_day = $this->decode($data[11]);
+ $activity_time = $this->decode($data[12]);
+ $activity_update_date =
$this->decode($data[22]);
if($activity_update_date)
{
$act_update_array = explode(".",
$activity_update_date);
@@ -506,12 +563,15 @@
//var_dump($activity_updated_date);
}
}
- $activity_district = $this->decode($data[22]);
+ $activity_district = $this->decode($data[23]);
if($activity_district)
{
$activity_district =
$soactivity->get_district_from_name($activity_district);
}
+ $activity_contact_person_2_address =
$this->decode($data[18]);
+ $activity_contact_person_2_zip =
$this->decode($data[19]);
+
if($activity_title){
$activity->set_title($activity_title);
$activity->set_organization_id($activity_org);
@@ -520,6 +580,7 @@
$activity->set_target($activity_target);
$activity->set_description($activity_description);
$activity->set_arena($curr_arena_id);
+
$activity->set_internal_arena($internal_arena_id);
$activity->set_state(3);
$activity->set_time($activity_day.'
'.$activity_time);
if($activity_adapted)
@@ -528,6 +589,8 @@
}
$activity->set_office($this->office);
$activity->set_district($activity_district);
+
$activity->set_contact_person_2_address($activity_contact_person_2_address);
+
$activity->set_contact_person_2_zip($activity_contact_person_2_zip);
$activity->set_last_change_date($activity_updated_date);
if($activity_persons)
{
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -2,6 +2,7 @@
phpgw::import_class('activitycalendar.uicommon');
phpgw::import_class('activitycalendar.soorganization');
phpgw::import_class('activitycalendar.sogroup');
+phpgw::import_class('activitycalendar.soactivity');
include_class('activitycalendar', 'organization', 'inc/model/');
include_class('activitycalendar', 'group', 'inc/model/');
@@ -36,7 +37,8 @@
}
public function changed_organizations()
- {
+ {
+
self::set_active_menu('activitycalendar::organizationList::changed_organizations');
$this->render('organization_list_changed.php');
}
@@ -63,53 +65,150 @@
public function edit()
{
+ $GLOBALS['phpgw_info']['flags']['app_header'] .=
'::'.lang('edit');
$id = (int)phpgw::get_var('id');
$type = phpgw::get_var('type');
if($type)
{
//var_dump($type);
$so = activitycalendar_sogroup::get_instance();
+ $group = $so->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]];
+ }
+ if(isset($_POST['save_organization'])) // The user has
pressed the save button
+ {
+ $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 = phpgw::get_var('address');
+ $desc = phpgw::get_var('org_description');
+ }
+ else if(isset($_POST['store_organization'])) // The
user has pressed the store button
+ {
+ $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 = phpgw::get_var('address');
+ $desc = phpgw::get_var('org_description');
+ }
+
+ $data = array
+ (
+ 'group' => $group,
+ 'editable' => true,
+ 'errorMsgs' => $errorMsgs,
+ 'infoMsgs' => $infoMsgs
+ );
+ return $this->render('group.php', $data);
}
else
{
//var_dump('org');
$so = activitycalendar_soorganization::get_instance();
+ $so_activity =
activitycalendar_soactivity::get_instance();
+ $org_array = $so->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]];
+ }
+ //var_dump($org);
+ $districts = $so_activity->get_districts();
+
+ if(isset($_POST['save_organization'])) // The user has
pressed the save button
+ {
+
$org->set_organization_number(phpgw::get_var('orgno'));
+
$org->set_district(phpgw::get_var('org_district'));
+ $org->set_homepage(phpgw::get_var('homepage'));
+ $org->set_email(phpgw::get_var('email'));
+ $org->set_phone(phpgw::get_var('phone'));
+ $org->set_address(phpgw::get_var('address'));
+
$org->set_description(phpgw::get_var('org_description'));
+
+ if($so->store($org))
+ {
+ $message = lang('messages_saved_form');
+ }
+ else
+ {
+ $error = lang('messages_form_error');
+ }
+
+
+
+ }
+ else if(isset($_POST['store_organization'])) // The
user has pressed the store button
+ {
+ $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 = phpgw::get_var('address');
+ $desc = phpgw::get_var('org_description');
+ }
+
+ $data = array
+ (
+ 'organization' => $org,
+ 'districts' => $districts,
+ 'editable' => true,
+ 'errorMsgs' => $errorMsgs,
+ 'infoMsgs' => $infoMsgs
+ );
+
+ return $this->render('organization.php', $data);
}
}
public function show()
{
+ $GLOBALS['phpgw_info']['flags']['app_header'] .=
'::'.lang('view');
$id = (int)phpgw::get_var('id');
$type = phpgw::get_var('type');
if($type)
{
//var_dump($type);
$so = activitycalendar_sogroup::get_instance();
- $group = $so->get(null, null, null, null, null, null,
array('id' => $id));
+ $group_array = $so->get(null, null, null, null, null,
null, array('id' => $id));
+ if(count($group_array) > 0){
+ $keys = array_keys($group_array);
+ $group = $group_array[$keys[0]];
+ }
- return $this->render('group.php', array
- (
- 'group' => $group,
- 'editable' => true,
- 'message' => isset($message) ? $message
: phpgw::get_var('message'),
- 'error' => isset($error) ? $error :
phpgw::get_var('error')
- )
+ $data = array
+ (
+ 'group' => $group,
+ 'errorMsgs' => $errorMsgs,
+ 'infoMsgs' => $infoMsgs
);
+ return $this->render('group.php', $data);
}
else
{
//var_dump('org');
$so = activitycalendar_soorganization::get_instance();
- $org = $so->get(null, null, null, null, null, null,
array('id' => $id));
+ $org_array = $so->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]];
+ }
- return $this->render('organization.php', array
- (
- 'organization' => $org,
- 'editable' => true,
- 'message' => isset($message) ? $message
: phpgw::get_var('message'),
- 'error' => isset($error) ? $error :
phpgw::get_var('error')
- )
+ var_dump($org);
+
+ $data = array
+ (
+ 'organization' => $org,
+ 'errorMsgs' => $errorMsgs,
+ 'infoMsgs' => $infoMsgs
);
+
+ return $this->render('organization.php', $data);
}
}
Modified:
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -25,6 +25,8 @@
protected $last_change_date;
protected $contact_person_1;
protected $contact_person_2;
+ protected $contact_person_2_address;
+ protected $contact_person_2_zip;
protected $special_adaptation;
protected $secret;
protected $internal_arena;
@@ -176,6 +178,20 @@
public function get_contact_person_2() { return
$this->contact_person_2; }
+ public function
set_contact_person_2_address($contact_person_2_address)
+ {
+ $this->contact_person_2_address =
$contact_person_2_address;
+ }
+
+ public function get_contact_person_2_address() { return
$this->contact_person_2_address; }
+
+ public function set_contact_person_2_zip($contact_person_2_zip)
+ {
+ $this->contact_person_2_zip = $contact_person_2_zip;
+ }
+
+ public function get_contact_person_2_zip() { return
$this->contact_person_2_zip; }
+
public function set_special_adaptation($special_adaptation)
{
$this->special_adaptation = $special_adaptation;
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-08-17 09:11:46 UTC (rev 7508)
@@ -385,4 +385,6 @@
building activitycalendar no Kommunale bygg
Download as excel activitycalendar no Last ned i Excel-format
arena_name activitycalendar no Navn
-Send mail to selection activitycalendar no Send E-post til utvalg
\ No newline at end of file
+Send mail to selection activitycalendar no Send E-post til utvalg
+contact_person_2_address activitycalendar no Adresse for
kulturkontoret
+contact_person_2_zip activitycalendar no Poststed for
kulturkontoret
\ 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-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -1,6 +1,6 @@
<?php
$setup_info['activitycalendar']['name'] = 'activitycalendar';
- $setup_info['activitycalendar']['version'] = '0.1.4';
+ $setup_info['activitycalendar']['version'] = '0.1.5';
$setup_info['activitycalendar']['app_order'] = 60;
$setup_info['activitycalendar']['enable'] = 1;
$setup_info['activitycalendar']['app_group'] = 'office';
@@ -8,7 +8,10 @@
$setup_info['activitycalendar']['tables'] = array
(
'activity_activity',
- 'activity_arena'
+ 'activity_arena',
+ 'activity_organization',
+ 'activity_group',
+ 'activity_contact_person'
);
$setup_info['activitycalendar']['description'] = 'Bergen kommune
activitycalendar';
Modified:
branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_current.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -20,7 +20,9 @@
'contact_person_1' => array('type' =>
'varchar','precision' => '255'),
'contact_person_2' => array('type' =>
'varchar','precision' => '255'),
'secret' => array('type' => 'text','nullable'
=> False),
- 'special_adaptation' => array('type' =>
'bool','nullable' => true,'default' => 'false')
+ 'special_adaptation' => array('type' =>
'bool','nullable' => true,'default' => 'false'),
+ 'contact_person_2_address' => array('type' =>
'varchar','precision' => '255'),
+ 'contact_person_2_zip' => array('type' =>
'varchar','precision' => '255'),
),
'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-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -114,4 +114,19 @@
$GLOBALS['setup_info']['activitycalendar']['currentver'] =
'0.1.4';
return $GLOBALS['setup_info']['activitycalendar']['currentver'];
}
+ $test[] = '0.1.4';
+ function activitycalendar_upgrade0_1_4()
+ {
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','contact_person_2_address',array(
+ 'type' => 'varchar',
+ 'precision' => '255'
+ ));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','contact_person_2_zip',array(
+ 'type' => 'varchar',
+ 'precision' => '255'
+ ));
+
+ $GLOBALS['setup_info']['activitycalendar']['currentver'] =
'0.1.5';
+ return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+ }
?>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -399,6 +399,44 @@
}
?>
</dd>
+ <dt>
+ <?php
if($activity->get_contact_person_2_address() || $editable) { ?>
+ <label
for="contact_person_2_address"><?php echo lang('contact_person_2_address')
?></label>
+ <?php } ?>
+ </dt>
+ <dd>
+ <?php
+ if ($editable)
+ {
+ ?>
+ <input type="text"
name="contact_person_2_address" id="contact_person_2_address" value="<?php echo
$activity->get_contact_person_2_address() ?>" />
+ <?php
+ }
+ else
+ {
+ echo
$activity->get_contact_person_2_address();
+ }
+ ?>
+ </dd>
+ <dt>
+ <?php
if($activity->get_contact_person_2_zip() || $editable) { ?>
+ <label for="contact_person_2_zip"><?php
echo lang('contact_person_2_zip') ?></label>
+ <?php } ?>
+ </dt>
+ <dd>
+ <?php
+ if ($editable)
+ {
+ ?>
+ <input type="text"
name="contact_person_2_zip" id="contact_person_2_zip" value="<?php echo
$activity->get_contact_person_2_zip() ?>" />
+ <?php
+ }
+ else
+ {
+ echo
$activity->get_contact_person_2_zip();
+ }
+ ?>
+ </dd>
<dt>
<label for="special_adaptation"><?php
echo lang('special_adaptation') ?></label>
</dt>
Copied: branches/Version-1_0-branch/activitycalendar/templates/base/group.php
(from rev 7507, trunk/activitycalendar/templates/base/group.php)
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/group.php
(rev 0)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/group.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -0,0 +1 @@
+<?php
Copied:
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
(from rev 7507, trunk/activitycalendar/templates/base/organization.php)
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
(rev 0)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -0,0 +1,92 @@
+<?php
+ //include common logic for all templates
+ include("common.php");
+?>
+<div class="identifier-header">
+ <h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH
?>images/32x32/custom/contact.png" /><?php echo lang('organization') ?></h1>
+</div>
+<div class="yui-content">
+ <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'; }
?>"/>
+ <dl class="proplist-col">
+ <dt><label
for="orgname">Organisasjonsnavn</label></dt>
+ <dd><?php echo $organization->get_name();?></dd>
+ <dt><label
for="orgno">Organisasjonsnummer</label></dt>
+ <dd>
+ <?php
+ if($editable){?>
+ <input type="text" name="orgno"
value="<?php echo $organization->get_organization_number();?>"/><br/>
+ <?php
+ }else{?>
+ <?php echo
$organization->get_organization_number();?>
+ <?php }?>
+ </dd>
+ <dt><label for="district">Bydel</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <?php $curr_district =
$organization->get_district();?>
+ <select name="org_district">
+ <option value="0">Ingen bydel
valgt</option>
+ <?php
+ foreach($districts as $d){?>
+ <option value="<?php
echo $d['part_of_town_id']?>" <?php echo ($curr_district ==
$d['part_of_town_id'])? 'selected' : '' ?>><?php echo $d['name']?></option>
+ <?php }?>
+ </select>
+ <?php }else{?>
+ <?php echo
activitycalendar_soactivity::get_instance()->get_district_from_id($organization->get_district());?>
+ <?php }?>
+ </dd>
+ <dt><label
for="homepage">Hjemmeside</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <input type="text" name="homepage"
value="<?php echo $organization->get_homepage();?>"/><br/>
+ <?php }else{?>
+ <?php echo
$organization->get_homepage();?>
+ <?php }?>
+ </dd>
+ <dt><label for="email">E-post</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <input type="text" name="email"
value="<?php echo $organization->get_email();?>"/>
+ <?php }else{?>
+ <?php echo $organization->get_email();?>
+ <?php }?>
+ </dd>
+ <dt><label for="phone">Telefon</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <input type="text" name="phone"
value="<?php echo $organization->get_phone();?>"/>
+ <?php }else{?>
+ <?php echo $organization->get_phone();?>
+ <?php }?>
+ </dd>
+ <dt><label for="street">Adresse</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <input type="text" name="address"
value="<?php echo $organization->get_address();?>"/>
+ <?php }else{?>
+ <?php echo
$organization->get_address();?>
+ <?php }?>
+ </dd>
+ <dt><label
for="org_description">Beskrivelse</label></dt>
+ <dd>
+ <?php if($editable){?>
+ <textarea rows="10" cols="100"
name="org_description"><?php echo $organization->get_description();?></textarea>
+ <?php }else{?>
+ <?php echo
$organization->get_description();?>
+ <?php }?>
+ </dd>
+ </dl>
+ <div class="form-buttons">
+ <?php
+ if ($editable) {
+ echo '<input type="submit"
name="save_organization" value="' . lang('save') . '"/>';
+ echo '<input type="submit"
name="store_organization" value="' . lang('store') . '"/>';
+ }
+ ?>
+ </div>
+ </form>
+ </div>
+</div>
+
\ No newline at end of file
Modified: branches/Version-1_0-branch/property/inc/class.boevent.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boevent.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/property/inc/class.boevent.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -105,6 +105,7 @@
$type =
phpgw::get_var('type');
$type_id =
phpgw::get_var('type_id', 'int');
$user_id =
phpgw::get_var('user_id', 'int');
+ $status_id =
phpgw::get_var('status_id');
$this->start = $start ? $start : 0;
$this->query = isset($_REQUEST['query']) ?
$query : $this->query;
@@ -115,6 +116,7 @@
$this->location_id =
isset($_REQUEST['location_id']) ? $location_id : $this->location_id;
$this->user_id = isset($_REQUEST['user_id'])
? $user_id : $this->user_id;
$this->allrows = isset($allrows) ? $allrows :
false;
+ $this->status_id = isset($_REQUEST['status_id'])
? $status_id : $this->status_id;
}
public function save_sessiondata($data)
@@ -140,12 +142,14 @@
$this->allrows = $data['allrows'];
$this->location_id = $data['location_id'];
$this->user_id = $data['user_id'];
+ $this->status_id = $data['status_id'];
}
public function read($dry_run='')
{
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
- 'allrows'=>$this->allrows, 'location_id' =>
$this->location_id, 'user_id' => $this->user_id, 'dry_run'=>$dry_run));
+ 'allrows'=>$this->allrows, 'location_id' =>
$this->location_id, 'user_id' => $this->user_id, 'dry_run'=>$dry_run,
+ 'status_id' => $this->status_id));
static $locations = array();
static $urls = array();
Modified: branches/Version-1_0-branch/property/inc/class.soevent.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soevent.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/property/inc/class.soevent.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -59,6 +59,7 @@
$dry_run =
isset($data['dry_run']) ? $data['dry_run'] : '';
$location_id = isset($data['location_id'])
&& $data['location_id'] ? (int)$data['location_id'] : -1;
$user_id =
isset($data['user_id']) && $data['user_id'] ? (int)$data['user_id'] : 0;
+ $status_id =
isset($data['status_id']) && $data['status_id'] ? $data['status_id'] : 'open';
if ($order)
{
@@ -89,6 +90,23 @@
$filtermethod .= " AND fm_event.responsible_id
=" . (int)$user->person_id ;
}
+ switch($status_id)
+ {
+ case 'all':
+ break;
+ case 'open':
+ $filtermethod .= " AND
fm_event_receipt.event_id IS NULL AND fm_event_exception.event_id IS NULL";
+ break;
+ case 'closed':
+ $filtermethod .= " AND
fm_event_receipt.event_id IS NOT NULL";
+ break;
+ case 'exception':
+ $filtermethod .= " AND
fm_event_exception.event_id IS NOT NULL";
+ break;
+ default:
+ }
+
+
if($query)
{
$query = $this->_db->db_addslashes($query);
Modified: branches/Version-1_0-branch/property/inc/class.uievent.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uievent.inc.php
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/property/inc/class.uievent.inc.php
2011-08-17 09:11:46 UTC (rev 7508)
@@ -81,6 +81,7 @@
$this->allrows =
$this->bo->allrows;
$this->location_id =
$this->bo->location_id;
$this->user_id =
$this->bo->user_id;
+ $this->status_id =
$this->bo->status_id;
}
function save_sessiondata()
@@ -94,6 +95,7 @@
'allrows' =>
$this->allrows,
'location_id' => $this->location_id,
'user_id' =>
$this->user_id,
+ 'status_id' =>
$this->status_id
);
$this->bo->save_sessiondata($data);
}
@@ -140,7 +142,8 @@
$datatable['config']['base_java_url'] =
"menuaction:'property.uievent.index',"
."location_id:'{$this->location_id}',"
- ."user_id:'{$this->user_id}'";
+ ."user_id:'{$this->user_id}',"
+ ."status_id:'{$this->status_id}'";
$values_combo_box = array();
@@ -154,6 +157,12 @@
$default_value =
array('id'=>'','name'=>lang('no user'));
array_unshift
($values_combo_box[1],$default_value);
+ $values_combo_box[2] = array();
+ array_unshift ($values_combo_box[2],array
('id'=>'exception','name'=> lang('exception')));
+ array_unshift ($values_combo_box[2],array
('id'=>'closed','name'=> lang('closed')));
+ array_unshift ($values_combo_box[2],array
('id'=>'all','name'=> lang('all')));
+ array_unshift ($values_combo_box[2],array
('id'=>'open','name'=> lang('open')));
+
$datatable['config']['allow_allrows'] = true;
$datatable['actions']['form'] = array
@@ -191,6 +200,15 @@
'tab_index' => 2
),
array
+ ( //boton
STATUS
+ 'id' =>
'btn_status_id',
+ 'name'
=> 'status_id',
+ 'value'
=> lang('Status'),
+ 'type'
=> 'button',
+ 'style'
=> 'filter',
+
'tab_index' => 3
+ ),
+ array
( // boton SAVE
'id'
=> 'btn_save',
//'name' => 'save',
@@ -224,7 +242,7 @@
'menuaction' => 'property.uiproject.date_search')
)."','','width=350,height=250')",
'value'
=> lang('Date search'),
-
'tab_index' => 5
+
'tab_index' => 6
),
array
( //button
SEARCH
@@ -232,7 +250,7 @@
'name'
=> 'search',
'value'
=> lang('search'),
'type'
=> 'button',
-
'tab_index' => 4
+
'tab_index' => 5
),
array
( // TEXT INPUT
@@ -242,7 +260,7 @@
'type'
=> 'text',
'onkeypress' => 'return pulsar(event)',
'size'
=> 28,
-
'tab_index' => 3
+
'tab_index' => 4
),
array
( //place
holder for selected events
@@ -262,6 +280,11 @@
( //div values
combo_box_1
'id' =>
'values_combo_box_1',
'value'
=> $this->bocommon->select2String($values_combo_box[1])
+ ),
+ array
+ ( //div values
combo_box_2
+ 'id' =>
'values_combo_box_2',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[2])
)
)
)
Modified: branches/Version-1_0-branch/property/js/yahoo/event.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/event.index.js
2011-08-17 09:10:14 UTC (rev 7507)
+++ branches/Version-1_0-branch/property/js/yahoo/event.index.js
2011-08-17 09:11:46 UTC (rev 7508)
@@ -2,11 +2,11 @@
// Declaration of event.index vars
//--------------------------------------------------------
//define SelectButton
- var oMenuButton_0, oMenuButton_1;//, oMenuButton_2, oMenuButton_3;
+ var oMenuButton_0, oMenuButton_1, oMenuButton_2;//, oMenuButton_3;
var selectsButtons = [
{order:0,
var_URL:'location_id',name:'btn_location_id',style:'locationbutton',dependiente:''},
- {order:1, var_URL:'user_id',
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
-// {order:3,
var_URL:'status_id',name:'btn_status_id',style:'partOFTownbutton',dependiente:''},
+ {order:1, var_URL:'user_id',
name:'btn_user_id',style:'ownerIdbutton',dependiente:''},
+ {order:2,
var_URL:'status_id',name:'btn_status_id',style:'statusIdbutton',dependiente:''}
];
// define buttons
@@ -114,6 +114,14 @@
{
oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
}
+
+ //status
+ index =
locate_in_array_options(2,"value",path_values.status_id);
+ if(index)
+ {
+ oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
+ }
+
/*
//district
index =
locate_in_array_options(1,"value",path_values.district_id);
@@ -121,12 +129,6 @@
{
oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
}
- //status
- index =
locate_in_array_options(2,"value",path_values.status_id);
- if(index)
- {
- oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
- }
//user
index =
locate_in_array_options(3,"value",path_values.user_id);
if(index)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7508] Merge 7505:7507 from trunk,
Sigurd Nes <=