[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16207] more on eventplanner
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16207] more on eventplanner |
Date: |
Mon, 30 Jan 2017 08:50:48 -0500 (EST) |
Revision: 16207
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16207
Author: sigurdne
Date: 2017-01-30 08:50:48 -0500 (Mon, 30 Jan 2017)
Log Message:
-----------
more on eventplanner
Modified Paths:
--------------
trunk/eventplanner/inc/class.soapplication.inc.php
trunk/eventplanner/inc/class.uievents.inc.php
trunk/eventplanner/inc/class.uivendor_report.inc.php
trunk/eventplanner/inc/model/class.booking.inc.php
trunk/eventplanner/inc/model/class.customer.inc.php
trunk/eventplanner/inc/model/class.vendor.inc.php
trunk/eventplanner/inc/model/class.vendor_report.inc.php
trunk/eventplanner/setup/setup.inc.php
trunk/eventplanner/setup/tables_current.inc.php
trunk/eventplanner/setup/tables_update.inc.php
Added Paths:
-----------
trunk/eventplanner/inc/class.bocustomer_report.inc.php
trunk/eventplanner/inc/class.boevents.inc.php
trunk/eventplanner/inc/class.socustomer_report.inc.php
trunk/eventplanner/inc/class.soevents.inc.php
trunk/eventplanner/inc/class.uicustomer_report.inc.php
trunk/eventplanner/inc/model/class.customer_report.inc.php
trunk/eventplanner/templates/base/report.xsl
Removed Paths:
-------------
trunk/eventplanner/inc/class.boresource.inc.php
trunk/eventplanner/inc/class.soresource.inc.php
trunk/eventplanner/inc/class.uiresource.inc.php
trunk/eventplanner/inc/model/class.resource.inc.php
trunk/eventplanner/templates/base/vendor_report.xsl
Added: trunk/eventplanner/inc/class.bocustomer_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bocustomer_report.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.bocustomer_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -0,0 +1,112 @@
+<?php
+ /**
+ * phpGroupWare
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
+ * @internal
+ * @package eventplanner
+ * @subpackage customer_report
+ * @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 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/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('eventplanner.socustomer_report');
+
+ include_class('eventplanner', 'customer_report', 'inc/model/');
+
+ class eventplanner_bocustomer_report extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public $cats;
+
+ public function __construct()
+ {
+ $this->fields =
eventplanner_customer_report::get_fields();
+ $this->acl_location =
eventplanner_customer_report::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$bo == null)
+ {
+ self::$bo = new
eventplanner_bocustomer_report();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_socustomer_report::get_instance()->store($object);
+ $this->store_post_commit($object);
+ return $ret;
+ }
+
+ public function read($params)
+ {
+ if (isset($params['filters']['category_id']) &&
$params['filters']['category_id'] > 0)
+ {
+ $category_id =
$params['filters']['category_id'];
+ $cat_list = $this->cats->return_sorted_array(0,
false, '', '', '', false, $category_id, false);
+ $cat_filter = array($category_id);
+ foreach ($cat_list as $_category)
+ {
+ $cat_filter[] = $_category['id'];
+ }
+ $params['filters']['category_id'] = $cat_filter;
+ }
+
+ $values =
eventplanner_socustomer_report::get_instance()->read($params);
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
+ $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_socustomer_report::get_instance()->read_single($id,
$return_object);
+ }
+ else
+ {
+ $values = new eventplanner_customer_report();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.boevents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boevents.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.boevents.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -0,0 +1,115 @@
+<?php
+ /**
+ * phpGroupWare
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
+ * @internal
+ * @package eventplanner
+ * @subpackage application
+ * @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 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/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('eventplanner.soevents');
+
+ include_class('eventplanner', 'application', 'inc/model/');
+
+ class eventplanner_boevents extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public $cats;
+
+ public function __construct()
+ {
+ $this->fields = eventplanner_application::get_fields();
+ $this->acl_location =
eventplanner_application::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$bo == null)
+ {
+ self::$bo = new eventplanner_boevents();
+ }
+ return self::$bo;
+ }
+
+ /**
+ * Nothing to store - just reporting
+ * @param type $object
+ */
+ public function store($object)
+ {
+ }
+
+ public function read($params)
+ {
+ if (isset($params['filters']['category_id']) &&
$params['filters']['category_id'] > 0)
+ {
+ $category_id =
$params['filters']['category_id'];
+ $cat_list = $this->cats->return_sorted_array(0,
false, '', '', '', false, $category_id, false);
+ $cat_filter = array($category_id);
+ foreach ($cat_list as $_category)
+ {
+ $cat_filter[] = $_category['id'];
+ }
+ $params['filters']['category_id'] = $cat_filter;
+ }
+
+ $values =
eventplanner_soevents::get_instance()->read($params);
+ $status_text =
eventplanner_application::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ $entry['status'] =
$status_text[$entry['status']];
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
+ $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
+ $entry['case_officer_id'] =
$entry['case_officer_id'] ?
$GLOBALS['phpgw']->accounts->get($entry['case_officer_id'])->__toString() : '';
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_soevents::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new eventplanner_application();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Deleted: trunk/eventplanner/inc/class.boresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boresource.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/class.boresource.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -1,98 +0,0 @@
-<?php
- /**
- * phpGroupWare
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
- * @internal
- * @package eventplanner
- * @subpackage resource
- * @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 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/>.
- */
-
- phpgw::import_class('phpgwapi.bocommon');
- phpgw::import_class('eventplanner.soresource');
-
- include_class('eventplanner', 'resource', 'inc/model/');
-
- class eventplanner_boresource extends phpgwapi_bocommon
- {
- protected static
- $bo,
- $fields,
- $acl_location;
-
- public function __construct()
- {
- $this->fields = eventplanner_resource::get_fields();
- $this->acl_location =
eventplanner_resource::acl_location;
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- if (self::$bo == null)
- {
- self::$bo = new eventplanner_boresource();
- }
- return self::$bo;
- }
-
- public function store($object)
- {
- $this->store_pre_commit($object);
- $ret =
eventplanner_soresource::get_instance()->store($object);
- $this->store_post_commit($object);
- return $ret;
- }
-
- public function read($params)
- {
- $values =
eventplanner_soresource::get_instance()->read($params);
- $status_text = eventplanner_resource::get_status_list();
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- foreach ($values['results'] as &$entry)
- {
- $entry['status'] =
$status_text[$entry['status']];
- $entry['entry_date'] =
$GLOBALS['phpgw']->common->show_date($entry['entry_date']);
- $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
- $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
- $entry['executive_officer'] =
$entry['executive_officer'] ?
$GLOBALS['phpgw']->accounts->get($entry['executive_officer'])->__toString() :
'';
- }
- return $values;
- }
-
- public function read_single($id, $return_object = true)
- {
- if ($id)
- {
- $values =
eventplanner_soresource::get_instance()->read_single($id, $return_object);
- }
- else
- {
- $values = new eventplanner_resource();
- }
-
- return $values;
- }
- }
\ No newline at end of file
Modified: trunk/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soapplication.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/class.soapplication.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -37,6 +37,7 @@
{
parent::__construct('eventplanner_application',
eventplanner_application::get_fields());
$this->acl_location =
eventplanner_application::acl_location;
+ $this->use_acl = true;
$this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
$this->cats->supress_info = true;
}
@@ -55,7 +56,75 @@
return self::$so;
}
+ public function _get_cols_and_joins( $filters = array() )
+ {
+ $cols_joins = parent::_get_cols_and_joins($filters);
+ $cols = $cols_joins[0];
+ $joins = $cols_joins[1];
+
+ $joins[] = " JOIN eventplanner_vendor on
eventplanner_vendor.id=eventplanner_application.vendor_id";
+
+ return array($cols, $joins);
+ }
+
+
+ function get_acl_condition( )
+ {
+ $clause = '';
+
+ if($this->use_acl && $this->currentapp &&
$this->acl_location)
+ {
+ $paranthesis = false;
+
+ $grants =
$this->acl->get_grants2($this->currentapp, $this->acl_location);
+ $public_user_list = array();
+ if (is_array($grants['accounts']) &&
$grants['accounts'])
+ {
+ foreach($grants['accounts'] as $user =>
$_right)
+ {
+ $public_user_list[] = $user;
+ }
+ unset($user);
+ reset($public_user_list);
+ $clause .=
"({$this->table_name}.owner_id IN(" . implode(',', $public_user_list) . ")";
+ $paranthesis = true;
+ }
+
+ $public_group_list = array();
+ if (is_array($grants['groups']) &&
$grants['groups'])
+ {
+ foreach($grants['groups'] as $user =>
$_right)
+ {
+ $public_group_list[] = $user;
+ }
+ unset($user);
+ reset($public_group_list);
+ $where = $public_user_list ? 'OR' :
'AND';
+ if(!$paranthesis)
+ {
+ $clause .='(';
+ }
+ $clause .= " $where
phpgw_group_map.group_id IN(" . implode(',', $public_group_list) . ")";
+
+ $paranthesis = true;
+ }
+
+ if($this->currentapp == 'eventplannerfrontend')
+ {
+ $org_id =
phpgw::get_var('org_id','string' , 'SESSION', -1);
+ $clause .= " AND
eventplanner_vendor.organization_number = '{$org_id}'";
+ }
+
+ if($paranthesis)
+ {
+ $clause .=')';
+ }
+ }
+
+ return $clause;
+ }
+
protected function populate( array $data )
{
$object = new eventplanner_application();
Added: trunk/eventplanner/inc/class.socustomer_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.socustomer_report.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.socustomer_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -0,0 +1,138 @@
+<?php
+ /**
+ * phpGroupWare - property: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare 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.
+ *
+ * phpGroupWare 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_socustomer_report extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+
parent::__construct('eventplanner_booking_customer_report',
eventplanner_customer_report::get_fields());
+ $this->acl_location =
eventplanner_customer_report::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.socustomer_report');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_customer_report();
+ foreach ($this->fields as $field => $field_info)
+ {
+ $object->set_field($field, $data[$field]);
+ }
+
+ return $object;
+ }
+
+ function get_category_name( $cat_id )
+ {
+ static $category_name = array();
+
+ if (!isset($category_name[$cat_id]))
+ {
+ $category = $this->cats->return_single($cat_id);
+ $category_name[$cat_id] = $category[0]['name'];
+ }
+ return $category_name[$cat_id];
+ }
+
+ protected function update( $object )
+ {
+ $this->db->transaction_begin();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $original =
$this->read_single($object->get_id());//returned as array()
+ foreach ($this->fields as $field => $params)
+ {
+ $new_value = $object->$field;
+ $old_value = $original[$field];
+ if (!empty($params['history']) && ($new_value
!= $old_value))
+ {
+ $label = !empty($params['label']) ?
lang($params['label']) : $field;
+ switch ($field)
+ {
+ case 'status':
+ $old_value =
$status_text[$old_value];
+ $new_value =
$status_text[$new_value];
+ break;
+ case 'date_start':
+ case 'date_end':
+ $old_value =
$GLOBALS['phpgw']->common->show_date($old_value, $dateformat);
+ $new_value =
$GLOBALS['phpgw']->common->show_date($new_value, $dateformat);
+
+ break;
+ case 'case_officer_id':
+ $old_value = $old_value
? $GLOBALS['phpgw']->accounts->get($old_value)->__toString() : '';
+ $new_value = $new_value
? $GLOBALS['phpgw']->accounts->get($new_value)->__toString() : '';
+ break;
+ case 'category_id':
+ $old_value = $old_value
? $this->get_category_name($old_value) : '';
+ $new_value = $new_value
? $this->get_category_name($new_value) : '';
+ break;
+ default:
+ break;
+ }
+ $value_set = array
+ (
+ 'customer_report_id' =>
$object->get_id(),
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
+ 'type' => 'history',
+ );
+
+ $this->db->query( 'INSERT INTO
eventplanner_customer_report_comment (' . implode( ',', array_keys( $value_set
) ) . ') VALUES ('
+ . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
+ }
+
+ }
+
+ parent::update($object);
+
+ return $this->db->transaction_commit();
+ }
+
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.soevents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soevents.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.soevents.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -0,0 +1,63 @@
+<?php
+ /**
+ * phpGroupWare - property: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare 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.
+ *
+ * phpGroupWare 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.soapplication');
+
+ class eventplanner_soevents extends eventplanner_soapplication
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->use_acl = false;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.soevents');
+ }
+ return self::$so;
+ }
+
+
+
+
+ protected function update( $object )
+ {
+ //nothing;
+ }
+ }
\ No newline at end of file
Deleted: trunk/eventplanner/inc/class.soresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soresource.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/class.soresource.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -1,120 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a part of a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare 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.
- *
- * phpGroupWare 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this resource was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
- phpgw::import_class('phpgwapi.socommon');
-
- class eventplanner_soresource extends phpgwapi_socommon
- {
-
- protected static $so;
-
- public function __construct()
- {
- parent::__construct('eventplanner_resource',
eventplanner_resource::get_fields());
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- if (self::$so == null)
- {
- self::$so =
CreateObject('eventplanner.soresource');
- }
- return self::$so;
- }
-
-
- protected function populate( array $data )
- {
- $object = new eventplanner_resource();
- foreach ($this->fields as $field => $field_info)
- {
- $object->set_field($field, $data[$field]);
- }
-
- return $object;
- }
-
- protected function update( $object )
- {
- $this->db->transaction_begin();
- $status_text = eventplanner_resource::get_status_list();
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $original =
$this->read_single($object->get_id());//returned as array()
- foreach ($this->fields as $field => $params)
- {
- $new_value = $object->$field;
- $old_value = $original[$field];
- if (!empty($params['history']) && ($new_value
!= $old_value))
- {
- $label = !empty($params['label']) ?
lang($params['label']) : $field;
- switch ($field)
- {
- case 'status':
- $old_value =
$status_text[$old_value];
- $new_value =
$status_text[$new_value];
- break;
- case 'date_start':
- case 'date_end':
- $old_value =
$GLOBALS['phpgw']->common->show_date($old_value, $dateformat);
- $new_value =
$GLOBALS['phpgw']->common->show_date($new_value, $dateformat);
-
- break;
- case 'executive_officer':
- $old_value = $old_value
? $GLOBALS['phpgw']->accounts->get($old_value)->__toString() : '';
- $new_value = $new_value
? $GLOBALS['phpgw']->accounts->get($new_value)->__toString() : '';
- break;
- default:
- break;
- }
- $value_set = array
- (
- 'resource_id' =>
$object->get_id(),
- 'time' => time(),
- 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
- 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
- 'type' => 'history',
- );
-
- $this->db->query( 'INSERT INTO
eventplanner_resource_comment (' . implode( ',', array_keys( $value_set ) )
. ') VALUES ('
- . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
- }
-
- }
-
- parent::update($object);
-
- return $this->db->transaction_commit();
- }
-
- }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.uicustomer_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicustomer_report.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uicustomer_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -0,0 +1,263 @@
+<?php
+/**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare 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.
+ *
+ * phpGroupWare 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+// include_class('eventplanner', 'customer_report', 'inc/model/');
+
+ class eventplanner_uicustomer_report extends phpgwapi_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $permissions,
+ $custom_fields,
+ $currentapp;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('customer report');
+ $this->bo =
createObject('eventplanner.bocustomer_report');
+ $this->cats = & $this->bo->cats;
+ $this->fields =
eventplanner_customer_report::get_fields();
+ $this->permissions =
eventplanner_customer_report::get_instance()->get_permission_array();
+ $this->custom_fields =
eventplanner_customer_report::get_instance()->get_custom_fields();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
self::set_active_menu("{$this->currentapp}::customer_report");
+ }
+
+
+ private function _get_filters()
+ {
+ $combos = array();
+ $combos[] = array(
+ 'type' => 'autocomplete',
+ 'name' => 'customer',
+ 'app' => 'eventplanner',
+ 'ui' => 'customer',
+ 'label_attr' => 'name',
+ 'text' => lang('customer') . ':',
+ 'requestGenerator' => 'requestWithVendorFilter'
+ );
+
+ return $combos;
+
+ }
+ public function index()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ phpgwapi_jquery::load_widget('autocomplete');
+
+ $function_msg = lang('customer report');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.index",
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ // 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uicustomer_report.add')),
+ 'editor_action' => '',
+ 'field' => parent::_get_fields()
+ )
+ );
+
+ $filters = $this->_get_filters();
+
+ foreach ($filters as $filter)
+ {
+ array_unshift($data['form']['toolbar']['item'],
$filter);
+ }
+
+ $parameters = array(
+ 'parameter' => array(
+ array(
+ 'name' => 'id',
+ 'source' => 'id'
+ )
+ )
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'view',
+ 'text' => lang('show'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.view"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.edit"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'customer_report.index.js');
+ phpgwapi_jquery::load_widget('numberformat');
+
+ self::render_template_xsl('datatable_jquery', $data);
+ }
+
+ /*
+ * Edit the price item with the id given in the http variable
'id'
+ */
+
+ public function edit( $values = array(), $mode = 'edit' )
+ {
+ $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ if (!empty($values['object']))
+ {
+ $customer_report = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $customer_report = $this->bo->read_single($id);
+ }
+
+ $booking_id = $customer_report->booking_id ?
$customer_report->booking_id : phpgw::get_var('booking_id', 'int');
+ $booking =
createObject('eventplanner.bobooking')->read_single($booking_id);
+
+ $application =
createObject('eventplanner.boapplication')->read_single($booking->application_id);
+ $application_type_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'application_type'));
+ $types = (array)$application->types;
+ if($types)
+ {
+ foreach ($application_type_list as
&$application_type)
+ {
+ foreach ($types as $type)
+ {
+ if((!empty($type['type_id']) &&
$type['type_id'] == $application_type['id']) || ($type ==
$application_type['id']))
+ {
+
$application_type['selected'] = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ $custom_values = $customer_report->json_representation
? $customer_report->json_representation : array();
+ $custom_fields =
createObject('booking.custom_fields','eventplanner');
+ $fields = $this->custom_fields;
+ foreach ($fields as $attrib_id => &$attrib)
+ {
+ $attrib['value'] =
isset($custom_values[$attrib['name']]) ? $custom_values[$attrib['name']] : null;
+
+ if (isset($attrib['choice']) &&
is_array($attrib['choice']) && $attrib['value'])
+ {
+ foreach ($attrib['choice'] as &$choice)
+ {
+ if (is_array($attrib['value']))
+ {
+ $choice['selected'] =
in_array($choice['id'], $attrib['value']) ? 1 : 0;
+ }
+ else
+ {
+ $choice['selected'] =
$choice['id'] == $attrib['value'] ? 1 : 0;
+ }
+ }
+ }
+ }
+// _debug_array($fields);
+ $organized_fields =
$custom_fields->organize_fields(eventplanner_customer_report::acl_location,
$fields);
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('customer report'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+ $data = array(
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer_report.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer_report.index",)),
+ 'report' => $customer_report,
+ 'booking' => $booking,
+ 'application' => $application,
+ 'application_type_list' =>
$application_type_list,
+ 'booking_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uibooking.edit", 'id' => $booking->id, 'active_tab' =>
'reports')),
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab,
+ 'attributes_group' => $organized_fields,
+ );
+ phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
+ phpgwapi_jquery::load_widget('autocomplete');
+ // self::add_javascript('eventplanner', 'portico',
'customer_report.edit.js');
+
self::render_template_xsl(array('report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
+ }
+
+
+ public function save()
+ {
+ parent::save();
+ }
+
+ }
\ No newline at end of file
Modified: trunk/eventplanner/inc/class.uievents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uievents.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/class.uievents.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -48,7 +48,7 @@
{
parent::__construct();
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('events');
- $this->bo = createObject('eventplanner.boapplication');
+ $this->bo = createObject('eventplanner.boevents');
$this->cats = & $this->bo->cats;
$this->fields = eventplanner_application::get_fields();
unset($this->fields['modified']);
Deleted: trunk/eventplanner/inc/class.uiresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiresource.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/class.uiresource.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -1,312 +0,0 @@
-<?php
-/**
- * phpGroupWare - eventplanner: a part of a Facilities Management
System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare 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.
- *
- * phpGroupWare 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
- phpgw::import_class('phpgwapi.uicommon');
- phpgw::import_class('phpgwapi.datetime');
-
- include_class('eventplanner', 'resource', 'inc/model/');
- use eventplanner_resource;
-
- class eventplanner_uiresource extends phpgwapi_uicommon
- {
-
- public $public_functions = array(
- 'add' => true,
- 'index' => true,
- 'query' => true,
- 'view' => true,
- 'edit' => true,
- 'save' => true,
- );
-
- protected
- $fields,
- $composite_types,
- $payment_methods,
- $permissions;
-
- public function __construct()
- {
- parent::__construct();
- self::set_active_menu('eventplanner::resource');
- $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('resource');
- $this->bo = createObject('eventplanner.boresource');
- $this->fields = eventplanner_resource::get_fields();
- $this->permissions =
eventplanner_resource::get_instance()->get_permission_array();
- }
-
- private function get_status_options( $selected = 0 )
- {
- $status_options = array();
- $status_list = eventplanner_resource::get_status_list();
-
- $status_options[] = array(
- 'id' => '',
- 'name' => lang('all')
- );
-
- foreach ($status_list as $_key => $_value)
- {
- $status_options[] = array(
- 'id' => $_key,
- 'name' => $_value,
- 'selected' => $_key == $selected ? 1 : 0
- );
- }
- return $status_options;
- }
-
-
- public function index()
- {
- if (empty($this->permissions[PHPGW_ACL_READ]))
- {
- phpgw::no_access();
- }
-
- if (phpgw::get_var('phpgw_return_as') == 'json')
- {
- return $this->query();
- }
-
- phpgwapi_jquery::load_widget('autocomplete');
-
- $status_options = $this->get_status_options();
- $function_msg = lang('resource');
-
- $data = array(
- 'datatable_name' => $function_msg,
- 'form' => array(
- 'toolbar' => array(
- 'item' => array(
- array(
- 'type' =>
'filter',
- 'name' =>
'filter_status',
- 'text' =>
lang('status'),
- 'list' =>
$status_options
- ),
- array('type' =>
'autocomplete',
- 'name' =>
'ecodimb',
- 'app' =>
'property',
- 'ui' =>
'generic',
- 'label_attr' =>
'descr',
- // 'show_id'=>
true,
- 'text' =>
lang('dimb') . ':',
-
'requestGenerator' => 'requestWithDimbFilter',
- ),
- )
- )
- ),
- 'datatable' => array(
- 'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uiresource.index',
- 'phpgw_return_as' => 'json'
- )),
- 'allrows' => true,
- 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uiresource.add')),
- 'editor_action' => '',
- 'field' => parent::_get_fields()
- )
- );
-
- $parameters = array(
- 'parameter' => array(
- array(
- 'name' => 'id',
- 'source' => 'id'
- )
- )
- );
-
- $data['datatable']['actions'][] = array
- (
- 'my_name' => 'view',
- 'text' => lang('show'),
- 'action' => self::link(array
- (
- 'menuaction' =>
'eventplanner.uiresource.view'
- )),
- 'parameters' => json_encode($parameters)
- );
-
- $data['datatable']['actions'][] = array
- (
- 'my_name' => 'edit',
- 'text' => lang('edit'),
- 'action' => self::link(array
- (
- 'menuaction' =>
'eventplanner.uiresource.edit'
- )),
- 'parameters' => json_encode($parameters)
- );
-
- self::add_javascript('eventplanner', 'portico',
'resource.index.js');
- phpgwapi_jquery::load_widget('numberformat');
-
- self::render_template_xsl('datatable_jquery', $data);
- }
-
- /*
- * Edit the price item with the id given in the http variable
'id'
- */
-
- public function edit( $values = array(), $mode = 'edit' )
- {
- $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
- $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
- if (empty($this->permissions[PHPGW_ACL_ADD]))
- {
- phpgw::no_access();
- }
-
- if (!empty($values['object']))
- {
- $resource = $values['object'];
- }
- else
- {
- $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
- $resource = $this->bo->read_single($id);
- }
-
- if (empty($this->permissions[PHPGW_ACL_EDIT]))
- {
- $step = 1;
- }
- else if ($resource->get_id())
- {
- $step = 2;
- }
-
- $tabs = array();
- $tabs['first_tab'] = array(
- 'label' => lang('resource'),
- 'link' => '#first_tab',
- 'function' => "set_tab('first_tab')"
- );
- $tabs['party'] = array(
- 'label' => lang('party'),
- 'link' => '#party',
- 'function' => "set_tab('party')"
- );
- if($step > 1)
- {
- $tabs['assignment'] = array(
- 'label' => lang('assignment'),
- 'link' => '#assignment',
- 'function' => "set_tab('assignment')"
- );
- }
-
- $composite_types = array();
- foreach ($this->composite_types as $_key => $_value)
- {
- $composite_types[] = array('id' => $_key,
'name' => $_value);
- }
-
- $payment_methods = array();
- foreach ($this->payment_methods as $_key => $_value)
- {
- $payment_methods[] = array('id' => $_key,
'name' => $_value);
- }
-
- $bocommon = CreateObject('property.bocommon');
-
- $GLOBALS['phpgw']->jqcal->add_listener('date_start');
- $GLOBALS['phpgw']->jqcal->add_listener('date_end');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end');
-
- $accounts =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, '.resource',
'eventplanner');
- $executive_officer_options[] = array('id' => '', 'name'
=> lang('nobody'), 'selected' => 0);
- foreach ($accounts as $account)
- {
- $executive_officer_options[] = array(
- 'id' => $account['account_id'],
- 'name' =>
$GLOBALS['phpgw']->accounts->get($account['account_id'])->__toString(),
- 'selected' => ($account['account_id']
== $resource->executive_officer) ? 1 : 0
- );
- }
- $comments = (array)$resource->comments;
- foreach ($comments as $key => &$comment)
- {
- $comment['value_count'] = $key +1;
- $comment['value_date'] =
$GLOBALS['phpgw']->common->show_date($comment['time']);
- }
-
- $comments_def = array(
- array('key' => 'value_count', 'label' => '#',
'sortable' => true, 'resizeable' => true),
- array('key' => 'value_date', 'label' =>
lang('Date'), 'sortable' => true, 'resizeable' => true),
- array('key' => 'author', 'label' =>
lang('User'), 'sortable' => true, 'resizeable' => true),
- array('key' => 'comment', 'label' =>
lang('Note'), 'sortable' => true, 'resizeable' => true)
- );
-
- $datatable_def[] = array(
- 'container' => 'datatable-container_0',
- 'requestUrl' => "''",
- 'ColumnDefs' => $comments_def,
- 'data' => json_encode($comments),
- 'config' => array(
- array('disableFilter' => true),
- array('disablePagination' => true)
- )
- );
-
- $data = array(
- 'datatable_def' => $datatable_def,
- 'form_action' => self::link(array('menuaction'
=> 'eventplanner.uiresource.save')),
- 'cancel_url' => self::link(array('menuaction'
=> 'eventplanner.uiresource.index',)),
- 'resource' => $resource,//->toArray(),
- 'list_executive_officer' => array('options' =>
$executive_officer_options),
- 'step' => $step,
- 'value_ecodimb_descr' =>
ExecMethod('property.bogeneric.get_single_attrib_value', array(
- 'type' => 'dimb',
- 'id' => $resource->ecodimb_id,
- 'attrib_name' => 'descr')
- ),
- 'district_list' => array('options' =>
$bocommon->select_district_list('', $resource->district_id)),
- 'composite_type_list' => array('options' =>
$bocommon->select_list($resource->composite_type_id, $composite_types)),
- 'payment_method_list' => array('options' =>
$bocommon->select_list($resource->payment_method, $payment_methods)),
- 'status_list' => array('options' =>
$this->get_status_options($resource->status)),
- 'mode' => $mode,
- 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
- 'value_active_tab' => $active_tab
- );
- phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
- phpgwapi_jquery::load_widget('autocomplete');
- self::add_javascript('eventplanner', 'portico',
'resource.edit.js');
- self::render_template_xsl(array('resource',
'datatable_inline'), array($mode => $data));
- }
-
-
-// public function save()
-// {
-// parent::save();
-// }
-
- }
\ No newline at end of file
Modified: trunk/eventplanner/inc/class.uivendor_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uivendor_report.inc.php 2017-01-29
18:38:11 UTC (rev 16206)
+++ trunk/eventplanner/inc/class.uivendor_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -238,7 +238,7 @@
$data = array(
'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor_report.save")),
'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor_report.index",)),
- 'vendor_report' => $vendor_report,
+ 'report' => $vendor_report,
'booking' => $booking,
'application' => $application,
'application_type_list' =>
$application_type_list,
@@ -251,7 +251,7 @@
phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
phpgwapi_jquery::load_widget('autocomplete');
// self::add_javascript('eventplanner', 'portico',
'vendor_report.edit.js');
-
self::render_template_xsl(array('vendor_report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
+
self::render_template_xsl(array('report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
}
Modified: trunk/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.booking.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/model/class.booking.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active,
$completed,
$cost,
@@ -96,6 +97,10 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
'history' => true
@@ -241,6 +246,7 @@
{
$entity->status =
eventplanner_booking::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
if (empty($entity->completed))
Modified: trunk/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.customer.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/model/class.customer.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active,
$category_id,
$created,
@@ -99,6 +100,10 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
'history' => true
@@ -238,13 +243,11 @@
$entity->modified = time();
$entity->active = (int)$entity->active;
- if($entity->get_id())
+ if(!$entity->get_id())
{
- }
- else
- {
$entity->status =
eventplanner_customer::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
}
Added: trunk/eventplanner/inc/model/class.customer_report.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.customer_report.inc.php
(rev 0)
+++ trunk/eventplanner/inc/model/class.customer_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -0,0 +1,181 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare 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.
+ *
+ * phpGroupWare 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.bocustomer_report');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_customer_report extends phpgwapi_model
+ {
+
+ const acl_location = '.customer_report';
+
+ protected
+ $id,
+ $owner_id,
+ $booking_id,
+ $booking_location,
+ $created,
+ $json_representation;
+ static $custom_fields = array();
+ protected $field_of_responsibility_name = '.customer_report';
+
+ public function __construct( int $id = null )
+ {
+ parent::__construct((int)$id);
+ $this->field_of_responsibility_name =
self::acl_location;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ return new eventplanner_customer_report();
+ }
+
+ public static function get_custom_fields()
+ {
+ static $custom_fields = array();
+ if(!$custom_fields)
+ {
+ $custom_fields =
$GLOBALS['phpgw']->custom_fields->find('eventplanner', self::acl_location, 0,
'', 'ASC', 'attrib_sort', true, true);
+ }
+ return $custom_fields;
+ }
+
+ public function get_organized_fields()
+ {
+ if (!$this->custom_fields)
+ {
+ $this->custom_fields =
createObject('booking.custom_fields',
'eventplanner')->get_organized_fields(self::acl_location);
+ }
+ return $this->custom_fields;
+ }
+
+ public static function get_fields( $debug = true )
+ {
+ $fields = array(
+ 'id' => array('action' => PHPGW_ACL_READ,
+ 'type' => 'int',
+ 'label' => 'id',
+ 'sortable' => true,
+ 'formatter' =>
'JqueryPortico.formatLink',
+ ),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
+ 'booking_id' => array('action' => PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'booking',
+ 'sortable' => true,
+ 'required' => true,
+ ),
+ 'booking_location' => array('action' =>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'location',
+ 'join' => array(
+ 'table' =>
'eventplanner_booking',
+ 'fkey' => 'booking_id',
+ 'key' => 'id',
+ 'column' => 'location'
+ )
+ ),
+ 'created' => array('action' => PHPGW_ACL_READ |
PHPGW_ACL_ADD,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'json_representation' => array('action' =>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'json',
+ 'sortable' => false,
+ ),
+ );
+
+ if ($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+ if
(!property_exists('eventplanner_customer_report', $field))
+ {
+ phpgwapi_cache::message_set('$'
. "{$field},", 'error');
+ }
+ }
+ }
+ return $fields;
+ }
+
+ /**
+ * Implement in subclasses to perform actions on entity before
validation
+ */
+ protected function preValidate( &$entity )
+ {
+ if (!empty($entity->comment))
+ {
+ $entity->comment_input = array(
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $entity->comment,
+ 'type' => 'comment'
+ );
+ }
+ $entity->modified = time();
+ $entity->active = (int)$entity->active;
+
+ if (!$entity->get_id())
+ {
+ $entity->created = time();
+ $entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ }
+ }
+
+ protected function generate_secret( $length = 10 )
+ {
+ return substr(base64_encode(rand(1000000000,
9999999999)), 0, $length);
+ }
+
+ public function serialize()
+ {
+ return self::toArray();
+ }
+
+ public function store()
+ {
+ return
eventplanner_bocustomer_report::get_instance()->store($this);
+ }
+
+ public function read_single( $id )
+ {
+ return
eventplanner_bocustomer_report::get_instance()->read_single($id, true);
+ }
+ }
\ No newline at end of file
Deleted: trunk/eventplanner/inc/model/class.resource.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.resource.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/model/class.resource.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -1,197 +0,0 @@
-<?php
- /**
- * phpGroupWare - eventplanner: a part of a Facilities Management
System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare 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.
- *
- * phpGroupWare 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
-
- phpgw::import_class('eventplanner.boresource');
-
- include_class('phpgwapi', 'model', 'inc/model/');
-
- class eventplanner_resource extends phpgwapi_model
- {
- const STATUS_REGISTERED = 1;
- const STATUS_PENDING = 2;
- const STATUS_REJECTED = 3;
- const STATUS_APPROVED = 4;
-
- const acl_location = '.resource';
-
- protected
- $id,
- $status,
- $category_id,
- $category_name,
- $date_start,
- $date_end,
- $active,
- $name,
- $description,
- $comment,
- $comments,
- $comment_input,
- $entry_date,
- $executive_officer;
-
- protected $field_of_responsibility_name;
-
- public function __construct( int $id = null )
- {
- parent::__construct((int)$id);
- $this->field_of_responsibility_name =
self::acl_location;
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- return new eventplanner_resource();
- }
-
- public static function get_status_list()
- {
- return array(
- self::STATUS_REGISTERED => lang('registered'),
- self::STATUS_PENDING => lang('pending'),
- self::STATUS_REJECTED => lang('rejected'),
- self::STATUS_APPROVED => lang('approved')
- );
- }
-
-
- public static function get_fields($debug = true)
- {
- $fields = array(
- 'id' => array('action'=> PHPGW_ACL_READ,
- 'type' => 'int',
- 'label' => 'id',
- 'sortable'=> true,
- 'formatter' =>
'JqueryPortico.formatLink',
- ),
- 'category_id' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'label' => 'category',
- ),
- 'category_name' => array(
- 'action'=> PHPGW_ACL_READ,
- 'type' => 'string',
- 'label' => 'category',
- 'join' => array(
- 'table' =>
'eventplanner_resource_category',
- 'fkey' => 'category_id',
- 'key' => 'id',
- 'column' => 'name'
- )
- ),
- 'date_start' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
- 'type' => 'date'),
- 'date_end' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'date'),
- 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'bool'),
- 'name' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'query' => true,
- 'label' => 'name',
- ),
- 'description' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'query' => true,
- 'label' => 'description',
- ),
- 'comments' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'manytomany' => array(
- 'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_resource_comment',
- 'key' => 'resource_id',
- 'column' => array('time',
'author', 'comment', 'type'),
- 'order' => array('sort' =>
'time', 'dir' => 'ASC')
- )),
- 'comment' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'related' => true,
- ),
- 'executive_officer' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'label' => 'executive_officer',
- 'sortable' => true,
- 'history' => true,
- ),
-
- 'entry_date' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD,
- 'type' => 'int',
- 'label' => 'entry_date',
- 'sortable' => true,
- ),
- );
-
- if($debug)
- {
- foreach ($fields as $field => $field_info)
- {
-
if(!property_exists('eventplanner_resource', $field))
- {
- phpgwapi_cache::message_set("$field
is missing from model-definition", 'error');
- }
-
- }
- }
- return $fields;
- }
-
- /**
- * Implement in subclasses to perform actions on entity before
validation
- */
- protected function preValidate( &$entity )
- {
- }
-
- public function serialize()
- {
- return self::toArray();
- }
-
- public function store()
- {
- return
eventplanner_boresource::get_instance()->store($this);
- }
-
- public function read_single($id)
- {
- return
eventplanner_boresource::get_instance()->read_single($id, true);
- }
- }
Modified: trunk/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.vendor.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/inc/model/class.vendor.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active = 1,
$category_id,
$created,
@@ -99,6 +100,10 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
'history' => true
@@ -238,6 +243,7 @@
{
$entity->status =
eventplanner_vendor::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
}
Modified: trunk/eventplanner/inc/model/class.vendor_report.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.vendor_report.inc.php 2017-01-29
18:38:11 UTC (rev 16206)
+++ trunk/eventplanner/inc/model/class.vendor_report.inc.php 2017-01-30
13:50:48 UTC (rev 16207)
@@ -37,6 +37,7 @@
protected
$id,
+ $owner_id,
$booking_id,
$booking_location,
$created,
@@ -88,6 +89,10 @@
'sortable' => true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'booking_id' => array('action' => PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
'type' => 'int',
'label' => 'booking',
@@ -150,6 +155,7 @@
{
$entity->created = time();
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
}
Modified: trunk/eventplanner/setup/setup.inc.php
===================================================================
--- trunk/eventplanner/setup/setup.inc.php 2017-01-29 18:38:11 UTC (rev
16206)
+++ trunk/eventplanner/setup/setup.inc.php 2017-01-30 13:50:48 UTC (rev
16207)
@@ -11,7 +11,7 @@
* @version $Id: setup.inc.php 14728 2016-02-11 22:28:46Z sigurdne $
*/
$setup_info['eventplanner']['name'] = 'eventplanner';
- $setup_info['eventplanner']['version'] = '0.9.18.004';
+ $setup_info['eventplanner']['version'] = '0.9.18.005';
$setup_info['eventplanner']['app_order'] = 20;
$setup_info['eventplanner']['enable'] = 1;
$setup_info['eventplanner']['app_group'] = 'office';
@@ -55,12 +55,9 @@
'eventplanner_application_type',
'eventplanner_application',
'eventplanner_application_comment',
- 'eventplanner_resource',
- 'eventplanner_resource_comment',
'eventplanner_booking',
'eventplanner_booking_comment',
'eventplanner_booking_cost',
- 'eventplanner_booking_resource',
'eventplanner_order',
'eventplanner_booking_vendor_report',
'eventplanner_booking_customer_report'
Modified: trunk/eventplanner/setup/tables_current.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_current.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/setup/tables_current.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -39,6 +39,8 @@
'remark' => array('type' => 'text', 'nullable'
=> True),
'secret' => array('type' => 'text', 'nullable'
=> False),
'organization_number' => array('type' =>
'varchar', 'precision' => '9','nullable' => True),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
'created' => array('type' => 'int', 'precision'
=> '8', 'nullable' => False, 'default' => 'current_timestamp'),
'modified' => array('type' => 'int',
'precision' => '8', 'nullable' => False, 'default' => 'current_timestamp'),
'json_representation' => array('type' =>
'jsonb', 'nullable' => true),
@@ -94,6 +96,8 @@
'remark' => array('type' => 'text', 'nullable'
=> True),
'secret' => array('type' => 'text', 'nullable'
=> False),
'organization_number' => array('type' =>
'varchar', 'precision' => '9','nullable' => True),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
'created' => array('type' => 'int', 'precision'
=> '8', 'nullable' => False, 'default' => 'current_timestamp'),
'modified' => array('type' => 'int',
'precision' => '8', 'nullable' => False, 'default' => 'current_timestamp'),
'json_representation' => array('type' =>
'jsonb', 'nullable' => true),
@@ -145,6 +149,7 @@
'contact_phone' => array('type' => 'text',
'nullable' => False),
'secret' => array('type' => 'text', 'nullable'
=> true),
'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
'case_officer_id' => array('type' => 'int',
'precision' => '4', 'nullable' => True),
'charge_per_unit' => array('type' => 'decimal',
'precision' => '20', 'scale' => '2','nullable' => true, 'default' => '0.00'),
'number_of_units' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
@@ -219,43 +224,6 @@
'ix' => array(),
'uc' => array()
),
- 'eventplanner_resource' => array(
- 'fd' => array(
- 'id' => array('type' => 'auto', 'nullable' =>
False),
- 'category_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
- 'date_start' => array('type' => 'int',
'precision' => '8', 'nullable' => false),
- 'date_end' => array('type' => 'int',
'precision' => '8', 'nullable' => false),
- 'active' => array('type' => 'int', 'precision'
=> '2', 'nullable' => false),
- 'name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => false),
- 'description' => array('type' => 'text',
'nullable' => false),
- 'executive_officer' => array('type' => 'int',
'precision' => '4', 'nullable' => true),
- 'entry_date' => array('type' => 'int',
'precision' => '8', 'nullable' => false),
- 'created_by' => array('type' => 'int',
'precision' => 4, 'nullable' => false),
- 'last_updated' => array('type' => 'int',
'precision' => '8', 'nullable' => false),
- 'json_representation' => array('type' =>
'jsonb', 'nullable' => true),
- ),
- 'pk' => array('id'),
- 'fk' => array(
- 'phpgw_accounts' => array('executive_officer'
=> 'account_id')
- ),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'eventplanner_resource_comment' => array(
- 'fd' => array(
- 'id' => array('type' => 'auto', 'nullable' =>
False),
- 'resource_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
- 'time' => array('type' => 'int', 'precision' =>
'8', 'nullable' => False),
- 'author' => array('type' => 'text', 'nullable'
=> False),
- 'comment' => array('type' => 'text', 'nullable'
=> False),
- 'type' => array('type' => 'varchar',
'precision' => '20', 'nullable' => false,'default' => 'comment'),
- ),
- 'pk' => array('id'),
- 'fk' => array(
- 'eventplanner_resource' => array('resource_id'
=> 'id')),
- 'ix' => array(),
- 'uc' => array()
- ),
'eventplanner_booking' => array(
'fd' => array(
'id' => array('type' => 'auto', 'nullable' =>
False),
@@ -273,6 +241,8 @@
'reminder' => array('type' => 'int',
'precision' => 4, 'nullable' => False, 'default' => '0'),
'secret' => array('type' => 'text', 'nullable'
=> False),
'sms_total' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
'created' => array('type' => 'int', 'precision'
=> '8', 'nullable' => False, 'default' => 'current_timestamp'),
),
'pk' => array('id'),
@@ -313,22 +283,10 @@
'ix' => array(),
'uc' => array()
),
- 'eventplanner_booking_resource' => array(
- 'fd' => array(
- 'booking_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
- 'resource_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
- ),
- 'pk' => array('booking_id', 'resource_id'),
- 'fk' => array(
- 'eventplanner_booking' => array('booking_id' =>
'id'),
- 'eventplanner_resource' => array('resource_id'
=> 'id')
- ),
- 'ix' => array(),
- 'uc' => array()
- ),
'eventplanner_order' => array(
'fd' => array(
'id' => array('type' => 'int', 'precision' =>
'4', 'nullable' => False),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
'booking_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
'time' => array('type' => 'int', 'precision' =>
'8', 'nullable' => False, 'default' => 'current_timestamp'),
'author' => array('type' => 'text', 'nullable'
=> False),
@@ -356,6 +314,8 @@
'id' => array('type' => 'auto', 'nullable' =>
False),
'booking_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
'created' => array('type' => 'int', 'precision'
=> '8', 'nullable' => False, 'default' => 'current_timestamp'),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
// 'author' => array('type' => 'text', 'nullable'
=> False),
'json_representation' => array('type' =>
'jsonb', 'nullable' => true),
),
@@ -370,6 +330,8 @@
'id' => array('type' => 'auto', 'nullable' =>
False),
'booking_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
'created' => array('type' => 'int', 'precision'
=> '8', 'nullable' => False, 'default' => 'current_timestamp'),
+ 'owner_id' => array('type' => 'int',
'precision' => '4', 'nullable' => False),
+ 'public' => array('type' => 'int', 'precision'
=> '2', 'nullable' => True),
// 'author' => array('type' => 'text', 'nullable'
=> False),
'json_representation' => array('type' =>
'jsonb', 'nullable' => true),
),
Modified: trunk/eventplanner/setup/tables_update.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_update.inc.php 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/setup/tables_update.inc.php 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -80,3 +80,71 @@
}
return $GLOBALS['setup_info']['eventplanner']['currentver'];
}
+
+ $test[] = '0.9.18.004';
+
+ function eventplanner_upgrade0_9_18_004()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->DropTable('eventplanner_resource_comment');
+
$GLOBALS['phpgw_setup']->oProc->DropTable('eventplanner_booking_resource');
+
$GLOBALS['phpgw_setup']->oProc->DropTable('eventplanner_resource');
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_vendor', 'owner_id',
array(
+ 'type' => 'int', 'precision' => 4, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_vendor', 'public',
array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_customer', 'owner_id',
array(
+ 'type' => 'int', 'precision' => 4, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_customer', 'public',
array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking', 'owner_id',
array(
+ 'type' => 'int', 'precision' => 4, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking', 'public',
array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
+ $GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_order',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_application', 'public',
array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking_vendor_report',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking_vendor_report',
'public', array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking_customer_report',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('eventplanner_booking_customer_report',
'public', array(
+ 'type' => 'int', 'precision' => 2, 'nullable' => True));
+
+ $sql = "UPDATE eventplanner_vendor SET owner_id = 7";
+ $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+ $sql = "UPDATE eventplanner_customer SET owner_id = 7";
+ $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+ $sql = "UPDATE eventplanner_booking SET owner_id = 7";
+ $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+ $sql = "UPDATE eventplanner_booking_vendor_report SET owner_id
= 7";
+ $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+ $sql = "UPDATE eventplanner_booking_customer_report SET
owner_id = 7";
+ $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_vendor', 'owner_id',
array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_customer',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_booking', 'owner_id',
array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_booking_vendor_report',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_booking_customer_report',
'owner_id', array(
+ 'type' => 'int', 'precision' => 4, 'nullable' =>
false));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['eventplanner']['currentver'] =
'0.9.18.005';
+ }
+ return $GLOBALS['setup_info']['eventplanner']['currentver'];
+ }
Added: trunk/eventplanner/templates/base/report.xsl
===================================================================
--- trunk/eventplanner/templates/base/report.xsl
(rev 0)
+++ trunk/eventplanner/templates/base/report.xsl 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -0,0 +1,143 @@
+
+<!-- $Id: price_item.xsl 12604 2015-01-15 17:06:11Z nelson224 $ -->
+<xsl:template match="data">
+ <xsl:choose>
+ <xsl:when test="edit">
+ <xsl:apply-templates select="edit" />
+ </xsl:when>
+ <xsl:when test="view">
+ <xsl:apply-templates select="view" />
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<!-- add / edit -->
+<xsl:template xmlns:php="http://php.net/xsl" match="edit">
+ <xsl:variable name="date_format">
+ <xsl:value-of select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')" />
+ <xsl:text> H:i</xsl:text>
+ </xsl:variable>
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
+ </xsl:variable>
+ <xsl:variable name="mode">
+ <xsl:value-of select="mode"/>
+ </xsl:variable>
+
+ <div>
+ <script type="text/javascript">
+ var lang = <xsl:value-of
select="php:function('js_lang', 'Name or company is required')"/>;
+ </script>
+ <form id="form" name="form" method="post"
action="{$form_action}" class="pure-form pure-form-aligned">
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
+ <input type="hidden" id="active_tab"
name="active_tab" value="{value_active_tab}"/>
+ <div id="first_tab">
+ <xsl:if test="booking/id > 0">
+ <div class="pure-control-group">
+ <label>
+ <a
href="{booking_url}">
+
<xsl:value-of select="php:function('lang', 'booking')"/>
+ </a>
+ </label>
+ <input type="hidden"
name="booking_id" value="{booking/id}"/>
+ <xsl:value-of
select="booking/id"/>
+ </div>
+ </xsl:if>
+ <xsl:if test="report/id > 0">
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'report')"/>
+ </label>
+ <input type="hidden"
name="id" value="{report/id}"/>
+ <xsl:value-of
select="report/id"/>
+ </div>
+ </xsl:if>
+ <xsl:call-template
name="application_info">
+ <xsl:with-param
name="application" select ='application'/>
+ <xsl:with-param
name="application_type_list" select ='application_type_list'/>
+ </xsl:call-template>
+ <div class="pure-control-group">
+ <xsl:variable name="lang_from">
+ <xsl:value-of
select="php:function('lang', 'from')"/>
+ </xsl:variable>
+ <label>
+ <xsl:value-of
select="$lang_from"/>
+ </label>
+ <xsl:value-of
select="php:function('show_date', number(booking/from_), $date_format)"/>
+ </div>
+
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'to')"/>
+ </label>
+ <xsl:value-of
select="php:function('show_date', number(booking/to_), $date_format)"/>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'customer')"/>
+ </label>
+ <xsl:value-of
select="booking/customer_name"/>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="php:function('lang', 'location')"/>
+ </label>
+ <xsl:value-of
select="booking/location"/>
+ </div>
+
+ <fieldset>
+ <!--xsl:apply-templates
select="attributes_group/attributes"/-->
+ <xsl:call-template
name="attributes_values"/>
+
+ </fieldset>
+ </div>
+ </div>
+ <div class="proplist-col">
+ <input type="submit" class="pure-button
pure-button-primary" name="save">
+ <xsl:attribute name="value">
+ <xsl:value-of
select="php:function('lang', 'save')"/>
+ </xsl:attribute>
+ </input>
+ <xsl:variable name="cancel_url">
+ <xsl:value-of select="cancel_url"/>
+ </xsl:variable>
+ <input type="button" class="pure-button
pure-button-primary" name="cancel" onClick="window.location = '{cancel_url}';">
+ <xsl:attribute name="value">
+ <xsl:value-of
select="php:function('lang', 'cancel')"/>
+ </xsl:attribute>
+ </input>
+ </div>
+ </form>
+ </div>
+</xsl:template>
+
+<xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected" value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes" select="name"/>
+ </option>
+</xsl:template>
+
+
+<xsl:template xmlns:php="http://php.net/xsl" match="view">
+ <div>
+ <form id="form" name="form" method="post" action=""
class="pure-form pure-form-aligned">
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
+ <div id="showing">
+
+ </div>
+ </div>
+ <div class="proplist-col">
+ <xsl:variable name="cancel_url">
+ <xsl:value-of select="cancel_url"/>
+ </xsl:variable>
+ <input type="button" class="pure-button
pure-button-primary" name="cancel" value="{lang_cancel}"
onMouseout="window.status='';return true;" onClick="window.location =
'{cancel_url}';"/>
+ </div>
+ </form>
+ </div>
+</xsl:template>
Deleted: trunk/eventplanner/templates/base/vendor_report.xsl
===================================================================
--- trunk/eventplanner/templates/base/vendor_report.xsl 2017-01-29 18:38:11 UTC
(rev 16206)
+++ trunk/eventplanner/templates/base/vendor_report.xsl 2017-01-30 13:50:48 UTC
(rev 16207)
@@ -1,143 +0,0 @@
-
-<!-- $Id: price_item.xsl 12604 2015-01-15 17:06:11Z nelson224 $ -->
-<xsl:template match="data">
- <xsl:choose>
- <xsl:when test="edit">
- <xsl:apply-templates select="edit" />
- </xsl:when>
- <xsl:when test="view">
- <xsl:apply-templates select="view" />
- </xsl:when>
- </xsl:choose>
-
-</xsl:template>
-
-<!-- add / edit -->
-<xsl:template xmlns:php="http://php.net/xsl" match="edit">
- <xsl:variable name="date_format">
- <xsl:value-of select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')" />
- <xsl:text> H:i</xsl:text>
- </xsl:variable>
- <xsl:variable name="form_action">
- <xsl:value-of select="form_action"/>
- </xsl:variable>
- <xsl:variable name="mode">
- <xsl:value-of select="mode"/>
- </xsl:variable>
-
- <div>
- <script type="text/javascript">
- var lang = <xsl:value-of
select="php:function('js_lang', 'Name or company is required')"/>;
- </script>
- <form id="form" name="form" method="post"
action="{$form_action}" class="pure-form pure-form-aligned">
- <div id="tab-content">
- <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
- <input type="hidden" id="active_tab"
name="active_tab" value="{value_active_tab}"/>
- <div id="first_tab">
- <xsl:if test="booking/id > 0">
- <div class="pure-control-group">
- <label>
- <a
href="{booking_url}">
-
<xsl:value-of select="php:function('lang', 'booking')"/>
- </a>
- </label>
- <input type="hidden"
name="booking_id" value="{booking/id}"/>
- <xsl:value-of
select="booking/id"/>
- </div>
- </xsl:if>
- <xsl:if test="vendor_report/id > 0">
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'report')"/>
- </label>
- <input type="hidden"
name="id" value="{vendor_report/id}"/>
- <xsl:value-of
select="vendor_report/id"/>
- </div>
- </xsl:if>
- <xsl:call-template
name="application_info">
- <xsl:with-param
name="application" select ='application'/>
- <xsl:with-param
name="application_type_list" select ='application_type_list'/>
- </xsl:call-template>
- <div class="pure-control-group">
- <xsl:variable name="lang_from">
- <xsl:value-of
select="php:function('lang', 'from')"/>
- </xsl:variable>
- <label>
- <xsl:value-of
select="$lang_from"/>
- </label>
- <xsl:value-of
select="php:function('show_date', number(booking/from_), $date_format)"/>
- </div>
-
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'to')"/>
- </label>
- <xsl:value-of
select="php:function('show_date', number(booking/to_), $date_format)"/>
- </div>
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'customer')"/>
- </label>
- <xsl:value-of
select="booking/customer_name"/>
- </div>
- <div class="pure-control-group">
- <label>
- <xsl:value-of
select="php:function('lang', 'location')"/>
- </label>
- <xsl:value-of
select="booking/location"/>
- </div>
-
- <fieldset>
- <!--xsl:apply-templates
select="attributes_group/attributes"/-->
- <xsl:call-template
name="attributes_values"/>
-
- </fieldset>
- </div>
- </div>
- <div class="proplist-col">
- <input type="submit" class="pure-button
pure-button-primary" name="save">
- <xsl:attribute name="value">
- <xsl:value-of
select="php:function('lang', 'save')"/>
- </xsl:attribute>
- </input>
- <xsl:variable name="cancel_url">
- <xsl:value-of select="cancel_url"/>
- </xsl:variable>
- <input type="button" class="pure-button
pure-button-primary" name="cancel" onClick="window.location = '{cancel_url}';">
- <xsl:attribute name="value">
- <xsl:value-of
select="php:function('lang', 'cancel')"/>
- </xsl:attribute>
- </input>
- </div>
- </form>
- </div>
-</xsl:template>
-
-<xsl:template match="options">
- <option value="{id}">
- <xsl:if test="selected != 0">
- <xsl:attribute name="selected" value="selected"/>
- </xsl:if>
- <xsl:value-of disable-output-escaping="yes" select="name"/>
- </option>
-</xsl:template>
-
-
-<xsl:template xmlns:php="http://php.net/xsl" match="view">
- <div>
- <form id="form" name="form" method="post" action=""
class="pure-form pure-form-aligned">
- <div id="tab-content">
- <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
- <div id="showing">
-
- </div>
- </div>
- <div class="proplist-col">
- <xsl:variable name="cancel_url">
- <xsl:value-of select="cancel_url"/>
- </xsl:variable>
- <input type="button" class="pure-button
pure-button-primary" name="cancel" value="{lang_cancel}"
onMouseout="window.status='';return true;" onClick="window.location =
'{cancel_url}';"/>
- </div>
- </form>
- </div>
-</xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16207] more on eventplanner,
sigurdne <=