[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7484] Merge 7470:7483 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7484] Merge 7470:7483 from trunk |
Date: |
Mon, 08 Aug 2011 12:44:31 +0000 |
Revision: 7484
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7484
Author: sigurdne
Date: 2011-08-08 12:44:31 +0000 (Mon, 08 Aug 2011)
Log Message:
-----------
Merge 7470:7483 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.uiactivities.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_partial.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
branches/Version-1_0-branch/property/inc/class.borequest.inc.php
branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/setup/setup.inc.php
branches/Version-1_0-branch/property/setup/tables_current.inc.php
branches/Version-1_0-branch/property/setup/tables_update.inc.php
branches/Version-1_0-branch/property/templates/base/attributes_form.xsl
branches/Version-1_0-branch/property/templates/base/request.xsl
Added Paths:
-----------
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.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
+
/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
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-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -148,10 +148,21 @@
$activity_state =
$this->marshal($filters['activity_state'],'int');
$filter_clauses[] = "activity.state =
{$activity_state}";
}
- if(isset($filters['activity_district']) &&
$filters['activity_district'] != 'all'){
- $activity_district =
$this->marshal($filters['activity_district'],'int');
- $filter_clauses[] = "activity.office =
'{$activity_district}'";
+ if(isset($filters['activity_district'])){
+ if($filters['activity_district'] != 'all')
+ {
+ $activity_district =
$this->marshal($filters['activity_district'],'int');
+ $filter_clauses[] = "activity.office =
'{$activity_district}'";
+ }
}
+ else
+ {
+ $activity_district =
$this->get_office_from_user($filters['user_id']);
+ if($activity_district && $activity_district != '')
+ {
+ $filter_clauses[] = "activity.office =
'{$activity_district}'";
+ }
+ }
if(count($filter_clauses))
{
@@ -452,6 +463,22 @@
return $district;
}
+
+ function get_office_from_user($user_id)
+ {
+ if(user_id)
+ {
+ $user_id = (int)$user_id;
+ $q1="SELECT office FROM bb_office_user WHERE
account_id={$user_id}";
+ //var_dump($q1);
+ $this->db->query($q1, __LINE__, __FILE__);
+ while($this->db->next_record()){
+ $office_id = $this->db->f('office');
+ }
+ }
+ return $office_id;
+ }
+
function get_office_name($district_id)
{
$result = "Ingen";
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-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -230,6 +230,30 @@
}
return $desc;
}
+
+ function get_district_from_name($name)
+ {
+ $this->db->query("SELECT part_of_town_id FROM fm_part_of_town
where name like UPPER('%{$name}%') ", __LINE__, __FILE__);
+ while($this->db->next_record()){
+ $result = $this->db->f('part_of_town_id');
+ }
+ return $result;
+ }
+
+ function get_office_from_district($district_id)
+ {
+ if($district_id)
+ {
+ $district_id = (int)$district_id;
+ $q1="SELECT fm_district.descr FROM
fm_part_of_town,fm_district WHERE
fm_part_of_town.part_of_town_id={$district_id} AND fm_district.id =
fm_part_of_town.district_id";
+ //var_dump($q1);
+ $this->db->query($q1, __LINE__, __FILE__);
+ while($this->db->next_record()){
+ $office_name = $this->db->f('descr');
+ }
+ }
+ return $office_name;
+ }
/**
* Function for adding a new party to the database. Updates the party
object.
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-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -239,11 +239,19 @@
$num_of_objects = null;
}
+ $email_param = phpgw::get_var('email');
+ $email = false;
+ if(isset($email_param)){
+ $email=true;
+ }
+
+ $uid = $GLOBALS['phpgw_info']['user']['account_id'];
+
switch($query_type)
{
case 'all_activities':
default:
- $filters = array('activity_state' =>
phpgw::get_var('activity_state'), 'activity_district' =>
phpgw::get_var('activity_district'));
+ $filters = array('activity_state' =>
phpgw::get_var('activity_state'), 'activity_district' =>
phpgw::get_var('activity_district'), 'user_id' => $uid);
$result_objects =
activitycalendar_soactivity::get_instance()->get($start_index, $num_of_objects,
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
$object_count =
activitycalendar_soactivity::get_instance()->get_count($search_for,
$search_type, $filters);
break;
@@ -251,24 +259,32 @@
//Create an empty row set
$rows = array();
+ $mail_rows = array();
foreach($result_objects as $result) {
//var_dump($result);
if(isset($result))
{
// ... add a serialized result
$rows[] = $result->serialize();
+ $mail_rows[] = $result;
}
}
// ... add result data
$result_data = array('results' => $rows, 'total_records' =>
$object_count);
- if(!$export){
+ if(!$export && !$email){
//Add action column to each row in result table
array_walk($result_data['results'], array($this,
'add_actions'), array($query_type));
}
-
- return $this->yui_results($result_data, 'total_records',
'results');
+ if($email)
+ {
+ $this->send_email_to_selection($mail_rows);
+ }
+ else
+ {
+ return $this->yui_results($result_data,
'total_records', 'results');
+ }
}
/**
@@ -291,18 +307,49 @@
{
case 'all_activities':
$value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiactivities.edit', 'id' => $value['id'])));
+ $value['labels'][] = lang('edit');
+ $value['ajax'][] = false;
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiactivities.view', 'id' => $value['id'])));
$value['labels'][] = lang('show');
$value['ajax'][] = false;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiactivities.edit', 'id' => $value['id'])));
- $value['labels'][] = lang('edit');
- $value['ajax'][] = false;
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiactivities.send_mail', 'activity_id' =>
$value['id'],'message_type' => 'update')));
$value['labels'][] = lang('send_mail');
break;
}
}
+ private function send_email_to_selection($activities)
+ {
+ foreach($activities as $activity)
+ {
+
+ //$activity =
activitycalendar_soactivity::get_instance()->get_single($activity_id);
+ $subject = lang('mail_subject_update');
+ $body = lang('mail_body_update', $activity->get_id() . ', ' .
$activity->get_title());
+
+ //var_dump($subject);
+ //var_dump($body);
+ //var_dump($activity->get_organization_id() . " ; " .
$activity->get_group_id());
+
+ if($activity->get_group_id() && $activity->get_group_id() > 0)
+ {
+ //var_dump("group!");
+ //$contact_person2 =
activitycalendar_socontactperson::get_instance()->get_group_contact2($activity>get_group_id());
+
activitycalendar_uiactivities::send_mailnotification_to_group($activity->get_contact_person_2(),
$subject, $body);
+ }
+ else if($activity->get_organization_id() &&
$activity->get_organization_id() > 0)
+ {
+ //var_dump("org!");
+ //$contact_person2 =
activitycalendar_socontactperson::get_instance()->get_oup_contact2($activity>get_group_id());
+
activitycalendar_uiactivities::send_mailnotification_to_organization($activity->get_contact_person_2(),
$subject, $body);
+ }
+ }
+
+ //$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'activitycalendar.uiactivities.index', 'message' => 'E-post sendt'));
+
+ }
+
public function send_mail()
{
$activity_id = (int)phpgw::get_var('activity_id');
Modified: branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -13,6 +13,7 @@
'view' => true,
'add' => true,
'edit' => true,
+ 'download' => true,
'get_address_search' => true
);
@@ -215,11 +216,11 @@
{
case 'all_arenas':
$value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiarena.edit', 'id' => $value['id'])));
+ $value['labels'][] = lang('edit');
+ $value['ajax'][] = false;
$value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiarena.view', 'id' => $value['id'])));
$value['labels'][] = lang('show');
- $value['ajax'][] = false;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiarena.edit', 'id' => $value['id'])));
- $value['labels'][] = lang('edit');
break;
}
}
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-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -211,11 +211,17 @@
unset($act_targets);
unset($activity_persons);
unset($activity_description);
+ unset($org_info);
+ unset($contact_person);
+ unset($contact1);
+ unset($contact2);
+ unset($contact3);
+ unset($contact4);
$arena = new activitycalendar_arena();
//8: sted, 9:adresse
- $arena_name = $this->decode($data[7]);
- $arena_address = $this->decode($data[8]);
+ $arena_name = $this->decode($data[8]);
+ $arena_address = $this->decode($data[9]);
$curr_arena_id = 0;
if($arena_name){
@@ -224,10 +230,10 @@
// All is good, store notification
if ($soarena->store($arena)) {
- $this->messages[] =
"Successfully imported arena: Name ({$this->decode($data[7])})";
+ $this->messages[] =
"Successfully imported arena: Name ({$arena_name})";
$curr_arena_id =
$arena->get_id();
} else {
- $this->errors[] = "Error
importing arena: Name ({$this->decode($data[7])})";
+ $this->errors[] = "Error
importing arena: Name ({$arena_name})";
$curr_arena_id = 0;
$arenaOK = false;
}
@@ -240,12 +246,93 @@
$activity = new activitycalendar_activity();
$activity_title = $this->decode($data[1]);
- $activity_org = $this->decode($data[2]);
+ $activity_group = $this->decode($data[2]);
+ $activity_org = $this->decode($data[3]);
+ $activity_category = $this->decode($data[5]);
+ if($activity_category)
+ {
+ $activity_category =
$soactivity->get_category_from_name($activity_category);
+ }
+
if($activity_org)
{
$activity_org =
$soactivity->get_orgid_from_orgno($activity_org);
if($activity_org)
{
+ //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['description'] =
$this->decode($data[6]);
+ $org_info['street'] =
$this->decode($data[9]);
+ $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['activity_id'] =
$activity_category;
+ $org_info['district'] =
$this->decode($data[22]);
+
$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['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['org_id'] =
$this->decode($activity_org);
+
$soactivity->add_contact_person_org($contact2);
+
+ //group-stuff:
+ if($activity_group)
+ {
+ $group_info = array();
+
$group_info['organization_id'] = $activity_org;
+
$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['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['group_id'] =
$this->decode($new_group_id);
+
$soactivity->add_contact_person_group($contact4);
+
+ $activity_persons =
activitycalendar_sogroup::get_instance()->get_contacts($new_group_id);
+ }
+ else
+ {
+ $activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($activity_org);
+ }
+/*
+ foreach($activity_persons as
$pers)
+ {
+ unset($contact_person);
+ $contact_person['id'] =
$pers;
+ $contact_person['name']
= $this->decode($data[11]);
+
$contact_person['phone'] = $this->decode($data[12]);
+ $contact_person['mail']
= $this->decode($data[13]);
+
$contact_person['org_id'] = $this->decode($new_org_id);
+
$soactivity->update_contact_person_org($contact_person);
+ }
+*/
+ /*
$soactivity->set_org_active($activity_org);
$activity_description =
$this->decode($data[5]);
if($activity_description)
@@ -256,18 +343,143 @@
//if(strlen($activity_description) > 255)
//{
//$activity_description = substr($activity_description,0,254);
- //}
+ //}
}
- $activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($activity_org);
+ */
+ //$activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($activity_org);
}
+ 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['description'] =
$this->decode($data[6]);
+ $org_info['street'] =
$this->decode($data[9]);
+ $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['activity_id'] =
$activity_category;
+ $org_info['district'] =
$this->decode($data[22]);
+ $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['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['org_id'] =
$this->decode($new_org_id);
+
$soactivity->add_contact_person_org($contact2);
+
+ //group-stuff:
+ if($activity_group)
+ {
+ $group_info = array();
+
$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['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['group_id'] =
$this->decode($new_group_id);
+
$soactivity->add_contact_person_group($contact4);
+
+ $activity_persons =
activitycalendar_sogroup::get_instance()->get_contacts($new_group_id);
+ }
+ else
+ {
+ $activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($new_org_id);
+ }
+ }
}
- $activity_adapted = $this->decode($data[3]);
- $activity_category = $this->decode($data[4]);
- if($activity_category)
+ else //add org unit without org no
{
- $activity_category =
$soactivity->get_category_from_name($activity_category);
+ $org_info = array();
+ if($activity_group && !$activity_group
== '')
+ {
+ $org_info['name'] =
$activity_group;
+ }
+ else
+ {
+ $org_info['name'] =
$this->decode($data[1]);
+ }
+
+ //$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['description'] =
$this->decode($data[6]);
+ $org_info['street'] =
$this->decode($data[9]);
+ $org_info['zip'] =
$this->decode($data[18]);
+ $org_info['activity_id'] =
$activity_category;
+ $org_info['district'] =
$this->decode($data[22]);
+ $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['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['org_id'] =
$this->decode($new_org_id);
+
$soactivity->add_contact_person_org($contact2);
+
+ //group-stuff:
+ if($activity_group)
+ {
+ $group_info = array();
+ $group_info['organization_id']
= $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['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['group_id'] =
$this->decode($new_group_id);
+
$soactivity->add_contact_person_group($contact4);
+
+ $activity_persons =
activitycalendar_sogroup::get_instance()->get_contacts($new_group_id);
+ }
+ else
+ {
+ $activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($new_org_id);
+ }
}
- $activity_target = $this->decode($data[6]);
+
+ $activity_adapted = $this->decode($data[4]);
+ $activity_target = $this->decode($data[7]);
//var_dump($activity_target);
if($activity_target)
{
@@ -279,9 +491,9 @@
$activity_target = implode(",",
$act_targets);
}
- $activity_day = $this->decode($data[9]);
- $activity_time = $this->decode($data[10]);
- $activity_update_date =
$this->decode($data[20]);
+ $activity_day = $this->decode($data[10]);
+ $activity_time = $this->decode($data[11]);
+ $activity_update_date =
$this->decode($data[21]);
if($activity_update_date)
{
$act_update_array = explode(".",
$activity_update_date);
@@ -294,7 +506,7 @@
//var_dump($activity_updated_date);
}
}
- $activity_district = $this->decode($data[21]);
+ $activity_district = $this->decode($data[22]);
if($activity_district)
{
$activity_district =
$soactivity->get_district_from_name($activity_district);
@@ -303,10 +515,12 @@
if($activity_title){
$activity->set_title($activity_title);
$activity->set_organization_id($activity_org);
+ $activity->set_group_id($new_group_id);
$activity->set_category($activity_category);
$activity->set_target($activity_target);
$activity->set_description($activity_description);
$activity->set_arena($curr_arena_id);
+ $activity->set_state(3);
$activity->set_time($activity_day.'
'.$activity_time);
if($activity_adapted)
{
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-08-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -107,6 +107,7 @@
public function serialize()
{
+ $so_org =
activitycalendar_soorganization::get_instance();
return array(
'id' => $this->get_id(),
'name' => $this->get_name(),
@@ -118,7 +119,8 @@
'phone' => $this->get_phone(),
'address' => $this->get_address(),
'show_in_portal' => $this->get_show_in_portal(),
- 'change_type' => $this->get_change_type()
+ 'change_type' => $this->get_change_type(),
+ 'office' =>
$so_org->get_office_from_district($so_org->get_district_from_name($this->get_district()))
);
}
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-08-08 12:44:31 UTC (rev 7484)
@@ -382,4 +382,7 @@
address_number activitycalendar no Nummer
changed_organizations_groups activitycalendar no Endrede
organisasjoner/grupper
changed_org_group activitycalendar no Endringer
-building activitycalendar no Kommunale bygg
\ No newline at end of file
+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
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
2011-08-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -130,6 +130,8 @@
function activity_export(ptype) {
var query = document.getElementById('<?php echo $list_id
?>_ctrl_search_query').value;
+ var office = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_activity_state').value;
+ var state = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_activity_district').value;
<?php
/* FIXME Search queries will affect ALL data tables listed on one page
(of that type) when exporting
* even though the search only affects one of the data tables.
@@ -140,14 +142,37 @@
window.location =
'index.php?menuaction=activitycalendar.uiactivities.download'+
'<?php echo $url_add_on; ?>'+
'&query='+query+
- '&search_option='+sOption+
+ '&activity_district='+office+
+ '&activity_state='+state+
'&export=true';
}
+ function activity_email(ptype) {
+
+ var query = document.getElementById('<?php echo $list_id
?>_ctrl_search_query').value;
+ var office = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_activity_state').value;
+ var state = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_activity_district').value;
+ <?php
+ /* FIXME Search queries will affect ALL data tables listed on one page
(of that type) when exporting
+ * even though the search only affects one of the data tables.
+ * F.ex on /index.php?menuaction=rental.uicontract.edit&id=1 -> Parties
+ */
+ ?>
+
+ window.location =
'index.php?menuaction=activitycalendar.uiactivities.query'+
+ '<?php echo $url_add_on; ?>'+
+ '&query='+query+
+ '&activity_district='+office+
+ '&activity_state='+state+
+ '&email=true';
+ }
+
</script>
<?php
if($list_form)
{
+ $uid = $GLOBALS['phpgw_info']['user']['account_id'];
+ $user_office =
activitycalendar_soactivity::get_instance()->get_office_from_user($uid);
?>
<form id="<?php echo $list_id ?>_form" method="GET">
@@ -161,12 +186,6 @@
<fieldset>
<!-- Filters -->
-<!-- <label class="toolbar_element_label"
for="ctrl_toggle_activity_type"><?php //echo lang('activity_type') ?></label>
- <select name="activity_type" id="<?php //echo $list_id
?>_ctrl_toggle_activity_type">
- <option value="all"><?php //echo lang('all') ?></option>
- <option value="1"><?php //echo lang('internal')
?></option>
- <option value="2" ><?php //echo lang('not_internal')
?></option>
- </select> -->
<label class="toolbar_element_label"
for="ctrl_toggle_activity_state"><?php echo lang('activity_state') ?></label>
<select name="activity_state" id="<?php echo $list_id
?>_ctrl_toggle_activity_state">
<option value="all"><?php echo lang('all') ?></option>
@@ -185,7 +204,7 @@
<?php
foreach($districts as $district)
{
- echo "<option
value=\"{$district['id']}\">".$district['name']."</option>";
+ echo "<option value=\"{$district['id']}\"".
($user_office == $district['id']? 'selected':'') .
">".$district['name']."</option>";
}
?>
</select>
@@ -197,5 +216,15 @@
}
?>
+<fieldset>
+ <h3><?php echo lang('export_to') ?></h3>
+ <?php
+ $export_format =
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'])
&& $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format']
? $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] :
'csv';
+ ?>
+ <div id="export">
+ <a href="javascript:activity_export('<?php echo $list_id ?>')"
title="<?php echo lang('Download as excel') ?>"><img src="<?php echo
ACTIVITYCALENDAR_IMAGE_PATH
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a> <a
href="javascript:activity_email('<?php echo $list_id ?>')" title="<?php echo
lang('Send email to selection') ?>"><button><?php echo lang('Send mail to
selection') ?></button></a>
+ </div>
+</fieldset>
+
<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
2011-08-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/arena_list_partial.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -80,6 +80,8 @@
function arena_export(ptype) {
var query = document.getElementById('<?php echo $list_id
?>_ctrl_search_query').value;
+ var aType = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_arena_type').value;
+ var active = document.getElementById('<?php echo $list_id
?>_ctrl_toggle_active').value;
<?php
/* FIXME Search queries will affect ALL data tables listed on one page
(of that type) when exporting
* even though the search only affects one of the data tables.
@@ -90,7 +92,8 @@
window.location =
'index.php?menuaction=activitycalendar.uiarena.download'+
'<?php echo $url_add_on; ?>'+
'&query='+query+
- '&search_option='+sOption+
+ '&arena_type='+aType+
+ '&active='+active+
'&export=true';
}
@@ -136,9 +139,7 @@
$export_format =
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'])
&& $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format']
? $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] :
'csv';
?>
<div id="export">
- <a href="javascript:arena_export('<?php echo $list_id ?>')"
title="<?php echo lang('Download as %1', $export_format) ?>"><img src="<?php
echo RENTAL_TEMPLATE_PATH
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>
- &nbsp;&nbsp;
- <a href="index.php?menuaction=rental.uiarena.download_agresso"
title="<?php echo lang('Download Agresso import file') ?>"><img src="<?php echo
RENTAL_TEMPLATE_PATH ?>images/16x16/mimetypes/x-office-document.png"/></a>
+ <a href="javascript:arena_export('<?php echo $list_id ?>')"
title="<?php echo lang('Download as excel') ?>"><img src="<?php echo
ACTIVITYCALENDAR_IMAGE_PATH
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>
</div>
</fieldset>
Copied:
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
(from rev 7483,
trunk/activitycalendar/templates/base/organization_list_changed.php)
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
(rev 0)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_changed.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -0,0 +1,24 @@
+<?php
+ include("common.php");
+?>
+
+<h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH
?>images/32x32/x-office-address-book.png" /> <?php echo
lang('changed_organizations_groups') ?></h1>
+
+<h2><?php echo lang('organization')?></h2>
+<?php
+ $list_form = true;
+ $list_id = 'changed_organizations';
+ $url_add_on = '&type=changed_organizations';
+ $nosearch = true;
+ $extra_cols = array(array("key" => "change_type", "label" =>
lang('change_type'), "sortable" => true, "index" => 5));
+ include('organization_list_partial.php');
+?>
+<h2><?php echo lang('group')?></h2>
+<?php
+ $list_form = true;
+ $list_id = 'changed_groups';
+ $url_add_on = '&type=changed_groups';
+ $nosearch = true;
+ $extra_cols = array(array("key" => "change_type", "label" =>
lang('change_type'), "sortable" => true, "index" => 5));
+ include('organization_list_partial.php');
+?>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_partial.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_partial.php
2011-08-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendar/templates/base/organization_list_partial.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -27,6 +27,11 @@
sortable: true
},
{
+ key: "office",
+ label: "<?php echo lang('office') ?>",
+ sortable: true
+ },
+ {
key: "description",
label: "<?php echo lang('description') ?>",
sortable: true
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-08-08 12:38:33 UTC (rev 7483)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -207,7 +207,7 @@
<input type="text"
name="orgno"/><br/>
<label
for="district">Bydel</label>
<select
name="org_district">
- <option
value="0">Ingen distrikt valgt</option>
+ <option
value="0">Ingen bydel valgt</option>
<?php
foreach($districts as $d)
{
Modified: branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -416,7 +416,7 @@
if ($_POST['recurring'] != 'on' &&
$_POST['outseason'] != 'on' )
{
-
echo"<pre>single:";print_r($step);echo"\n";print_r($from_date);echo"\n";print_r($allocation);exit;
+ //echo
"<pre>single:";print_r($step);echo"\n";print_r($from_date);echo"\n";print_r($allocation);exit;
$err = $this->bo->so->check_for_booking($id);
if ($err)
{
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -553,9 +553,15 @@
. " WHERE location_id =
{$loc_id} AND attrib_sort > {$attrib_sort} AND group_id = {$group_id}";
$this->_db->query($sql, __LINE__,
__FILE__);
}
+
+ $sql = "DELETE FROM phpgw_cust_choice"
+ . " WHERE location_id =
{$loc_id} AND attrib_id = {$attrib_id}";
+ $this->_db->query($sql, __LINE__,__FILE__);
+
$sql = "DELETE FROM phpgw_cust_attribute"
. " WHERE location_id =
{$loc_id} AND id = {$attrib_id}";
$this->_db->query($sql, __LINE__,__FILE__);
+
}
return $this->_db->transaction_commit();
}
Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -190,32 +190,18 @@
return $output_list;
}
- function select_list($selected='',$input_list='')
+ function select_list($selected='',$list=array())
{
- $entry_list = array();
- if (isset($input_list) AND is_array($input_list))
+ if (is_array($list))
{
- foreach($input_list as $entry)
+ foreach($list as &$entry)
{
if ($entry['id']==$selected)
{
- $entry_list[] = array
- (
- 'id'
=> $entry['id'],
- 'name'
=> $entry['name'],
- 'selected'
=> 'selected'
- );
+ $entry['selected'] = 'selected';
}
- else
- {
- $entry_list[] = array
- (
- 'id'
=> $entry['id'],
- 'name'
=> $entry['name'],
- );
- }
}
- return $entry_list;
+ return $list;
}
}
Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -229,6 +229,27 @@
return $probability_list;
}
+
+ function select_reference_list($reference_value = 0)
+ {
+ $selected = $reference_value ? $reference_value :
(int)$GLOBALS['phpgw_info']['user']['preferences']['property']['request_reference_level'];
+
+ $reference_list = array();
+ $reference_comment = array();
+ $reference_comment[0]=' - '.lang('none');
+ $reference_comment[1]=' - '.lang('minor');
+ $reference_comment[2]=' - '.lang('medium');
+ $reference_comment[3]=' - '.lang('serious');
+ for ($i=0; $i<=3; $i++)
+ {
+ $reference_list[$i]['id'] = $i;
+ $reference_list[$i]['name'] =
"{$i}{$reference_comment[$i]}";
+ $reference_list[$i]['selected'] = $i==$selected
? 1 : 0;
+ }
+
+ return $reference_list;
+ }
+
function select_conditions($request_id='')
{
$values = array();
@@ -251,14 +272,16 @@
$risk =
(int)$conditions[$i]['probability'] * (int)$conditions[$i]['consequence'];
$values[] = array
(
+ 'reference'
=> array('options' =>
$this->select_reference_list($conditions[$i]['reference'])),
'degree'
=> array('options' =>
$this->select_degree_list($conditions[$i]['degree'])),
'probability'
=> array('options' =>
$this->select_probability_list($conditions[$i]['probability'])),
'consequence'
=> array('options' =>
$this->select_consequence_list($conditions[$i]['consequence'])),
'condition_type'
=> $condition_type_list[$i]['id'],
'condition_type_name' =>
$condition_type_list[$i]['name'],
+ 'failure'
=> (int)$conditions[$i]['reference'] - (int)$conditions[$i]['degree'] <
0 ? 'X' : '',
'weight'
=> $condition_type_list[$i]['weight'],
'risk'
=> $risk,
- 'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
+ 'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
);
}
}
@@ -277,17 +300,20 @@
$values[] = array
(
'condition_type_list' =>
array('options' => $this->bocommon->select_list($i, $condition_type_list)),
+ 'reference'
=> array('options' =>
$this->select_reference_list($conditions[$i]['reference'])),
'degree'
=> array('options' => $this->select_degree_list($conditions[$i]['degree'])),
'probability' =>
array('options' =>
$this->select_probability_list($conditions[$i]['probability'])),
'consequence' =>
array('options' =>
$this->select_consequence_list($conditions[$i]['consequence'])),
'condition_type' =>
$condition_type_list[$i]['id'],
'condition_type_name' =>
$condition_type_list[$i]['name'],
+ 'condition_type_descr' =>
$condition_type_list[$i]['descr'],
+ 'failure'
=> (int)$conditions[$i]['reference'] - (int)$conditions[$i]['degree'] < 0 ? 'X'
: '',
'weight'
=> $condition_type_list[$i]['weight'],
'risk'
=> $risk,
'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
);
}
-
+//_debug_array($values);die();
return $values;
}
Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -919,6 +919,12 @@
(
array
(
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
'name' =>
'descr',
'descr' =>
lang('descr'),
'type' =>
'varchar'
@@ -2252,14 +2258,14 @@
if($this->location_info['id']['type']!='auto')
{
- $this->_db->query("SELECT id FROM {$table}
WHERE {$this->location_info['id']['name']} =
'{$data['id']}'",__LINE__,__FILE__);
+ $this->_db->query("SELECT
{$this->location_info['id']['name']} AS id FROM {$table} WHERE
{$this->location_info['id']['name']} =
'{$data[$this->location_info['id']['name']]}'",__LINE__,__FILE__);
if($this->_db->next_record())
{
$receipt['error'][]=array('msg'=>lang('duplicate key value'));
$receipt['error'][]=array('msg'=>lang('record has not been saved'));
return $receipt;
}
- $id = $data['id'];
+ $id = $data[$this->location_info['id']['name']];
}
else
{
Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -143,7 +143,7 @@
function select_condition_type_list()
{
- $this->db->query("SELECT id, descr, priority_key FROM
fm_request_condition_type ORDER BY id",__LINE__,__FILE__);
+ $this->db->query("SELECT * FROM
fm_request_condition_type ORDER BY id",__LINE__,__FILE__);
$values = array();
while ($this->db->next_record())
@@ -152,7 +152,8 @@
$values[$id] = array
(
'id' => $id,
- 'name' =>
$this->db->f('descr',true),
+ 'name' =>
$this->db->f('name',true),
+ 'descr' =>
$this->db->f('descr',true),
'weight' =>
$this->db->f('priority_key')
);
}
@@ -174,6 +175,7 @@
(
'request_id' => $request_id,
'condition_type' =>
$this->db->f('condition_type'),
+ 'reference' =>
$this->db->f('reference'),
'degree' =>
$this->db->f('degree'),
'probability' =>
$this->db->f('probability'),
'consequence' =>
$this->db->f('consequence')
@@ -645,10 +647,11 @@
foreach( $request['condition'] as
$condition_type => $value_type )
{
$_condition_type =
isset($value_type['condition_type']) && $value_type['condition_type'] ?
$value_type['condition_type'] : $condition_type;
- $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,degree,probability,consequence,user_id,entry_date) "
+ $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
"
. "VALUES ('"
. $request['id']. "','"
. $_condition_type . "',"
+ . $value_type['reference']. ","
. $value_type['degree']. ","
. $value_type['probability'].
","
. $value_type['consequence'].
","
@@ -834,12 +837,13 @@
foreach( $request['condition'] as
$condition_type => $value_type )
{
$_condition_type =
isset($value_type['condition_type']) && $value_type['condition_type'] ?
$value_type['condition_type'] : $condition_type;
- $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,degree,probability,consequence,user_id,entry_date) "
+ $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
"
. "VALUES ('"
. $request['id']. "','"
. $_condition_type . "',"
+ . $value_type['reference']. ","
. $value_type['degree']. ","
- .
$value_type['probability']. ","
+ . $value_type['probability'].
","
. $value_type['consequence'].
","
. $this->account . ","
. time() .
")",__LINE__,__FILE__);
Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -1177,16 +1177,6 @@
}
-
- $table_header_importance[] = array
- (
- 'lang_subject' =>
lang('Subject'),
- 'lang_condition_degree' =>
lang('Condidtion degree'),
- 'lang_prob_worsening' =>
lang('Probability'),
- 'lang_consequence' =>
lang('Consequence')
- );
-
-
if($values['project_id'])
{
$project_lookup_data = array
@@ -1394,7 +1384,7 @@
'tenant_id'
=> $values['tenant_id'],
'lang_importance'
=> lang('Importance'),
- 'table_header_importance'
=> $table_header_importance,
+
'importance_weight'
=> $importance_weight,
'lang_no_workorders'
=> lang('No workorder budget'),
@@ -1442,12 +1432,8 @@
'lang_request_id'
=> lang('request ID'),
'value_request_id'
=> $id,
- 'lang_title'
=> lang('Title'),
'value_title'
=> $values['title'],
- 'lang_title_statustext'
=> lang('Enter request Title'),
- 'lang_descr_statustext'
=> lang('Enter a description of the request'),
- 'lang_descr'
=> lang('Description'),
'value_descr'
=> $values['descr'],
'lang_score'
=> lang('Score'),
'value_score'
=> $values['score'],
Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang 2011-08-08
12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang 2011-08-08
12:44:31 UTC (rev 7484)
@@ -342,21 +342,22 @@
communication types manager property no Type kommunikasjon
composites property no Leieobjekter
condition property no Tilstand
-condidtion degree property no Tilstandsgrad
+condition degree property no Tilstandsgrad
config property no Konfigurer
configuration property no Konfigurasjon
confirm status property no Bekreft status
confirm status to the history property no Bekreft status til
historikk
consequence property no Konsekvens
+consequence type property no Konsekvenstype
consequential damage property no Følgeskader
consume property no forbruk
consume date property no Dato historisk forbruk
consume value property no Beløp historisk forbruk
consume history property no Historisk forbruk
planning property no Planlagt
-planning date property no Dato planagt disponering
-planning value property no Beløp planagt disponering
-planning serie property no Planagt disponering
+planning date property no Dato planlagt disponering
+planning value property no Beløp planlagt disponering
+planning serie property no Planlagt disponering
check to delete property no Merk for å slette
contact property no Kontakt
@@ -635,7 +636,7 @@
enter a description of the document property no gi en
beskrivelse av dokumentet
enter a description of the equipment property no gi en
beskrivelse av utstyret
enter a description of the project property no gi en
beskrivelse av prosjektet
-enter a description of the request property no gi en
beskrivelse av anmodningen
+enter a description of the request property no Gi en
beskrivelse av tiltaket
enter a description of the standard property no gi en
beskrivelse av standarden
enter a description of the status property no Angi en
beskrivelse av statusen
enter a description the attribute property no gi en
beskrivelse av attributten
@@ -680,7 +681,7 @@
enter other branch if not found in the list property no Angi
andre fag om det ikke finnes i listen
enter project name property no Angi Prosjekt navn
enter quantity of unit property no angi mengde
-enter request title property no angi tittel for anmodning
+enter request title property no Angi beskrivende navn for tiltak
enter the attribute id property no angi attributt ID
enter the attribute value for this entity property no angi
attributt verdi for denne posten
enter the billable hour for the task property no Angi egne timer
for oppgaven
@@ -770,6 +771,7 @@
failed to create directory property no klarte ikke å lage
katalog
failed to delete file property no klarte ikke å slette fil
failed to upload file ! property no Opplasting av fil
feilet!
+failure property no Svikt
false property no False
feste nr property no Feste nr
fetch the history for this item property no Hent historikk
for dette elementet
@@ -1277,6 +1279,7 @@
receipt property no Kvittering
receipt date property no Kvitteringsdato
record property no Post
+reference level property no Referanse nivå
regulations property no Forskrifter
related property no Relatert
related info property no Relatert info
@@ -1297,7 +1300,6 @@
request %1 has been edited property no anmodning %1 er oppdater
request %1 has been saved property no anmodning %1 er lagret
request budget property no Budsjett for tiltak
-request condition_type property no Tema for tilstand
request descr property no Beskrivelse av tiltak
request end date property no anmodning frist
request entry date property no Registreringsdato for tiltak
@@ -1305,6 +1307,7 @@
request start date property no anmodning startdato
request status property no Status anmodning
request title property no Tiltak tittel
+request description property no Tilstand beskrivelse
requirement property no Behov/pålegg
resend workorder property no Send ordre på nytt
reserve property no reserve
Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php 2011-08-08
12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php 2011-08-08
12:44:31 UTC (rev 7484)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.620';
+ $setup_info['property']['version'] = '0.9.17.621';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -810,6 +810,7 @@
'fd' => array(
'request_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'condition_type' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'reference' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
'degree' => array('type' => 'int','precision'
=> '4','default' => '0','nullable' => True),
'probability' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
'consequence' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
@@ -1277,7 +1278,8 @@
'fm_request_condition_type' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
- 'descr' => array('type' =>
'varchar','precision' => '50','nullable' => False),
+ 'name' => array('type' => 'varchar','precision'
=> '255','nullable' => False),
+ 'descr' => array('type' =>
'varchar','precision' => '50','nullable' => true),
'priority_key' => array('type' =>
'int','precision' => '4','default' => '1','nullable' => True)
),
'pk' => array('id'),
Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php
2011-08-08 12:44:31 UTC (rev 7484)
@@ -5345,7 +5345,30 @@
}
}
+
/**
+ * Update property version from 0.9.17.620 to 0.9.17.621
+ *
+ */
+
+ $test[] = '0.9.17.620';
+ function property_upgrade0_9_17_620()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_request_condition_type','descr','name');
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request_condition_type','descr',
array('type' => 'varchar','precision' => '255','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request_condition','reference',
array('type' => 'int','precision' => '4','default' => '0','nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.621';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
+
+ /**
* Update property version from 0.9.17.607 to 0.9.17.608
* Add more room for address at tickets
*
Modified:
branches/Version-1_0-branch/property/templates/base/attributes_form.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/attributes_form.xsl
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/templates/base/attributes_form.xsl
2011-08-08 12:44:31 UTC (rev 7484)
@@ -14,7 +14,7 @@
</xsl:for-each>
</xsl:template>
- <xsl:template match="attributes">
+ <xsl:template match="attributes" xmlns:php="http://php.net/xsl">
<xsl:variable name="statustext"><xsl:value-of
select="statustext"/></xsl:variable>
<tr>
<td align="left" width="19%" valign="top"
title="{$statustext}">
@@ -35,10 +35,10 @@
<xsl:text>[ </xsl:text>
<xsl:choose>
<xsl:when
test="value!=''">
-
<xsl:value-of select="//lang_edit"/>
+
<xsl:value-of select="php:function('lang', 'edit')" />
</xsl:when>
<xsl:otherwise>
-
<xsl:value-of select="//lang_add"/>
+
<xsl:value-of select="php:function('lang', 'add')" />
</xsl:otherwise>
</xsl:choose>
<xsl:text> ]</xsl:text>
@@ -70,7 +70,9 @@
</xsl:attribute>
</xsl:when>
</xsl:choose>
-
<option value=""><xsl:value-of select="//lang_none"/></option>
+
<option value="">
+
<xsl:value-of select="php:function('lang', 'select')" />
+
</option>
<xsl:for-each select="choice">
<xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
<xsl:choose>
Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl
2011-08-08 12:38:33 UTC (rev 7483)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl
2011-08-08 12:44:31 UTC (rev 7484)
@@ -263,24 +263,24 @@
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_title"/>
+
<xsl:value-of select="php:function('lang', 'request title')" />
</td>
<td>
<input
type="text" name="values[title]" value="{value_title}" size="60">
<xsl:attribute name="title">
-
<xsl:value-of select="lang_title_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter request title')" />
</xsl:attribute>
</input>
</td>
</tr>
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_descr"/>
+
<xsl:value-of select="php:function('lang', 'request description')" />
</td>
<td>
<textarea cols="60" rows="6" name="values[descr]">
<xsl:attribute name="title">
-
<xsl:value-of select="lang_descr_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter a description of the
request')" />
</xsl:attribute>
<xsl:value-of select="value_descr"/>
</textarea>
@@ -527,20 +527,23 @@
</div>
<div id="condition">
<table>
+ <xsl:apply-templates
select="custom_attributes/attributes"/>
<tr>
<td colspan='2'>
<table
border="1" width="100%" cellpadding="2" cellspacing="2" align="center">
-
<xsl:apply-templates select="table_header_importance"/>
+
<xsl:call-template name="table_header_importance"/>
<xsl:apply-templates select="condition_list"/>
</table>
</td>
</tr>
-
<tr>
-
<td>
-
<br/>
-
</td>
-
</tr>
+ <tr>
+ <td>
+ <br/>
+ </td>
+ </tr>
+ <xsl:choose>
+
<xsl:when test="authorities_demands/options!=''">
<tr>
<td align="left">
<xsl:value-of select="php:function('lang', 'Authorities
Demands')" />
@@ -563,6 +566,9 @@
<br/>
</td>
</tr>
+
</xsl:when>
+ </xsl:choose>
+<!--
<tr>
<td valign='top' align="left">
<xsl:value-of select="php:function('lang', 'regulations')" />
@@ -612,7 +618,7 @@
</table>
</td>
</tr>
-
<xsl:apply-templates select="custom_attributes/attributes"/>
+-->
<tr>
<td>
<br/>
@@ -749,8 +755,7 @@
<td class="small_text" align="left">
<xsl:choose>
<xsl:when test="condition_type_list !=
''">
- <xsl:variable
name="lang_degree_statustext"><xsl:value-of
select="//lang_degree_statustext"/></xsl:variable>
- <select
name="values[condition][{condition_type}][condition_type]" class="forms"
title="{$lang_degree_statustext}">
+ <select
name="values[condition][{condition_type}][condition_type]" class="forms">
<xsl:apply-templates
select="condition_type_list/options"/>
</select>
</xsl:when>
@@ -761,6 +766,12 @@
</td>
<td class="small_text" align="center">
+ <xsl:variable
name="lang_reference_statustext"><xsl:value-of
select="//lang_reference_statustext"/></xsl:variable>
+ <select
name="values[condition][{condition_type}][reference]" class="forms"
title="{$lang_reference_statustext}">
+ <xsl:apply-templates
select="reference/options"/>
+ </select>
+ </td>
+ <td class="small_text" align="center">
<xsl:variable
name="lang_degree_statustext"><xsl:value-of
select="//lang_degree_statustext"/></xsl:variable>
<select
name="values[condition][{condition_type}][degree]" class="forms"
title="{$lang_degree_statustext}">
<xsl:apply-templates
select="degree/options"/>
@@ -778,6 +789,9 @@
<xsl:apply-templates
select="consequence/options"/>
</select>
</td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="failure"/>
+ </td>
<td class="small_text" align="right">
<xsl:value-of select="weight"/>
</td>
@@ -831,6 +845,11 @@
<xsl:if test="selected != 0">
<xsl:attribute name="selected" value="selected"
/>
</xsl:if>
+ <xsl:if test="descr != ''">
+ <xsl:attribute name="title">
+ <xsl:value-of
disable-output-escaping="yes" select="descr"/>
+ </xsl:attribute>
+ </xsl:if>
<xsl:value-of disable-output-escaping="yes"
select="name"/>
</option>
</xsl:template>
@@ -882,21 +901,27 @@
</tr>
</xsl:template>
- <xsl:template match="table_header_importance"
xmlns:php="http://php.net/xsl">
+ <xsl:template name="table_header_importance"
xmlns:php="http://php.net/xsl">
<tr>
<th width="20%" align="left">
- <xsl:value-of select="php:function('lang',
'request condition_type')" />
+ <xsl:value-of select="php:function('lang',
'consequence type')" />
</th>
+ <th width="20%" align="left">
+ <xsl:value-of select="php:function('lang',
'reference level')" />
+ </th>
<th width="20%" align="center">
- <xsl:value-of select="lang_condition_degree"/>
+ <xsl:value-of select="php:function('lang',
'condition degree')" />
</th>
<th width="20%" align="center">
- <xsl:value-of select="lang_prob_worsening"/>
+ <xsl:value-of select="php:function('lang',
'Probability')" />
</th>
<th width="20%" align="center">
- <xsl:value-of select="lang_consequence"/>
+ <xsl:value-of select="php:function('lang',
'Consequence')" />
</th>
<th width="5%" align="center">
+ <xsl:value-of select="php:function('lang',
'failure')" />
+ </th>
+ <th width="5%" align="center">
<xsl:value-of select="php:function('lang',
'weight')" />
</th>
<th width="5%" align="center">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7484] Merge 7470:7483 from trunk,
Sigurd Nes <=