[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15824] start work on eventplanner
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15824] start work on eventplanner |
Date: |
Thu, 13 Oct 2016 14:56:17 +0000 (UTC) |
Revision: 15824
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15824
Author: sigurdne
Date: 2016-10-13 14:56:17 +0000 (Thu, 13 Oct 2016)
Log Message:
-----------
start work on eventplanner
Modified Paths:
--------------
trunk/booking/inc/class.soapplication.inc.php
Added Paths:
-----------
trunk/eventplanner/
trunk/eventplanner/inc/
trunk/eventplanner/inc/class.boapplication.inc.php
trunk/eventplanner/inc/class.bocommon.inc.php
trunk/eventplanner/inc/class.bocustomer.inc.php
trunk/eventplanner/inc/class.bogeneric.inc.php
trunk/eventplanner/inc/class.boresource.inc.php
trunk/eventplanner/inc/class.bovendor.inc.php
trunk/eventplanner/inc/class.menu.inc.php
trunk/eventplanner/inc/class.soapplication.inc.php
trunk/eventplanner/inc/class.socustomer.inc.php
trunk/eventplanner/inc/class.sogeneric.inc.php
trunk/eventplanner/inc/class.soresource.inc.php
trunk/eventplanner/inc/class.sovendor.inc.php
trunk/eventplanner/inc/class.uiapplication.inc.php
trunk/eventplanner/inc/class.uicommon.inc.php
trunk/eventplanner/inc/class.uicustomer.inc.php
trunk/eventplanner/inc/class.uigeneric.inc.php
trunk/eventplanner/inc/class.uiresource.inc.php
trunk/eventplanner/inc/class.uivendor.inc.php
trunk/eventplanner/inc/custom/
trunk/eventplanner/inc/custom/demo_custom.php
trunk/eventplanner/inc/hook_help.inc.php
trunk/eventplanner/inc/hook_manual.inc.php
trunk/eventplanner/inc/hook_settings.inc.php
trunk/eventplanner/inc/model/
trunk/eventplanner/inc/model/class.application.inc.php
trunk/eventplanner/inc/model/class.customer.inc.php
trunk/eventplanner/inc/model/class.resource.inc.php
trunk/eventplanner/inc/model/class.vendor.inc.php
trunk/eventplanner/index.php
trunk/eventplanner/js/
trunk/eventplanner/js/portico/
trunk/eventplanner/js/portico/application.edit.js
trunk/eventplanner/js/portico/application.index.js
trunk/eventplanner/js/portico/customer.index.js
trunk/eventplanner/js/portico/demo.edit.js
trunk/eventplanner/js/portico/demo.index.js
trunk/eventplanner/setup/
trunk/eventplanner/setup/default_records.inc.php
trunk/eventplanner/setup/phpgw_en.lang
trunk/eventplanner/setup/phpgw_no.lang
trunk/eventplanner/setup/setup.inc.php
trunk/eventplanner/setup/tables_current.inc.php
trunk/eventplanner/setup/tables_update.inc.php
trunk/eventplanner/templates/
trunk/eventplanner/templates/base/
trunk/eventplanner/templates/base/app_data.xsl
trunk/eventplanner/templates/base/application.xsl
trunk/eventplanner/templates/base/config.tpl
trunk/eventplanner/templates/base/customer.xsl
trunk/eventplanner/templates/base/images/
trunk/eventplanner/templates/base/images/navbar.png
trunk/eventplanner/templates/base/vendor.xsl
trunk/eventplanner/templates/default/
Modified: trunk/booking/inc/class.soapplication.inc.php
===================================================================
--- trunk/booking/inc/class.soapplication.inc.php 2016-10-13 13:04:59 UTC
(rev 15823)
+++ trunk/booking/inc/class.soapplication.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -66,9 +66,10 @@
'manytomany' => array(
'table' =>
'bb_application_agegroup',
'key' => 'application_id',
- 'column' => array('agegroup_id'
=> array('type' => 'int', 'required' => true),
- 'male' => array('type'
=> 'int', 'required' => true), 'female' => array('type' => 'int',
- 'required' =>
true)),
+ 'column' => array(
+ 'agegroup_id' =>
array('type' => 'int', 'required' => true),
+ 'male' => array('type'
=> 'int', 'required' => true),
+ 'female' =>
array('type' => 'int','required' => true)),
)),
'dates' => array('type' => 'timestamp',
'required' => true,
'manytomany' => array(
Added: trunk/eventplanner/inc/class.boapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boapplication.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.boapplication.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -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('eventplanner.bocommon');
+ phpgw::import_class('eventplanner.soapplication');
+
+ include_class('eventplanner', 'application', 'inc/model/');
+
+ class eventplanner_boapplication extends eventplanner_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_boapplication();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_soapplication::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_soapplication::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_soapplication::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new eventplanner_application();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.bocommon.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bocommon.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.bocommon.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,159 @@
+<?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/>.
+ */
+
+
+ abstract class eventplanner_bocommon
+ {
+
+ protected static
+ $fields,
+ $acl_location;
+
+
+ public function __construct()
+ {
+ }
+
+
+ /*
+ * Get the filters and search parametres for table-listings
+ */
+ public function build_default_read_params()
+ {
+ $fields = $this->fields;
+
+ $search = phpgw::get_var('search');
+ $query = phpgw::get_var('query');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
+
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', 0),
+ 'query' => $query ? $query : $search['value'],
+ 'sort' => $columns[$order[0]['column']]['data'],
+ 'dir' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+
+ foreach ($fields as $field => $_params)
+ {
+ if (!empty($_REQUEST["filter_$field"]))
+ {
+ $params['filters'][$field] =
phpgw::get_var("filter_$field", $_params['type']);
+ }
+ }
+
+ return $params;
+ }
+
+ /**
+ * Insert values prosted from form
+ * @param object $object
+ * @return object
+ */
+ public function populate($object)
+ {
+ $fields = $this->fields;
+
+ foreach ($fields as $field => $field_info)
+ {
+ if(($field_info['action'] & PHPGW_ACL_ADD) ||
($field_info['action'] & PHPGW_ACL_EDIT))
+ {
+ $object->set_field( $field,
phpgw::get_var($field, $field_info['type'] ) );
+ }
+ }
+ return $object;
+ }
+
+ public abstract function store( $object );
+
+
+ /**
+ * Perform custom actions defined per location before storing
object to database
+ * @param object $object
+ */
+ public function store_pre_commit( &$object )
+ {
+ $criteria = array(
+ 'appname' => 'eventplanner',
+ 'location' => $this->acl_location,
+ 'pre_commit' => true,
+ 'allrows' => true
+ );
+
+ $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+ foreach ($custom_functions as $entry)
+ {
+ // prevent path traversal
+ if (preg_match('/\.\./', $entry['file_name']))
+ {
+ continue;
+ }
+
+ $file = PHPGW_SERVER_ROOT .
"/eventplanner/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+ if ($entry['active'] && is_file($file) &&
!$entry['client_side'] && $entry['pre_commit'])
+ {
+ require $file;
+ }
+ }
+ }
+
+ /**
+ * Perform custom actions defined per location after storing
object to database
+ * @param object $object
+ */
+ public function store_post_commit( &$object )
+ {
+ $criteria = array(
+ 'appname' => 'eventplanner',
+ 'location' => $this->acl_location,
+ 'allrows' => true
+ );
+
+ $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+
+ foreach ($custom_functions as $entry)
+ {
+ // prevent path traversal
+ if (preg_match('/\.\./', $entry['file_name']))
+ {
+ continue;
+ }
+
+ $file = PHPGW_SERVER_ROOT .
"/eventplanner/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+ if ($entry['active'] && is_file($file) &&
!$entry['client_side'] && !$entry['pre_commit'])
+ {
+ require $file;
+ }
+ }
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.bocustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bocustomer.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.bocustomer.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,104 @@
+<?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
+ * @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('eventplanner.bocommon');
+ phpgw::import_class('eventplanner.socustomer');
+
+ include_class('eventplanner', 'customer', 'inc/model/');
+
+ class eventplanner_bocustomer extends eventplanner_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public function __construct()
+ {
+ $this->fields = eventplanner_customer::get_fields();
+ $this->acl_location =
eventplanner_customer::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_bocustomer();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_socustomer::get_instance()->store($object);
+ $this->store_post_commit($object);
+ return $ret;
+ }
+
+ public function read($params)
+ {
+ if(empty($params['filters']['active']))
+ {
+ $params['filters']['active'] = 1;
+ }
+ else
+ {
+ unset($params['filters']['active']);
+ }
+ $values =
eventplanner_socustomer::get_instance()->read($params);
+ // $status_text = eventplanner_customer::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']);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_socustomer::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new eventplanner_customer();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.bogeneric.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bogeneric.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.bogeneric.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,37 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.bogeneric');
+
+ class eventplanner_bogeneric extends property_bogeneric
+ {
+ public function __construct()
+ {
+ parent::__construct();
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.boresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boresource.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.boresource.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,98 @@
+<?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('eventplanner.bocommon');
+ phpgw::import_class('eventplanner.soresource');
+
+ include_class('eventplanner', 'resource', 'inc/model/');
+
+ class eventplanner_boresource extends eventplanner_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
Added: trunk/eventplanner/inc/class.bovendor.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bovendor.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.bovendor.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,110 @@
+<?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 vendor
+ * @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('eventplanner.bocommon');
+ phpgw::import_class('eventplanner.sovendor');
+
+ include_class('eventplanner', 'vendor', 'inc/model/');
+
+ class eventplanner_bovendor extends eventplanner_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public function __construct()
+ {
+ $this->fields = eventplanner_vendor::get_fields();
+ $this->acl_location = eventplanner_vendor::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_bovendor();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_sovendor::get_instance()->store($object);
+ $this->store_post_commit($object);
+ return $ret;
+ }
+
+ public function read($params)
+ {
+ if(empty($params['filters']['active']))
+ {
+ $params['filters']['active'] = 1;
+ }
+ else
+ {
+ unset($params['filters']['active']);
+ }
+
+ $organization_number =
phpgw::get_var('organization_number', 'bool');
+ $values =
eventplanner_sovendor::get_instance()->read($params);
+ // $status_text = eventplanner_vendor::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ // $entry['status'] =
$status_text[$entry['status']];
+ if($organization_number)
+ {
+ $entry['name'] .= "
[{$entry['vendor_organization_number']}]";
+ }
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_sovendor::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new eventplanner_vendor();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.menu.inc.php
===================================================================
--- trunk/eventplanner/inc/class.menu.inc.php (rev 0)
+++ trunk/eventplanner/inc/class.menu.inc.php 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,172 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package eventplanner
+ * @subpackage core
+ * @version $Id: class.menu.inc.php 14728 2016-02-11 22:28:46Z sigurdne
$
+ */
+ /*
+ 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 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/>.
+ */
+
+ /**
+ * Description
+ * @package eventplanner
+ */
+ class eventplanner_menu
+ {
+
+ /**
+ * Get the menus for the eventplanner
+ *
+ * @return array available menus for the current user
+ */
+ public function get_menu()
+ {
+ $start_page = 'application';
+ if
(isset($GLOBALS['phpgw_info']['user']['preferences']['eventplanner']['default_start_page'])
&&
$GLOBALS['phpgw_info']['user']['preferences']['eventplanner']['default_start_page'])
+ {
+ $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['eventplanner']['default_start_page'];
+ }
+
+ $menus['navbar'] = array(
+ 'eventplanner' => array(
+ 'text' => lang('eventplanner'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.ui{$start_page}.index")),
+ 'image' => array('eventplanner',
'navbar'),
+ 'order' => 35,
+ 'group' => 'office'
+ ),
+ );
+
+ $menus['toolbar'] = array();
+ if
(isset($GLOBALS['phpgw_info']['user']['apps']['admin']))
+ {
+ $menus['admin'] = array
+ (
+ 'acl' => array(
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Configure Access Permissions',
array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl',
+ 'acl_app' =>
'eventplanner'))
+ ),
+ 'list_atrribs' => array(
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('custom fields', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute',
+ 'appname' =>
'eventplanner'))
+ ),
+ 'list_functions' => array(
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('custom functions', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_custom_function',
+ 'appname' =>
'eventplanner'))
+ ),
+ 'application_cats' => array
+ (
+ 'text' => lang('Application
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index',
+ 'appname' =>
'eventplanner', 'location' => '.application', 'global_cats' => 'true',
+ 'menu_selection' =>
'admin::eventplanner::application_cats'))
+ ),
+ 'application_type' => array
+ (
+ 'text' => lang('application
type'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uigeneric.index', 'type' => 'application_type') )
+ ),
+ 'customer_category' => array
+ (
+ 'text' => lang('customer
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uigeneric.index', 'type' => 'customer_category') )
+ ),
+ 'vendor_category' => array
+ (
+ 'text' => lang('vendor
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uigeneric.index', 'type' => 'vendor_category') )
+ ),
+ 'resource_category' => array
+ (
+ 'text' => lang('resource
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uigeneric.index', 'type' => 'resource_category') )
+ ),
+ );
+ }
+
+ if
(isset($GLOBALS['phpgw_info']['user']['apps']['preferences']))
+ {
+ $menus['preferences'] = array
+ (
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'eventplanner',
+ 'type' => 'user'))
+ ),
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.aclprefs',
+ 'acl_app' =>
'eventplanner'))
+ )
+ );
+
+ $menus['toolbar'][] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'eventplanner')),
+ 'image' => array('eventplanner',
'preferences')
+ );
+ }
+
+ $menus['navigation'] = array(
+ 'application' => array(
+ 'text' => 'application',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.index'))
+ ),
+ 'resource' => array(
+ 'text' => lang('resource'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uiresource.index")),
+ 'image' => array('resource', 'navbar'),
+ ),
+ 'customer' => array(
+ 'text' => lang('customer'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uicustomer.index")),
+ 'image' => array('customer', 'navbar'),
+ ),
+ 'vendor' => array(
+ 'text' => lang('vendor'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uivendor.index")),
+ 'image' => array('vendor', 'navbar'),
+ ),
+ 'booking' => array(
+ 'text' => lang('booking'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uibooking.index")),
+ 'image' => array('customer', 'navbar'),
+ ),
+ 'vendor_report' => array(
+ 'text' => lang('vendor report'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uivendor_report.index")),
+ 'image' => array('vendor_report',
'navbar'),
+ ),
+ 'customer_report' => array(
+ 'text' => lang('customer report'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uicustomer_report.index")),
+ 'image' => array('customer_report',
'navbar'),
+ )
+ );
+ return $menus;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soapplication.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.soapplication.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,139 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_soapplication extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('eventplanner_application',
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::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.soapplication');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_application();
+ 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();
+ $status_text =
eventplanner_application::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 '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
+ (
+ 'application_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_application_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.socustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.socustomer.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.socustomer.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,116 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage customer
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_socustomer extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('eventplanner_customer',
eventplanner_customer::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.socustomer');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_customer();
+ 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_customer::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $lang_active = lang('active');
+ $lang_inactive = lang('inactive');
+
+ $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 'active':
+ $old_value = $old_value
? $lang_active : $lang_inactive;
+ $new_value = $new_value
? $lang_active : $lang_inactive;
+ break;
+ default:
+ break;
+ }
+ $value_set = array
+ (
+ 'customer_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_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.sogeneric.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sogeneric.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.sogeneric.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,149 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.sogeneric_');
+
+ class eventplanner_sogeneric extends property_sogeneric_
+ {
+ function __construct( $type = '', $type_id = 0 )
+ {
+ parent::__construct($type, $type_id);
+ }
+
+ public function get_location_info( $type, $type_id )
+ {
+
+ $type_id = (int)$type_id;
+ $this->type = $type;
+ $this->type_id = $type_id;
+ $info = array();
+
+ if (!$type)
+ {
+ return $info;
+ }
+
+ switch ($type)
+ {
+ case 'application_type':
+ $info = array
+ (
+ 'table' =>
'eventplanner_application_type',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array(
+ array('name' => 'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array(
+ 'name' =>
'active',
+ 'descr' =>
lang('active'),
+ 'type' =>
'checkbox',
+ 'default' =>
'checked',
+ 'filter' =>
true,
+ 'sortable' =>
true,
+ 'values_def' =>
array(
+
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+ )
+ )
+ ),
+ 'edit_msg' => lang('edit type'),
+ 'add_msg' => lang('add type'),
+ 'name' => lang('type'),
+ 'acl_app' => 'eventplanner',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::eventplanner::application_type'
+ );
+ break;
+ case 'resource_category':
+ $info = array
+ (
+ 'table' =>
'eventplanner_resource_category',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array(
+ array('name' => 'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ )
+ ),
+ 'edit_msg' => lang('edit type'),
+ 'add_msg' => lang('add type'),
+ 'name' => lang('type'),
+ 'acl_app' => 'eventplanner',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::eventplanner::resource_category'
+ );
+ break;
+ case 'vendor_category':
+ $info = array
+ (
+ 'table' =>
'eventplanner_vendor_category',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array(
+ array('name' => 'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ )
+ ),
+ 'edit_msg' => lang('edit type'),
+ 'add_msg' => lang('add type'),
+ 'name' => lang('type'),
+ 'acl_app' => 'eventplanner',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::eventplanner::vendor_category'
+ );
+ break;
+ case 'customer_category':
+ $info = array
+ (
+ 'table' =>
'eventplanner_customer_category',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array(
+ array('name' => 'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ )
+ ),
+ 'edit_msg' => lang('edit type'),
+ 'add_msg' => lang('add type'),
+ 'name' => lang('type'),
+ 'acl_app' => 'eventplanner',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::eventplanner::customer_category'
+ );
+ break;
+
+ default:
+ $message = lang('ERROR: illegal type
%1', $type);
+ phpgwapi_cache::message_set($message,
'error');
+ }
+
+ $this->location_info = $info;
+ return $info;
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.soresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soresource.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.soresource.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,120 @@
+<?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/ and Nordlandssykehuset
+ * @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.sovendor.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sovendor.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.sovendor.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,116 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage vendor
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_sovendor extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('eventplanner_vendor',
eventplanner_vendor::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.sovendor');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_vendor();
+ 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_vendor::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $lang_active = lang('active');
+ $lang_inactive = lang('inactive');
+
+ $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 'active':
+ $old_value = $old_value
? $lang_active : $lang_inactive;
+ $new_value = $new_value
? $lang_active : $lang_inactive;
+ break;
+ default:
+ break;
+ }
+ $value_set = array
+ (
+ 'vendor_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_vendor_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.uiapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiapplication.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uiapplication.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,314 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'application', 'inc/model/');
+
+ class eventplanner_uiapplication extends eventplanner_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $composite_types,
+ $permissions;
+
+ public function __construct()
+ {
+ parent::__construct();
+ self::set_active_menu('eventplanner::application');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('application');
+ $this->bo = createObject('eventplanner.boapplication');
+ $this->cats = & $this->bo->cats;
+ $this->composite_types =
eventplanner_application::get_composite_types();
+ $this->fields = eventplanner_application::get_fields();
+ $this->permissions =
eventplanner_application::get_instance()->get_permission_array();
+ }
+
+ private function get_status_options( $selected = 0 )
+ {
+ $status_options = array();
+ $status_list =
eventplanner_application::get_status_list();
+
+ foreach ($status_list as $_key => $_value)
+ {
+ $status_options[] = array(
+ 'id' => $_key,
+ 'name' => $_value,
+ 'selected' => $_key == $selected ? 1 : 0
+ );
+ }
+ return $status_options;
+ }
+
+ private function _get_filters()
+ {
+ $combos = array();
+ $combos[] = array(
+ 'type' => 'autocomplete',
+ 'name' => 'vendor',
+ 'app' => 'eventplanner',
+ 'ui' => 'vendor',
+ 'label_attr' => 'name',
+ 'text' => lang('vendor') . ':',
+ 'requestGenerator' => 'requestWithVendorFilter'
+ );
+
+ $status_options = $this->get_status_options();
+ array_unshift($status_options, array('id' => '','name'
=> lang('all')));
+
+ $combos[] = array(
+ 'type' => 'filter',
+ 'name' => 'filter_status',
+ 'extra' => '',
+ 'text' => lang('status'),
+ 'list' => $status_options
+ );
+
+ $categories =
$this->cats->formatted_xslt_list(array('format' => 'filter',
+ 'selected' => $this->cat_id, 'globals'
=> true, 'use_acl' => $this->_category_acl));
+ $default_value = array('cat_id' => '', 'name' =>
lang('no category'));
+ array_unshift($categories['cat_list'], $default_value);
+
+ $_categories = array();
+ foreach ($categories['cat_list'] as $_category)
+ {
+ $_categories[] = array('id' =>
$_category['cat_id'], 'name' => $_category['name']);
+ }
+
+ $combos[] = array('type' => 'filter',
+ 'name' => 'filter_category_id',
+ 'extra' => '',
+ 'text' => lang('category'),
+ 'list' => $_categories
+ );
+
+ 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('application');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
'eventplanner.uiapplication.index',
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uiapplication.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' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uiapplication.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uiapplication.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'application.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']))
+ {
+ $application = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $application = $this->bo->read_single($id);
+ }
+
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('application'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+ $tabs['demands'] = array(
+ 'label' => lang('demands'),
+ 'link' => '#demands',
+ 'function' => "set_tab('demands')"
+ );
+
+ $composite_types = array();
+ foreach ($this->composite_types as $_key => $_value)
+ {
+ $composite_types[] = array('id' => $_key,
'name' => $_value);
+ }
+
+ $bocommon = CreateObject('property.bocommon');
+
+ $GLOBALS['phpgw']->jqcal->add_listener('date_start');
+ $GLOBALS['phpgw']->jqcal->add_listener('date_end');
+
+ $accounts =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, '.application',
'eventplanner');
+ $case_officer_options[] = array('id' => '', 'name' =>
lang('select'), 'selected' => 0);
+ foreach ($accounts as $account)
+ {
+ $case_officer_options[] = array(
+ 'id' => $account['account_id'],
+ 'name' =>
$GLOBALS['phpgw']->accounts->get($account['account_id'])->__toString(),
+ 'selected' => ($account['account_id']
== $application->case_officer_id) ? 1 : 0
+ );
+ }
+ $comments = (array)$application->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' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.index',)),
+ 'application' => $application,
+ 'list_case_officer' => array('options' =>
$case_officer_options),
+ 'cat_select' =>
$this->cats->formatted_xslt_list(array(
+ 'select_name' => 'category_id',
+ 'selected' =>
$application->category_id,
+ 'use_acl' => $this->_category_acl,
+ 'required' => true)),
+ 'status_list' => array('options' =>
$this->get_status_options($application->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',
'application.edit.js');
+ self::render_template_xsl(array('application',
'datatable_inline'), array($mode => $data));
+ }
+
+
+ public function save()
+ {
+ parent::save();
+ }
+
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.uicommon.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicommon.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uicommon.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,170 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage common
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon_jquery');
+ phpgw::import_class('phpgwapi.datetime');
+
+
+ class eventplanner_uicommon extends phpgwapi_uicommon_jquery
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $composite_types,
+ $payment_methods,
+ $permissions,
+ $called_class_arr;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $called_class = get_called_class();
+ $this->called_class_arr = explode('_', $called_class);
+ }
+
+
+ protected function _get_fields()
+ {
+ $values = array();
+ foreach ($this->fields as $field => $field_info)
+ {
+ if($field_info['action'] & PHPGW_ACL_READ)
+ {
+ $data = array(
+ 'key' => $field,
+ 'label' =>
!empty($field_info['label']) ? lang($field_info['label']) : $field,
+ 'sortable' =>
!empty($field_info['sortable']) ? true : false,
+ 'hidden' =>
!empty($field_info['hidden']) ? true : false,
+ );
+
+ if(!empty($field_info['formatter']))
+ {
+ $data['formatter'] =
$field_info['formatter'];
+ }
+
+ $values[] = $data;
+ }
+ }
+ return $values;
+ }
+
+ /*
+ * View the price item with the id given in the http variable
'id'
+ */
+
+ public function view()
+ {
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('view');
+
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $this->edit(array(), 'view');
+ }
+ /*
+ * To be removed
+ * Add a new item to the database. Requires only a title.
+ */
+
+ public function add()
+ {
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ $this->edit();
+ }
+
+ public function save()
+ {
+ $called_class = get_called_class();
+
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+ $active_tab = phpgw::get_var('active_tab', 'string',
'REQUEST', 'first_tab');
+
+ $id = phpgw::get_var('id', 'int');
+
+ $object = $this->bo->read_single($id, true);
+
+ /*
+ * Overrides with incoming data from POST
+ */
+ $object = $this->bo->populate($object);
+
+ if($object->validate())
+ {
+ if($object->store($object))
+ {
+
phpgwapi_cache::message_set(lang('messages_saved_form'), 'message');
+ self::redirect(array(
+ 'menuaction' =>
"{$this->called_class_arr[0]}.{$this->called_class_arr[1]}.edit",
+ 'id' =>
$object->get_id(),
+ 'active_tab' => $active_tab
+ )
+ );
+ }
+ else
+ {
+
phpgwapi_cache::message_set(lang('messages_form_error'), 'error');
+ $this->edit(array('object' =>
$object, 'active_tab' => $active_tab));
+ }
+ }
+ else
+ {
+ $this->edit(array('object' => $object,
'active_tab' => $active_tab));
+ }
+ }
+
+ /**
+ * (non-PHPdoc)
+ * @see eventplanner/inc/eventplanner_uicommon#query()
+ */
+ public function query()
+ {
+ $params = $this->bo->build_default_read_params();
+ $values = $this->bo->read($params);
+ array_walk($values["results"], array($this,
"_add_links"),
"{$this->called_class_arr[0]}.{$this->called_class_arr[1]}.edit");
+
+ return $this->jquery_results($values);
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.uicustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicustomer.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uicustomer.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,243 @@
+<?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 customer was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage customer
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'customer', 'inc/model/');
+
+ class eventplanner_uicustomer extends eventplanner_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $permissions;
+
+ public function __construct()
+ {
+ parent::__construct();
+ self::set_active_menu('eventplanner::customer');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('customer');
+ $this->bo = createObject('eventplanner.bocustomer');
+ $this->fields = eventplanner_customer::get_fields();
+ $this->permissions =
eventplanner_customer::get_instance()->get_permission_array();
+ }
+
+ private function get_category_options( $selected = 0 )
+ {
+ $category_options = array();
+ $category_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'customer_category'));
+
+ $category_options[] = array(
+ 'id' => '',
+ 'name' => lang('select')
+ );
+
+ foreach ($category_list as $category)
+ {
+ $category_options[] = array(
+ 'id' => $category['id'],
+ 'name' => $category['name'],
+ 'selected' => $category['id'] ==
$selected ? 1 : 0
+ );
+ }
+ return $category_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');
+
+ $function_msg = lang('customer');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ array(
+ 'type' =>
'filter',
+ 'name' =>
'filter_category_id',
+ 'text' =>
lang('category'),
+ 'list' =>
$this->get_category_options()
+ ),
+ array(
+ 'type' =>
'checkbox',
+ 'name' =>
'filter_active',
+ 'text' =>
lang('showall'),
+ 'value' => 1,
+ 'checked'=> 1,
+ )
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
'eventplanner.uicustomer.index',
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uicustomer.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' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uicustomer.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uicustomer.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'customer.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 = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $customer = $this->bo->read_single($id);
+ }
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('customer'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+ $bocommon = CreateObject('property.bocommon');
+
+ $comments = (array)$customer->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' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uicustomer.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uicustomer.index',)),
+ 'customer' => $customer,
+ 'category_list' => array('options' =>
$this->get_category_options( $customer->category_id )),
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab
+ );
+ phpgwapi_jquery::formvalidator_generate(array());
+ self::add_javascript('eventplanner', 'portico',
'customer.edit.js');
+ self::render_template_xsl(array('customer',
'datatable_inline'), array($mode => $data));
+ }
+
+ public function save()
+ {
+ parent::save();
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.uigeneric.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uigeneric.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uigeneric.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,37 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('property.uigeneric');
+
+ class eventplanner_uigeneric extends property_uigeneric
+ {
+ public function __construct()
+ {
+ parent::__construct();
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/class.uiresource.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiresource.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uiresource.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,312 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage resource
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'resource', 'inc/model/');
+ use eventplanner_resource;
+
+ class eventplanner_uiresource extends eventplanner_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' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uiresource.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', 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' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiresource.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', 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
Added: trunk/eventplanner/inc/class.uivendor.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uivendor.inc.php
(rev 0)
+++ trunk/eventplanner/inc/class.uivendor.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,243 @@
+<?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 vendor was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage vendor
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'vendor', 'inc/model/');
+
+ class eventplanner_uivendor extends eventplanner_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $permissions;
+
+ public function __construct()
+ {
+ parent::__construct();
+ self::set_active_menu('eventplanner::vendor');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('vendor');
+ $this->bo = createObject('eventplanner.bovendor');
+ $this->fields = eventplanner_vendor::get_fields();
+ $this->permissions =
eventplanner_vendor::get_instance()->get_permission_array();
+ }
+
+ private function get_category_options( $selected = 0 )
+ {
+ $category_options = array();
+ $category_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'vendor_category'));
+
+ $category_options[] = array(
+ 'id' => '',
+ 'name' => lang('select')
+ );
+
+ foreach ($category_list as $category)
+ {
+ $category_options[] = array(
+ 'id' => $category['id'],
+ 'name' => $category['name'],
+ 'selected' => $category['id'] ==
$selected ? 1 : 0
+ );
+ }
+ return $category_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');
+
+ $function_msg = lang('vendor');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ array(
+ 'type' =>
'filter',
+ 'name' =>
'filter_category_id',
+ 'text' =>
lang('category'),
+ 'list' =>
$this->get_category_options()
+ ),
+ array(
+ 'type' =>
'checkbox',
+ 'name' =>
'filter_active',
+ 'text' =>
lang('showall'),
+ 'value' => 1,
+ 'checked'=> 1,
+ )
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
'eventplanner.uivendor.index',
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uivendor.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' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uivendor.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'eventplanner.uivendor.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'vendor.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']))
+ {
+ $vendor = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $vendor = $this->bo->read_single($id);
+ }
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('vendor'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+ $bocommon = CreateObject('property.bocommon');
+
+ $comments = (array)$vendor->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' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor.index',)),
+ 'vendor' => $vendor,
+ 'category_list' => array('options' =>
$this->get_category_options( $vendor->category_id )),
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab
+ );
+ phpgwapi_jquery::formvalidator_generate(array());
+ self::add_javascript('eventplanner', 'portico',
'vendor.edit.js');
+ self::render_template_xsl(array('vendor',
'datatable_inline'), array($mode => $data));
+ }
+
+ public function save()
+ {
+ parent::save();
+ }
+ }
\ No newline at end of file
Added: trunk/eventplanner/inc/custom/demo_custom.php
===================================================================
--- trunk/eventplanner/inc/custom/demo_custom.php
(rev 0)
+++ trunk/eventplanner/inc/custom/demo_custom.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,6 @@
+<?php
+//_debug_array($values);
+//_debug_array($values_attribute);
+ // Demo - custom function
+
+ echo "<h1>Custom function: do something!</h1>";
Added: trunk/eventplanner/inc/hook_help.inc.php
===================================================================
--- trunk/eventplanner/inc/hook_help.inc.php (rev 0)
+++ trunk/eventplanner/inc/hook_help.inc.php 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,43 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package eventplanner
+ * @subpackage manual
+ * @version $Id: hook_help.inc.php 14728 2016-02-11 22:28:46Z sigurdne $
+ */
+ /**
+ * Description
+ */
+ include(PHPGW_SERVER_ROOT . '/' . 'eventplanner' .
'/setup/setup.inc.php');
+
+ $GLOBALS['phpgw']->help->set_params(array('app_name' => 'eventplanner',
+ 'title' => lang('eventplanner'),
+ 'app_version' => $setup_info['eventplanner']['version']));
+ $GLOBALS['phpgw']->help->data[] = array
+ (
+ 'text' => lang('overview'),
+ 'url' =>
$GLOBALS['phpgw']->help->check_help_file('overview.php'),
+ 'lang_link_statustext' => lang('overview')
+ );
+
+
+ $GLOBALS['phpgw']->help->data[] = array
+ (
+ 'text' => lang('eventplanner'),
+ 'url' =>
$GLOBALS['phpgw']->help->check_help_file('eventplanner.php'),
+ 'lang_link_statustext' => lang('eventplanner')
+ );
+
+ $GLOBALS['phpgw']->help->data[] = array
+ (
+ 'text' => lang('project'),
+ 'url' =>
$GLOBALS['phpgw']->help->check_help_file('project.php'),
+ 'lang_link_statustext' => lang('project')
+ );
+
+ $GLOBALS['phpgw']->help->draw();
Added: trunk/eventplanner/inc/hook_manual.inc.php
===================================================================
--- trunk/eventplanner/inc/hook_manual.inc.php (rev 0)
+++ trunk/eventplanner/inc/hook_manual.inc.php 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,20 @@
+<?php
+ /**
+ * phpGroupWare - DEMO: A demo application.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package demo
+ * @subpackage core
+ * @version $Id: hook_manual.inc.php 14728 2016-02-11 22:28:46Z
sigurdne $
+ */
+ // Only Modify the $file variable.....
+ $file = Array(
+ 'User' => 'user.php',
+ 'Job' => 'job.php',
+ );
+//Do not modify below this line
+ display_manual_section($appname, $file);
+
Added: trunk/eventplanner/inc/hook_settings.inc.php
===================================================================
--- trunk/eventplanner/inc/hook_settings.inc.php
(rev 0)
+++ trunk/eventplanner/inc/hook_settings.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,19 @@
+<?php
+ /**
+ * phpGroupWare - DEMO: A demo application.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package demo
+ * @subpackage core
+ * @version $Id: hook_settings.inc.php 14728 2016-02-11 22:28:46Z
sigurdne $
+ */
+ //$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+ $yes_and_no = array(
+ 'True' => 'Yes',
+ '' => 'No'
+ );
+
Added: trunk/eventplanner/inc/model/class.application.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.application.inc.php
(rev 0)
+++ trunk/eventplanner/inc/model/class.application.inc.php 2016-10-13
14:56:17 UTC (rev 15824)
@@ -0,0 +1,434 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+
+ phpgw::import_class('eventplanner.boapplication');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_application extends phpgwapi_model
+ {
+
+ const STATUS_REGISTERED = 1;
+ const STATUS_PENDING = 2;
+ const STATUS_REJECTED = 3;
+ const STATUS_APPROVED = 4;
+ const acl_location = '.application';
+
+ protected
+ $id,
+ $active,
+ $display_in_dashboard,
+ $category_id,
+ $vendor_id,
+ $vendor_name,
+ $status,
+ $created,
+ $modified,
+ $secret,
+ $frontend_modified,
+ $owner_id,
+ $description,
+ $remark,
+ $contact_name,
+ $contact_email,
+ $contact_phone,
+// $customer_identifier_type,
+// $customer_ssn,
+// $customer_organization_number,
+ $case_officer_id,
+ $case_officer_name,
+ $types,
+ $comments,
+ $comment,
+ $date_start,
+ $date_end,
+ $timespan,
+ $charge_per_unit,
+ $number_of_units,
+ $rig_up_min_before,
+ $rig_up_num_person,
+ $during_num_person,
+ $rig_down_num_person,
+ $rig_down_min_after,
+ $power,
+ $sound,
+ $light,
+ $piano,
+ $power_remark,
+ $sound_remark,
+ $light_remark,
+ $piano_remark,
+ $equipment_remark;
+
+ protected $field_of_responsibility_name = '.application';
+
+ 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_application();
+ }
+
+ public static function get_composite_types()
+ {
+ return array(1 => 'Hybel', 2 => 'Leilighet');
+ }
+ 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',
+ ),
+ 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'active',
+ 'history' => true,
+ ),
+ 'display_in_dashboard' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'bool'),
+ 'category_id' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'category',
+ 'history' => true),
+ 'status' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'status',
+ 'history' => true
+ ),
+ 'created' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'modified' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'modified',
+ 'sortable' => true,
+ ),
+ 'secret' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'string',
+ 'label' => 'secret',
+ 'sortable' => false,
+ ),
+/* 'frontend_modified' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'date'),*/
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
+ 'description' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ ),
+ 'remark' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ ),
+ 'contact_name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact name',
+ 'history' => true,
+ ),
+ 'contact_email' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field%
is invalid')),
+ 'label' => 'contact email',
+ 'history' => true,
+ ),
+ 'contact_phone' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact phone',
+ 'history' => true,
+ ),
+ /* 'customer_identifier_type' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'label' => 'customer_identifier_type',
+ ),
+ 'customer_ssn' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
+ 'label' => 'customer_ssn'
+ ),
+ 'customer_organization_number' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
+ 'label' =>
'customer_organization_number'
+ ),*/
+ 'vendor_id' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'vendor',
+ 'sortable' => true,
+ 'history' => true,
+ ),
+ 'vendor_name' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'vendor',
+ 'join' => array(
+ 'table' =>
'eventplanner_vendor',
+ 'fkey' => 'vendor_id',
+ 'key' => 'id',
+ 'column' => 'name'
+ )
+ ),
+ 'case_officer_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => true,
+ 'label' => 'case officer',
+ 'sortable' => true,
+ 'history' => true,
+ ),
+ 'case_officer_name' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'case officer',
+ 'join' => array(
+ 'table' => 'phpgw_accounts',
+ 'fkey' => 'case_officer_id',
+ 'key' => 'account_id',
+ 'column' => 'account_lid'
+ )
+ ),
+ 'types' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int', 'required' => true,
+ 'manytomany' => array(
+ 'table' =>
'eventplanner_application_type_relation',
+ 'key' => 'application_id',
+ 'column' => array(
+ 'type_id' =>
array('type' => 'int', 'required' => true)),
+ )),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_application_comment',
+ 'key' => 'application_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,
+ ),
+ 'date_start' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'date start',
+ 'history' => true
+ ),
+ 'date_end' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'date end',
+ 'history' => true
+ ),
+ 'charge_per_unit' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'charge per unit',
+ 'required' => true,
+ 'history' => true
+ ),
+ 'number_of_units' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'number of units',
+ 'required' => true,
+ 'history' => true
+ ),
+ 'timespan' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'timespan',
+ 'required' => true,
+ 'history' => true,
+ ),
+ 'rig_up_min_before' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'rig_up_num_person' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'during_num_person' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'rig_down_num_person' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'rig_down_min_after' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'power' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'sound' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'light' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'piano' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => false,
+ ),
+ 'power_remark' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ ),
+ 'sound_remark' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ ),
+ 'light_remark' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ ),
+ 'piano_remark' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ ),
+ 'equipment_remark' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ ),
+/*
+ 'company_name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ )*/
+ );
+
+ if($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+
if(!property_exists('eventplanner_application', $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->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $entity->status =
eventplanner_application::STATUS_REGISTERED;
+ $entity->secret = self::generate_secret();
+ }
+ }
+
+ 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_boapplication::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
eventplanner_boapplication::get_instance()->read_single($id, true);
+ }
+ }
Added: trunk/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.customer.inc.php
(rev 0)
+++ trunk/eventplanner/inc/model/class.customer.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,283 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage customer
+ * @version $Id: $
+ */
+
+ phpgw::import_class('eventplanner.bocustomer');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_customer extends phpgwapi_model
+ {
+
+ const STATUS_REGISTERED = 1;
+ const STATUS_PENDING = 2;
+ const STATUS_REJECTED = 3;
+ const STATUS_APPROVED = 4;
+ const acl_location = '.customer';
+
+ protected
+ $id,
+ $active,
+ $category_id,
+ $created,
+ $modified,
+ $secret,
+ $name,
+ $address_1,
+ $address_2,
+ $zip_code,
+ $city,
+ $customer_organization_number,
+ $contact_name,
+ $contact_email,
+ $contact_phone,
+ $account_number,
+ $description,
+ $remark,
+ // $customer_identifier_type,
+ // $customer_ssn,
+
+ $comments,
+ $comment;
+
+ protected $field_of_responsibility_name = '.customer';
+
+ 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();
+ }
+
+ 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',
+ ),
+ 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'history' => true
+ ),
+ 'category_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int'
+ ),
+ 'created' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'modified' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'modified',
+ 'sortable' => true,
+ ),
+ 'secret' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'string',
+ 'label' => 'secret',
+ 'sortable' => false,
+ ),
+ 'name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'name',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'address_1' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true
+ ),
+ 'address_2' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'zip_code' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'city' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'account_number' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'description' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ 'required' => true
+ ),
+ 'remark' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ ),
+ 'contact_name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact name',
+ ),
+ 'contact_email' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field%
is invalid')),
+ 'label' => 'contact email',
+ ),
+ 'contact_phone' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact phone',
+ ),
+/* 'customer_identifier_type' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'label' => 'customer_identifier_type',
+ ),
+ 'customer_ssn' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
+ 'label' => 'customer_ssn'
+ ),*/
+ 'customer_organization_number' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
+ 'label' => 'organization_number'
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_customer_comment',
+ 'key' => 'customer_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,
+ )
+ );
+
+ if($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+
if(!property_exists('eventplanner_customer', $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())
+ {
+ }
+ else
+ {
+ $entity->status =
eventplanner_customer::STATUS_REGISTERED;
+ $entity->secret = self::generate_secret();
+ }
+ }
+
+ 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::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
eventplanner_bocustomer::get_instance()->read_single($id, true);
+ }
+ }
Added: trunk/eventplanner/inc/model/class.resource.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.resource.inc.php
(rev 0)
+++ trunk/eventplanner/inc/model/class.resource.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,197 @@
+<?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/ and Nordlandssykehuset
+ * @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);
+ }
+ }
Added: trunk/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.vendor.inc.php
(rev 0)
+++ trunk/eventplanner/inc/model/class.vendor.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,280 @@
+<?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/ and Nordlandssykehuset
+ * @package eventplanner
+ * @subpackage vendor
+ * @version $Id: $
+ */
+
+ phpgw::import_class('eventplanner.bovendor');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_vendor extends phpgwapi_model
+ {
+
+ const STATUS_REGISTERED = 1;
+ const STATUS_PENDING = 2;
+ const STATUS_REJECTED = 3;
+ const STATUS_APPROVED = 4;
+ const acl_location = '.vendor';
+
+ protected
+ $id,
+ $active = 1,
+ $category_id,
+ $created,
+ $modified,
+ $secret,
+ $name,
+ $address_1,
+ $address_2,
+ $zip_code,
+ $city,
+ $vendor_organization_number,
+ $contact_name,
+ $contact_email,
+ $contact_phone,
+ $account_number,
+ $description,
+ $remark,
+ // $vendor_identifier_type,
+ // $vendor_ssn,
+
+ $comments,
+ $comment;
+
+ protected $field_of_responsibility_name = '.vendor';
+
+ 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_vendor();
+ }
+
+ 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',
+ ),
+ 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'history' => true
+ ),
+ 'category_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int'
+ ),
+ 'created' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'modified' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'modified',
+ 'sortable' => true,
+ ),
+ 'secret' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'string',
+ 'label' => 'secret',
+ 'sortable' => false,
+ ),
+ 'name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'name',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'address_1' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true
+ ),
+ 'address_2' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'zip_code' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'city' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'account_number' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true),
+ 'description' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ 'required' => true
+ ),
+ 'remark' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ ),
+ 'contact_name' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact name',
+ ),
+ 'contact_email' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field%
is invalid')),
+ 'label' => 'contact email',
+ ),
+ 'contact_phone' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'label' => 'contact phone',
+ ),
+/* 'vendor_identifier_type' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'label' => 'vendor_identifier_type',
+ ),
+ 'vendor_ssn' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => false,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
+ 'label' => 'vendor_ssn'
+ ),*/
+ 'vendor_organization_number' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'required' => true,
+ 'query' => true,
+ 'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
+ 'label' => 'organization_number'
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_vendor_comment',
+ 'key' => 'vendor_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,
+ )
+ );
+
+ if($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+
if(!property_exists('eventplanner_vendor', $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->status =
eventplanner_vendor::STATUS_REGISTERED;
+ $entity->secret = self::generate_secret();
+ }
+ }
+
+ 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_bovendor::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
eventplanner_bovendor::get_instance()->read_single($id, true);
+ }
+ }
Added: trunk/eventplanner/index.php
===================================================================
--- trunk/eventplanner/index.php (rev 0)
+++ trunk/eventplanner/index.php 2016-10-13 14:56:17 UTC (rev 15824)
@@ -0,0 +1,41 @@
+<?php
+ /**
+ * phpGroupWare - Event Planner.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package hrm
+ * @version $Id: index.php 14728 2016-02-11 22:28:46Z sigurdne $
+ */
+ /**
+ * Start page
+ *
+ * This script will check if there is defined a startpage in the users
+ * preferences - and then forward the user to this page
+ */
+ $currentapp = 'eventplanner';
+
+
+ $GLOBALS['phpgw_info']['flags'] = array(
+ 'noheader' => True,
+ 'nonavbar' => True,
+ 'currentapp' => $currentapp
+ );
+
+ include('../header.inc.php');
+
+ $start_page =
(isset($GLOBALS['phpgw_info']['user']['preferences'][$currentapp]['default_start_page'])
?
$GLOBALS['phpgw_info']['user']['preferences'][$currentapp]['default_start_page']
: '');
+
+ if ($start_page)
+ {
+ $start_page = array('menuaction' => $currentapp . '.ui' .
$start_page . '.index');
+ }
+ else
+ {
+ $start_page = array('menuaction' => $currentapp .
'.uiapplication.index');
+ }
+
+ $GLOBALS['phpgw']->redirect_link('/index.php', $start_page);
+?>
Added: trunk/eventplanner/js/portico/application.edit.js
===================================================================
--- trunk/eventplanner/js/portico/application.edit.js
(rev 0)
+++ trunk/eventplanner/js/portico/application.edit.js 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,57 @@
+
+var oArgs = {menuaction: 'eventplanner.uivendor.index', organization_number:
true};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'vendor_name', 'vendor_id',
'vendor_container', 'name');
+
+$(document).ready(function ()
+{
+ $("#number_of_units").change(function ()
+ {
+ calculate_total_amount();
+ });
+ $("#charge_per_unit").change(function ()
+ {
+ calculate_total_amount();
+ });
+
+ calculate_total_amount();
+
+ $.formUtils.addValidator({
+ name: 'naming',
+ validatorFunction: function (value, $el, config, languaje,
$form)
+ {
+ var v = false;
+ var firstname = $('#firstname').val();
+ var lastname = $('#lastname').val();
+ var company_name = $('#company_name').val();
+ var department = $('#department').val();
+ if ((firstname != "" && lastname != "") ||
(company_name != "" && department != ""))
+ {
+ v = true;
+ }
+ return v;
+ },
+ errorMessage: lang['Name or company is required'],
+ errorMessageKey: ''
+ });
+});
+
+function set_tab(tab)
+{
+ $("#active_tab").val(tab);
+}
+
+function calculate_total_amount()
+{
+ var total_amount = 0
+
+ var number_of_units = $("#number_of_units").val();
+ var charge_per_unit = $("#charge_per_unit").val();
+
+ if(charge_per_unit && charge_per_unit)
+ {
+ total_amount = number_of_units * charge_per_unit;
+ }
+ $("#total_amount").val(total_amount);
+}
+
Added: trunk/eventplanner/js/portico/application.index.js
===================================================================
--- trunk/eventplanner/js/portico/application.index.js
(rev 0)
+++ trunk/eventplanner/js/portico/application.index.js 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,4 @@
+function requestWithVendorFilter(request)
+{
+ return request + '&organization_number=1';
+}
Added: trunk/eventplanner/js/portico/customer.index.js
===================================================================
--- trunk/eventplanner/js/portico/customer.index.js
(rev 0)
+++ trunk/eventplanner/js/portico/customer.index.js 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,4 @@
+function requestWithCategoryFilter(request)
+{
+ return request + '&type=customer_category&type_id=0';
+}
Added: trunk/eventplanner/js/portico/demo.edit.js
===================================================================
--- trunk/eventplanner/js/portico/demo.edit.js (rev 0)
+++ trunk/eventplanner/js/portico/demo.edit.js 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,64 @@
+var myDataSource, myDataTable, myContextMenu;
+var tableYUI;
+var myPaginator_0;
+var myDataTable_0;
+
+
+/********************************************************************************
+ *
+ */
+this.addFooterDatatable = function (paginator, datatable)
+{
+ //call getSumPerPage(name of column) in property.js
+ tmp_sum1 = getSumPerPage('budget', 2, paginator, datatable);
+ tmp_sum2 = getSumPerPage('calculation', 2, paginator, datatable);
+
+ if (typeof (tableYUI) == 'undefined')
+ {
+ tableYUI = YAHOO.util.Dom.getElementsByClassName("yui-dt-data",
"tbody")[0].parentNode;
+ tableYUI.setAttribute("id", "tableYUI");
+ }
+ else
+ {
+ tableYUI.deleteTFoot();
+ }
+
+ //Create ROW
+ newTR = document.createElement('tr');
+
+ td_sum('Sum');
+ td_sum(tmp_sum1);
+ td_sum(tmp_sum2);
+ td_empty(3);
+
+ myfoot = tableYUI.createTFoot();
+ myfoot.setAttribute("id", "myfoot");
+ myfoot.appendChild(newTR);
+}
+
+/********************************************************************************/
+var FormatterCenter = function (elCell, oRecord, oColumn, oData)
+{
+ elCell.innerHTML = "<center>" + oData + "</center>";
+}
+
+var FormatterRight = function (elCell, oRecord, oColumn, oData)
+{
+ elCell.innerHTML = "<div align=\"right\">" +
YAHOO.util.Number.format(oData, {thousandsSeparator: " "}) + "</div>";
+}
+
+/********************************************************************************/
+YAHOO.util.Event.addListener(window, "load", function ()
+{
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone",
+ type: "js",
+ fullpath: property_js
+ });
+
+ loader.require("anyone");
+ loader.insert();
+});
+
+
Added: trunk/eventplanner/js/portico/demo.index.js
===================================================================
--- trunk/eventplanner/js/portico/demo.index.js (rev 0)
+++ trunk/eventplanner/js/portico/demo.index.js 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,77 @@
+//--------------------------------------------------------
+// Declaration of location.index vars
+//--------------------------------------------------------
+// define buttons
+var oMenuButton_0;
+var selectsButtons = [
+ {order: 0, var_URL: 'cat_id', name: 'btn_cat_id', style:
'categorybutton', dependiente: [
+ ]}
+];
+
+
+var oNormalButton_0, oNormalButton_1, oNormalButton_2, oNormalButton_3;
+var normalButtons = [
+ {order: 0, name: 'btn_search', funct: "onSearchClick"},
+ {order: 1, name: 'btn_new', funct: "onNewClick"},
+ {order: 2, name: 'btn_done', funct: "onDoneClick"},
+ {order: 3, name: 'btn_export', funct: "onDownloadClick"}
+];
+
+// define Text buttons
+var textImput = [
+ {order: 0, name: 'query', id: 'txt_query'}
+];
+
+var toolTips =
+[
+ {name: 'btn_export', title: 'download', description: 'Download table to
your browser', ColumnDescription: ''}
+]
+
+// define the hidden column in datatable
+var config_values =
+{
+ date_search: 0, //if search has link "Data search"
+ particular_done: "property.uilocation.index"
+}
+
+/********************************************************************************/
+var FormatterRight = function (elCell, oRecord, oColumn, oData)
+{
+ elCell.innerHTML = "<div align=\"right\">" + oData + "</div>";
+}
+
+/****************************************************************************************/
+this.particular_setting = function ()
+{
+ if (flag_particular_setting == 'init')
+ {
+ }
+ else if (flag_particular_setting == 'update')
+ {
+ }
+}
+/****************************************************************************************/
+
+this.myParticularRenderEvent = function ()
+{
+ //don't delete it
+ document.getElementById('txt_query').focus();
+}
+/****************************************************************************************/
+YAHOO.util.Event.addListener(window, "load", function ()
+{
+ YAHOO.util.Dom.getElementsByClassName('toolbar',
'div')[0].style.display = 'none';
+
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone", //module name; must be unique
+ type: "js", //can be "js" or "css"
+ fullpath: property_js //'property_js' have the path for
property.js, is render in HTML
+ });
+
+ loader.require("anyone");
+
+ //Insert JSON utility on the page
+
+ loader.insert();
+});
Added: trunk/eventplanner/setup/default_records.inc.php
===================================================================
--- trunk/eventplanner/setup/default_records.inc.php
(rev 0)
+++ trunk/eventplanner/setup/default_records.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,26 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package eventplanner
+ * @subpackage setup
+ * @version $Id: default_records.inc.php 14728 2016-02-11 22:28:46Z
sigurdne $
+ */
+ /**
+ * Description
+ * @package eventplanner
+ */
+ $GLOBALS['phpgw']->locations->add('.', 'Tom', 'eventplanner');
+ $GLOBALS['phpgw']->locations->add('.admin', 'admin', 'eventplanner',
$allow_grant = true, $custom_tbl = 'eventplanner_application', $c_function =
true);
+ $GLOBALS['phpgw']->locations->add('.application', 'application',
'eventplanner', $allow_grant = true, $custom_tbl = 'eventplanner_application',
$c_function = true);
+ $GLOBALS['phpgw']->locations->add('.resource', 'resource',
'eventplanner', $allow_grant = true, $custom_tbl = 'eventplanner_resource',
$c_function = true);
+ $GLOBALS['phpgw']->locations->add('.customer', 'customer',
'eventplanner', $allow_grant = true, $custom_tbl = 'eventplanner_resource',
$c_function = true);
+ $GLOBALS['phpgw']->locations->add('.vendor', 'vendor', 'eventplanner',
$allow_grant = true, $custom_tbl = 'eventplanner_resource', $c_function = true);
+ $GLOBALS['phpgw']->locations->add('.booking', 'booking',
'eventplanner', $allow_grant = true, $custom_tbl = 'eventplanner_resource',
$c_function = true);
+ $GLOBALS['phpgw']->locations->add('.vendor_report', 'vendor_report',
'eventplanner', $allow_grant = true, $custom_tbl = 'eventplanner_resource',
$c_function = true);
+ $GLOBALS['phpgw']->locations->add('.customer_report',
'customer_report', 'eventplanner', $allow_grant = true, $custom_tbl =
'eventplanner_resource', $c_function = true);
+
Added: trunk/eventplanner/setup/phpgw_en.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_en.lang (rev 0)
+++ trunk/eventplanner/setup/phpgw_en.lang 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,6 @@
+demo app demo en Demonstration application
+demo common en Demo Module
+Add demo en Add
+Delete demo en Delete
+Edit demo en Edit
+View demo en View
Property changes on: trunk/eventplanner/setup/phpgw_en.lang
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang (rev 0)
+++ trunk/eventplanner/setup/phpgw_no.lang 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,51 @@
+eventplanner common no Turneplanlegger
+Add eventplanner no Legg til
+Delete eventplanner no Slett
+Edit eventplanner no Editer
+View eventplanner no Vis
+apply eventplanner no Mellomlagre
+list eventplanner no Liste
+general eventplanner no Generell
+dates eventplanner no Datoer
+custom attributes eventplanner no Egendefinerte attributter
+no category eventplanner no Kategori ikke valgt
+time created eventplanner no Tidsstempel
+inline tables eventplanner no Tabeller
+table eventplanner no Tabell
+application eventplanner no Søknad
+old value eventplanner no Opprinnelig verdi
+new value eventplanner no Ny verdi
+all eventplanner no Alle
+registered eventplanner no Registrert
+pending eventplanner no Under behandling
+rejected eventplanner no Avvist
+approved eventplanner no Godkjent
+vendor eventplanner no Leverandør
+new eventplanner no Ny
+show eventplanner no vis
+history eventplanner no Historikk
+date start eventplanner no Første dato
+date end eventplanner no Siste dato
+contact name eventplanner no Kontaktperson
+contact email eventplanner no Epost kontaktperson
+contact phone eventplanner no Tlf. kontaktperson
+case officer eventplanner no Saksbehandler
+active eventplanner no Aktiv
+select eventplanner no Velg
+remark eventplanner no Merknad
+comment eventplanner no Kommentar
+demands eventplanner no Forutsetning
+payment eventplanner no Betaling
+labour support eventplanner no Personellstøtte
+technical support eventplanner no Teknisk støtte
+charge per unit eventplanner no betaling pr stk
+timespan eventplanner no lengde på arrangement (min.)
+number of units eventplanner no Antall arrangement
+integer eventplanner no Heltall
+total amount eventplanner no Sum
+created eventplanner no Registrert
+modified eventplanner no Endret
+id eventplanner no Id
+messages_saved_form eventplanner no Skjemaet er lagret
+field %1 is required eventplanner no Feltet %1 er påkrevd
+please select a category ! eventplanner no Velg en kategori
\ No newline at end of file
Added: trunk/eventplanner/setup/setup.inc.php
===================================================================
--- trunk/eventplanner/setup/setup.inc.php (rev 0)
+++ trunk/eventplanner/setup/setup.inc.php 2016-10-13 14:56:17 UTC (rev
15824)
@@ -0,0 +1,82 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner: a eventplanner application.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package eventplanner
+ * @subpackage setup
+ * @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.001';
+ $setup_info['eventplanner']['app_order'] = 20;
+ $setup_info['eventplanner']['enable'] = 1;
+ $setup_info['eventplanner']['app_group'] = 'office';
+
+ $setup_info['eventplanner']['author'] = array
+ (
+ 'name' => 'Sigurd Nes',
+ 'email' => 'address@hidden'
+ );
+
+ $setup_info['eventplanner']['maintainer'] = array
+ (
+ 'name' => 'Sigurd Nes',
+ 'email' => 'address@hidden'
+ );
+
+ $setup_info['eventplanner']['license'] = 'GPL';
+ $setup_info['eventplanner']['description'] = '<div align="left">
+ <b>Eventplanner</b> for cultural events:
+ <ol>
+ <li>Application</li>
+ <ol>
+ <li>Artist / vendor</li>
+ </ol>
+ <ol>
+ <li>Institution / customer</li>
+ </ol>
+ <li>Tour planning</li>
+ </ol>
+ </div>';
+
+ $setup_info['eventplanner']['note'] = 'Notes for the eventplanner goes
here';
+
+ $setup_info['eventplanner']['tables'] = array(
+ 'eventplanner_customer_category',
+ 'eventplanner_customer',
+ 'eventplanner_customer_comment',
+ 'eventplanner_vendor_category',
+ 'eventplanner_vendor',
+ 'eventplanner_vendor_comment',
+ 'eventplanner_application_type',
+ 'eventplanner_application',
+ 'eventplanner_application_comment',
+ 'eventplanner_resource',
+ 'eventplanner_resource_comment',
+ 'eventplanner_booking',
+ 'eventplanner_booking_cost',
+ 'eventplanner_booking_resource',
+ 'eventplanner_order',
+ 'eventplanner_booking_vendor_report',
+ 'eventplanner_booking_customer_report'
+ );
+
+ /* The hooks this app includes, needed for hooks registration */
+ $setup_info['eventplanner']['hooks'] = array(
+ 'manual',
+ 'settings',
+ 'help',
+ 'menu' => 'eventplanner.menu.get_menu'
+ );
+
+ /* Dependencies for this app to work */
+ $setup_info['eventplanner']['depends'][] = array
+ (
+ 'appname' => 'phpgwapi',
+ 'versions' => Array('0.9.17', '0.9.18')
+ );
+
Added: trunk/eventplanner/setup/tables_current.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_current.inc.php
(rev 0)
+++ trunk/eventplanner/setup/tables_current.inc.php 2016-10-13 14:56:17 UTC
(rev 15824)
@@ -0,0 +1,361 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @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/bbb_/ekstern/
+ * @package eventplanner
+ * @subpackage setup
+ * @version $Id: tables_current.inc.php 14728 2016-02-11 22:28:46Z
sigurdne $
+ */
+ $phpgw_baseline = array(
+ 'eventplanner_vendor_category' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'name' => array('type' => 'text', 'nullable' =>
False),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_vendor' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'address_1' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'address_2' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'zip_code' => array('type' => 'varchar',
'precision' => '10', 'nullable' => False),
+ 'city' => array('type' => 'varchar',
'precision' => '64', 'nullable' => False),
+ 'account_number' => array('type' => 'varchar',
'precision' => '20', 'nullable' => False),
+ 'category_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'active' => array('type' => 'int', 'nullable'
=> False, 'precision' => '4', 'default' => 1),
+ 'contact_name' => array('type' => 'text',
'nullable' => False),
+ 'contact_email' => array('type' => 'text',
'nullable' => False),
+ 'contact_phone' => array('type' => 'text',
'nullable' => False),
+ 'description' => array('type' => 'text',
'nullable' => False),
+ 'remark' => array('type' => 'text', 'nullable'
=> True),
+ 'secret' => array('type' => 'text', 'nullable'
=> False),
+ 'vendor_identifier_type' => array('type' =>
'varchar', 'precision' => '255','nullable' => True),
+ 'vendor_organization_number' => array('type' =>
'varchar', 'precision' => '9','nullable' => True),
+ 'vendor_ssn' => array('type' => 'varchar',
'precision' => '12', '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),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(
+ 'eventplanner_vendor_category' =>
array('category_id' => 'id'),
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_vendor_comment' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'vendor_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_vendor' => array('vendor_id' =>
'id'),
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_customer_category' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'name' => array('type' => 'text', 'nullable' =>
False),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_customer' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'name' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'address_1' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'address_2' => array('type' => 'varchar',
'precision' => '255', 'nullable' => False),
+ 'zip_code' => array('type' => 'varchar',
'precision' => '10', 'nullable' => False),
+ 'city' => array('type' => 'varchar',
'precision' => '64', 'nullable' => False),
+ 'account_number' => array('type' => 'varchar',
'precision' => '20', 'nullable' => False),
+ 'category_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'active' => array('type' => 'int', 'nullable'
=> False, 'precision' => '4', 'default' => 1),
+ 'contact_name' => array('type' => 'text',
'nullable' => False),
+ 'contact_email' => array('type' => 'text',
'nullable' => False),
+ 'contact_phone' => array('type' => 'text',
'nullable' => False),
+ 'description' => array('type' => 'text',
'nullable' => False),
+ 'remark' => array('type' => 'text', 'nullable'
=> True),
+ 'secret' => array('type' => 'text', 'nullable'
=> False),
+ 'customer_identifier_type' => array('type' =>
'varchar', 'precision' => '255','nullable' => True),
+ 'customer_organization_number' => array('type'
=> 'varchar', 'precision' => '9','nullable' => True),
+ 'customer_ssn' => array('type' => 'varchar',
'precision' => '12', '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),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(
+ 'eventplanner_customer_category' =>
array('category_id' => 'id'),
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_customer_comment' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'nullable' =>
False),
+ 'customer_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_customer' => array('customer_id'
=> 'id'),
+ ),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+ 'eventplanner_application' => array(
+ 'fd' => array(
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15824] start work on eventplanner,
sigurdne <=