[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11477] bkbooking: stavanger bugfixes collision mail,
From: |
Kjell Arne Espedal |
Subject: |
[Fmsystem-commits] [11477] bkbooking: stavanger bugfixes collision mail, orgaization mail select on add event |
Date: |
Thu, 21 Nov 2013 09:09:23 +0000 |
Revision: 11477
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11477
Author: kjell
Date: 2013-11-21 09:09:22 +0000 (Thu, 21 Nov 2013)
Log Message:
-----------
bkbooking: stavanger bugfixes collision mail, orgaization mail select on add
event
Modified Paths:
--------------
branches/stavangerkommune/booking/inc/class.boallocation.inc.php
branches/stavangerkommune/booking/inc/class.soevent.inc.php
branches/stavangerkommune/booking/inc/class.uievent.inc.php
branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
Modified: branches/stavangerkommune/booking/inc/class.boallocation.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.boallocation.inc.php
2013-11-21 07:53:57 UTC (rev 11476)
+++ branches/stavangerkommune/booking/inc/class.boallocation.inc.php
2013-11-21 09:09:22 UTC (rev 11477)
@@ -25,7 +25,6 @@
$external_site_address =
isset($config->config_data['external_site_address']) &&
$config->config_data['external_site_address'] ?
$config->config_data['external_site_address'] :
$GLOBALS['phpgw_info']['server']['webserver_url'];
- echo "<pre>\n";
if($maildata['outseason'] != 'on' && $maildata['recurring'] !=
'on')
{
$res_names = '';
Modified: branches/stavangerkommune/booking/inc/class.soevent.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.soevent.inc.php 2013-11-21
07:53:57 UTC (rev 11476)
+++ branches/stavangerkommune/booking/inc/class.soevent.inc.php 2013-11-21
09:09:22 UTC (rev 11477)
@@ -135,23 +135,24 @@
function get_contact_mail($id,$type)
{
+ $mail = array();
if ($type == 'allocation')
{
- $this->db->limit_query("SELECT
bb_organization_contact.email FROM bb_organization_contact WHERE
organization_id IN (SELECT bb_allocation.organization_id FROM bb_allocation
WHERE id=$id)", 0, __LINE__, __FILE__, 1);
+ $sql = "SELECT bb_organization_contact.email FROM
bb_organization_contact WHERE organization_id IN (SELECT
bb_allocation.organization_id FROM bb_allocation WHERE id=$id)";
}
else
{
- $this->db->limit_query("SELECT bb_group_contact.email
FROM bb_group_contact WHERE group_id IN (SELECT bb_booking.group_id FROM
bb_booking WHERE id=$id)", 0, __LINE__, __FILE__, 1);
- }
- if(!$result = $this->db->resultSet)
- {
- return False;
+ $sql = "SELECT bb_group_contact.email FROM
bb_group_contact WHERE group_id IN (SELECT bb_booking.group_id FROM bb_booking
WHERE id=$id)";
}
- $mail = array();
- foreach ($result as $res)
- {
- array_push($mail,$res['email']);
- }
+ $this->db->query($sql, __LINE__, __FILE__);
+ if($result = $this->db->resultSet)
+ {
+ foreach ($result as $res)
+ {
+ $mail[] = $res['email'];
+ }
+ }
+
return $mail;
}
Modified: branches/stavangerkommune/booking/inc/class.uievent.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.uievent.inc.php 2013-11-21
07:53:57 UTC (rev 11476)
+++ branches/stavangerkommune/booking/inc/class.uievent.inc.php 2013-11-21
09:09:22 UTC (rev 11477)
@@ -354,10 +354,16 @@
$errors['resource_number'] = lang('The resource number is wrong or not
present');
}
}
- $_POST['contact_name'] =
$organization['contacts'][0]['name'];
- $_POST['contact_email'] =
$organization['contacts'][0]['email'];
- $_POST['contact_phone'] =
$organization['contacts'][0]['phone'];
- }
+ if ($organization['contacts'][0]['name'] != '') {
+ $_POST['contact_name'] =
$organization['contacts'][0]['name'];
+ $_POST['contact_email'] =
$organization['contacts'][0]['email'];
+ $_POST['contact_phone'] =
$organization['contacts'][0]['phone'];
+ } else {
+ $_POST['contact_name'] =
$organization['contacts'][1]['name'];
+ $_POST['contact_email'] =
$organization['contacts'][1]['email'];
+ $_POST['contact_phone'] =
$organization['contacts'][1]['phone'];
+ }
+ }
if (!$_POST['application_id'])
{
$temp_errors = array();
Modified:
branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
2013-11-21 07:53:57 UTC (rev 11476)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uiallocation.inc.php
2013-11-21 09:09:22 UTC (rev 11477)
@@ -61,6 +61,7 @@
if ($config->config_data['user_can_delete_allocations']
!= 'yes') {
$allocation =
$this->bo->read_single(intval(phpgw::get_var('allocation_id', 'GET')));
+ $organization =
$this->organization_bo->read_single($allocation['organization_id']);
$errors = array();
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
@@ -79,14 +80,13 @@
$system_message =
array_merge($system_message, extract_values($_POST, array('message')));
$system_message['type'] = 'cancelation';
$system_message['status'] = 'NEW';
- $system_message['name'] = ' ';
- $system_message['phone'] = ' ';
- $system_message['email'] = ' ';
+ $system_message['name'] =
$allocation['organization_name'].' - '.$organization['contacts'][0]['name'];
+ $system_message['phone'] =
$organization['contacts'][0]['phone'];
+ $system_message['email'] =
$organization['contacts'][0]['email'];
$system_message['title'] =
lang('Cancelation of allocation from')." ".$allocation['organization_name'];
$link = self::link(array('menuaction' =>
'booking.uiallocation.delete','allocation_id' => $allocation['id'], 'outseason'
=> $outseason, 'recurring' => $recurring, 'repeat_until' => $repeat_until,
'field_interval' => $field_interval));
$link = mb_strcut($link,16,strlen($link));
$system_message['message'] =
$system_message['message']."\n\n".lang('To cancel allocation use this link')."
- <a href='".$link."'>".lang('Delete')."</a>";
-
$this->system_message_bo->add($system_message);
$this->redirect(array('menuaction' =>
'bookingfrontend.uibuilding.schedule', 'id' => $system_message['building_id']));
@@ -108,6 +108,7 @@
$repeat_until = phpgw::get_var('repeat_until',
'GET');
$field_interval =
intval(phpgw::get_var('field_interval', 'GET'));
$allocation = $this->bo->read_single($id);
+ $organization =
$this->organization_bo->read_single($allocation['organization_id']);
$season =
$this->season_bo->read_single($allocation['season_id']);
$step = phpgw::get_var('step', 'str', 'POST');
if (! isset($step)) $step = 1;
@@ -147,9 +148,9 @@
$system_message =
array_merge($system_message, extract_values($_POST, array('message')));
$system_message['type'] = 'cancelation';
$system_message['status'] = 'NEW';
- $system_message['name']
= ' ';
-
$system_message['phone'] = ' ';
-
$system_message['email'] = ' ';
+ $system_message['name'] =
$allocation['organization_name'].' - '.$organization['contacts'][0]['name'];
+ $system_message['phone'] =
$organization['contacts'][0]['phone'];
+ $system_message['email'] =
$organization['contacts'][0]['email'];
$system_message['title'] = lang('Cancelation of allocation from')."
".$allocation['organization_name'];
foreach
($allocation['resources'] as $res) {
$res_names =
$res_names.$this->bo->so->get_resource($res)." ";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11477] bkbooking: stavanger bugfixes collision mail, orgaization mail select on add event,
Kjell Arne Espedal <=