[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16787] Syncromind: Merge 16739:16786 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16787] Syncromind: Merge 16739:16786 from trunk |
Date: |
Sat, 27 May 2017 14:53:04 -0400 (EDT) |
Revision: 16787
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16787
Author: sigurdne
Date: 2017-05-27 14:53:04 -0400 (Sat, 27 May 2017)
Log Message:
-----------
Syncromind: Merge 16739:16786 from trunk
Modified Paths:
--------------
branches/dev-syncromind-2/activitycalendar/inc/class.soactivity.inc.php
branches/dev-syncromind-2/admin/inc/class.bolog.inc.php
branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
branches/dev-syncromind-2/booking/setup/default_records.inc.php
branches/dev-syncromind-2/bookingfrontend/inc/class.uisearch.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
branches/dev-syncromind-2/eventplanner/setup/phpgw_no.lang
branches/dev-syncromind-2/eventplanner/templates/base/config.tpl
branches/dev-syncromind-2/frontend/setup/setup.inc.php
branches/dev-syncromind-2/helpdesk/inc/class.botts.inc.php
branches/dev-syncromind-2/helpdesk/inc/class.uitts.inc.php
branches/dev-syncromind-2/helpdesk/setup/phpgw_no.lang
branches/dev-syncromind-2/helpdesk/templates/base/config.tpl
branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.log.inc.php
branches/dev-syncromind-2/phpgwapi/inc/functions.inc.php
branches/dev-syncromind-2/property/setup/setup.inc.php
branches/dev-syncromind-2/property/setup/tables_current.inc.php
branches/dev-syncromind-2/property/setup/tables_update.inc.php
Property Changed:
----------------
branches/dev-syncromind-2/
branches/dev-syncromind-2/booking/
branches/dev-syncromind-2/bookingfrontend/
Index: branches/dev-syncromind-2
===================================================================
--- branches/dev-syncromind-2 2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2 2017-05-27 18:53:04 UTC (rev 16787)
Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
-/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798,15800-15812,15814-15838,15840,15842-15888,15890,15892-15997,15999-16097,16103-16128,16131-16187,16190-16299,16301-16393,16396-16586,16589-16737
\ No newline at end of property
+/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798,15800-15812,15814-15838,15840,15842-15888,15890,15892-15997,15999-16097,16103-16128,16131-16187,16190-16299,16301-16393,16396-16586,16589-16737,16740-16786
\ No newline at end of property
Modified:
branches/dev-syncromind-2/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/dev-syncromind-2/activitycalendar/inc/class.soactivity.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/activitycalendar/inc/class.soactivity.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -807,7 +807,8 @@
);
}
- foreach ($activities as &$activity)
+ $result = array();
+ foreach ($activities as $activity)
{
if ($activity['group_id'] &&
!$activity['group_id'] == '' && !$activity['group_id'] == 0)
{
@@ -825,9 +826,11 @@
$activity['arena_info'] =
$this->get_all_arena_info($activity['arena'], $activity['internal_arena']);
$activity['internal_arena_info'] =
$this->get_internal_arena_info($activity['internal_arena']);
$activity['contact_person'] =
$this->get_contact_person($activity['organization_id'], $activity['group_id'],
$activity['contact_person_1']);
+ $result[] = $activity;
+
}
//_debug_array($activities);
- return $activities;
+ return $result;
}
function get_contact_person( $org_id, $group_id, $cont_pers )
Modified: branches/dev-syncromind-2/admin/inc/class.bolog.inc.php
===================================================================
--- branches/dev-syncromind-2/admin/inc/class.bolog.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/admin/inc/class.bolog.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -33,6 +33,12 @@
$_records = array();
$records = $this->so->list_log($account_id, $start,
$order, $sort);
+ if ( !isset($GLOBALS['phpgw']->log)
+ || !is_object($GLOBALS['phpgw']->log) )
+ {
+ $GLOBALS['phpgw']->log =
createObject('phpgwapi.log');
+ }
+ $log =& $GLOBALS['phpgw']->log;
foreach ( $records as $record )
{
// build and pass the format by hand as we want
to show the seconds
@@ -46,13 +52,13 @@
$record['log_account_lid'] = $t[0];
}
- $record['log_severity'] =
lang($GLOBALS['phpgw']->log->get_level_name($record['log_severity']));
+ $level_name =
$log->get_level_name($record['log_severity']);
$_records[] = array(
'log_date' =>
$record['log_date'],
'log_account_lid' =>
$record['log_account_lid'],
'log_app' =>
$record['log_app'],
- 'log_severity' =>
$record['log_severity'],
+ 'log_severity' =>
lang($level_name),
'log_file' =>
$record['log_file'],
'log_line' =>
$record['log_line'],
'log_msg' =>
$record['log_msg']
Index: branches/dev-syncromind-2/booking
===================================================================
--- branches/dev-syncromind-2/booking 2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/booking 2017-05-27 18:53:04 UTC (rev 16787)
Property changes on: branches/dev-syncromind-2/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
/branches/stavangerkommune/booking:9468-12740,12743-12875,12986
-/trunk/booking:14937-15027,15165-15215,15253-15304,15306-15337,15341-15398,15476-15607,15613-15652,15654-15732,15814-15838,15892-15997,15999-16097,16131-16187,16301-16393,16396-16586,16589-16737
\ No newline at end of property
+/trunk/booking:14937-15027,15165-15215,15253-15304,15306-15337,15341-15398,15476-15607,15613-15652,15654-15732,15814-15838,15892-15997,15999-16097,16131-16187,16301-16393,16396-16586,16589-16737,16740-16786
\ No newline at end of property
Modified: branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
===================================================================
--- branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -1060,10 +1060,25 @@
// echo $b['id']."\tfrom: ".substr($b['from_'],11,19)." to:
".substr($b['to_'],11,19)."\n";
// echo $e['id']."\tfrom: ".substr($e['from_'],11,19)." to:
".substr($e['to_'],11,19)." ".$e['name']."\n";
- if ((($b['from_'] >= $e['from_'] &&
$b['from_'] < $e['to_']) ||
+ if (
+ (
+ ($b['from_'] >= $e['from_'] &&
$b['from_'] < $e['to_']) ||
($b['to_'] > $e['from_'] &&
$b['to_'] <= $e['to_']) ||
- ($b['from_'] <= $e['from_'] &&
$b['to_'] >= $e['to_'])) && (array_intersect($b['resources'], $e['resources'])
!= array()))
+ ($b['from_'] <= $e['from_'] &&
$b['to_'] >= $e['to_'])
+ )
+ &&
+
(array_intersect($b['resources'], $e['resources']) != array()))
{
+ $test_intersect =
array_intersect($e['resources'], $b['resources']);
+
+ $resources_to_keep =
array_diff($b['resources'], $test_intersect);
+ if($resources_to_keep)
+ {
+ $tmp = $b;
+ $tmp['resources'] =
$resources_to_keep;
+ $last[] = $tmp;
+ }
+
// echo "##$i\n";
$keep = false;
$e['conflicts'][] = $b;
Modified: branches/dev-syncromind-2/booking/setup/default_records.inc.php
===================================================================
--- branches/dev-syncromind-2/booking/setup/default_records.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/booking/setup/default_records.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -26,3 +26,25 @@
// Insert start values for billing sequential numbers
$oProc->query("INSERT INTO bb_billing_sequential_number_generator (
name, value ) VALUES ( 'internal', 1 ), ( 'external', 1 )");
+ $GLOBALS['phpgw']->locations->add('.office', 'office', 'booking');
+ $GLOBALS['phpgw']->locations->add('.office.user', 'office/user
relation', 'booking', false, 'bb_office_user');
+ $GLOBALS['phpgw']->db = clone($GLOBALS['phpgw_setup']->oProc->m_odb);
+
+ $attrib = array
+ (
+ 'appname' => 'booking',
+ 'location' => '.office.user',
+ 'column_name' => 'account_id',
+ 'input_text' => 'User',
+ 'statustext' => 'System user',
+ 'search' => true,
+ 'list' => true,
+ 'column_info' => array
+ (
+ 'type' => 'user',
+ 'nullable' => 'False',
+ 'custom' => 1
+ )
+ );
+
+ $GLOBALS['phpgw']->custom_fields->add($attrib, 'bb_office_user');
Index: branches/dev-syncromind-2/bookingfrontend
===================================================================
--- branches/dev-syncromind-2/bookingfrontend 2017-05-26 03:34:11 UTC (rev
16786)
+++ branches/dev-syncromind-2/bookingfrontend 2017-05-27 18:53:04 UTC (rev
16787)
Property changes on: branches/dev-syncromind-2/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
/branches/stavangerkommune/bookingfrontend:9468-12740,12986
-/trunk/bookingfrontend:14937-15027,15253-15304,15306-15337,15476-15607,15613-15652,15814-15838,15892-15997,16131-16187,16190-16299,16301-16393,16396-16586,16589-16737
\ No newline at end of property
+/trunk/bookingfrontend:14937-15027,15253-15304,15306-15337,15476-15607,15613-15652,15814-15838,15892-15997,16131-16187,16190-16299,16301-16393,16396-16586,16589-16737,16740-16786
\ No newline at end of property
Modified: branches/dev-syncromind-2/bookingfrontend/inc/class.uisearch.inc.php
===================================================================
--- branches/dev-syncromind-2/bookingfrontend/inc/class.uisearch.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/bookingfrontend/inc/class.uisearch.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -185,7 +185,7 @@
// _debug_array($activity_criteria);
// _debug_array($criteria);
// die();
- if ($searchterm || $building_id || $activity_criteria
|| $filter_part_of_town || $filter_top_level ||
phpgw::get_var('filter_search_type'))
+ if ($searchterm || $building_id || $activity_criteria
|| $filter_part_of_town || phpgw::get_var('filter_top_level', 'string') ||
phpgw::get_var('filter_search_type'))
{
$data = array(
'results' =>
$this->bo->search($searchterm, $building_id, $filter_part_of_town,
$filter_top_level, $activity_criteria)
Modified: branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -10,20 +10,19 @@
* @subpackage booking
* @version $Id:$
*/
-
/*
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
phpgw::import_class('phpgwapi.bocommon');
@@ -33,6 +32,7 @@
class eventplanner_bobooking extends phpgwapi_bocommon
{
+
protected static
$bo,
$fields,
@@ -58,10 +58,10 @@
return self::$bo;
}
- public function store($object)
+ public function store( $object )
{
$save_last_booking = false;
- if(!$object->get_id())
+ if (!$object->get_id())
{
$save_last_booking = true;
}
@@ -68,9 +68,15 @@
$this->store_pre_commit($object);
$ret =
eventplanner_sobooking::get_instance()->store($object);
- if($ret && $save_last_booking)
+ if ($ret && $save_last_booking)
{
phpgwapi_cache::system_set('eventplanner',
"last_booking{$object->customer_id}", time());
+
+
+ /**
+ * Send email receipt...
+ */
+ $this->send_email($object);
}
$this->store_post_commit($object);
@@ -77,10 +83,219 @@
return $ret;
}
- public function read($params)
+ public function send_email( $booking )
{
+ if
(empty($GLOBALS['phpgw_info']['server']['smtp_server']))
+ {
+ phpgwapi_cache::message_set(lang('SMTP server
is not set! (admin section)'), 'error');
+ return false;
+ }
+
+ $config = CreateObject('phpgwapi.config',
'eventplanner')->read();
+// _debug_array($booking);
+
+ $customer =
createObject('eventplanner.bocustomer')->read_single($booking->customer_id,
true, $relaxe_acl = true);
+ $customer_name =$customer->name;
+
+ $customer_contact_name =
$booking->customer_contact_name;
+ $customer_contact_email =
$booking->customer_contact_email;
+ $customer_contact_phone =
$booking->customer_contact_phone;
+ $location = $booking->location;
+
+ $calendar_id = $booking->calendar_id;
+ $calendar =
createObject('eventplanner.bocalendar')->read_single($calendar_id, true,
$relaxe_acl = true);
+ $from_ =
$GLOBALS['phpgw']->common->show_date($calendar->from_);
+ $to_ =
$GLOBALS['phpgw']->common->show_date($calendar->to_);
+
+ $application =
createObject('eventplanner.boapplication')->read_single($calendar->application_id,
true, $relaxe_acl = true);
+// _debug_array($application);
+// _debug_array($application);
+
+ $vendor_name = $application->vendor_name;
+ $vendor_contact_name = $application->contact_name;
+ $vendor_contact_email = $application->contact_email;
+ $vendor_contact_phone = $application->contact_phone;
+ $vendor_receipt_text =
!empty($config['vendor_receipt_text']) ? $config['vendor_receipt_text'] : null;
+ $customer_receipt_text =
!empty($config['customer_receipt_text']) ? $config['customer_receipt_text'] :
null;
+
+ $subject = !empty($config['receipt_subject']) ?
$config['receipt_subject'] : $event_title;
+ $event_title = $application->title;
+
+ $send = CreateObject('phpgwapi.send');
+
+ $lang_when = lang('when');
+ $lang_where = lang('where');
+
+ $body = <<<HTML
+ <h2>{$event_title}</h2>
+ <table>
+ <tr>
+ <td>
+ {$lang_when}:
+ </td>
+ <td>
+ {$from_} - {$to_}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {$lang_where}:
+ </td>
+ <td>
+ {$location}
+ </td>
+ </tr>
+ </table>
+HTML;
+
+ $lang_vendor = lang('vendor');
+ $lang_customer = lang('customer');
+ $lang_contact_info = lang('contact info');
+
+ $body .= <<<HTML
+ <table border='1' class='pure-table pure-table-bordered
pure-table-striped'>
+ <thead>
+ <tr>
+ <th colspan="2" align = "left">
+ {$lang_contact_info}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <b>{$lang_vendor}</b>
+ </td>
+ <td>
+ {$vendor_name}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ {$vendor_contact_name}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ {$vendor_contact_email}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ {$vendor_contact_phone}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>{$lang_customer}</b>
+ </td>
+ <td>
+ {$customer_name}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ {$customer_contact_name}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+
{$customer_contact_email}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+
{$customer_contact_phone}
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+HTML;
+
+
+ $vendor_receipt_text =
!empty($config['vendor_receipt_text']) ? $config['vendor_receipt_text'] : null;
+
+ if($vendor_receipt_text)
+ {
+
+ // $lang_vendor_note = lang('vendor note');
+ $body .= <<<HTML
+ {$vendor_receipt_text}
+HTML;
+
+ }
+ $customer_receipt_text =
!empty($config['customer_receipt_text']) ? $config['customer_receipt_text'] :
null;
+
+ if($customer_receipt_text)
+ {
+
+ // $lang_customer_note = lang('customer note');
+ $body .= <<<HTML
+ {$customer_receipt_text}
+HTML;
+
+ }
+
+ $content = <<<HTML
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ {$body}
+ </body>
+</html>
+HTML;
+
+//echo $content; die();
+ /**
+ * Vendor
+ */
+ $cc = $customer_contact_email;
+ $bcc = '';
+ $to_email = $vendor_contact_email;
+ $from_email = $customer_contact_email;
+ $from_name = $customer_contact_name;
+
+ try
+ {
+ $rcpt = $send->msg('email', $to_email,
$subject, stripslashes($content), '', $cc, $bcc, $from_email, $from_name,
'html');
+ }
+ catch (phpmailerException $e)
+ {
+ phpgwapi_cache::message_set($e->getMessage(),
'error');
+ }
+
+ phpgwapi_cache::message_set("Email: $to_email, $cc",
'message');
+
+ return $rcpt;
+ }
+
+ public function read( $params )
+ {
$status_text = array(lang('inactive'), lang('active'));
- if(empty($params['filters']['active']))
+ if (empty($params['filters']['active']))
{
$params['filters']['active'] = 1;
}
@@ -88,7 +303,7 @@
{
unset($params['filters']['active']);
}
- $values =
eventplanner_sobooking::get_instance()->read($params);
+ $values =
eventplanner_sobooking::get_instance()->read($params);
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
foreach ($values['results'] as &$entry)
{
@@ -101,7 +316,7 @@
return $values;
}
- public function read_single($id, $return_object = true)
+ public function read_single( $id, $return_object = true )
{
if ($id)
{
@@ -119,77 +334,4 @@
{
return
eventplanner_sobooking::get_instance()->get_booking_id_from_calendar($calendar_id);
}
-
-/* public function update_active_status( $ids, $action )
- {
- if($action == 'enable' && $ids)
- {
- $_ids = array();
- $application_id =
eventplanner_sobooking::get_instance()->read_single($ids[0],
true)->application_id;
-
- $application =
createObject('eventplanner.boapplication')->read_single($application_id);
- $params = array();
- $params['filters']['active'] = 1;
- $params['filters']['application_id'] =
$application_id;
-
- $bookings =
eventplanner_sobooking::get_instance()->read($params);
-
- $existing_booking_ids = array();
- foreach ($bookings['results'] as $booking)
- {
- $existing_booking_ids[] =
$booking['id'];
- }
-
- $number_of_active =
(int)$bookings['total_records'];
- $limit = (int)$application->num_granted_events;
-
- $error = false;
- foreach ($ids as $id)
- {
- if(in_array($id, $existing_booking_ids)
)
- {
- continue;
- }
- if($limit > $number_of_active)
- {
- $_ids[] = $id;
- $number_of_active ++;
- }
- else
- {
- $error = true;
- $message = lang('maximum of
granted events are reached');
-
phpgwapi_cache::message_set($message, 'error');
- break;
- }
- }
- if($ids && !$_ids && !$error)
- {
- return true;
- }
- }
- else if ($action == 'delete' && $ids)
- {
- foreach ($ids as $id)
- {
- $booking =
eventplanner_sobooking::get_instance()->read_single($id, true);
- if(!$booking->customer_id)
- {
- $_ids[] = $id;
- }
- else
- {
- $message = lang('can not delete
booking with customer');
-
phpgwapi_cache::message_set($message, 'error');
- }
- }
- }
- else
- {
- $_ids = $ids;
- }
-
- return
eventplanner_sobooking::get_instance()->update_active_status($_ids, $action);
- }
-*/
}
\ No newline at end of file
Modified: branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -160,7 +160,7 @@
{
$new_value = $object->$field;
$old_value = $original[$field];
- if (!empty($params['history']) && ($new_value
!= $old_value))
+ if (!empty($params['history']) && ($new_value
!= $old_value) && ($params['action'] & PHPGW_ACL_EDIT))
{
$label = !empty($params['label']) ?
lang($params['label']) : $field;
switch ($field)
Modified: branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -115,7 +115,7 @@
return $this->db->transaction_commit();
}
- function check_duplicate_organization($organization_number =
false)
+ function check_duplicate_organization($organization_number =
false, $vendor_id = 0)
{
if(!$organization_number)
{
@@ -124,6 +124,11 @@
$query = $this->db->db_addslashes($organization_number);
$sql = "SELECT name FROM eventplanner_vendor WHERE
organization_number = '{$query}'";
+ if($vendor_id)
+ {
+ $sql .= ' AND id !=' . (int)$vendor_id;
+ }
+
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
return $this->db->f('name', true);
Modified:
branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -139,7 +139,7 @@
'type' => 'int',
'label' => 'category',
'history' => true),
- 'num_granted_events' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'num_granted_events' => array('action'=> 0,
'type' => 'int',
'label' => 'number of granted events',
'history' => true
@@ -181,10 +181,11 @@
'sortable' => false,
'required' => true,
),
- 'summary' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'summary' => array('action'=> 0,
'type' => 'html',
'label' => 'summary',
'sortable' => false,
+ 'query' => true,
),
'remark' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'string',
@@ -358,6 +359,11 @@
if($currentapp == 'eventplanner')
{
$backend_fields = array(
+ 'num_granted_events' =>
array('action'=> PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'number of granted
events',
+ 'history' => true
+ ),
'case_officer_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int',
'required' => true,
@@ -386,6 +392,11 @@
'label' => 'status',
'history' => true
),
+ 'summary' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'html',
+ 'label' => 'summary',
+ 'sortable' => false,
+ ),
'comments' => array(
'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'string',
Modified: branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -290,12 +290,6 @@
protected function doValidate( $entity, &$errors )
{
- $params = array();
- $params['filters']['active'] = 1;
- $params['filters']['customer_id'] =
$entity->customer_id;
-
- $bookings =
eventplanner_sobooking::get_instance()->read($params);
-
$orig_customer_id = 0;
if ($entity->get_id())
{
@@ -319,11 +313,20 @@
$customer =
createObject('eventplanner.bocustomer')->read_single($entity->customer_id);
$max_events = (int)$customer->max_events;
+
+ $params = array();
+ $params['filters']['active'] = 1;
+ $params['filters']['customer_id'] =
$entity->customer_id;
+ $bookings =
eventplanner_sobooking::get_instance()->read($params);
+
+ $calendar_id = $entity->calendar_id;
+ $calendar =
createObject('eventplanner.bocalendar')->read_single($calendar_id, true,
$relaxe_acl = true);
+
foreach ($bookings['results'] as $booking)
{
$booking_year = date('Y',
$booking['from_']);
- if ($booking_year != date('Y',
$entity->from_))
+ if ($booking_year != date('Y',
$calendar->from_))
{
continue;
}
@@ -330,7 +333,7 @@
$test_total_tecords ++;
}
- if ($entity->customer_id ||
$entity->process_update) // update
+ if ($entity->get_id() ||
$entity->process_update) // update
{
}
else // new entry
Modified:
branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -225,9 +225,8 @@
'label' => 'organization number'
),
'max_events' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'action'=> 0,
'type' => 'int',
- 'required' => true,
'query' => false,
'label' => 'maximum number of
events',
)
@@ -236,6 +235,13 @@
if($currentapp == 'eventplanner')
{
$backend_fields = array(
+ 'max_events' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => true,
+ 'query' => false,
+ 'label' => 'maximum number of
events',
+ ),
'active' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int',
'history' => true
@@ -245,8 +251,8 @@
'type' => 'string',
'manytomany' => array(
'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_vendor_comment',
- 'key' => 'vendor_id',
+ 'table' =>
'eventplanner_customer_comment',
+ 'key' => 'customer_id',
'column' =>
array('time', 'author', 'comment', 'type'),
'order' => array('sort'
=> 'time', 'dir' => 'ASC')
)),
Modified: branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -267,7 +267,7 @@
protected function doValidate( $entity, &$errors )
{
$organization_number = $entity->organization_number;
- $duplicate_name =
eventplanner_sovendor::get_instance()->check_duplicate_organization($organization_number);
+ $duplicate_name =
eventplanner_sovendor::get_instance()->check_duplicate_organization($organization_number,
$entity->get_id());
if ($duplicate_name)
{
$errors['organization_number'] =
lang('organization number already exists for %1', $duplicate_name);
Modified: branches/dev-syncromind-2/eventplanner/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind-2/eventplanner/setup/phpgw_no.lang 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/setup/phpgw_no.lang 2017-05-27
18:53:04 UTC (rev 16787)
@@ -124,4 +124,12 @@
summary eventplanner no kortversjon programbeskrivelse
organization number already exists for %1 eventplanner no
Organisasjonsnummeret er allerede registrert på %1.
you need to log in to access this page. eventplanner no Du må
logge deg på for å få tilgang til denne siden.
-do you represent the owner of this entry? eventplanner no
Representerer du eieren av denne posten?
\ No newline at end of file
+do you represent the owner of this entry? eventplanner no
Representerer du eieren av denne posten?
+contact info eventplanner no Kontaktinformasjon
+vendor note eventplanner no Generelt for utøver
+customer note eventplanner no Generelt for Mottakersted
+when eventplanner no Når
+where eventplanner no Hvor
+vendor receipt text eventplanner no utøvernotat ved kvittering
+customer receipt text eventplanner no Mottakerstednotat ved kvittering
+receipt subject eventplanner no Kvitteringsoverskrift
\ No newline at end of file
Modified: branches/dev-syncromind-2/eventplanner/templates/base/config.tpl
===================================================================
--- branches/dev-syncromind-2/eventplanner/templates/base/config.tpl
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/eventplanner/templates/base/config.tpl
2017-05-27 18:53:04 UTC (rev 16787)
@@ -20,6 +20,24 @@
<input type="number"
name="newsettings[booking_interval]" value="{value_booking_interval}">
</td>
</tr>
+ <tr>
+ <td>{lang_receipt_subject}:</td>
+ <td>
+ <input type="text"
name="newsettings[receipt_subject]" value="{value_receipt_subject}">
+ </td>
+ </tr>
+ <tr>
+ <td>{lang_vendor_receipt_text}:</td>
+ <td>
+ <textarea
name="newsettings[vendor_receipt_text]">{value_vendor_receipt_text}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>{lang_customer_receipt_text}:</td>
+ <td>
+ <textarea
name="newsettings[customer_receipt_text]">{value_customer_receipt_text}</textarea>
+ </td>
+ </tr>
<!-- END body -->
<!-- BEGIN footer -->
Modified: branches/dev-syncromind-2/frontend/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind-2/frontend/setup/setup.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/frontend/setup/setup.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -36,11 +36,6 @@
'versions' => array('0.1.0')
);
- $setup_info['frontend']['depends'][] = array(
- 'appname' => 'messenger',
- 'versions' => array('0.9.17.500')
- );
-
/* The hooks this app includes, needed for hooks registration */
$setup_info['frontend']['hooks'] = array
(
Modified: branches/dev-syncromind-2/helpdesk/inc/class.botts.inc.php
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.botts.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/helpdesk/inc/class.botts.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -702,7 +702,7 @@
if ((isset($data['send_mail']) && $data['send_mail'])
|| (isset($this->config->config_data['mailnotification']) &&
$this->config->config_data['mailnotification'])
)
{
- $receipt_mail =
$this->mail_ticket($receipt['id'], false, $receipt, $data['location_code'],
false, isset($data['send_mail']) && $data['send_mail'] ? true : false);
+ $receipt_mail =
$this->mail_ticket($receipt['id'], false, $receipt, false,
isset($data['send_mail']) && $data['send_mail'] ? true : false);
}
reset($custom_functions);
@@ -768,7 +768,7 @@
return $address_element;
}
- function mail_ticket($id, $fields_updated, $receipt =
array(),$location_code='', $get_message = false)
+ function mail_ticket($id, $fields_updated, $receipt = array(),
$get_message = false)
{
$log_recipients = array();
$this->send =
CreateObject('phpgwapi.send');
@@ -789,7 +789,7 @@
$group_name=
$GLOBALS['phpgw']->accounts->id2name($ticket['group_id']);
// build subject
- $subject = '['.lang('Ticket').' #'.$id.'] : ' .
$location_code .' ' .$this->get_category_name($ticket['cat_id']) . '; '
.$ticket['subject'];
+ $subject = '['.lang('Ticket').' #'.$id.'] : ' .
$this->get_category_name($ticket['cat_id']) . '; ' .$ticket['subject'];
$prefs_user =
$this->bocommon->create_preferences('helpdesk',$ticket['user_id']);
@@ -815,12 +815,22 @@
{
$GLOBALS['phpgw_info']['server']['enforce_ssl']
= true;
}
+
+ $link_text = lang('Ticket') . ' #' . $id ;
+
+ $messages_sendt =
$this->historylog->return_array(array(),array('M'),'history_timestamp','DESC',$id);
+
+ if(!$get_message &&
!empty($this->config->config_data['update_message']) && $messages_sendt)
+ {
+ $link_text =
"<H2>{$this->config->config_data['update_message']}</H2>";
+ }
+
$body = '<a href ="' .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'helpdesk.uitts.view',
- 'id' => $id), false, true) . '">' .
lang('Ticket') . ' #' . $id . '</a>' . "\n";
+ 'id' => $id), false, true) . '">' .
$link_text . '</a>' . "\n";
$body .= "<table>";
$body .= '<tr><td>'. lang('Date
Opened').'</td><td>: '.$entry_date."</td></tr>";
- $body .= '<tr><td>'.
lang('status').'</td><td>: '.$status_text[$ticket['status']]."</td></tr>";
+ $body .= '<tr><td>'.
lang('status').'</td><td>: <b>'.$status_text[$ticket['status']]."</b></td></tr>";
$body .= '<tr><td>'.
lang('Category').'</td><td>: '.
$this->get_category_name($ticket['cat_id']) ."</td></tr>";
$body .= '<tr><td>'. lang('Assigned
To').'</td><td>: '.$GLOBALS['phpgw']->accounts->id2name($ticket['assignedto'])."</td></tr>";
Modified: branches/dev-syncromind-2/helpdesk/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.uitts.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/helpdesk/inc/class.uitts.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -313,7 +313,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
$id = phpgw::get_var('id', 'int');
- $ticket_html = $this->bo->mail_ticket($id,
$fields_updated = true, $receipt = array(), $location_code = '', $get_message =
true);
+ $ticket_html = $this->bo->mail_ticket($id,
$fields_updated = true, $receipt = array(), $get_message = true);
$ticket = $this->bo->read_single($id);
@@ -1688,7 +1688,7 @@
)
)
{
- $receipt = $this->bo->mail_ticket($id,
$this->bo->fields_updated, $receipt, '', false, isset($values['send_mail']) &&
$values['send_mail'] ? true : false);
+ $receipt = $this->bo->mail_ticket($id,
$this->bo->fields_updated, $receipt, false, isset($values['send_mail']) &&
$values['send_mail'] ? true : false);
}
//--------- files
Modified: branches/dev-syncromind-2/helpdesk/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind-2/helpdesk/setup/phpgw_no.lang 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/helpdesk/setup/phpgw_no.lang 2017-05-27
18:53:04 UTC (rev 16787)
@@ -201,4 +201,5 @@
sent helpdesk no Sendt
generic helpdesk no Generelt
reverse helpdesk no Revers tildeling
-owned by helpdesk no Eies av
\ No newline at end of file
+owned by helpdesk no Eies av
+update message helpdesk no Oppdateringsmelding
\ No newline at end of file
Modified: branches/dev-syncromind-2/helpdesk/templates/base/config.tpl
===================================================================
--- branches/dev-syncromind-2/helpdesk/templates/base/config.tpl
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/helpdesk/templates/base/config.tpl
2017-05-27 18:53:04 UTC (rev 16787)
@@ -20,6 +20,10 @@
<td><input name="newsettings[app_name]"
value="{value_app_name}"></td>
</tr>
<tr>
+ <td>{lang_update_message}: </td>
+ <td><input name="newsettings[update_message]"
value="{value_update_message}"></td>
+ </tr>
+ <tr>
<td>{lang_from_email}: <br>
<td><input name="newsettings[from_email]"
value="{value_from_email}"></td>
</tr>
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -70,7 +70,7 @@
$params['filters'][$field] =
phpgw::get_var("filter_$field", $_params['type']);
}
- if($field == $order)
+ if($field == $sort && $_params['sortable'])
{
$params['sort'] = $field;
}
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.log.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.log.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.log.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -88,6 +88,7 @@
function get_level_name($level)
{
+ $level = trim($level);
return $this->log_level_names[$level];
}
@@ -297,7 +298,7 @@
else
{
echo $message;
- $call_footer = true;
+ $call_footer = false;
}
// phpgwapi_cache::message_set($message, 'error');
Modified: branches/dev-syncromind-2/phpgwapi/inc/functions.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/functions.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/phpgwapi/inc/functions.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -421,6 +421,33 @@
*/
function phpgw_handle_exception($e)
{
+ if ( !isset($GLOBALS['phpgw']->log)
+ || !is_object($GLOBALS['phpgw']->log) )
+ {
+ $GLOBALS['phpgw']->log = createObject('phpgwapi.log');
+ }
+ $log =& $GLOBALS['phpgw']->log;
+
+// $log_args = array
+// (
+// 'file' => $e->getfile(),
+// 'line' => $e->getline(),
+// 'text' => "Uncaught Exception:\n". $e->getMessage() .
"\n" . $e->getTraceAsString(),
+// 'severity' => 'F'
+// );
+
+ if ($GLOBALS['phpgw']->db->get_transaction())
+ {
+ $GLOBALS['phpgw']->db->transaction_abort();
+ }
+
+// $log->fatal($log_args);
+
+ $log->error(array(
+ 'text' => "<b>Uncaught Exception:</b>\n".
$e->getMessage() . "\n" . $e->getTraceAsString(),
+ 'line' => $e->getline(),
+ 'file' => $e->getfile()
+ ));
$help = 'Please contact your administrator for assistance';
if (!ini_get('display_errors'))
@@ -428,6 +455,7 @@
echo <<<HTML
<h1>Uncaught Exception</h1>
<p>{$help}</p>
+ <p>Error is logged</p>
HTML;
exit;
}
@@ -438,6 +466,7 @@
echo <<<HTML
<h1>Uncaught Exception: {$msg}</h1>
<p>{$help}</p>
+ <p>Error is logged</p>
<h2>Backtrace:</h2>
<pre>
{$trace}
Modified: branches/dev-syncromind-2/property/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind-2/property/setup/setup.inc.php 2017-05-26
03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/property/setup/setup.inc.php 2017-05-27
18:53:04 UTC (rev 16787)
@@ -11,7 +11,7 @@
* @version $Id$
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.712';
+ $setup_info['property']['version'] = '0.9.17.713';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -68,6 +68,7 @@
$setup_info['property']['tables'] = array(
+ 'fm_district',
'fm_part_of_town',
'fm_gab_location',
'fm_streetaddress',
@@ -75,7 +76,6 @@
'fm_tenant_category',
'fm_vendor',
'fm_vendor_category',
- 'fm_district',
'fm_locations',
'fm_location1_category',
'fm_location1',
Modified: branches/dev-syncromind-2/property/setup/tables_current.inc.php
===================================================================
--- branches/dev-syncromind-2/property/setup/tables_current.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/property/setup/tables_current.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -11,14 +11,24 @@
* @version $Id$
*/
$phpgw_baseline = array(
+ 'fm_district' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'int', 'precision' =>
'2', 'nullable' => False),
+ 'descr' => array('type' => 'varchar',
'precision' => '50', 'nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'fm_part_of_town' => array(
'fd' => array(
'id' => array('type' => 'auto', 'precision' =>
'2', 'nullable' => False),
- 'name' => array('type' => 'varchar',
'precision' => '20', 'nullable' => True),
- 'district_id' => array('type' => 'int',
'precision' => '2', 'nullable' => True)
+ 'name' => array('type' => 'varchar',
'precision' => '150', 'nullable' => false),
+ 'district_id' => array('type' => 'int',
'precision' => '2', 'nullable' => false)
),
'pk' => array('id'),
- 'fk' => array(),
+ 'fk' => array('fm_district' => array('district_id' =>
'id')),
'ix' => array(),
'uc' => array()
),
@@ -114,16 +124,6 @@
'ix' => array(),
'uc' => array()
),
- 'fm_district' => array(
- 'fd' => array(
- 'id' => array('type' => 'int', 'precision' =>
'2', 'nullable' => False),
- 'descr' => array('type' => 'varchar',
'precision' => '20', 'nullable' => True)
- ),
- 'pk' => array('id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
'fm_standard_unit' => array(
'fd' => array(
'id' => array('type' => 'int', 'precision' =>
4, 'nullable' => False),
Modified: branches/dev-syncromind-2/property/setup/tables_update.inc.php
===================================================================
--- branches/dev-syncromind-2/property/setup/tables_update.inc.php
2017-05-26 03:34:11 UTC (rev 16786)
+++ branches/dev-syncromind-2/property/setup/tables_update.inc.php
2017-05-27 18:53:04 UTC (rev 16787)
@@ -9545,3 +9545,22 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+ /**
+ * Update property version from 0.9.17.712 to 0.9.17.713
+ *
+ */
+ $test[] = '0.9.17.712';
+
+ function property_upgrade0_9_17_712()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_part_of_town',
'name', array('type' => 'varchar', 'precision' => '150', 'nullable' => false));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.713';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16787] Syncromind: Merge 16739:16786 from trunk,
sigurdne <=