[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16129] Syncromind: Merge 16102:16128 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16129] Syncromind: Merge 16102:16128 from trunk |
Date: |
Sun, 1 Jan 2017 18:24:47 +0000 (UTC) |
Revision: 16129
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16129
Author: sigurdne
Date: 2017-01-01 18:24:47 +0000 (Sun, 01 Jan 2017)
Log Message:
-----------
Syncromind: Merge 16102:16128 from trunk
Modified Paths:
--------------
branches/dev-syncromind-2/eventplanner/inc/class.boapplication.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bocustomer.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bogeneric.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.boresource.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bovendor.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.bovendor_report.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.sobooking.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.socustomer.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.sogeneric.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.soresource.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.sovendor_report.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uiapplication.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uibooking.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uicustomer.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uigeneric.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uiresource.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uivendor.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uivendor_report.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.resource.inc.php
branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php
branches/dev-syncromind-2/mobilefrontend/inc/class.uifront.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.categories.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.login.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.uicommon.inc.php
branches/dev-syncromind-2/phpgwapi/inc/model/class.model.inc.php
branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/head.tpl
branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/navbar.inc.php
branches/dev-syncromind-2/property/inc/class.uitts.inc.php
branches/dev-syncromind-2/property/inc/class.uiwo_hour.inc.php
branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
branches/dev-syncromind-2/property/js/portico/project.edit.js
branches/dev-syncromind-2/property/js/portico/workorder.edit.js
branches/dev-syncromind-2/property/templates/base/cat_sub_select.xsl
branches/dev-syncromind-2/property/templates/base/columns.xsl
branches/dev-syncromind-2/property/templates/base/project.xsl
branches/dev-syncromind-2/property/templates/base/workorder.xsl
branches/dev-syncromind-2/rental/inc/class.bomoveout.inc.php
branches/dev-syncromind-2/rental/inc/class.menu.inc.php
branches/dev-syncromind-2/rental/inc/class.socontract.inc.php
branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php
branches/dev-syncromind-2/rental/inc/class.somoveout.inc.php
branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
branches/dev-syncromind-2/rental/inc/class.uimoveout.inc.php
branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
branches/dev-syncromind-2/rental/inc/model/class.moveout.inc.php
branches/dev-syncromind-2/rental/js/rental/moveout.edit.js
branches/dev-syncromind-2/rental/setup/phpgw_no.lang
branches/dev-syncromind-2/rental/setup/setup.inc.php
branches/dev-syncromind-2/rental/setup/tables_current.inc.php
branches/dev-syncromind-2/rental/setup/tables_update.inc.php
branches/dev-syncromind-2/rental/templates/base/config.tpl
branches/dev-syncromind-2/rental/templates/base/contract.xsl
branches/dev-syncromind-2/rental/templates/base/moveout.xsl
Added Paths:
-----------
branches/dev-syncromind-2/mobilefrontend/rental/class.uimovein.inc.php
branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
branches/dev-syncromind-2/phpgwapi/js/signature_pad/
branches/dev-syncromind-2/rental/inc/class.boemail_out.inc.php
branches/dev-syncromind-2/rental/inc/class.bomovein.inc.php
branches/dev-syncromind-2/rental/inc/class.soemail_out.inc.php
branches/dev-syncromind-2/rental/inc/class.somovein.inc.php
branches/dev-syncromind-2/rental/inc/class.uiemail_out.inc.php
branches/dev-syncromind-2/rental/inc/class.uimovein.inc.php
branches/dev-syncromind-2/rental/inc/model/class.email_out.inc.php
branches/dev-syncromind-2/rental/inc/model/class.movein.inc.php
branches/dev-syncromind-2/rental/js/rental/movein.edit.js
branches/dev-syncromind-2/rental/templates/base/contract_info.xsl
branches/dev-syncromind-2/rental/templates/base/email_out.xsl
branches/dev-syncromind-2/rental/templates/base/movein.xsl
Removed Paths:
-------------
branches/dev-syncromind-2/eventplanner/inc/class.bocommon.inc.php
branches/dev-syncromind-2/eventplanner/inc/class.uicommon.inc.php
Property Changed:
----------------
branches/dev-syncromind-2/
Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798,15800-15812,15814-15838,15840,15842-15888,15890,15892-15997,15999-16097
+ /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798,15800-15812,15814-15838,15840,15842-15888,15890,15892-15997,15999-16097,16103-16128
Modified: branches/dev-syncromind-2/eventplanner/inc/class.boapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.boapplication.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.boapplication.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.soapplication');
include_class('eventplanner', 'application', 'inc/model/');
- class eventplanner_boapplication extends eventplanner_bocommon
+ class eventplanner_boapplication extends phpgwapi_bocommon
{
protected static
$bo,
Modified: branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bobooking.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.sobooking');
include_class('eventplanner', 'booking', 'inc/model/');
- class eventplanner_bobooking extends eventplanner_bocommon
+ class eventplanner_bobooking extends phpgwapi_bocommon
{
protected static
$bo,
Deleted: branches/dev-syncromind-2/eventplanner/inc/class.bocommon.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bocommon.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bocommon.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -1,177 +0,0 @@
-<?php
- /**
- * phpGroupWare
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
- * @internal
- * @package eventplanner
- * @subpackage 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))
- {
- if($field_info['type'] == 'json')
- {
- $values = array();
- $custom_fields =
$object->get_custom_fields();
- $values_attribute =
phpgw::get_var('values_attribute');
-
- foreach ($custom_fields as $key
=> $custom_field)
- {
-
$values[$custom_field['name']] = $values_attribute[$key]['value'];
- }
- $object->set_field( $field,
$values);
- }
- else
- {
- $object->set_field( $field,
phpgw::get_var($field, $field_info['type'] ) );
- }
- }
- }
- $values_attribute = phpgw::get_var('values_attribute');
- $object->set_field( 'values_attribute',
$values_attribute);
-
- 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
Modified: branches/dev-syncromind-2/eventplanner/inc/class.bocustomer.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bocustomer.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bocustomer.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.socustomer');
include_class('eventplanner', 'customer', 'inc/model/');
- class eventplanner_bocustomer extends eventplanner_bocommon
+ class eventplanner_bocustomer extends phpgwapi_bocommon
{
protected static
$bo,
Modified: branches/dev-syncromind-2/eventplanner/inc/class.bogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bogeneric.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bogeneric.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.boresource.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.boresource.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.boresource.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.soresource');
include_class('eventplanner', 'resource', 'inc/model/');
- class eventplanner_boresource extends eventplanner_bocommon
+ class eventplanner_boresource extends phpgwapi_bocommon
{
protected static
$bo,
Modified: branches/dev-syncromind-2/eventplanner/inc/class.bovendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bovendor.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bovendor.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.sovendor');
include_class('eventplanner', 'vendor', 'inc/model/');
- class eventplanner_bovendor extends eventplanner_bocommon
+ class eventplanner_bovendor extends phpgwapi_bocommon
{
protected static
$bo,
Modified:
branches/dev-syncromind-2/eventplanner/inc/class.bovendor_report.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.bovendor_report.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.bovendor_report.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -26,12 +26,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('eventplanner.sovendor_report');
include_class('eventplanner', 'vendor_report', 'inc/model/');
- class eventplanner_bovendor_report extends eventplanner_bocommon
+ class eventplanner_bovendor_report extends phpgwapi_bocommon
{
protected static
$bo,
Modified: branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.soapplication.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.sobooking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.sobooking.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.sobooking.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage booking
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.socustomer.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.socustomer.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.socustomer.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage customer
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.sogeneric.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.sogeneric.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.soresource.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.soresource.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.soresource.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this resource was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage resource
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.sovendor.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage vendor
* @version $Id: $
Modified:
branches/dev-syncromind-2/eventplanner/inc/class.sovendor_report.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.sovendor_report.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.sovendor_report.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage vendor_report
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uiapplication.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uiapplication.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'application', 'inc/model/');
- class eventplanner_uiapplication extends eventplanner_uicommon
+ class eventplanner_uiapplication extends phpgwapi_uicommon
{
public $public_functions = array(
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uibooking.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uibooking.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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 booking was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @internal Development of this booking was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage booking
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'booking', 'inc/model/');
- class eventplanner_uibooking extends eventplanner_uicommon
+ class eventplanner_uibooking extends phpgwapi_uicommon
{
public $public_functions = array(
Deleted: branches/dev-syncromind-2/eventplanner/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uicommon.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uicommon.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -1,215 +0,0 @@
-<?php
-/**
- * phpGroupWare - eventplanner: a part of a Facilities Management
System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/ 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,
2);
- }
-
-
- 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($ajax = false)
- {
- $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))
- {
- if($ajax)
- {
-
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
- return array(
- 'status_kode' => 'ok',
- 'status' => lang('ok'),
- 'msg' =>
lang('messages_saved_form')
- );
- }
- else
- {
-
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
- {
- if($ajax)
- {
-
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
- return array(
- 'status_kode' =>
'error',
- 'status' =>
lang('error'),
- 'msg' =>
lang('messages_form_error')
- );
- }
- else
- {
-
phpgwapi_cache::message_set(lang('messages_form_error'), 'error');
- $this->edit(array('object'
=> $object, 'active_tab' => $active_tab));
- }
- }
- }
- else
- {
- if($ajax)
- {
-
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
- return array(
- 'status_kode' => 'error',
- 'status' => lang('error'),
- 'msg' => lang('Did not
validate')
- );
- }
- else
- {
- foreach ($this->fields as $field =>
$field_info)
- {
- $_temp = $object->$field;
- if($_temp && !is_array($_temp))
- {
- $object->$field =
htmlspecialchars_decode(str_replace(array('&','(', ')',
'=','−−',';'), array('&','(', ')', '=', '--',';'),
$_temp),ENT_QUOTES);
- }
- }
-
- $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
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uicustomer.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uicustomer.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uicustomer.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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
+ * @internal Development of this customer was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage customer
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'customer', 'inc/model/');
- class eventplanner_uicustomer extends eventplanner_uicommon
+ class eventplanner_uicustomer extends phpgwapi_uicommon
{
public $public_functions = array(
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uigeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uigeneric.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uigeneric.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uiresource.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uiresource.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uiresource.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,18 +21,18 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage resource
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'resource', 'inc/model/');
use eventplanner_resource;
- class eventplanner_uiresource extends eventplanner_uicommon
+ class eventplanner_uiresource extends phpgwapi_uicommon
{
public $public_functions = array(
Modified: branches/dev-syncromind-2/eventplanner/inc/class.uivendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uivendor.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uivendor.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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
+ * @internal Development of this vendor was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage vendor
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'vendor', 'inc/model/');
- class eventplanner_uivendor extends eventplanner_uicommon
+ class eventplanner_uivendor extends phpgwapi_uicommon
{
public $public_functions = array(
Modified:
branches/dev-syncromind-2/eventplanner/inc/class.uivendor_report.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/class.uivendor_report.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/class.uivendor_report.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage vendor_report
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('eventplanner', 'vendor_report', 'inc/model/');
- class eventplanner_uivendor_report extends eventplanner_uicommon
+ class eventplanner_uivendor_report extends phpgwapi_uicommon
{
public $public_functions = array(
Modified:
branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.application.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage application
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.booking.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage booking
* @version $Id: $
Modified:
branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.customer.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage customer
* @version $Id: $
Modified:
branches/dev-syncromind-2/eventplanner/inc/model/class.resource.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.resource.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.resource.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage resource
* @version $Id: $
Modified: branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/eventplanner/inc/model/class.vendor.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,7 +21,7 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
* @package eventplanner
* @subpackage vendor
* @version $Id: $
Modified: branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -141,7 +141,7 @@
'edit_msg' => lang('edit'),
'add_msg' => lang('add'),
'name' => lang('response
template'),
- 'acl_app' => 'property',
+ 'acl_app' => 'helpdesk',
'acl_location' => '.ticket',
'menu_selection' =>
'helpdesk::response_template',
'default' => array
Modified: branches/dev-syncromind-2/mobilefrontend/inc/class.uifront.inc.php
===================================================================
--- branches/dev-syncromind-2/mobilefrontend/inc/class.uifront.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/mobilefrontend/inc/class.uifront.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -25,11 +25,10 @@
* @package mobilefrontend
* @version $Id$
*/
- phpgw::import_class('phpgwapi.uicommon');
-// phpgw::import_class('phpgwapi.jquery');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
- class mobilefrontend_uifront extends phpgwapi_uicommon
+ class mobilefrontend_uifront extends phpgwapi_uicommon_jquery
{
public $public_functions = array
Copied: branches/dev-syncromind-2/mobilefrontend/rental/class.uimovein.inc.php
(from rev 16128, trunk/mobilefrontend/rental/class.uimovein.inc.php)
===================================================================
--- branches/dev-syncromind-2/mobilefrontend/rental/class.uimovein.inc.php
(rev 0)
+++ branches/dev-syncromind-2/mobilefrontend/rental/class.uimovein.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -0,0 +1,39 @@
+<?php
+ /**
+ * phpGroupWare - rental: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package rental
+ * @subpackage movein
+ * @version $Id: class.uitts.inc.php 14728 2016-02-11 22:28:46Z
sigurdne $
+ */
+ phpgw::import_class('rental.uimovein');
+
+ class mobilefrontend_uimovein extends rental_uimovein
+ {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] = true;
+ }
+ }
\ No newline at end of file
Copied: branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php (from rev
16128, trunk/phpgwapi/inc/class.bocommon.inc.php)
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
(rev 0)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.bocommon.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -0,0 +1,177 @@
+<?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 phpgwapi
+ * @subpackage utilities
+ * @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 phpgwapi_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))
+ {
+ if($field_info['type'] == 'json')
+ {
+ $values = array();
+ $custom_fields =
$object->get_custom_fields();
+ $values_attribute =
phpgw::get_var('values_attribute');
+
+ foreach ($custom_fields as $key
=> $custom_field)
+ {
+
$values[$custom_field['name']] = $values_attribute[$key]['value'];
+ }
+ $object->set_field( $field,
$values);
+ }
+ else
+ {
+ $object->set_field( $field,
phpgw::get_var($field, $field_info['type'] ) );
+ }
+ }
+ }
+ $values_attribute = phpgw::get_var('values_attribute');
+ $object->set_field( 'values_attribute',
$values_attribute);
+
+ 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
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.categories.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.categories.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.categories.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -498,7 +498,7 @@
$cats = array();
if ($this->db->next_record())
{
- $cats[0] = array
+ $cat = array
(
'id' =>
$this->db->f('cat_id'),
'owner' =>
$this->db->f('cat_owner'),
@@ -510,8 +510,16 @@
'name' =>
$this->db->f('cat_name', true),
'description' =>
$this->db->f('cat_description', true),
'data' =>
$this->db->f('cat_data'),
- 'active' =>
(int)$this->db->f('active')
+ 'active' =>
(int)$this->db->f('active'),
+ 'is_node' => true
);
+ $this->db->query("SELECT cat_id FROM
phpgw_categories WHERE cat_parent = {$id}",__LINE__,__FILE__);
+
+ if ($this->db->next_record())
+ {
+ $cat['is_node'] = false;
+ }
+ $cats[] = $cat;
}
return $cats;
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.login.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.login.inc.php 2017-01-01
18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.login.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -67,6 +67,8 @@
if($frontend)
{
$GLOBALS['phpgw']->hooks->process('set_auth_type', array($frontend));
+ $GLOBALS['phpgw_info']['login_left_message'] =
'';
+ $GLOBALS['phpgw_info']['login_right_message'] =
'';
}
if (isset($_REQUEST['skip_remote']) &&
$_REQUEST['skip_remote']) // In case a user failed logged in via SSO - get
another try
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -52,6 +52,8 @@
$this->skip_limit_query = null;
$this->fields = $fields;
$this->table_name = $table_name;
+ $this->dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
}
/**
@@ -147,6 +149,10 @@
{
return json_decode($value, true);
}
+ else if ($type == 'datestring')
+ {
+ return date($this->dateformat,
strtotime($value));
+ }
return $value;
}
@@ -663,6 +669,7 @@
$value_set[$entry['name']] =
$entry['value'];
}
}
+ $object->values_attribute = $values_attribute;
// update with converted
}
$sql = "UPDATE {$this->table_name} SET "
Modified: branches/dev-syncromind-2/phpgwapi/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.uicommon.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.uicommon.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -1,40 +1,416 @@
<?php
- /**
- * phpGroupWare
- *
- * @author Erink Holm-Larsen <address@hidden>
- * @author Torstein Vadla <address@hidden>
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2012 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package phpgwapi
- * @subpackage utilities
- * @version $Id$
- */
-
+/**
+ * phpGroupWare
+ *
+ * @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 HF
+ * @package phpgwapi
+ * @subpackage utilities
+ * @version $Id$
+ */
phpgw::import_class('phpgwapi.uicommon_jquery');
+ phpgw::import_class('phpgwapi.datetime');
- abstract class phpgwapi_uicommon extends phpgwapi_uicommon_jquery
- {
+
+ class phpgwapi_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,
2);
}
- }
+
+
+ protected function _get_fields()
+ {
+ $values = array();
+ foreach ($this->fields as $field => $field_info)
+ {
+ if($field_info['action'] & PHPGW_ACL_READ)
+ {
+ $label =
!empty($field_info['translated_label']) ? $field_info['translated_label'] :'';
+ if(!$label)
+ {
+ $label
=!empty($field_info['label']) ? lang($field_info['label']) : $field;
+ }
+
+ $data = array(
+ 'key' => $field,
+ 'label' => $label,
+ '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($ajax = false)
+ {
+ $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))
+ {
+ $class_info = explode('_',
get_class($object), 2);
+
+ $this->_handle_files($class_info[0],
$class_info[1], $object->get_id());
+
+ if($ajax)
+ {
+
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+ return array(
+ 'status_kode' => 'ok',
+ 'status' => lang('ok'),
+ 'msg' =>
lang('messages_saved_form')
+ );
+ }
+ else
+ {
+
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
+ {
+ if($ajax)
+ {
+
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+ return array(
+ 'status_kode' =>
'error',
+ 'status' =>
lang('error'),
+ 'msg' =>
lang('messages_form_error')
+ );
+ }
+ else
+ {
+
phpgwapi_cache::message_set(lang('messages_form_error'), 'error');
+ $this->edit(array('object'
=> $object, 'active_tab' => $active_tab));
+ }
+ }
+ }
+ else
+ {
+ if($ajax)
+ {
+
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+ return array(
+ 'status_kode' => 'error',
+ 'status' => lang('error'),
+ 'msg' => lang('Did not
validate')
+ );
+ }
+ else
+ {
+ foreach ($this->fields as $field =>
$field_info)
+ {
+ $_temp = $object->$field;
+ if($_temp && !is_array($_temp))
+ {
+ $object->$field =
htmlspecialchars_decode(str_replace(array('&','(', ')',
'=','−−',';'), array('&','(', ')', '=', '--',';'),
$_temp),ENT_QUOTES);
+ }
+ }
+
+ $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);
+ }
+
+ /**
+ * Called from subclasses
+ * @param type $id
+ */
+ protected function _handle_files( $fakebase, $sub_module, $id )
+ {
+ $id = (int)$id;
+ if (!$id)
+ {
+ throw new Exception(__CLASS__.'::' .
__FUNCTION__.'() - missing id');
+ }
+ if (!$sub_module)
+ {
+ throw new Exception(__CLASS__.'::' .
__FUNCTION__.'() - missing sub_module');
+ }
+ if (!$fakebase)
+ {
+ throw new Exception(__CLASS__.'::' .
__FUNCTION__.'() - missing fakebase');
+ }
+
+ $bofiles = CreateObject('property.bofiles', '/' .
ltrim($fakebase, '/'));
+
+ if (isset($_POST['delete_file']) &&
is_array($_POST['delete_file']))
+ {
+
$bofiles->delete_file("/{$sub_module}/{$id}/",array('file_action' =>
$_POST['delete_file']));
+ }
+ $file_name = str_replace(' ', '_',
$_FILES['file']['name']);
+
+ if ($file_name)
+ {
+ if (!is_file($_FILES['file']['tmp_name']))
+ {
+
phpgwapi_cache::message_set(lang('Failed to upload file !'), 'error');
+ return;
+ }
+
+ $to_file =
"{$bofiles->fakebase}/{$sub_module}/{$id}/{$file_name}";
+ if ($bofiles->vfs->file_exists(array(
+ 'string' => $to_file,
+ 'relatives' =>
Array(RELATIVE_NONE)
+ )))
+ {
+ phpgwapi_cache::message_set(lang('This
file already exists !'), 'error');
+ }
+ else
+ {
+
$bofiles->create_document_dir("{$sub_module}/{$id}");
+ $bofiles->vfs->override_acl = 1;
+
+ if (!$bofiles->vfs->cp(array(
+ 'from' =>
$_FILES['file']['tmp_name'],
+ 'to' => $to_file,
+ 'relatives' =>
array(RELATIVE_NONE | VFS_REAL, RELATIVE_ALL))))
+ {
+
phpgwapi_cache::message_set(lang('Failed to upload file !'), 'error');
+ }
+ $bofiles->vfs->override_acl = 0;
+ }
+ }
+ }
+
+ public function get_files($fakebase, $sub_module, $menuaction,
$id)
+ {
+
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = (int)$id;
+
+ $vfs = CreateObject('phpgwapi.vfs');
+ $vfs->override_acl = 1;
+
+ $values = (array)$vfs->ls (array(
+ 'string' => "/{$fakebase}/{$sub_module}/{$id}",
+ 'relatives' => array(RELATIVE_NONE)));
+
+ $vfs->override_acl = 0;
+
+ $link_view_file = self::link(array('menuaction' =>
$menuaction));
+
+ $content_files = array();
+ $img_types = array(
+ 'image/jpeg',
+ 'image/png',
+ 'image/gif'
+ );
+
+ $lang_view = lang('click to view file');
+ $lang_delete = lang('Check to delete file');
+ $z = 0;
+ foreach ($values as $_entry)
+ {
+ $content_files[] = array(
+ 'file_name' => "<a
href=\"{$link_view_file}&file_id={$_entry['file_id']}\" target=\"_blank\"
title=\"{$lang_view}\">{$_entry['name']}</a>",
+ 'delete_file' => "<input
type=\"checkbox\" name=\"delete_file[]\" value=\"{$_entry['file_id']}\"
title=\"{$lang_delete}\">",
+ );
+ if ( in_array($_entry['mime_type'], $img_types))
+ {
+ $content_files[$z]['file_name'] =
$_entry['name'];
+ $content_files[$z]['img_id'] =
$_entry['file_id'];
+ $content_files[$z]['img_url'] =
self::link(array(
+ 'menuaction' =>
$menuaction,
+ 'file_id' =>
$_entry['file_id'],
+ 'file' =>
$_entry['directory'] . '/' . urlencode($_entry['name'])
+ ));
+ $content_files[$z]['thumbnail_flag'] =
'thumb=1';
+ }
+ $z ++;
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+
+ $total_records = count($content_files);
+
+ return array
+ (
+ 'data' => $content_files,
+ 'draw' => phpgw::get_var('draw', 'int'),
+ 'recordsTotal' => $total_records,
+ 'recordsFiltered' => $total_records
+ );
+ }
+ return $content_files;
+ }
+
+ public function view_file()
+ {
+ $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $thumb = phpgw::get_var('thumb', 'bool');
+ $file_id = phpgw::get_var('file_id', 'int');
+
+ $bofiles = CreateObject('property.bofiles');
+
+ if($file_id)
+ {
+ $file_info = $bofiles->vfs->get_info($file_id);
+ $file =
"{$file_info['directory']}/{$file_info['name']}";
+ }
+ else
+ {
+ $file = urldecode(phpgw::get_var('file'));
+ }
+
+ $source = "{$bofiles->rootdir}{$file}";
+ $thumbfile = "$source.thumb";
+
+ // prevent path traversal
+ if (preg_match('/\.\./', $source))
+ {
+ return false;
+ }
+
+ $uigallery = CreateObject('property.uigallery');
+
+ $re_create = false;
+ if ($uigallery->is_image($source) && $thumb &&
$re_create)
+ {
+ $uigallery->create_thumb($source, $thumbfile,
$thumb_size = 50);
+ readfile($thumbfile);
+ }
+ else if ($thumb && is_file($thumbfile))
+ {
+ readfile($thumbfile);
+ }
+ else if ($uigallery->is_image($source) && $thumb)
+ {
+ $uigallery->create_thumb($source, $thumbfile,
$thumb_size = 50);
+ readfile($thumbfile);
+ }
+ else if ($file_id)
+ {
+ $bofiles->get_file($file_id);
+ }
+ else
+ {
+ $bofiles->view_file('', $file);
+ }
+ }
+
+ }
\ No newline at end of file
Modified: branches/dev-syncromind-2/phpgwapi/inc/model/class.model.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/model/class.model.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/inc/model/class.model.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -283,7 +283,7 @@
/**
* Implement in subclasses
*/
- public function get_custom_fields()
+ public static function get_custom_fields()
{
return array();
}
Modified: branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/head.tpl
===================================================================
--- branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/head.tpl
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/head.tpl
2017-01-01 18:24:47 UTC (rev 16129)
@@ -4,6 +4,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
+ <meta name="viewport" content="width=device-width,
initial-scale=1.0">
<meta name="author" content="phpGroupWare
http://www.phpgroupware.org">
<meta name="description" content="phpGroupWare">
<meta name="keywords" content="phpGroupWare">
Modified:
branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/navbar.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/navbar.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/phpgwapi/templates/mobilefrontend/navbar.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -20,9 +20,14 @@
$tts_text = lang('ticket');
$condition_survey_url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'property.uicondition_survey.index'));
$condition_survey_text =
$GLOBALS['phpgw']->translation->translate('condition survey', array(), false,
'property');
+ $movein_url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'rental.uimovein.index'));
+ $movein_text =
$GLOBALS['phpgw']->translation->translate('movein', array(), false, 'rental');
$moveout_url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'rental.uimoveout.index'));
$moveout_text =
$GLOBALS['phpgw']->translation->translate('moveout', array(), false, 'rental');
+ $acl = & $GLOBALS['phpgw']->acl;
+
+
$topmenu = <<<HTML
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list">
@@ -38,9 +43,29 @@
<li class="pure-menu-item">
<a href="{$condition_survey_url}"
class="pure-menu-link">{$condition_survey_text}</a>
</li>
+HTML;
+
+ if($acl->check('.movein', PHPGW_ACL_READ, 'rental'))
+ {
+ $topmenu .= <<<HTML
<li class="pure-menu-item">
+ <a href="{$movein_url}"
class="pure-menu-link">{$movein_text}</a>
+ </li>
+HTML;
+
+ }
+ if($acl->check('.moveout', PHPGW_ACL_READ, 'rental'))
+ {
+ $topmenu .= <<<HTML
+ <li class="pure-menu-item">
<a href="{$moveout_url}"
class="pure-menu-link">{$moveout_text}</a>
</li>
+HTML;
+
+ }
+
+
+ $topmenu .= <<<HTML
</ul>
</div>
HTML;
Modified: branches/dev-syncromind-2/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uitts.inc.php 2017-01-01
18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/inc/class.uitts.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -998,7 +998,7 @@
'value' =>
lang('columns'),
'href' => '#',
'class' => '',
- 'onclick' =>
"JqueryPortico.openPopup({menuaction:'property.uitts.columns'},
{closeAction:'reload'})"
+ 'onclick' =>
"JqueryPortico.openPopup({menuaction:'property.uitts.columns'},
{closeAction:'reload', height: 500})"
),
)
)
Modified: branches/dev-syncromind-2/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiwo_hour.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/inc/class.uiwo_hour.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -1520,7 +1520,7 @@
{
if ($e)
{
- throw $e;
+
phpgwapi_cache::message_set($e->getMessage(), 'error');
}
}
Modified: branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -2192,6 +2192,8 @@
$_cat_sub = $this->cats->return_sorted_array($start =
0, $limit = false, $query = '', $sort = '', $order = '', $globals = False,
false);
$selected_cat = $values['cat_id'] ? $values['cat_id'] :
$project['cat_id'];
+ $validatet_category = '';
+
$cat_sub = array();
foreach ($_cat_sub as $entry)
{
@@ -2199,6 +2201,18 @@
{
continue;
}
+
+ if(!$validatet_category)
+ {
+ if ($entry['active'] && $entry['id'] ==
$selected_cat)
+ {
+ $_category =
$this->cats->return_single($entry['id']);
+ if($_category[0]['is_node'])
+ {
+ $validatet_category = 1;
+ }
+ }
+ }
$entry['name'] = str_repeat(' . ',
(int)$entry['level']) . $entry['name'];
$entry['title'] = $entry['description'];
$cat_sub[] = $entry;
@@ -2378,6 +2392,7 @@
'cat_sub_list' =>
$this->bocommon->select_list($selected_cat, $cat_sub),
'cat_sub_name' => 'values[cat_id]',
'lang_cat_sub_statustext' => lang('select sub
category'),
+ 'validatet_category' => $validatet_category,
'sum_workorder_budget' =>
(isset($values['sum_workorder_budget']) ? $values['sum_workorder_budget'] : ''),
'workorder_budget' =>
(isset($values['workorder_budget']) ? $values['workorder_budget'] : ''),
'lang_coordinator' => lang('Coordinator'),
Modified:
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
===================================================================
---
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-01-01 18:05:50 UTC (rev 16128)
+++
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -164,8 +164,8 @@
'BuyerProductDescr' => $line['descr'],
//'Kopipapir',
'UnitCode' => 'STK',
'Quantity' => 1,
- 'Price' => $line['price'],
- 'LineTotal'=> $line['price'],
+ 'Price' =>
number_format($line['price'], 2, '.', ''),
+ 'LineTotal'=>
number_format($line['price'], 2, '.', ''),
'DetailInfo' => $DetailInfo
);
@@ -175,7 +175,7 @@
$Orders['Order'][] = array(
'OrderNo' => $param['order_id'],
- 'VoucherType' => $param['voucher_type'],
+ 'VoucherType' => $this->voucher_type,
'TransType' => 41,
'Header' => array($Header),
'Details' => array('Detail' => $Detail)
@@ -233,14 +233,15 @@
return $filename;
}
- public function transfer( $debug )
+ public function transfer( )
{
$batchid = $this->soXport->increment_batchid();
$this->batchid = $batchid;
$filename = $this->create_file_name($this->order_id);
$content = $this->transfer_xml;
+ $debug =
empty($this->config->config_data['export']['activate_transfer']) ? true : false;
- if($debug) // keep a copy?
+ if(!empty($this->config->config_data['export']['path'])
&& is_dir($this->config->config_data['export']['path'])) // keep a copy
{
$file_written = false;
$fp = fopen($filename, "wb");
@@ -257,8 +258,7 @@
}
$transfer_ok = false;
-// if ($this->config->config_data['common']['method'] ==
'ftp' || $this->config->config_data['common']['method'] == 'ssh')
- if (!$debug)//Not yet...
+ if (!$debug &&
($this->config->config_data['common']['method'] == 'ftp' ||
$this->config->config_data['common']['method'] == 'ssh'))
{
$this->db->transaction_begin();
Modified:
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
===================================================================
---
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-01-01 18:05:50 UTC (rev 16128)
+++
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -39,12 +39,14 @@
class lag_agresso_ordre_fra_workorder
{
- var $debug = true;
+ var $debug = false;
public function __construct()
{
$this->cats = CreateObject('phpgwapi.categories', -1,
'property', '.project');
$this->cats->supress_info = true;
+ $config = CreateObject('admin.soconfig',
$GLOBALS['phpgw']->locations->get_id('property', '.invoice'));
+ $this->debug =
empty($config->config_data['export']['activate_transfer']) ? true : false;
}
public function transfer( $project, $workorder )
@@ -52,6 +54,8 @@
// _debug_array($workorder);die();
if (!$this->debug && $workorder['order_sent'])
{
+ $transfer_time =
$GLOBALS['phpgw']->common->show_date($workorder['order_sent']);
+ phpgwapi_cache::message_set("Info: Ordre
#{$workorder['id']} er allerede overført til Agresso {$transfer_time}");
return 2;
}
@@ -64,12 +68,12 @@
if($approval_level == 'project')
{
$approval_amount =
ExecMethod('property.boworkorder.get_accumulated_budget_amount',
$workorder['project_id']);
- $price =
ExecMethod('property.boworkorder.get_budget_amount', $workorder['id']);
+ $price = (float)
ExecMethod('property.boworkorder.get_budget_amount', $workorder['id']);
}
else
{
$approval_amount =
ExecMethod('property.boworkorder.get_budget_amount', $workorder['id']);
- $price = $approval_amount;
+ $price = (float) $approval_amount;
}
@@ -115,17 +119,34 @@
$user_name =
$GLOBALS['phpgw']->accounts->get($workorder['user_id'])->__toString();
$account_lid =
$GLOBALS['phpgw']->accounts->id2lid($workorder['user_id']);
+
+ if ($workorder['ecodimb'])
+ {
+ $dim1 = $workorder['ecodimb'];
+ }
+ else if ($project['ecodimb'])
+ {
+ $dim1 = $project['ecodimb'];
+ }
+ else
+ {
+ throw new Exception('Dimensjonen "Ansvar"
mangler');
+ }
+
if ($workorder['location_code'])
{
$location_code = $workorder['location_code'];
$location = explode('-', $location_code);
- $dim3 = isset($location[1]) && $location[1] ?
"{$location[0]}{$location[1]}" : "{$location[0]}01";
+// $dim3 = isset($location[1]) && $location[1] ?
"{$location[0]}{$location[1]}" : "{$location[0]}01";
+ $dim3 = $location[0];
+
}
else if ($project['location_code'])
{
$location_code = $project['location_code'];
$location = explode('-', $location_code);
- $dim3 = isset($location[1]) && $location[1] ?
"{$location[0]}{$location[1]}" : "{$location[0]}01";
+// $dim3 = isset($location[1]) && $location[1] ?
"{$location[0]}{$location[1]}" : "{$location[0]}01";
+ $dim3 = $location[0];
}
else
{
@@ -154,9 +175,9 @@
),
'BuyerReferences' => array(
array(
- 'Responsible' => $account_lid,
- 'RequestedBy' => $account_lid,
- 'Accountable' => $account_lid,
+ 'Responsible' =>
strtoupper($account_lid),
+ 'RequestedBy' =>
strtoupper($account_lid),
+ 'Accountable' =>
strtoupper($account_lid),
)
)
);
@@ -192,11 +213,22 @@
//Override from workorder
$tax_code = $workorder['tax_code'] ?
$workorder['tax_code'] : $tax_code;
+ switch ($tax_code)
+ {
+ case '0':
+ $tax_code = '6A';
+ break;
+ case '75':
+ $tax_code = '60';
+ break;
+ default:
+ $tax_code = '6A';
+ break;
+ }
+
$tjeneste = $workorder['service_id'] ?
$workorder['service_id'] : $tjeneste;
// _debug_array($location_info);die();
- $config = CreateObject('phpgwapi.config', 'property');
- $config->read();
$collect_building_part = false;
if
(isset($config->config_data['workorder_require_building_part']))
@@ -250,7 +282,7 @@
$param = array(
'dim0' => $workorder['b_account_id'], // Art
- 'dim1' => $workorder['ecodimb'], // Ansvar
+ 'dim1' => $dim1, // Ansvar
'dim2' => $tjeneste, // Tjeneste liste 30 stk,
default 9
'dim3' => $dim3, // Objekt: eiendom + bygg: 6
siffer
'dim4' => $workorder['contract_id'], //
Kontrakt - frivillig / 9, 7 tegn - alfanumerisk
Modified: branches/dev-syncromind-2/property/js/portico/project.edit.js
===================================================================
--- branches/dev-syncromind-2/property/js/portico/project.edit.js
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/js/portico/project.edit.js
2017-01-01 18:24:47 UTC (rev 16129)
@@ -127,6 +127,24 @@
{
check_button_names();
+ $.formUtils.addValidator({
+ name: 'category',
+ validatorFunction: function (value, $el, config, languaje,
$form)
+ {
+ var validatet_category = $('#validatet_category').val();
+ if(validatet_category ==1)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ },
+ errorMessage: 'Ugyldig kategori',
+ errorMessageKey: ''
+ });
+
$("#global_category_id").change(function ()
{
var oArgs = {menuaction: 'property.boworkorder.get_category',
cat_id: $(this).val()};
Modified: branches/dev-syncromind-2/property/js/portico/workorder.edit.js
===================================================================
--- branches/dev-syncromind-2/property/js/portico/workorder.edit.js
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/js/portico/workorder.edit.js
2017-01-01 18:24:47 UTC (rev 16129)
@@ -313,6 +313,24 @@
errorMessageKey: ''
});
+ $.formUtils.addValidator({
+ name: 'category',
+ validatorFunction: function (value, $el, config, languaje,
$form)
+ {
+ var validatet_category = $('#validatet_category').val();
+ if(validatet_category ==1)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ },
+ errorMessage: 'Ugyldig kategori',
+ errorMessageKey: ''
+ });
+
$("#global_category_id").change(function ()
{
var oArgs = {menuaction: 'property.boworkorder.get_category',
cat_id: $(this).val()};
@@ -328,10 +346,15 @@
{
if (data != null)
{
- if (data.active != 1)
+ if (data.active != 1 || data.is_node
=== false)
{
alert('Denne kan ikke velges');
+
$('#validatet_category').val('');
}
+ else
+ {
+ $('#validatet_category').val(1);
+ }
}
}
});
@@ -541,10 +564,10 @@
var total_amount = Math.max((contract_sum - Number(local_value_budget)
+ Number(accumulated_budget_amount)),
- (budget_sum - Number(local_value_budget) +
Number(accumulated_budget_amount)),
- (Number(local_value_budget),Number(accumulated_budget_amount)));
+ (budget_sum - Number(local_value_budget) +
Number(accumulated_budget_amount)),
+ (Number(local_value_budget),
Number(accumulated_budget_amount)));
- var order_received_amount = Math.max(contract_sum, budget_sum,
Number(local_value_budget));
+ var order_received_amount = Math.max(contract_sum, budget_sum,
Number(local_value_budget));
$("#order_received_amount").val(order_received_amount);
Modified: branches/dev-syncromind-2/property/templates/base/cat_sub_select.xsl
===================================================================
--- branches/dev-syncromind-2/property/templates/base/cat_sub_select.xsl
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/templates/base/cat_sub_select.xsl
2017-01-01 18:24:47 UTC (rev 16129)
@@ -1,32 +1,36 @@
<!-- $Id$ -->
<xsl:template name="cat_sub_select">
- <xsl:variable name="lang_cat_sub_statustext">
- <xsl:value-of select="lang_cat_sub_statustext"/>
- </xsl:variable>
- <xsl:variable name="cat_sub_name">
- <xsl:value-of select="cat_sub_name"/>
- </xsl:variable>
- <select id = "global_category_id" name="{$cat_sub_name}"
class="forms" title="{$lang_cat_sub_statustext}">
- <xsl:apply-templates select="cat_sub_list"/>
- </select>
+ <xsl:variable name="lang_cat_sub_statustext">
+ <xsl:value-of select="lang_cat_sub_statustext"/>
+ </xsl:variable>
+ <xsl:variable name="cat_sub_name">
+ <xsl:value-of select="cat_sub_name"/>
+ </xsl:variable>
+ <select id = "global_category_id" name="{$cat_sub_name}" class="forms"
title="{$lang_cat_sub_statustext}">
+ <xsl:attribute name="data-validation">
+ <xsl:text>category</xsl:text>
+ </xsl:attribute>
+
+ <xsl:apply-templates select="cat_sub_list"/>
+ </select>
</xsl:template>
<!-- New template-->
<xsl:template match="cat_sub_list">
- <xsl:variable name="id">
- <xsl:value-of select="id"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="selected">
- <option value="{$id}" selected="selected"
title="{title}">
- <xsl:value-of
disable-output-escaping="yes" select="name"/>
- </option>
- </xsl:when>
- <xsl:otherwise>
- <option value="{$id}" title="{title}">
- <xsl:value-of
disable-output-escaping="yes" select="name"/>
- </option>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="id">
+ <xsl:value-of select="id"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="selected">
+ <option value="{$id}" selected="selected"
title="{title}">
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option value="{$id}" title="{title}">
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
Modified: branches/dev-syncromind-2/property/templates/base/columns.xsl
===================================================================
--- branches/dev-syncromind-2/property/templates/base/columns.xsl
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/templates/base/columns.xsl
2017-01-01 18:24:47 UTC (rev 16129)
@@ -10,7 +10,7 @@
<!-- New template-->
<xsl:template match="columns">
- <div align="left">
+ <div class='body'>
<form method="post" name="form" action="{form_action}" class=
"pure-form pure-form-aligned">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
@@ -23,6 +23,13 @@
</xsl:when>
</xsl:choose>
</table>
+ <div class="proplist-col">
+ <input type="submit" class="pure-button
pure-button-primary" name="values[save]">
+ <xsl:attribute name="value">
+ <xsl:value-of
select="php:function('lang', 'save')"/>
+ </xsl:attribute>
+ </input>
+ </div>
<fieldset>
<legend>
@@ -32,19 +39,6 @@
<xsl:apply-templates
select="column_list"/>
</div>
</fieldset>
-
- <tr height="50">
- <td>
- <xsl:variable name="lang_save">
- <xsl:value-of
select="lang_save"/>
- </xsl:variable>
- <input type="submit"
name="values[save]" value="{$lang_save}">
- <xsl:attribute name="title">
- <xsl:value-of
select="lang_save_statustext"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
</form>
</div>
</xsl:template>
Modified: branches/dev-syncromind-2/property/templates/base/project.xsl
===================================================================
--- branches/dev-syncromind-2/property/templates/base/project.xsl
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/templates/base/project.xsl
2017-01-01 18:24:47 UTC (rev 16129)
@@ -47,6 +47,7 @@
<xsl:value-of select="decimal_separator"/>
</xsl:variable>
<input type="hidden" id="active_tab" name="active_tab"
value="{value_active_tab}"/>
+ <input type="hidden" name='validatet_category'
id="validatet_category" value="1"/>
<div id="tab-content">
<xsl:value-of disable-output-escaping="yes"
select="tabs"/>
Modified: branches/dev-syncromind-2/property/templates/base/workorder.xsl
===================================================================
--- branches/dev-syncromind-2/property/templates/base/workorder.xsl
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/property/templates/base/workorder.xsl
2017-01-01 18:24:47 UTC (rev 16129)
@@ -164,6 +164,8 @@
<form ENCTYPE="multipart/form-data" method="post" id='form' name="form"
action="{$form_action}" class= "pure-form pure-form-aligned">
<input type="hidden" name="send_workorder" value=""/>
<input type="hidden" name='calculate_workorder' value=""/>
+ <input type="hidden" name='validatet_category'
id="validatet_category" value="{validatet_category}"/>
+
<xsl:variable name="decimal_separator">
<xsl:value-of select="decimal_separator"/>
</xsl:variable>
Copied: branches/dev-syncromind-2/rental/inc/class.boemail_out.inc.php (from
rev 16128, trunk/rental/inc/class.boemail_out.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.boemail_out.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.boemail_out.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -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 rental
+ * @subpackage email_out
+ * @version $Id:$
+ */
+
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('rental.soemail_out');
+
+ include_class('rental', 'email_out', 'inc/model/');
+
+ class rental_boemail_out extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public function __construct()
+ {
+ $this->fields = rental_email_out::get_fields();
+ $this->acl_location = rental_email_out::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 rental_boemail_out();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
rental_soemail_out::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 =
rental_soemail_out::get_instance()->read($params);
+ // $status_text = rental_email_out::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 =
rental_soemail_out::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new rental_email_out();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Copied: branches/dev-syncromind-2/rental/inc/class.bomovein.inc.php (from rev
16128, trunk/rental/inc/class.bomovein.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.bomovein.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.bomovein.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -0,0 +1,119 @@
+<?php
+ /**
+ * phpGroupWare - rental: 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
+ * @package rental
+ * @subpackage movein
+ * @version $Id: $
+ */
+
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('rental.somovein');
+
+ include_class('rental', 'movein', 'inc/model/');
+
+ class rental_bomovein extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public function __construct()
+ {
+ $this->fields = rental_movein::get_fields();
+ $this->acl_location = rental_movein::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 rental_bomovein();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret = rental_somovein::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 =
rental_somovein::get_instance()->read($params);
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ $entry['created'] = date($dateformat,
$entry['created']);//$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] = date($dateformat,
$entry['modified']);//$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
rental_somovein::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new rental_movein();
+ }
+
+ $custom_fields = rental_movein::get_custom_fields();
+ if($custom_fields)
+ {
+ $custom_fields =
rental_somovein::get_instance()->read_custom_field_values($id, $custom_fields);
+ $_values =
createObject('property.custom_fields')->prepare(array('attributes' =>
$custom_fields), 'rental', rental_movein::acl_location, $view = false);
+
+ if($return_object)
+ {
+ $values->attributes =
$_values[attributes];
+ }
+ else
+ {
+ $values['attributes'] =
$_values[attributes];
+ }
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/inc/class.bomoveout.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.bomoveout.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.bomoveout.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,19 +21,19 @@
* 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
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
* @package rental
* @subpackage moveout
* @version $Id: $
*/
- phpgw::import_class('eventplanner.bocommon');
+ phpgw::import_class('phpgwapi.bocommon');
phpgw::import_class('rental.somoveout');
include_class('rental', 'moveout', 'inc/model/');
- class rental_bomoveout extends eventplanner_bocommon
+ class rental_bomoveout extends phpgwapi_bocommon
{
protected static
$bo,
@@ -79,13 +79,11 @@
unset($params['filters']['active']);
}
$values =
rental_somoveout::get_instance()->read($params);
- // $status_text = rental_moveout::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['created'] = date($dateformat,
$entry['created']);//$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] = date($dateformat,
$entry['modified']);//$GLOBALS['phpgw']->common->show_date($entry['modified']);
}
return $values;
}
@@ -101,7 +99,7 @@
$values = new rental_moveout();
}
- $custom_fields =
rental_moveout::get_instance()->get_custom_fields();
+ $custom_fields = rental_moveout::get_custom_fields();
if($custom_fields)
{
$custom_fields =
rental_somoveout::get_instance()->read_custom_field_values($id, $custom_fields);
Modified: branches/dev-syncromind-2/rental/inc/class.menu.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.menu.inc.php 2017-01-01
18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.menu.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -143,11 +143,29 @@
if(!$use_fellesdata)
{
$menus['navigation'] =
array_reverse($menus['navigation'], true);
+ $menus['navigation']['email_out'] = array(
+ 'text' => lang('email out'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uiemail_out.index')),
+ 'image' => array('rental',
'text-x-generic'),
+ 'children' => array(
+ 'email_template' => array(
+ 'text' => lang('email
template'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uigeneric.index',
+ 'type' =>
'email_template', 'admin' => true))
+ )
+ )
+ );
+
$menus['navigation']['moveout'] = array(
'text' => lang('moveout'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimoveout.index')),
'image' => array('rental',
'text-x-generic'),
);
+ $menus['navigation']['movein'] = array(
+ 'text' => lang('movein'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimovein.index')),
+ 'image' => array('rental',
'text-x-generic'),
+ );
$menus['navigation']['schedule'] = array(
'text' => lang('schedule'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uicomposite.schedule')),
Modified: branches/dev-syncromind-2/rental/inc/class.socontract.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socontract.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.socontract.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -355,7 +355,7 @@
else
{
// columns to retrieve
- $columns[] = 'contract.id AS contract_id';
+ $columns[] = 'contract.id AS contract_id,
contract.notify_on_expire, contract.notified_time';
$columns[] = 'contract.date_start,
contract.date_end, contract.old_contract_id, contract.executive_officer,
contract.last_updated, contract.location_id, contract.billing_start,
contract.billing_end, contract.service_id, contract.responsibility_id,
contract.reference, contract.invoice_header, contract.project_id,
billing.deleted, contract.account_in, contract.account_out, contract.term_id,
contract.security_type, contract.security_amount, contract.comment,
contract.due_date,
contract.contract_type_id,contract.rented_area,contract.adjustable,contract.adjustment_interval,contract.adjustment_share,contract.adjustment_year,override_adjustment_start,contract.publish_comment';
$columns[] = 'party.id AS party_id';
$columns[] = 'party.first_name,
party.last_name, party.company_name, party.department, party.org_enhet_id';
@@ -446,6 +446,9 @@
$contract->set_notify_before($this->unmarshal($this->db->f('notify_before'),
'int'));
$contract->set_notify_before_due_date($this->unmarshal($this->db->f('notify_before_due_date'),
'int'));
$contract->set_notify_after_termination_date($this->unmarshal($this->db->f('notify_after_termination_date'),
'int'));
+
$contract->set_notify_on_expire($this->unmarshal($this->db->f('notify_on_expire'),
'int'));
+
$contract->set_notified_time($this->unmarshal($this->db->f('notified_time'),
'int'));
+
}
$timestamp_end =
$this->unmarshal($this->db->f('timestamp_end'), 'int');
@@ -1251,4 +1254,13 @@
}
return $price_items;
}
+
+ public function set_notified_on_expire( $contract_id,
$current_notify_on_expire )
+ {
+ $contract_id = (int) $contract_id;
+ $new_notify_on_expire = (int)$current_notify_on_expire
+ 1;
+ $now = time();
+ $sql = "UPDATE rental_contract SET notify_on_expire =
{$new_notify_on_expire}, notified_time = $now WHERE id={$contract_id} ";
+ return $this->db->query($sql);
+ }
}
\ No newline at end of file
Copied: branches/dev-syncromind-2/rental/inc/class.soemail_out.inc.php (from
rev 16128, trunk/rental/inc/class.soemail_out.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.soemail_out.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.soemail_out.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -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/
+ * @package rental
+ * @subpackage email_out
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class rental_soemail_out extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('rental_email_out',
rental_email_out::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('rental.soemail_out');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new rental_email_out();
+ 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 = rental_email_out::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
+ (
+ 'email_out_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
rental_email_out_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
Modified: branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -170,11 +170,55 @@
'menu_selection' =>
'admin::rental::composite_type'
);
break;
+ case 'email_template':
+ $info = array
+ (
+ 'table' =>
'rental_email_template',
+ 'id' => array('name' => 'id',
'type' => 'auto'),
+ 'fields' => array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'content',
+ 'descr' =>
lang('content'),
+ 'type' => 'text'
+ ),
+ array
+ (
+ 'name' =>
'public',
+ 'descr' =>
lang('public'),
+ 'type' =>
'checkbox'
+ )
+ ),
+ 'edit_msg' => lang('edit'),
+ 'add_msg' => lang('add'),
+ 'name' => lang('email
template'),
+ 'acl_app' => 'rental',
+ 'acl_location' => '.email_out',
+ 'menu_selection' =>
'rental::email_out::email_template',
+ 'default' => array
+ (
+ 'user_id' =>
array('add' => '$this->account'),
+ 'created' =>
array('add' => 'time()'),
+ 'modified' =>
array('edit' => 'time()'),
+ ),
+ 'check_grant' => true
+ );
+
+ break;
+
// END RENTAL TABLES
default:
$message = lang('ERROR: illegal type
%1', $type);
phpgwapi_cache::message_set($message,
'error');
+ throw new Exception;
}
$this->location_info = $info;
Copied: branches/dev-syncromind-2/rental/inc/class.somovein.inc.php (from rev
16128, trunk/rental/inc/class.somovein.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.somovein.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.somovein.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -0,0 +1,89 @@
+<?php
+ /**
+ * phpGroupWare - rental: 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 rental
+ * @subpackage movein
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class rental_somovein extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('rental_movein',
rental_movein::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('rental.somovein');
+ }
+ return self::$so;
+ }
+
+ public function read_custom_field_values( $id, $custom_fields )
+ {
+ $sql = "SELECT * FROM {$this->table_name} WHERE id = "
. (int)$id;
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ if ($this->db->next_record() &&
is_array($custom_fields))
+ {
+ foreach ($custom_fields as &$attr)
+ {
+ $attr['value'] =
$this->db->f($attr['column_name']);
+ }
+ }
+ return $custom_fields;
+ }
+
+ protected function populate( array $data )
+ {
+ $object = new rental_movein();
+ foreach ($this->fields as $field => $field_info)
+ {
+ $object->set_field($field, $data[$field]);
+ }
+
+ return $object;
+ }
+
+ protected function update( $object )
+ {
+ $this->db->transaction_begin();
+
+ parent::update($object);
+
+ return $this->db->transaction_commit();
+ }
+ }
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/inc/class.somoveout.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.somoveout.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.somoveout.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -81,46 +81,7 @@
protected function update( $object )
{
$this->db->transaction_begin();
- // $status_text =
rental_moveout::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
- (
- 'moveout_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
rental_moveout_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();
Modified: branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -44,7 +44,8 @@
'reset_price_item' => true,
'add_notification' => true,
'download' => true,
- 'get_total_price' => true
+ 'get_total_price' => true,
+ 'notify_on_expire' => true
);
public function __construct()
@@ -1719,6 +1720,28 @@
$document_search_options[] = array('id' => 'name',
'name' => lang('document_name'));
/* *
********************************************************************************
*/
+
+ $moveout_gross =
createObject('rental.bomoveout')->read(array('filters' => array('contract_id'
=> $contract_id)));
+ $moveout = $moveout_gross['results'] ?
$moveout_gross['results'][0] : array();
+ if($moveout)
+ {
+ $moveout['url'] = self::link(array('menuaction'
=> 'rental.uimoveout.view','id' => $moveout['id']));
+ }
+ else
+ {
+ $moveout['new_report'] =
self::link(array('menuaction' => 'rental.uimoveout.edit','contract_id' =>
$contract_id));
+ }
+ $movein_gross =
createObject('rental.bomovein')->read(array('filters' => array('contract_id' =>
$contract_id)));
+ $movein = $movein_gross['results'] ?
$movein_gross['results'][0] : array();
+ if($movein)
+ {
+ $movein['url'] = self::link(array('menuaction'
=> 'rental.uimovein.view','id' => $movein['id']));
+ }
+ else
+ {
+ $movein['new_report'] =
self::link(array('menuaction' => 'rental.uimovein.edit','contract_id' =>
$contract_id));
+ }
+
$code = <<<JS
var thousandsSeparator =
'$this->thousandsSeparator';
var decimalSeparator =
'$this->decimalSeparator';
@@ -1776,7 +1799,9 @@
'value_security_amount_view' =>
($contract->get_security_amount()) ? $contract->get_security_amount() : '0',
'value_current_interval' => $current_interval .
" " . lang('year'),
'value_current_share' => $current_share . " %",
- 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab)
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'moveout' => $moveout,
+ 'movein' => $movein
);
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('view');
@@ -2207,6 +2232,28 @@
$document_search_options[] = array('id' =>
'title', 'name' => lang('document_title'));
$document_search_options[] = array('id' =>
'name', 'name' => lang('document_name'));
/* *
********************************************************************************
*/
+
+ $moveout_gross =
createObject('rental.bomoveout')->read(array('filters' => array('contract_id'
=> $contract_id)));
+ $moveout = $moveout_gross['results'] ?
$moveout_gross['results'][0] : array();
+ if($moveout)
+ {
+ $moveout['url'] =
self::link(array('menuaction' => 'rental.uimoveout.view','id' =>
$moveout['id']));
+ }
+ else
+ {
+ $moveout['new_report'] =
self::link(array('menuaction' => 'rental.uimoveout.edit','contract_id' =>
$contract_id));
+ }
+ $movein_gross =
createObject('rental.bomovein')->read(array('filters' => array('contract_id' =>
$contract_id)));
+ $movein = $movein_gross['results'] ?
$movein_gross['results'][0] : array();
+ if($movein)
+ {
+ $movein['url'] =
self::link(array('menuaction' => 'rental.uimovein.view','id' => $movein['id']));
+ }
+ else
+ {
+ $movein['new_report'] =
self::link(array('menuaction' => 'rental.uimovein.edit','contract_id' =>
$contract_id));
+ }
+
}
$code = <<<JS
@@ -2287,6 +2334,8 @@
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'img_cal' =>
json_encode($GLOBALS['phpgw']->common->image('phpgwapi', 'cal')),
'dateformat' => str_ireplace(array('d', 'm',
'y'), array('dd', 'mm', 'yy'),
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+ 'moveout' => $moveout,
+ 'movein' => $movein
);
//$appname = $this->location_info['name'];
@@ -2808,4 +2857,91 @@
}
}
}
+
+
+
+ /**
+ * Sending email - consider the workbench instead
+ * run as cron-job
+ */
+ public function notify_on_expire( )
+ {
+ // Queries that depend on areas of responsibility
+ $types =
rental_socontract::get_instance()->get_fields_of_responsibility();
+ $ids = array();
+ $read_access = array();
+ foreach ($types as $id => $label)
+ {
+ $names = $this->locations->get_name($id);
+ if ($names['appname'] ==
$GLOBALS['phpgw_info']['flags']['currentapp'])
+ {
+ $ids[] = $id;
+ }
+ }
+ $comma_seperated_ids = implode(',', $ids);
+ $filters = array('contract_status' =>
'under_dismissal', 'contract_type' => $comma_seperated_ids);
+
+ $candidates = array();
+ $candidates = rental_socontract::get_instance()->get(0,
0, '', false, '', '', $filters);
+
+ $notify_on_expire_email =
$this->config->config_data['notify_on_expire_email'];
+ $from_email =
$this->config->config_data['from_email_setting'];
+ $notify_reminder_days =
$this->config->config_data['notify_reminder_days'];
+
+ if(!$notify_on_expire_email)
+ {
+ throw new Exception(__CLASS__.'::' .
__FUNCTION__.'() - missing email target');
+ }
+
+ if (!is_object($GLOBALS['phpgw']->send))
+ {
+ $GLOBALS['phpgw']->send =
CreateObject('phpgwapi.send');
+ }
+
+ $do_notify = false;
+ foreach ($candidates as $contract_id => $contract)
+ {
+ $notify_on_expire =
$contract->get_notify_on_expire();
+
+ if($notify_on_expire > 1)
+ {
+ continue;
+ }
+
+ $now = time();
+ $end_date =
$contract->get_contract_date()->get_end_date();
+ $datediff = $end_date - $now;
+ $days_to_expire = floor($datediff / (60 * 60 *
24));
+
+ _debug_array($days_to_expire);
+
+ if ($notify_on_expire == 0 &&
($notify_reminder_days > $days_to_expire)) // first time
+ {
+ $do_notify = true;
+ }
+ else if($notify_reminder_days >=
$days_to_expire)// second time
+ {
+ $do_notify = true;
+ $notify_on_expire = 1;
+ }
+
+ if($do_notify)
+ {
+ $subject = lang('contract %1 expires in
%2 days', $contract_id, $days_to_expire);
+ $message = '<a href ="' .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uicontract.edit',
+ 'id' => $contract_id),
false, true) . '">' . $subject . '</a>';
+ try
+ {
+ $rcpt =
$GLOBALS['phpgw']->send->msg('email', $notify_on_expire_email, $subject,
stripslashes($message), '', $cc, $bcc, $from_email, $from_email, 'html');
+ }
+ catch (Exception $exc)
+ {
+
phpgwapi_cache::message_set($exc->getMessage(),'error');
+ }
+
+
rental_socontract::get_instance()->set_notified_on_expire($contract_id,
$notify_on_expire);
+ }
+
+ }
+ }
}
\ No newline at end of file
Copied: branches/dev-syncromind-2/rental/inc/class.uiemail_out.inc.php (from
rev 16128, trunk/rental/inc/class.uiemail_out.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiemail_out.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.uiemail_out.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -0,0 +1,228 @@
+<?php
+/**
+ * phpGroupWare - rental: 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 rental
+ * @subpackage email_out
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('rental', 'email_out', 'inc/model/');
+
+ class rental_uiemail_out extends phpgwapi_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ 'get' => true
+ );
+
+ protected
+ $fields,
+ $permissions;
+
+ public function __construct()
+ {
+ parent::__construct();
+ self::set_active_menu('rental::email_out');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('email_out');
+ $this->bo = createObject('rental.boemail_out');
+ $this->fields = rental_email_out::get_fields();
+ $this->permissions =
rental_email_out::get_instance()->get_permission_array();
+ }
+
+
+ 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('email_out');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
'rental.uiemail_out.index',
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => 'rental.uiemail_out.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' =>
'rental.uiemail_out.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'rental.uiemail_out.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('rental', 'portico',
'email_out.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']))
+ {
+ $email_out = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $email_out = $this->bo->read_single($id);
+ }
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('email_out'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+ $bocommon = CreateObject('property.bocommon');
+
+ $comments = (array)$email_out->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' =>
'rental.uiemail_out.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uiemail_out.index',)),
+ 'email_out' => $email_out,
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab
+ );
+ phpgwapi_jquery::formvalidator_generate(array());
+ self::add_javascript('rental', 'portico',
'email_out.edit.js');
+ self::render_template_xsl(array('email_out',
'datatable_inline'), array($mode => $data));
+ }
+
+ /*
+ * Get the email_out with the id given in the http variable 'id'
+ */
+
+ public function get( $id = 0 )
+ {
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = !empty($id) ? $id : phpgw::get_var('id', 'int');
+
+ $email_out = $this->bo->read_single($id)->toArray();
+
+ unset($email_out['secret']);
+
+ return $email_out;
+ }
+
+ public function save()
+ {
+ parent::save();
+ }
+ }
\ No newline at end of file
Copied: branches/dev-syncromind-2/rental/inc/class.uimovein.inc.php (from rev
16128, trunk/rental/inc/class.uimovein.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uimovein.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.uimovein.inc.php 2017-01-01
18:24:47 UTC (rev 16129)
@@ -0,0 +1,324 @@
+<?php
+ /**
+ * phpGroupWare - rental: 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 rental
+ * @subpackage movein
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('rental', 'movein', 'inc/model/');
+
+ class rental_uimovein extends phpgwapi_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ 'get' => true,
+ 'get_files' => true,
+ 'view_file'=> true
+ );
+ protected
+ $bo,
+ $fields,
+ $permissions,
+ $custom_fields;
+
+ public function __construct()
+ {
+ parent::__construct();
+ self::set_active_menu('rental::movein');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('movein');
+ $this->bo = createObject('rental.bomovein');
+ $this->fields = rental_movein::get_fields();
+ $this->permissions =
rental_movein::get_instance()->get_permission_array();
+ $this->custom_fields =
rental_movein::get_custom_fields();
+ }
+
+ public function index()
+ {
+ $function_msg = lang('movein');
+
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access($function_msg);
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ phpgwapi_jquery::load_widget('autocomplete');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
'rental.uimovein.index',
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => 'rental.uimovein.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' => 'rental.uimovein.view'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' => 'rental.uimovein.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('rental', 'rental',
'movein.index.js');
+ phpgwapi_jquery::load_widget('numberformat');
+
+ self::render_template_xsl('datatable_jquery', $data);
+ }
+
+ 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']))
+ {
+ $movein = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $movein = $this->bo->read_single($id);
+ }
+
+ $contract_id = $movein->contract_id ?
$movein->contract_id : phpgw::get_var('contract_id', 'int');
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('movein'),
+ 'link' => '#first_tab'
+ );
+// $tabs['signature'] = array(
+// 'label' => lang('signature'),
+// 'link' => '#signature'
+// );
+
+
+ $custom_values = $movein->attributes ?
$movein->attributes : array();
+
+ foreach ($custom_values as $attrib_id => &$attrib)
+ {
+ if (isset($attrib['choice']) &&
is_array($attrib['choice']) && $attrib['value'])
+ {
+ foreach ($attrib['choice'] as &$choice)
+ {
+ if (is_array($attrib['value']))
+ {
+ $choice['selected'] =
in_array($choice['id'], $attrib['value']) ? 1 : 0;
+ }
+ else
+ {
+ $choice['selected'] =
$choice['id'] == $attrib['value'] ? 1 : 0;
+ }
+ }
+ }
+ }
+
+ $organized_fields =
createObject('booking.custom_fields','rental')->organize_fields(rental_movein::acl_location,
$custom_values);
+ $file_def = array(
+ array('key' => 'file_name', 'label' =>
lang('Filename'), 'sortable' => false,
+ 'resizeable' => true),
+ array('key' => 'picture', 'label' =>
lang('picture'), 'sortable' => false,
+ 'resizeable' => true, 'formatter' =>
'JqueryPortico.showPicture'),
+ array('key' => 'delete_file', 'label' =>
lang('Delete file'), 'sortable' => false,
+ 'resizeable' => true, 'formatter' =>
'JqueryPortico.FormatterCenter'),
+ );
+
+ $datatable_def[] = array
+ (
+ 'container' => 'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'rental.uimovein.get_files',
+ 'id' => $id,
+ 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $file_def,
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
+ $comments = (array)$movein->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' => false, '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_1',
+ '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' =>
'rental.uimovein.save')),
+ 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimovein.index',)),
+ 'movein' => $movein,
+ 'contract' =>
createObject('rental.uicontract')->get($contract_id),
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab,
+ 'attributes_group' => $organized_fields,
+ );
+ phpgwapi_jquery::formvalidator_generate(array());
+ phpgwapi_jquery::load_widget('autocomplete');
+// self::add_javascript('phpgwapi', 'signature_pad',
'signature_pad.min.js');
+//
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/signature_pad/signature-pad.css');
+ $attributes_xsl = $mode == 'edit' ? 'attributes_form' :
'attributes_view';
+ self::add_javascript('rental', 'rental',
'movein.edit.js');
+ self::render_template_xsl(array('movein',
'contract_info', 'datatable_inline', $attributes_xsl), array($mode => $data));
+ }
+
+ /*
+ * Get the movein with the id given in the http variable 'id'
+ */
+
+ public function get( $id = 0 )
+ {
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = !empty($id) ? $id : phpgw::get_var('id', 'int');
+
+ $movein = $this->bo->read_single($id)->toArray();
+
+ unset($movein['secret']);
+
+ return $movein;
+ }
+
+ public function save()
+ {
+ parent::save();
+ }
+
+ /**
+ * (non-PHPdoc)
+ * @see phpgwapi/inc/phpgwapi_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"), "rental.uimovein.edit");
+
+ return $this->jquery_results($values);
+ }
+
+ public function view_file()
+ {
+ parent::view_file();
+ }
+
+ public function get_files()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = phpgw::get_var('id', 'int');
+ return parent::get_files('rental', 'movein',
'rental.uimovein.view_file', $id);
+ }
+ /**
+ * Store and / or delete files related to an entity
+ *
+ * @param int $id entity id
+ *
+ * @return void
+ */
+ protected function _handle_files( $id )
+ {
+ parent::_handle_files('rental', 'movein', $id);
+ }
+
+ }
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/inc/class.uimoveout.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uimoveout.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/class.uimoveout.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -21,17 +21,17 @@
* 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 moveout was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/ and Nordlandssykehuset
* @package rental
* @subpackage moveout
* @version $Id: $
*/
- phpgw::import_class('eventplanner.uicommon');
+ phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
include_class('rental', 'moveout', 'inc/model/');
- class rental_uimoveout extends eventplanner_uicommon
+ class rental_uimoveout extends phpgwapi_uicommon
{
public $public_functions = array(
@@ -41,7 +41,9 @@
'view' => true,
'edit' => true,
'save' => true,
- 'get' => true
+ 'get' => true,
+ 'get_files' => true,
+ 'view_file'=> true
);
protected
$bo,
@@ -57,7 +59,7 @@
$this->bo = createObject('rental.bomoveout');
$this->fields = rental_moveout::get_fields();
$this->permissions =
rental_moveout::get_instance()->get_permission_array();
- $this->custom_fields =
rental_moveout::get_instance()->get_custom_fields();
+ $this->custom_fields =
rental_moveout::get_custom_fields();
}
public function index()
@@ -152,13 +154,62 @@
$moveout = $this->bo->read_single($id);
}
+ $contract_id = $moveout->contract_id ?
$moveout->contract_id : phpgw::get_var('contract_id', 'int');
+
$tabs = array();
$tabs['first_tab'] = array(
'label' => lang('moveout'),
'link' => '#first_tab'
);
+// $tabs['signature'] = array(
+// 'label' => lang('signature'),
+// 'link' => '#signature'
+// );
+ $custom_values = $moveout->attributes ?
$moveout->attributes : array();
+ foreach ($custom_values as $attrib_id => &$attrib)
+ {
+ if (isset($attrib['choice']) &&
is_array($attrib['choice']) && $attrib['value'])
+ {
+ foreach ($attrib['choice'] as &$choice)
+ {
+ if (is_array($attrib['value']))
+ {
+ $choice['selected'] =
in_array($choice['id'], $attrib['value']) ? 1 : 0;
+ }
+ else
+ {
+ $choice['selected'] =
$choice['id'] == $attrib['value'] ? 1 : 0;
+ }
+ }
+ }
+ }
+
+ $organized_fields =
createObject('booking.custom_fields','rental')->organize_fields(rental_moveout::acl_location,
$custom_values);
+ $file_def = array(
+ array('key' => 'file_name', 'label' =>
lang('Filename'), 'sortable' => false,
+ 'resizeable' => true),
+ array('key' => 'picture', 'label' =>
lang('picture'), 'sortable' => false,
+ 'resizeable' => true, 'formatter' =>
'JqueryPortico.showPicture'),
+ array('key' => 'delete_file', 'label' =>
lang('Delete file'), 'sortable' => false,
+ 'resizeable' => true, 'formatter' =>
'JqueryPortico.FormatterCenter'),
+ );
+
+ $datatable_def[] = array
+ (
+ 'container' => 'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'rental.uimoveout.get_files',
+ 'id' => $id,
+ 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $file_def,
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
$comments = (array)$moveout->comments;
foreach ($comments as $key => &$comment)
{
@@ -168,13 +219,13 @@
$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' => 'value_date', 'label' =>
lang('Date'), 'sortable' => false, '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',
+ 'container' => 'datatable-container_1',
'requestUrl' => "''",
'ColumnDefs' => $comments_def,
'data' => json_encode($comments),
@@ -184,34 +235,12 @@
)
);
-
- $custom_values = $moveout->attributes ?
$moveout->attributes : array();
-
- foreach ($custom_values as $attrib_id => &$attrib)
- {
- if (isset($attrib['choice']) &&
is_array($attrib['choice']) && $attrib['value'])
- {
- foreach ($attrib['choice'] as &$choice)
- {
- if (is_array($attrib['value']))
- {
- $choice['selected'] =
in_array($choice['id'], $attrib['value']) ? 1 : 0;
- }
- else
- {
- $choice['selected'] =
$choice['id'] == $attrib['value'] ? 1 : 0;
- }
- }
- }
- }
- $organized_fields =
createObject('booking.custom_fields','rental')->organize_fields(rental_moveout::acl_location,
$custom_values);
-
$data = array(
'datatable_def' => $datatable_def,
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimoveout.save')),
'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'rental.uimoveout.index',)),
'moveout' => $moveout,
- 'contract' =>
createObject('rental.uicontract')->get($moveout->contract_id),
+ 'contract' =>
createObject('rental.uicontract')->get($contract_id),
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab,
@@ -219,8 +248,11 @@
);
phpgwapi_jquery::formvalidator_generate(array());
phpgwapi_jquery::load_widget('autocomplete');
+// self::add_javascript('phpgwapi', 'signature_pad',
'signature_pad.min.js');
+//
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/signature_pad/signature-pad.css');
+ $attributes_xsl = $mode == 'edit' ? 'attributes_form' :
'attributes_view';
self::add_javascript('rental', 'rental',
'moveout.edit.js');
- self::render_template_xsl(array('moveout',
'datatable_inline', 'attributes_form'), array($mode => $data));
+ self::render_template_xsl(array('moveout',
'contract_info', 'datatable_inline', $attributes_xsl), array($mode => $data));
}
/*
@@ -247,4 +279,45 @@
{
parent::save();
}
+
+ /**
+ * (non-PHPdoc)
+ * @see phpgwapi/inc/phpgwapi_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"), "rental.uimoveout.edit");
+
+ return $this->jquery_results($values);
+ }
+
+ public function view_file()
+ {
+ parent::view_file();
+ }
+
+ public function get_files()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = phpgw::get_var('id', 'int');
+ return parent::get_files('rental', 'moveout',
'rental.uimoveout.view_file', $id);
+ }
+ /**
+ * Store and / or delete files related to an entity
+ *
+ * @param int $id entity id
+ *
+ * @return void
+ */
+ protected function _handle_files( $id )
+ {
+ parent::_handle_files('rental', 'moveout', $id);
+ }
+
}
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -79,6 +79,8 @@
protected $bill_only_one_time;
protected $publish_comment;
protected $total_price_current_year;
+ protected $notify_on_expire;
+ protected $notified_time;
/**
* Constructor. Takes an optional ID. If a contract is
created from outside
@@ -1215,6 +1217,27 @@
$this->publish_comment = (bool)$publish_comment;
}
+ public function get_notify_on_expire()
+ {
+ return (int)$this->notify_on_expire;
+ }
+
+ public function set_notify_on_expire( $notify_on_expire )
+ {
+ $this->notify_on_expire = (int)$notify_on_expire;
+ }
+
+ public function get_notified_time()
+ {
+ return (int)$this->notified_time;
+ }
+
+ public function set_notified_time( $notified_time )
+ {
+ $this->notified_time = (int)$notified_time;
+ }
+
+
/**
* (non-PHPdoc)
* @see rental/inc/model/rental_model#validates()
Copied: branches/dev-syncromind-2/rental/inc/model/class.email_out.inc.php
(from rev 16128, trunk/rental/inc/model/class.email_out.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.email_out.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/model/class.email_out.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -0,0 +1,159 @@
+<?php
+ /**
+ * phpGroupWare - rental: 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 rental
+ * @subpackage email_out
+ * @version $Id: $
+ */
+
+ phpgw::import_class('rental.boemail_out');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class rental_email_out extends phpgwapi_model
+ {
+
+ const STATUS_PENDING = 1;
+ const STATUS_SENT = 2;
+ const STATUS_ERROR = 3;
+ const acl_location = '.email_out';
+
+ protected
+ $id,
+ $name,
+ $remark,
+ $subject,
+ $content,
+ $user_id,
+ $created,
+ $modified;
+
+
+ protected $field_of_responsibility_name = '.email_out';
+
+ 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 rental_email_out();
+ }
+
+ public static function get_status_list()
+ {
+ return array(
+ self::STATUS_PENDING => lang('pending'),
+ self::STATUS_SENT => lang('sent'),
+ self::STATUS_ERROR => lang('error')
+ );
+ }
+
+ public static function get_fields($debug = true)
+ {
+ $fields = array(
+ 'id' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'int',
+ 'label' => 'id',
+ 'sortable'=> true,
+ 'formatter' =>
'JqueryPortico.formatLink',
+ ),
+ 'name' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'name',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'subject' => array(
+ 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'subject',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'content' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'content',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'remark' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'label' => 'description',
+ 'sortable' => false,
+ ),
+ 'modified' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'modified',
+ 'sortable' => true,
+ )
+ );
+
+ if($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+ if(!property_exists('rental_email_out',
$field))
+ {
+
phpgwapi_cache::message_set('$'."{$field},", 'error');
+ }
+
+ }
+ }
+ return $fields;
+ }
+
+ /**
+ * Implement in subclasses to perform actions on entity before
validation
+ */
+ protected function preValidate( &$entity )
+ {
+ $entity->modified = time();
+ }
+
+
+ public function serialize()
+ {
+ return self::toArray();
+ }
+
+ public function store()
+ {
+ return rental_boemail_out::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
rental_boemail_out::get_instance()->read_single($id, true);
+ }
+ }
Copied: branches/dev-syncromind-2/rental/inc/model/class.movein.inc.php (from
rev 16128, trunk/rental/inc/model/class.movein.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.movein.inc.php
(rev 0)
+++ branches/dev-syncromind-2/rental/inc/model/class.movein.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -0,0 +1,222 @@
+<?php
+ /**
+ * phpGroupWare - rental: 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 rental
+ * @subpackage movein
+ * @version $Id: $
+ */
+
+ phpgw::import_class('rental.bomovein');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class rental_movein extends phpgwapi_model
+ {
+
+ const acl_location = '.movein';
+
+ protected
+ $id,
+ $contract_id,
+ $old_contract_id,
+ $created,
+ $modified,
+ $account_id,
+ $comments,
+ $comment,
+ $attributes,// custom fields
+ $values_attribute;// custom fields
+
+ protected $field_of_responsibility_name = '.movein';
+
+ 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 rental_movein();
+ }
+
+ public static function get_custom_fields()
+ {
+ static $custom_fields = array();
+ if(!$custom_fields)
+ {
+ $custom_fields =
$GLOBALS['phpgw']->custom_fields->find('rental', self::acl_location, 0, '',
'ASC', 'attrib_sort', true, true);
+ }
+ return $custom_fields;
+ }
+
+ public function get_organized_fields()
+ {
+ if (!$this->custom_fields)
+ {
+ $this->custom_fields =
createObject('booking.custom_fields',
'rental')->get_organized_fields(self::acl_location);
+ }
+ return $this->custom_fields;
+ }
+
+ public static function get_fields($debug = true)
+ {
+ $fields = array(
+ 'id' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'int',
+ 'label' => 'id',
+ 'sortable'=> true,
+ 'formatter' =>
'JqueryPortico.formatLink',
+ ),
+ 'created' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'modified' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'date',
+ 'label' => 'modified',
+ 'sortable' => true,
+ ),
+ 'account_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'label' => 'contract_id',
+ 'sortable' => true,
+ ),
+ 'contract_id' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'contract_id',
+ 'sortable' => true,
+ ),
+ 'old_contract_id' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'contract',
+ 'join' => array(
+ 'table' => 'rental_contract',
+ 'fkey' => 'contract_id',
+ 'key' => 'id',
+ 'column' => 'old_contract_id'
+ )
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'rental_movein_comment',
+ 'key' => 'movein_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('rental_movein',
$field))
+ {
+
phpgwapi_cache::message_set('$'."{$field},", 'error');
+ }
+
+ }
+ }
+
+ $custom_fields = self::get_custom_fields();
+
+ foreach ($custom_fields as $attrib_id => $attrtib)
+ {
+ $fields[$attrtib['name']] = array(
+ 'action'=> $attrtib['list'],
+ 'type' => $attrtib['datatype']
== 'D' || $attrtib['datatype'] == 'DT' ? 'datestring' : 'string',
+ 'label' =>
$attrtib['input_text'],
+ 'translated_label' =>
$attrtib['input_text'],
+ 'sortable' =>
!!$attrtib['attrib_sort'],
+ 'query' => !!$attrtib['search']
+ );
+ }
+ 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();
+ if(!$entity->get_id())
+ {
+ $entity->account_id =
(int)$GLOBALS['phpgw_info']['user']['account_id'];
+ }
+
+ }
+
+ protected function doValidate( $entity, &$errors )
+ {
+ $values =
rental_somovein::get_instance()->read(array('filters' => array('contract_id' =>
$entity->contract_id)));
+
+ //Duplicate
+ if(!$entity->get_id() &&!empty($values['results']))
+ {
+ $errors['contract_id'] = lang("report is
already recorded for %1", $entity->contract_id);
+ }
+ }
+
+ public function serialize()
+ {
+ return self::toArray();
+ }
+
+ public function store()
+ {
+ return rental_bomovein::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
rental_bomovein::get_instance()->read_single($id, true);
+ }
+ }
Modified: branches/dev-syncromind-2/rental/inc/model/class.moveout.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.moveout.inc.php
2017-01-01 18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/inc/model/class.moveout.inc.php
2017-01-01 18:24:47 UTC (rev 16129)
@@ -48,8 +48,6 @@
$attributes,// custom fields
$values_attribute;// custom fields
- static $custom_fields = array();
-
protected $field_of_responsibility_name = '.moveout';
public function __construct( int $id = null )
@@ -68,18 +66,14 @@
return new rental_moveout();
}
- public function set_custom_fields()
+ public static function get_custom_fields()
{
- $this->custom_fields =
$GLOBALS['phpgw']->custom_fields->find('rental', self::acl_location, 0, '',
'ASC', 'attrib_sort', true, true);
- }
-
- public function get_custom_fields()
- {
- if (!$this->custom_fields)
+ static $custom_fields = array();
+ if(!$custom_fields)
{
- $this->set_custom_fields();
+ $custom_fields =
$GLOBALS['phpgw']->custom_fields->find('rental', self::acl_location, 0, '',
'ASC', 'attrib_sort', true, true);
}
- return $this->custom_fields;
+ return $custom_fields;
}
public function get_organized_fields()
@@ -148,6 +142,7 @@
)
);
+
if($debug)
{
foreach ($fields as $field => $field_info)
@@ -159,6 +154,20 @@
}
}
+
+ $custom_fields = self::get_custom_fields();
+
+ foreach ($custom_fields as $attrib_id => $attrtib)
+ {
+ $fields[$attrtib['name']] = array(
+ 'action'=> $attrtib['list'],
+ 'type' => $attrtib['datatype']
== 'D' || $attrtib['datatype'] == 'DT' ? 'datestring' : 'string',
+ 'label' =>
$attrtib['input_text'],
+ 'translated_label' =>
$attrtib['input_text'],
+ 'sortable' =>
!!$attrtib['attrib_sort'],
+ 'query' => !!$attrtib['search']
+ );
+ }
return $fields;
}
@@ -176,10 +185,6 @@
'type' => 'comment'
);
}
- if (!empty($entity->moveout_organization_number))
- {
- $entity->moveout_organization_number =
str_replace(' ', '', $entity->moveout_organization_number);
- }
$entity->modified = time();
if(!$entity->get_id())
@@ -190,6 +195,18 @@
}
+ protected function doValidate( $entity, &$errors )
+ {
+ $values =
rental_somoveout::get_instance()->read(array('filters' => array('contract_id'
=> $entity->contract_id)));
+
+ //Duplicate
+ if(!$entity->get_id() &&!empty($values['results']))
+ {
+ $errors['contract_id'] = lang("report is
already recorded for %1", $entity->contract_id);
+ }
+ }
+
+
public function serialize()
{
return self::toArray();
Copied: branches/dev-syncromind-2/rental/js/rental/movein.edit.js (from rev
16128, trunk/rental/js/rental/movein.edit.js)
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/movein.edit.js
(rev 0)
+++ branches/dev-syncromind-2/rental/js/rental/movein.edit.js 2017-01-01
18:24:47 UTC (rev 16129)
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2016 hc483
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+var contract_id_selection;
+var lang;
+var oArgs = {menuaction: 'rental.uicontract.index', organization_number: true};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'contract_name', 'contract_id',
'contract_container', 'old_contract_id');
+
+$(window).on('load', function ()
+{
+ contract_id = $('#contract_id').val();
+ if (contract_id)
+ {
+ contract_id_selection = contract_id;
+ }
+ $("#contract_name").on("autocompleteselect", function (event, ui)
+ {
+ var contract_id = ui.item.value;
+ if (contract_id !== contract_id_selection)
+ {
+ populateContractParty(contract_id);
+ }
+ });
+});
+
+function populateContractParty(contract_id)
+{
+ contract_id = contract_id || $('#contract_id').val();
+
+ if (!contract_id)
+ {
+ return;
+ }
+ oArgs = {
+ menuaction: 'rental.uicontract.get',
+ id: contract_id
+ };
+
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+ var data = {};
+
+ JqueryPortico.execute_ajax(requestUrl,
+ function (result)
+ {
+
+ $("#executive_officer").html(result.executive_officer);
+ $("#composite").html(result.composite);
+ $("#rented_area").html(result.rented_area);
+ $("#security_amount").html(result.security_amount);
+ $("#date_start").html(result.date_start);
+ $("#date_end").html(result.date_end);
+ $("#type").html(result.type);
+ $("#party").html(result.party);
+ $("#identifier").html(result.identifier);
+ $("#mobile_phone").html(result.mobile_phone);
+ $("#department").html(result.department);
+ $("#contract_status").html(result.contract_status);
+ $("#rented_area").html(result.rented_area);
+ $("#term_label").html(result.term_label);
+
+ }, data, "POST", "json"
+ );
+}
+
+/*
+$(document).ready(function ()
+{
+
+ var wrapper = document.getElementById("signature-pad"),
+ clearButton = wrapper.querySelector("[data-action=clear]"),
+ saveButton = wrapper.querySelector("[data-action=save]"),
+ canvas = wrapper.querySelector("canvas"),
+ signaturePad;
+
+// Adjust canvas coordinate space taking into account pixel ratio,
+// to make it look crisp on mobile devices.
+// This also causes canvas to be cleared.
+ function resizeCanvas()
+ {
+ // When zoomed out to less than 100%, for some very strange
reason,
+ // some browsers report devicePixelRatio as less than 1
+ // and only part of the canvas is cleared then.
+ var ratio = Math.max(window.devicePixelRatio || 1, 1);
+ canvas.width = canvas.offsetWidth * ratio;
+ canvas.height = canvas.offsetHeight * ratio;
+ canvas.getContext("2d").scale(ratio, ratio);
+ }
+
+ window.onresize = resizeCanvas;
+ resizeCanvas();
+
+ signaturePad = new SignaturePad(canvas);
+
+ clearButton.addEventListener("click", function (event)
+ {
+ signaturePad.clear();
+ });
+
+ saveButton.addEventListener("click", function (event)
+ {
+ if (signaturePad.isEmpty())
+ {
+ alert("Please provide signature first.");
+ }
+ else
+ {
+ window.open(signaturePad.toDataURL());
+ }
+ });
+});
+ */
\ No newline at end of file
Modified: branches/dev-syncromind-2/rental/js/rental/moveout.edit.js
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/moveout.edit.js 2017-01-01
18:05:50 UTC (rev 16128)
+++ branches/dev-syncromind-2/rental/js/rental/moveout.edit.js 2017-01-01
18:24:47 UTC (rev 16129)
@@ -59,7 +59,7 @@
JqueryPortico.execute_ajax(requestUrl,
function (result)
{
-
+
$("#executive_officer").html(result.executive_officer);
$("#composite").html(result.composite);
$("#rented_area").html(result.rented_area);
@@ -78,3 +78,51 @@
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16129] Syncromind: Merge 16102:16128 from trunk,
sigurdne <=