[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16131] Stable: Merge 16100:16130 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16131] Stable: Merge 16100:16130 from trunk |
Date: |
Sun, 1 Jan 2017 18:58:29 +0000 (UTC) |
Revision: 16131
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16131
Author: sigurdne
Date: 2017-01-01 18:58:29 +0000 (Sun, 01 Jan 2017)
Log Message:
-----------
Stable: Merge 16100:16130 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/eventplanner/inc/class.boapplication.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bocustomer.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bogeneric.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.soapplication.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sobooking.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sogeneric.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uicustomer.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uigeneric.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uivendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.application.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
branches/Version-2_0-branch/mobilefrontend/inc/class.uifront.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.categories.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
branches/Version-2_0-branch/phpgwapi/inc/model/class.model.inc.php
branches/Version-2_0-branch/phpgwapi/setup/setup.inc.php
branches/Version-2_0-branch/phpgwapi/setup/tables_current.inc.php
branches/Version-2_0-branch/phpgwapi/setup/tables_update.inc.php
branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/navbar.inc.php
branches/Version-2_0-branch/property/inc/class.bogeneric_document.inc.php
branches/Version-2_0-branch/property/inc/class.multiuploader.inc.php
branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
branches/Version-2_0-branch/property/inc/class.uigeneric_document.inc.php
branches/Version-2_0-branch/property/inc/class.uiimport_components.inc.php
branches/Version-2_0-branch/property/inc/class.uitts.inc.php
branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
branches/Version-2_0-branch/property/js/portico/generic_document.edit.js
branches/Version-2_0-branch/property/js/portico/import_components.js
branches/Version-2_0-branch/property/js/portico/project.edit.js
branches/Version-2_0-branch/property/js/portico/workorder.edit.js
branches/Version-2_0-branch/property/templates/base/cat_sub_select.xsl
branches/Version-2_0-branch/property/templates/base/columns.xsl
branches/Version-2_0-branch/property/templates/base/condition_survey.xsl
branches/Version-2_0-branch/property/templates/base/import_components.xsl
branches/Version-2_0-branch/property/templates/base/multi_upload_file.xsl
branches/Version-2_0-branch/property/templates/base/project.xsl
branches/Version-2_0-branch/property/templates/base/workorder.xsl
branches/Version-2_0-branch/rental/inc/class.bomoveout.inc.php
branches/Version-2_0-branch/rental/inc/class.menu.inc.php
branches/Version-2_0-branch/rental/inc/class.socontract.inc.php
branches/Version-2_0-branch/rental/inc/class.sogeneric.inc.php
branches/Version-2_0-branch/rental/inc/class.somoveout.inc.php
branches/Version-2_0-branch/rental/inc/class.uicontract.inc.php
branches/Version-2_0-branch/rental/inc/class.uimoveout.inc.php
branches/Version-2_0-branch/rental/inc/model/class.contract.inc.php
branches/Version-2_0-branch/rental/inc/model/class.moveout.inc.php
branches/Version-2_0-branch/rental/js/rental/moveout.edit.js
branches/Version-2_0-branch/rental/setup/phpgw_no.lang
branches/Version-2_0-branch/rental/setup/setup.inc.php
branches/Version-2_0-branch/rental/setup/tables_current.inc.php
branches/Version-2_0-branch/rental/setup/tables_update.inc.php
branches/Version-2_0-branch/rental/templates/base/config.tpl
branches/Version-2_0-branch/rental/templates/base/contract.xsl
branches/Version-2_0-branch/rental/templates/base/moveout.xsl
Added Paths:
-----------
branches/Version-2_0-branch/mobilefrontend/rental/class.uimovein.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.bocommon.inc.php
branches/Version-2_0-branch/phpgwapi/js/signature_pad/
branches/Version-2_0-branch/rental/inc/class.boemail_out.inc.php
branches/Version-2_0-branch/rental/inc/class.bomovein.inc.php
branches/Version-2_0-branch/rental/inc/class.soemail_out.inc.php
branches/Version-2_0-branch/rental/inc/class.somovein.inc.php
branches/Version-2_0-branch/rental/inc/class.uiemail_out.inc.php
branches/Version-2_0-branch/rental/inc/class.uimovein.inc.php
branches/Version-2_0-branch/rental/inc/model/class.email_out.inc.php
branches/Version-2_0-branch/rental/inc/model/class.movein.inc.php
branches/Version-2_0-branch/rental/js/rental/movein.edit.js
branches/Version-2_0-branch/rental/templates/base/contract_info.xsl
branches/Version-2_0-branch/rental/templates/base/email_out.xsl
branches/Version-2_0-branch/rental/templates/base/movein.xsl
Removed Paths:
-------------
branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
Property Changed:
----------------
branches/Version-2_0-branch/
branches/Version-2_0-branch/booking/
branches/Version-2_0-branch/bookingfrontend/
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-15891
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099
+ /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-16129
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130
Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind-2/booking:14933-15891
/branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569,15585-15617,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055
+ /branches/dev-syncromind-2/booking:14933-16129
/branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569,15585-15617,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055,16101-16130
Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/dev-syncromind-2/bookingfrontend:14933-15891
/branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335,15585-15617,15621-15630,15714-15764,15813-15814,15820-15849,15889-15900,15902-16046
+ /branches/dev-syncromind-2/bookingfrontend:14933-16129
/branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335,15585-15617,15621-15630,15714-15764,15813-15814,15820-15849,15889-15900,15902-16046,16101-16130
Modified:
branches/Version-2_0-branch/eventplanner/inc/class.boapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.boapplication.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.boapplication.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bocustomer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bocustomer.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bocustomer.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bogeneric.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bogeneric.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.soapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.soapplication.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.soapplication.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.sobooking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sobooking.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sobooking.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sogeneric.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sogeneric.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sovendor.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uicustomer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uicustomer.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uicustomer.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uigeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uigeneric.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uigeneric.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uivendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uivendor.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uivendor.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/model/class.application.inc.php
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/model/class.application.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++
branches/Version-2_0-branch/eventplanner/inc/model/class.application.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/helpdesk/inc/class.sogeneric.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/mobilefrontend/inc/class.uifront.inc.php
===================================================================
--- branches/Version-2_0-branch/mobilefrontend/inc/class.uifront.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/mobilefrontend/inc/class.uifront.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/mobilefrontend/rental/class.uimovein.inc.php (from
rev 16130, trunk/mobilefrontend/rental/class.uimovein.inc.php)
===================================================================
--- branches/Version-2_0-branch/mobilefrontend/rental/class.uimovein.inc.php
(rev 0)
+++ branches/Version-2_0-branch/mobilefrontend/rental/class.uimovein.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.bocommon.inc.php (from
rev 16130, trunk/phpgwapi/inc/class.bocommon.inc.php)
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.bocommon.inc.php
(rev 0)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.bocommon.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.categories.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.categories.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.categories.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.uicommon.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -1105,7 +1105,9 @@
$data = array ();
}
- $string = preg_replace ("/'/", "/\'/", $data['string']);
+ //$string = preg_replace ("/'/", "/\'/",
$data['string']);
+ $string =
$GLOBALS['phpgw']->db->db_addslashes($data['string']);
+
return $string;
}
Modified: branches/Version-2_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -1157,7 +1157,7 @@
(
'owner_id' => $this->working_id,
'directory' => $p->fake_leading_dirs_clean,
- 'name' => $p->fake_name_clean
+ 'name' => $p->fake_name
);
$cols = implode(',', array_keys($value_set));
@@ -1167,7 +1167,7 @@
$query = $GLOBALS['phpgw']->db->query($sql, __LINE__,
__FILE__);
$last_insert_id =
$GLOBALS['phpgw']->db->get_last_insert_id('phpgw_vfs', 'file_id');
-
+
$this->set_attributes(array(
'string' => $p->fake_full_path,
'relatives' => array($p->mask),
@@ -1780,7 +1780,7 @@
{
throw new Exception('nothing to copy from');
}
-
+
if(!is_array($data))
{
$data = array();
@@ -1919,7 +1919,7 @@
'relatives' =>
array($data['relatives'][0])
)
);
-
+
if(!$this->acl_check(array(
'string' =>
$p->fake_full_path,
'relatives' =>
array($p->mask),
@@ -1942,12 +1942,17 @@
}
}
- $file_name = $t->fake_leading_dirs
.'/'.$data['id'].'_#' .$t->fake_name_clean;
+ $file_name = $t->fake_leading_dirs
.'/'.$data['id'].'_#' .$t->fake_name;
$t2 = $this->path_parts(array(
'string' =>
$file_name,
'relatives' =>
array($data['relatives'][1])
)
- );
+ );
+
+ if (!$this->fileoperation->rename($t,
$t2))
+ {
+ return false;
+ }
$query =
$GLOBALS['phpgw']->db->query("UPDATE phpgw_vfs SET
owner_id='{$this->working_id}',"
. "
directory='{$t2->fake_leading_dirs_clean}',"
@@ -1999,7 +2004,7 @@
{
if($this->file_actions)
{
- $new_name =
$t->fake_leading_dirs .'/'.$file_id.'_#' .$t->fake_name_clean;
+ $new_name =
$t->fake_leading_dirs .'/'.$file_id.'_#' .$t->fake_name;
$t2 =
$this->path_parts(array(
'string' => $new_name,
Modified: branches/Version-2_0-branch/phpgwapi/inc/model/class.model.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/model/class.model.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/inc/model/class.model.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -283,7 +283,7 @@
/**
* Implement in subclasses
*/
- public function get_custom_fields()
+ public static function get_custom_fields()
{
return array();
}
Modified: branches/Version-2_0-branch/phpgwapi/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/setup/setup.inc.php 2017-01-01
18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/setup/setup.inc.php 2017-01-01
18:58:29 UTC (rev 16131)
@@ -12,7 +12,7 @@
// Basic information about this app
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
- $setup_info['phpgwapi']['version'] = '0.9.17.552';
+ $setup_info['phpgwapi']['version'] = '0.9.17.553';
$setup_info['phpgwapi']['versions']['current_header'] = '1.31';
$setup_info['phpgwapi']['versions']['system'] = '2.0';
$setup_info['phpgwapi']['enable'] = 3;
Modified: branches/Version-2_0-branch/phpgwapi/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/setup/tables_current.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/setup/tables_current.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -291,6 +291,7 @@
'version' => array('type' =>
'varchar','precision' => 30,'nullable' => False,'default' => '0.0.0.0'),
'content' => array('type' => 'text','nullable'
=> True),
'external_id' => array('type' =>
'int','precision' => 8,'nullable' => True),
+ 'md5_sum' => array('type' =>
'varchar','precision' => '64','nullable' => True),
),
'pk' => array('file_id'),
'fk' => array(),
Modified: branches/Version-2_0-branch/phpgwapi/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/setup/tables_update.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/setup/tables_update.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -3428,3 +3428,31 @@
return $GLOBALS['setup_info']['phpgwapi']['currentver'];
}
}
+
+ $test[] = '0.9.17.552';
+ /**
+ * Alter column definition
+ * @return string the new version number
+ */
+ function phpgwapi_upgrade0_9_17_552()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $metadata =
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('phpgw_vfs');
+
+ if(empty($metadata['md5_sum']))
+ {
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_vfs','md5_sum', array(
+ 'type' => 'varchar',
+ 'precision' => 64,
+ 'nullable' => true
+ ));
+
+ }
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['phpgwapi']['currentver'] =
'0.9.17.553';
+ return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+ }
+ }
Modified: branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
===================================================================
--- branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/phpgwapi/templates/mobilefrontend/navbar.inc.php
===================================================================
---
branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/navbar.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++
branches/Version-2_0-branch/phpgwapi/templates/mobilefrontend/navbar.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/inc/class.bogeneric_document.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bogeneric_document.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.bogeneric_document.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -61,9 +61,9 @@
return json_decode($values);
}
- function get_file_relations( $location_id, $file_id )
+ function get_file_relations( $file_id, $location_id )
{
- $values = $this->so->get_file_relations($location_id,
$file_id);
+ $values = $this->so->get_file_relations($file_id,
$location_id);
return $values;
}
@@ -87,10 +87,10 @@
return $receipt;
}
- function save_file_relations( $items = array(), $location_id,
$file_id )
+ function save_file_relations( $add, $delete, $location_id,
$file_id )
{
- $receipt = $this->so->save_file_relations( $items,
$location_id, $file_id );
+ $receipt = $this->so->save_file_relations( $add,
$delete, $location_id, $file_id );
return $receipt;
}
Modified: branches/Version-2_0-branch/property/inc/class.multiuploader.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.multiuploader.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.multiuploader.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -348,4 +348,42 @@
return $this->generate_response($response,
$print_response);
}
+ public function generate_response($content, $print_response =
true) {
+ $this->response = $content;
+
+ if ($print_response)
+ {
+ $content_files =
scandir($this->options['upload_dir']);
+ $count_files = 0;
+ foreach($content_files as $key => $value)
+ {
+ $path =
realpath($this->options['upload_dir'].'/'.$value);
+ if(is_file($path))
+ {
+ $count_files ++;
+ }
+ }
+ $content['num_files'] = $count_files;
+
+ $json = json_encode($content);
+ $redirect =
stripslashes($this->get_post_param('redirect'));
+ if ($redirect &&
preg_match($this->options['redirect_allow_target'], $redirect)) {
+ $this->header('Location:
'.sprintf($redirect, rawurlencode($json)));
+ return;
+ }
+ $this->head();
+ if
($this->get_server_var('HTTP_CONTENT_RANGE')) {
+ $files =
isset($content[$this->options['param_name']]) ?
+
$content[$this->options['param_name']] : null;
+ if ($files && is_array($files) &&
is_object($files[0]) && $files[0]->size) {
+ $this->header('Range: 0-'.(
+
$this->fix_integer_overflow((int)$files[0]->size) - 1
+ ));
+ }
+ }
+ $this->body($json);
+ }
+ return $content;
+ }
+
}
\ No newline at end of file
Modified:
branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -167,9 +167,14 @@
return $values;
}
- public function get_file_relations($location_id, $file_id)
+ public function get_file_relations($file_id, $location_id =
null)
{
- $filtermethod = "WHERE location_id = {$location_id} AND
file_id = {$file_id}";
+ if ($location_id)
+ {
+ $filtermethod = "WHERE location_id =
{$location_id} AND file_id = {$file_id}";
+ } else {
+ $filtermethod = "WHERE file_id = {$file_id}";
+ }
$sql = "SELECT * FROM phpgw_vfs_file_relation " ."
{$filtermethod} ";
$this->db->query($sql, __LINE__, __FILE__);
@@ -188,18 +193,24 @@
return $values;
}
- function save_file_relations( $items = array(), $location_id,
$file_id )
+ function save_file_relations( $add, $delete, $location_id,
$file_id )
{
$this->db->transaction_begin();
- $this->db->query("DELETE FROM phpgw_vfs_file_relation
WHERE file_id = {$file_id} AND location_id = {$location_id}", __LINE__,
__FILE__);
-
+ if (count($delete))
+ {
+ foreach($delete as $item)
+ {
+ $this->db->query("DELETE FROM
phpgw_vfs_file_relation WHERE location_item_id = {$item} AND file_id =
{$file_id} AND location_id = {$location_id}", __LINE__, __FILE__);
+ }
+ }
+
$date_format =
phpgwapi_datetime::date_array(date('Y-m-d'));
$date = mktime(2, 0, 0, $date_format['month'],
$date_format['day'], $date_format['year']);
- if (count($items))
+ if (count($add))
{
- foreach($items as $item)
+ foreach($add as $item)
{
$values_insert = array
(
@@ -235,11 +246,11 @@
$values_insert = array
(
'file_id' => $file_id,
- 'metadata' => json_encode($data)
+ 'metadata' => "'" . json_encode($data) . "'"
);
$result = $this->db->query("INSERT INTO
phpgw_vfs_filedata (" . implode(',', array_keys($values_insert)) . ') VALUES ('
- .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
+ . implode(",", array_values($values_insert)) .
')', __LINE__, __FILE__);
if ($result)
{
Modified: branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -2857,4 +2857,4 @@
$this->db->transaction_commit();
return $_last_line_id;
}
- }
\ No newline at end of file
+ }
Modified:
branches/Version-2_0-branch/property/inc/class.uigeneric_document.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uigeneric_document.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.uigeneric_document.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -119,7 +119,7 @@
self::add_javascript('phpgwapi', 'jquery',
'editable/jquery.dataTables.editable.js');
$categories = $this->_get_categories();
-
+
$data = array(
'datatable_name' => lang('generic document'),
'form' => array(
@@ -228,7 +228,7 @@
'parameters' => json_encode($parameters)
);
}
-
+
self::render_template_xsl('datatable_jquery', $data);
}
@@ -259,13 +259,13 @@
{
return $values;
}
-
+
foreach($values as &$item)
- {
+ {
$item['name'] = '<a
href="'.self::link(array('menuaction' =>
'property.uigeneric_document.view_file', 'file_id' =>
$item['id'])).'">'.$item['name'].'</a>';
$item['link'] = self::link(array('menuaction'
=> 'property.uigeneric_document.view', 'id' => $item['id']));
}
-
+
$result_data = array('results' => $values);
$result_data['total_records'] =
$this->bo->total_records;
@@ -284,12 +284,11 @@
{
$type_id = 1;
}
-
+
$search = phpgw::get_var('search');
$order = phpgw::get_var('order');
$draw = phpgw::get_var('draw', 'int');
$columns = phpgw::get_var('columns');
- $mode = phpgw::get_var('mode');
$params = array(
'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
@@ -301,16 +300,16 @@
'type_id' => $type_id,
'district_id' => phpgw::get_var('district_id',
'int', 'REQUEST', 0),
'part_of_town_id' =>
phpgw::get_var('part_of_town_id', 'int', 'REQUEST', 0),
- 'allrows' => phpgw::get_var('length', 'int') ==
-1
+ 'allrows' => ($only_related) ? 1 :
(phpgw::get_var('length', 'int') == -1)
);
-
+
$solocation = CreateObject('property.solocation');
$locations = $solocation->read($params);
$location_id =
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$type_id}");
if ($file_id)
{
- $relation_values =
$this->bo->get_file_relations($location_id, $file_id);
+ $relation_values =
$this->bo->get_file_relations($file_id, $location_id);
}
$values_location_item_id = array();
if (count($relation_values))
@@ -320,32 +319,23 @@
$values_location_item_id[] =
$item['location_item_id'];
}
}
-
+
$values = array();
foreach($locations as $item)
{
- if($mode == 'edit')
- {
- $checked = in_array($item['id'],
$values_location_item_id) ? ' checked="checked"' : '';
- $relate = "<input value='{$item['id']}'
class='components mychecks' type='checkbox'{$checked}>";
+ $checked = in_array($item['id'],
$values_location_item_id) ? 'checked="checked"' : '';
+ $hidden = ($checked) ? '<input type="hidden"
class="locations_related" value="'.$item['id'].'">' : '';
- }
- else
- {
- $relate = in_array($item['id'],
$values_location_item_id) ? 'X' : '';
- $checked = $relate;
- }
-
if ($only_related && empty($checked))
{
continue;
}
-
+
$values[] = array(
'location_code' => '<a
href="'.self::link(array('menuaction' => 'property.uilocation.view',
'location_code' => $item['location_code'])).'">'.$item['location_code'].'</a>',
'loc1_name' => $item['loc1_name'],
- 'relate' => $relate
- );
+ 'relate' => '<input
value="'.$item['id'].'" class="locations mychecks" type="checkbox"
'.$checked.'>'.$hidden
+ );
}
$result_data = array('results' => $values);
@@ -355,7 +345,7 @@
return $this->jquery_results($result_data);
}
-
+
public function view()
{
if (!$this->acl_read)
@@ -383,7 +373,7 @@
public function edit( $values = array(), $mode = 'edit' )
{
$id = isset($values['id']) && $values['id'] ?
$values['id'] : phpgw::get_var('id', 'int');
-
+
if (!$this->acl_add && !$this->acl_edit)
{
$GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'property.uigeneric_document.view',
@@ -415,23 +405,23 @@
{
if (!$values)
{
- $values = (array)
$this->bo->read_single($id);
- $values['report_date'] =
($values['report_date']) ? date($this->dateFormat, $values['report_date']) :
'';
+ $values = (array)
$this->bo->read_single($id);
+ $values['report_date'] =
($values['report_date']) ? date($this->dateFormat, $values['report_date']) : '';
}
$values['id'] = $id;
}
-
+
$categories = $this->_get_categories($values['cat_id']);
self::message_set($this->receipt);
-
+
$datatable_def = array();
-
+
if ($id)
{
$tabs['relations'] = array('label' =>
lang('Components'), 'link' => '#relations');
$tabs['locations'] = array('label' =>
lang('Locations'), 'link' => '#locations');
-
+
$related_def = array
(
array('key' => 'id', 'label' =>
lang('id'), 'sortable' => false, 'resizeable' => true),
@@ -441,14 +431,14 @@
$values_location = $this->get_location_filter();
$entity_group =
execMethod('property.bogeneric.get_list', array('type' => 'entity_group',
'add_empty' => true));
- $type_filter =
execMethod('property.soadmin_location.read', array());
+ $type_filter =
execMethod('property.soadmin_location.read', array());
$category_filter =
$this->get_categories_for_type();
-
+
$district_filter =
$this->bocommon->select_district_list('filter');
array_unshift($district_filter, array('id' =>
'', 'name' => lang('no district')));
-
+
$part_of_town_filter =
$this->get_part_of_town();
-
+
$tabletools[] = array
(
'my_name' => 'relate',
@@ -470,11 +460,11 @@
(
'container' => 'datatable-container_0',
'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'property.uigeneric_document.get_componentes',
- 'id' => $id,
'location_id' => $values_location[0]['id'], 'mode' => $mode, 'phpgw_return_as'
=> 'json'))),
+ 'id' => $id,
'location_id' => $values_location[0]['id'], 'phpgw_return_as' => 'json'))),
'ColumnDefs' => $related_def,
'tabletools' => ($mode == 'edit') ?
$tabletools : array()
);
-
+
$related_def2 = array
(
array('key' => 'location_code', 'label'
=> lang('location'), 'sortable' => true, 'resizeable' => true),
@@ -482,7 +472,7 @@
//array('key' => 'location_id', 'label'
=> lang('location id'), 'sortable' => false, 'resizeable' => true, 'hidden' =>
true),
array('key' => 'relate', 'label' =>
lang('related'), 'sortable' => false, 'resizeable' => true),
);
-
+
$tabletools2[] = array
(
'my_name' => 'relate_locations',
@@ -497,19 +487,19 @@
setRelationsLocations(oArgs);
"
);
-
+
$datatable_def[] = array
(
'container' => 'datatable-container_1',
- 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'property.uigeneric_document.get_locations_for_type', 'id' => $id, 'mode' =>
$mode, 'phpgw_return_as' => 'json'))),
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'property.uigeneric_document.get_locations_for_type', 'id' => $id,
'phpgw_return_as' => 'json'))),
'ColumnDefs' => $related_def2,
'tabletools' => ($mode == 'edit') ?
$tabletools2 : array()
- );
+ );
}
-
+
$vfs = CreateObject('phpgwapi.vfs');
$file_info = $vfs->get_info($id);
-
+
$data = array
(
'datatable_def' => $datatable_def,
@@ -523,12 +513,12 @@
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'location_filter' => array('options' =>
$values_location),
'entity_group_filter' => array('options' =>
$entity_group),
-
+
'type_filter' => array('options' =>
$type_filter),
'category_filter' => array('options' =>
$category_filter),
'district_filter' => array('options' =>
$district_filter),
'part_of_town_filter' => array('options' =>
$part_of_town_filter),
-
+
'link_controller_example' =>
self::link(array('menuaction' => 'controller.uicomponent.index'))
);
@@ -559,7 +549,7 @@
{
$type_id = 1;
}
-
+
$categories =
$this->bocommon->select_category_list(array
('format' => 'filter',
'selected' => '',
@@ -571,7 +561,7 @@
return $categories;
}
-
+
public function get_part_of_town()
{
$district_id = phpgw::get_var('district_id', 'int');
@@ -580,11 +570,11 @@
return $values;
}
-
+
public function get_location_filter()
{
$entity_group_id = phpgw::get_var('entity_group_id',
'int');
-
+
$location_filter =
phpgwapi_cache::session_get('property', "location_filter_{$entity_group_id}");
if (!$location_filter)
@@ -670,8 +660,8 @@
return;
}
}
-
- if ($receipt['message'])
+
+ if ($receipt['message'])
{
phpgwapi_cache::message_set($receipt['message'], 'message');
} else {
@@ -695,20 +685,19 @@
{
return;
}
-
+
$file_id = phpgw::get_var('id', 'int');
$location_id = phpgw::get_var('location_id', 'int');
$search = phpgw::get_var('search');
- $mode = phpgw::get_var('mode');
$draw = phpgw::get_var('draw', 'int');
$only_related = phpgw::get_var('only_related',
'boolean');
-
+
$soentity = CreateObject('property.soentity');
$_components = $soentity->read( array(
'start' => phpgw::get_var('start', 'int', 'REQUEST', 0),
'results' => phpgw::get_var('length', 'int', 'REQUEST', 0),
'query' => $search['value'],
- 'allrows' => phpgw::get_var('length', 'int') == -1,
+ 'allrows' => ($only_related) ? 1 : (phpgw::get_var('length',
'int') == -1),
'filter_entity_group' => 0,
'location_id' => $location_id,
'filter_item' => array()
@@ -716,7 +705,7 @@
if ($file_id)
{
- $relation_values =
$this->bo->get_file_relations($location_id, $file_id);
+ $relation_values =
$this->bo->get_file_relations($file_id, $location_id );
}
$values_location_item_id = array();
if (count($relation_values))
@@ -726,34 +715,25 @@
$values_location_item_id[] =
$item['location_item_id'];
}
}
-
+
$values = array();
foreach($_components as $item)
{
- if($mode == 'edit')
- {
- $checked = in_array($item['id'],
$values_location_item_id) ? ' checked="checked"' : '';
- $relate = "<input value='{$item['id']}'
class='components mychecks' type='checkbox'{$checked}>";
+ $checked = in_array($item['id'],
$values_location_item_id) ? 'checked="checked"' : '';
+ $hidden = ($checked) ? '<input type="hidden"
class="components_related" value="'.$item['id'].'">' : '';
- }
- else
- {
- $relate = in_array($item['id'],
$values_location_item_id) ? 'X' : '';
- $checked = $relate;
- }
-
if ($only_related && empty($checked))
{
continue;
}
-
+
$values[] = array(
'id' => '<a
href="'.self::link(array('menuaction' => 'property.uientity.view',
'location_id' => $location_id, 'id' => $item['id'])).'">'.$item['id'].'</a>',
'name' => $item['benevnelse'],
- 'relate' => $relate
+ 'relate' => '<input
value="'.$item['id'].'" class="components mychecks" type="checkbox"
'.$checked.'>'.$hidden,
);
}
-
+
$result_data = array('results' => $values);
$result_data['total_records'] = ($only_related) ?
count($values_location_item_id) : $soentity->total_records;
@@ -762,23 +742,27 @@
return $this->jquery_results($result_data);
}
-
+
public function save_file_relations()
{
$receipt = array();
-
+
$type_id = phpgw::get_var('type_id', 'int');
$location_id = phpgw::get_var('location_id', 'int');
$file_id = phpgw::get_var('file_id', 'int');
- $items = phpgw::get_var('items');
-
+ $items = phpgw::get_var('items', 'array', 'REQUEST',
array());
+ $related = phpgw::get_var('related', 'array',
'REQUEST', array());
+
+ $add = array_diff($items, $related);
+ $delete = array_diff($related, $items);
+
if (empty($location_id))
{
$location_id =
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$type_id}");
}
-
- $result = $this->bo->save_file_relations( $items,
$location_id, $file_id );
-
+
+ $result = $this->bo->save_file_relations( $add,
$delete, $location_id, $file_id );
+
if ($result)
{
$receipt['message'][] = array('msg' =>
lang('Records has been added'));
@@ -787,11 +771,11 @@
{
$receipt['error'][] = array('msg' =>
lang('Nothing changed'));
}
-
+
return $receipt;
}
-
+
/**
* Dowloads a single file to the browser
*
@@ -827,9 +811,9 @@
throw new Exception('Failed to upload
file !');
}
}
-
+
$bofiles = CreateObject('property.bofiles');
-
+
$file_name = str_replace(' ', '_',
$_FILES['file']['name']);
if ($file_name)
@@ -851,19 +835,19 @@
throw new Exception('failed to
create directory');
}
$bofiles->vfs->override_acl = 1;
-
+
$file_id = $bofiles->vfs->cp3(array(
'from' =>
$_FILES['file']['tmp_name'],
'to' => $to_file,
'id' => $id,
'relatives' =>
array(RELATIVE_NONE | VFS_REAL, RELATIVE_ALL)));
$bofiles->vfs->override_acl = 0;
-
+
if (empty($file_id))
- {
+ {
throw new Exception('Failed to
upload file !');
- }
-
+ }
+
return $file_id;
//}
} else {
Modified:
branches/Version-2_0-branch/property/inc/class.uiimport_components.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiimport_components.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.uiimport_components.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -118,22 +118,24 @@
return chr(65 + $index);
}
}
-
+
public function import_component_files()
{
- /*$location_code =
phpgwapi_cache::session_get('property', 'location_code');
- $id = phpgwapi_cache::session_get('property',
'location_item_id');
- $attrib_name_componentID =
phpgwapi_cache::session_get('property', 'attrib_name_componentID');*/
-
$location_code = phpgw::get_var('location_code');
$id = phpgw::get_var('location_item_id');
$attrib_name_componentID =
phpgw::get_var('attribute_name_component_id');
+ $preview = phpgw::get_var('preview');
+ $with_components =
phpgw::get_var('with_components_check');
- if (!$attrib_name_componentID)
+ /*if ($_FILES['file']['tmp_name'])
{
- $receipt['error'][] = array('msg' =>
lang('Choose attribute name for Component ID'));
- return $receipt;
- }
+ if (!$attrib_name_componentID)
+ {
+ $receipt['error'][] = array('msg' =>
lang('Choose attribute name for Component ID'));
+ return $receipt;
+ }
+ }*/
+
if (!$location_code)
{
$receipt['error'][] = array('msg' =>
lang('Choose Location'));
@@ -141,8 +143,20 @@
}
$import_component_files = new import_component_files();
- $receipt = $import_component_files->add_files($id,
$location_code, $attrib_name_componentID);
+ if ($preview)
+ {
+ $receipt = $import_component_files->preview();
+ return $receipt;
+ }
+
+ if ($with_components)
+ {
+ $receipt =
$import_component_files->add_files_components_location($id, $location_code,
$attrib_name_componentID);
+ } else {
+ $receipt =
$import_component_files->add_files_location($id, $location_code);
+ }
+
return $receipt;
}
Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -1520,7 +1520,7 @@
{
if ($e)
{
- throw $e;
+
phpgwapi_cache::message_set($e->getMessage(), 'error');
}
}
Modified: branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/inc/class.uiworkorder.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
===================================================================
---
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-01-01 18:51:30 UTC (rev 16130)
+++
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
===================================================================
---
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-01-01 18:51:30 UTC (rev 16130)
+++
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
===================================================================
---
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
2017-01-01 18:51:30 UTC (rev 16130)
+++
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
2017-01-01 18:58:29 UTC (rev 16131)
@@ -1,7 +1,9 @@
<?php
-
+
class import_component_files
{
+ private $receipt = array();
+
public function __construct()
{
$this->acl = & $GLOBALS['phpgw']->acl;
@@ -9,8 +11,11 @@
$this->fakebase = '/temp_files_components';
$this->path_upload_dir =
$GLOBALS['phpgw_info']['server']['files_dir'].$this->fakebase.'/';
-
- $this->latest_uploads = array();
+
+ $this->last_files_added = array();
+ $this->list_component_id = array();
+ $this->paths_from_file = array();
+ $this->paths_empty = array();
}
public function get_path_upload_dir()
@@ -50,7 +55,7 @@
private function _valid_row($row)
{
- if (empty($row[0]) && empty($row[(count($row)-1)]))
+ if (empty($row[(count($row)-1)]))
{
return false;
}
@@ -65,7 +70,7 @@
private function _get_files_by_component($id, $location_id)
{
- $sql = "SELECT a.location_id, a.location_item_id,
b.file_id, b.name FROM phpgw_vfs_file_relation a INNER JOIN phpgw_vfs b "
+ $sql = "SELECT a.location_id, a.location_item_id,
b.file_id, b.name, b.md5_sum FROM phpgw_vfs_file_relation a INNER JOIN
phpgw_vfs b "
. " ON a.file_id = b.file_id WHERE
a.location_item_id = '{$id}' AND a.location_id = '{$location_id}'"
. " AND b.mime_type != 'Directory' AND
b.mime_type != 'journal' AND b.mime_type != 'journal-deleted'";
@@ -76,16 +81,16 @@
while ($this->db->next_record())
{
$healthy = $this->db->f('file_id').'_#';
- $values[] = trim(str_replace($healthy, '',
$this->db->f('name')));
+ $values[] =
$this->db->f('md5_sum').'_'.trim(str_replace($healthy, '',
$this->db->f('name')));
}
return $values;
}
- private function _search_in_latest_uploads($file)
+ private function _search_in_last_files_added($file_data)
{
- $file_name = str_replace(' ', '_', $file);
- $file_id = array_search($file_name,
$this->latest_uploads);
+ $val_md5sum = $file_data['val_md5sum'];
+ $file_id = array_search($val_md5sum,
$this->last_files_added);
if ($file_id)
{
return $file_id;
@@ -94,54 +99,418 @@
return false;
}
- private function _search_file_in_db($file)
- {
- $file_name = str_replace(' ', '_', $file);
+ public function add_files_location($id, $location_code)
+ {
+ @set_time_limit(5 * 60);
- $sql = "SELECT file_id, name FROM phpgw_vfs "
- . " WHERE name LIKE '%{$file_name}'"
- . " AND mime_type != 'Directory' AND
mime_type != 'journal' AND mime_type != 'journal-deleted'";
+ $message = array();
+
+ $uploaded_files =
phpgwapi_cache::session_get('property', 'import_data');
+ $this->paths_from_file =
phpgwapi_cache::session_get('property', 'paths_from_file');
+
+ $count_new_relations = 0;
+ $count_relations_existing = 0;
+ $count_new_files = 0;
+
//print_r($this->paths_from_file).'<br>'.print_r($uploaded_files); die;
+ $component = array('id' => $id, 'location_id' =>
$GLOBALS['phpgw']->locations->get_id('property',
'.location.'.count(explode('-', $location_code))));
- $this->db->query($sql, __LINE__, __FILE__);
+ $files_in_component =
$this->_get_files_by_component($component['id'], $component['location_id']);
- $value = array();
+ foreach ($uploaded_files as $file_data)
+ {
+ if (in_array(str_replace(' ', '_',
$file_data['val_md5sum']), $files_in_component))
+ {
+ $count_relations_existing++;
+ continue;
+ }
- if ($this->db->next_record())
+ $this->db->transaction_begin();
+ try
+ {
+ $this->db->Exception_On_Error = true;
+
+ $file = $file_data['file'];
+
+ $file_id =
$this->_search_in_last_files_added($file_data);
+ if (!$file_id)
+ {
+ $file_id =
$this->_save_file($file_data);
+ if (!$file_id)
+ {
+ throw new
Exception("failed to copy file '{$file_data['path_file']}'");
+ }
+ unlink($file_data['path_file']);
+ $count_new_files++;
+ }
+
+ $result =
$this->_save_file_relation($component['id'], $component['location_id'],
$file_id);
+ if (!$result)
+ {
+ $message['error'][] =
array('msg' => "failed to save relation. File: '{$file}'");
+ } else {
+ $count_new_relations++;
+ }
+
+ $this->db->Exception_On_Error = false;
+ }
+ catch (Exception $e)
+ {
+ if ($e)
+ {
+ $this->db->transaction_abort();
+ if ($e->getMessage())
+ {
+ $message['error'][] =
array('msg' => $e->getMessage());
+ }
+ continue;
+ }
+ }
+ $this->db->transaction_commit();
+ }
+
+ if ($count_new_files)
{
- $value['file_id'] = $this->db->f('file_id');
- $value['name'] = $this->db->f('name');
+ $message['message'][] = array('msg' => lang('%1
files copy successfully', $count_new_files));
+ } else {
+ $message['message'][] = array('msg' => lang('%1
files copy', $count_new_files));
}
+ if ($count_new_relations)
+ {
+ $message['message'][] = array('msg' => lang('%1
relations saved successfully', $count_new_relations));
+ } else {
+ $message['message'][] = array('msg' =>
lang('any relation has been saved'));
+ }
+ if ($count_relations_existing)
+ {
+ $message['message'][] = array('msg' => lang('%1
relations existing', $count_relations_existing));
+ }
+
+ return $message;
+ }
+
+ private function _compare_names(&$component_files,
$uploaded_files)
+ {
+ if (count($component_files))
+ {
+ foreach ($component_files as &$files)
+ {
+ foreach ($files as &$file_data)
+ {
+ foreach ($uploaded_files as
$file)
+ {
+ if
(strtolower($file['file']) == strtolower($file_data['file']))
+ {
+ if
($file['path_file_string'])
+ {
+ $pos =
stripos($file['path_file_string'], $file_data['path_file_string']);
+ if
($pos !== false)
+ {
+
$file_data['path_file'] = $file['path_file'];
+
$file_data['val_md5sum'] = $file['val_md5sum'];
+ }
+ } else {
+
$file_data['path_file'] = $file['path_file'];
+
$file_data['val_md5sum'] = $file['val_md5sum'];
+ }
+ }
+ }
+ if
(!empty($file_data['val_md5sum']))
+ {
+
$this->paths_from_file[$file_data['val_md5sum']][] = $file_data['path'];
+ } else {
+
$this->paths_empty[$file_data['path_file_string']] =
$file_data['path'].'/'.$file_data['file'];
+ }
+ }
+ }
+ } else {
+ foreach ($uploaded_files as $file)
+ {
+ if (!empty($file['val_md5sum']))
+ {
+
$this->paths_from_file[$file['val_md5sum']][] = dirname($file['path_file']);
+ } else {
+ $this->paths_empty[] =
$file['path_file'];
+ }
+ }
+ $component_files = $uploaded_files;
+ }
+ }
+
+ private function _un_zip($file, $dir)
+ {
+ @set_time_limit(5 * 60);
- return $value['file_id'];
+ $zip = new ZipArchive;
+ if ($zip->open($file) === TRUE)
+ {
+ for($i = 0; $i < $zip->numFiles; $i++)
+ {
+ $file_name = str_replace('..', '.',
iconv("CP850", "UTF-8", $zip->getNameIndex($i)));
+ $copy_to = $dir.'/'.$file_name;
+ if (!is_dir(dirname($copy_to)))
+ {
+ mkdir(dirname($copy_to), 0777,
true);
+ }
+
copy("zip://".$file."#".$zip->getNameIndex($i), "{$copy_to}");
+ }
+ $zip->close();
+
+ return true;
+ } else {
+ $this->receipt['error'][] = array('msg' =>
lang('Failed opening file %1', $file));
+ return false;
+ }
}
- public function add_files($id, $location_code,
$attrib_name_componentID)
+ private function _un_rar($file, $dir)
+ {
+ @set_time_limit(5 * 60);
+
+ $archive = RarArchive::open($file);
+ if ($archive === FALSE)
+ {
+ $this->receipt['error'][] = array('msg' =>
lang('Failed opening file %1', $file));
+ return false;
+ }
+
+ $entries = $archive->getEntries();
+ foreach ($entries as $entry)
+ {
+ $file_name = str_replace('..', '.',
$entry->getName());
+ $copy_to = $dir.'/'.$file_name;
+ if (!is_dir(dirname($copy_to)))
+ {
+ mkdir(dirname($copy_to), 0777, true);
+ }
+ copy("rar://".$file."#".$entry->getName(),
"{$copy_to}");
+ }
+ $archive->close();
+
+ return true;
+ }
+
+ private function _uncompresed_file($path_file)
{
- $exceldata =
$this->_getexceldata($_FILES['file']['tmp_name'], true);
- $component_files = array();
- $message = array();
+ $info = pathinfo($path_file);
+ $path_dir = $this->path_upload_dir.$info['filename'];
+ $result = true;
- foreach ($exceldata as $row)
+ if (!in_array($info['extension'], array('zip', 'rar')))
{
+ $this->receipt['error'][] = array('msg' =>
lang('The file extension should be zip or rar'));
+ return false;
+ }
+
+ if (is_dir($path_dir))
+ {
+ exec("rm -Rf '{$path_dir}'", $ret);
+ }
+ mkdir($path_dir, 0777, true);
+
+ if ($info['extension'] == 'zip')
+ {
+ $result = $this->_un_zip($path_file, $path_dir);
+ }
+ else if ($info['extension'] == 'rar')
+ {
+ $result = $this->_un_rar($path_file, $path_dir);
+ }
+
+ return $result;
+ }
+
+ private function _get_uploaded_files()
+ {
+ $compressed_file =
phpgw::get_var('compressed_file_check');
+ $compressed_file_name =
phpgw::get_var('compressed_file_name');
+
+ $list_files = array();
+
+ if ($compressed_file)
+ {
+ $path_file =
$this->path_upload_dir.$compressed_file_name;
+
+ if (!is_file($path_file))
+ {
+ $this->receipt['error'][] = array('msg'
=> lang('File %1 not exist', $path_file));
+ return;
+ }
+
+ if (!$this->_uncompresed_file($path_file))
+ {
+ return false;
+ }
+
+ $info = pathinfo($path_file);
+ $path_dir =
$this->path_upload_dir.$info['filename'];
+
+ if (!is_dir($path_dir))
+ {
+ $this->receipt['error'][] = array('msg'
=> lang('Directory %1 not exist', $path_dir));
+ return;
+ }
+
+ $list_files =
$this->_get_dir_contents($path_dir);
+ }
+ else {
+ $list_files =
$this->_get_files($this->path_upload_dir);
+ }
+
+ if (!count($list_files))
+ {
+ $this->receipt['error'][] = array('msg' =>
lang("no exist files to import"));
+ }
+
+ return $list_files;
+ }
+
+ private function _get_files($dir, $results = array())
+ {
+ $content = scandir($dir);
+
+ $output = array();
+ foreach($content as $key => $value)
+ {
+ $path = realpath($dir.'/'.$value);
+ if(is_file($path))
+ {
+ unset($output);
+ exec('md5sum "'.$path.'" 2>&1',
$output, $ret);
+ if ($ret)
+ {
+ $val_md5sum = '';
+ } else {
+ $val_md5sum =
trim(strstr($output[0], ' ', true)).' '.$value;
+ }
+ $results[] = array('file'=>$value,
+ 'val_md5sum'=>$val_md5sum,
+ 'path_file'=>$path);
+ }
+ }
+
+ return $results;
+ }
+
+ private function _get_dir_contents($dir, &$results = array())
+ {
+ $content = scandir($dir);
+ $patrones = array('(\\/)', '(\\\\)', '(")');
+ $sustituciones = array('_', '_', '_');
+
+ $output = array();
+ foreach($content as $key => $value)
+ {
+ $path = realpath($dir.'/'.$value);
+ if(is_file($path))
+ {
+ unset($output);
+ exec('md5sum "'.$path.'" 2>&1',
$output, $ret);
+ if ($ret)
+ {
+ $val_md5sum = '';
+ } else {
+ $val_md5sum =
trim(strstr($output[0], ' ', true)).' '.$value;
+ }
+ $results[] = array('file'=>$value,
+ 'val_md5sum'=>$val_md5sum,
+
'path_file_string'=>preg_replace($patrones, $sustituciones, $path),
+ 'path_file'=>$path);
+ }
+ else if($value != "." && $value != "..")
+ {
+ $this->_get_dir_contents($path,
$results);
+ }
+ }
+
+ return $results;
+ }
+
+ public function get_relations ()
+ {
+ $exceldata =
$this->_getexceldata($_FILES['file']['tmp_name'], false);
+ $component_files = array();
+
+ if ($this->receipt['error'])
+ {
+ return $this->receipt;
+ }
+
+ $patrones = array('(\\/)', '(\\\\)', '(")');
+ $sustituciones = array('_', '_', '_');
+ $patrones_2 = array('(\\/)', '(")');
+ $sustituciones_2 = array('_', '_');
+ foreach ($exceldata as $k => $row)
+ {
if (!$this->_valid_row($row))
{
continue;
}
- $array_path = explode("\\",
$row[(count($row)-1)]);
+ $path = $row[(count($row)-2)];
+ $path_file = str_replace('..', '.',
$row[(count($row)-1)]);
+ $array_path = explode("\\", $path_file);
$component_files[$row[0]][] = array(
'name' => $row[1],
'desription' => $row[2],
- 'file' =>
$array_path[count($array_path)-1]
+ 'file' =>
$array_path[count($array_path)-1],
+ 'path' => preg_replace($patrones_2,
$sustituciones_2, $path),
+ 'path_file_string' =>
preg_replace($patrones, $sustituciones, $path_file),
+ 'row' => ($k + 1)
);
}
+
+ return $component_files;
+ }
+
+ public function preview ()
+ {
+ $with_components =
phpgw::get_var('with_components_check');
+
+ $uploaded_files = $this->_get_uploaded_files();
+
+ if ($with_components)
+ {
+ $relations = $this->get_relations();
+ $this->_compare_names($relations,
$uploaded_files);
+ } else {
+ $relations = array();
+ $this->_compare_names($relations,
$uploaded_files);
+ }
- $count_new_relations = 0;
+ phpgwapi_cache::session_set('property',
'paths_from_file', $this->paths_from_file);
+ phpgwapi_cache::session_set('property', 'import_data',
$relations);
+
+ $message['message'][] = array('msg' => lang('%1 files
prepare to copy', count($this->paths_from_file)));
+
+ if (count($this->paths_empty))
+ {
+ $message['error'][] = array('msg' => lang('%1
files not exist in the temporary folder', count($this->paths_empty)));
+
+ foreach($this->paths_empty as $c => $v)
+ {
+ $message['error'][] = array('msg' =>
lang("file not exist: %1", $v));
+ }
+ }
+
+ return $message;
+ }
+
+ public function add_files_components_location($id,
$location_code, $attrib_name_componentID)
+ {
+ @set_time_limit(5 * 60);
+
+ $message = array();
+
+ $component_files =
phpgwapi_cache::session_get('property', 'import_data');
+ $this->paths_from_file =
phpgwapi_cache::session_get('property', 'paths_from_file');
+
+ $count_new_relations = 0;
$count_relations_existing = 0;
$count_new_files = 0;
- $count_files_existing = 0;
-
+ //$count_files_not_existing = 0;
+ $files_not_existing = array();
+
foreach ($component_files as $k => $files)
{
if (empty($k))
@@ -161,7 +530,7 @@
foreach ($files as $file_data)
{
- if (in_array(str_replace(' ', '_',
$file_data['file']), $files_in_component))
+ if (in_array(str_replace(' ', '_',
$file_data['val_md5sum']), $files_in_component))
{
$count_relations_existing++;
continue;
@@ -174,27 +543,22 @@
$file = $file_data['file'];
- $file_id =
$this->_search_in_latest_uploads($file);
- if (!$file_id)
+ $file_id =
$this->_search_in_last_files_added($file_data);
+ if (!$file_id)
{
- $file_id =
$this->_search_file_in_db($file);
- if ($file_id)
+ if
(!is_file($file_data['path_file']))
{
- throw new
Exception("file '{$file}' exist in DB. Component: '{$k}'");
-
$count_files_existing++;
- }
-
- if
(!is_file($this->path_upload_dir.$file))
- {
- throw new
Exception("file '{$file}' does not exist in folder temporary. Component:
'{$k}'");
+
//$count_files_not_existing++;
+
$files_not_existing[] = ($file_data['path_file']) ? $file_data['path_file'] :
$file_data['path'].'/'.$file_data['file'];
+ throw new
Exception();
}
$file_id =
$this->_save_file($file_data);
if (!$file_id)
{
- throw new
Exception("failed to copy file '{$file}'. Component: '{$k}'");
+ throw new
Exception("failed to copy file: '{$file_data['path_file']}'. Component:
'{$k}'");
}
-
unlink($this->path_upload_dir.$file);
+
unlink($file_data['path_file']);
$count_new_files++;
}
@@ -212,8 +576,11 @@
{
if ($e)
{
-
$this->db->transaction_abort();
- $message['error'][] =
array('msg' => $e->getMessage());
+
$this->db->transaction_abort();
+ if ($e->getMessage())
+ {
+
$message['error'][] = array('msg' => $e->getMessage());
+ }
continue;
}
}
@@ -224,111 +591,44 @@
if ($count_new_files)
{
$message['message'][] = array('msg' => lang('%1
files copy successfully', $count_new_files));
+ } else {
+ $message['message'][] = array('msg' => lang('%1
files copy', $count_new_files));
}
- if ($count_relations_existing)
- {
- $message['message'][] = array('msg' => lang('%1
relations existing', $count_relations_existing));
- }
if ($count_new_relations)
{
$message['message'][] = array('msg' => lang('%1
relations saved successfully', $count_new_relations));
+ } else {
+ $message['message'][] = array('msg' =>
lang('any relation has been saved'));
}
- if ($count_files_existing)
+ if ($count_relations_existing)
{
- $message['message'][] = array('msg' => lang('%1
files already exist and were rejected', $count_files_existing));
+ $message['message'][] = array('msg' => lang('%1
relations existing', $count_relations_existing));
}
- return $message;
- }
-
-
- /*public function add_files($id, $location_code,
$attrib_name_componentID)
- {
- $exceldata =
$this->_getexceldata($_FILES['file']['tmp_name'], true);
- $component_files = array();
- $message = array();
-
- foreach ($exceldata as $row)
+ if (count($files_not_existing))
{
- if (!$this->_valid_row($row))
- {
- continue;
- }
-
- $array_path = explode("\\",
$row[(count($row)-1)]);
-
- $component_files[$row[0]][] = array(
- 'name' => $row[1],
- 'desription' => $row[2],
- 'file' =>
$array_path[count($array_path)-1]
- );
+ $message['error'][] = array('msg' => lang('%1
files not exist in the temporary folder', count($files_not_existing)));
}
-
- $this->db->transaction_begin();
- try
+ if (count($files_not_existing))
{
- $this->db->Exception_On_Error = true;
-
- $count = 0;
- foreach ($component_files as $k => $files)
+ foreach($files_not_existing as $c => $v)
{
- if (empty($k))
- {
- $component = array('id' => $id,
'location_id' => $GLOBALS['phpgw']->locations->get_id('property',
'.location.'.count(explode('-', $location_code))));
- }
- else {
- $component =
$this->_get_component($k, $attrib_name_componentID, $location_code);
- if( empty($component['id']) ||
empty($component['location_id']))
- {
- throw new
Exception("component {$k} does not exist");
- }
- }
-
- foreach($files as $file_data)
- {
- $file = $file_data['file'];
-
- if
(!is_file($this->path_upload_dir.$file))
- {
- throw new
Exception("the file {$file} does not exist, component: {$k}");
- }
-
- $file_id =
$this->_save_file($file_data);
- if (!$file_id)
- {
- throw new
Exception("failed to save file {$file}, component: {$k}");
- }
-
- $result =
$this->_save_file_relation($component['id'], $component['location_id'],
$file_id);
- if (!$result)
- {
- throw new
Exception("failed to save relation, file: {$file}, component: {$k}");
- }
- $count++;
- }
+ $message['error'][] = array('msg' =>
lang("file not exist: %1", $v));
}
- $this->db->Exception_On_Error = false;
}
- catch (Exception $e)
- {
- if ($e)
- {
- $this->db->transaction_abort();
- $message['error'][] = array('msg' =>
$e->getMessage());
- return $message;
- }
- }
-
- $this->db->transaction_commit();
- $message['message'][] = array('msg' => lang('%1 files
saved successfully', $count));
return $message;
- }*/
+ }
private function _get_component( $query,
$attrib_name_componentID, $location_code)
{
+ if (array_key_exists($query, $this->list_component_id))
+ {
+ return $this->list_component_id[$query];
+ }
+
$location_code_values = explode('-', $location_code);
$loc1 = $location_code_values[0];
@@ -348,20 +648,29 @@
$values['id'] = $this->db->f('id');
$values['location_id'] =
$this->db->f('location_id');
}
+
+ if ($values['id'])
+ {
+ $this->list_component_id[$query] = $values;
+ }
return $values;
}
-
private function _save_file( $file_data )
{
$metadata = array();
+
+ //$tmp_file = $file_data['file'];
- $tmp_file = $file_data['file'];
+ $val_md5sum = $file_data['val_md5sum'];
+ $path_file = $file_data['path_file'];
+
+ $md5_sum = trim(strstr($val_md5sum, ' ', true));
$bofiles = CreateObject('property.bofiles');
- $file_name = str_replace(' ', '_', $tmp_file);
+ $file_name = str_replace(' ', '_',
trim(strstr($val_md5sum, ' ')));
$to_file = $bofiles->fakebase . '/generic_document/'
.$file_name;
@@ -373,30 +682,43 @@
$bofiles->vfs->override_acl = 1;
$file_id = $bofiles->vfs->cp3(array(
- 'from' =>
$this->path_upload_dir.$tmp_file,
+ 'from' => $path_file,
'to' => $to_file,
'id' => '',
'relatives' => array(RELATIVE_NONE |
VFS_REAL, RELATIVE_ALL)));
$bofiles->vfs->override_acl = 0;
- if ($file_id)
+ if (empty($file_id))
{
- $this->latest_uploads[$file_id] = $file_name;
-
- $metadata['report_date'] =
phpgwapi_datetime::date_to_timestamp(date('Y-m-d'));
- $metadata['title'] = $file_data['name'];
- $metadata['descr'] = $file_data['desription'];
-
- $values_insert = array
- (
- 'file_id' => $file_id,
- 'metadata' => json_encode($metadata)
- );
+ return false;
+ }
+
+ $this->last_files_added[$file_id] = $val_md5sum;
- $this->db->query("INSERT INTO
phpgw_vfs_filedata (" . implode(',', array_keys($values_insert)) . ') VALUES ('
- .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
+ $this->db->query("UPDATE phpgw_vfs SET
md5_sum='{$md5_sum}'"
+ . " WHERE file_id='{$file_id}'", __LINE__,
__FILE__);
+
+ if (count($this->paths_from_file[$val_md5sum]))
+ {
+ $paths =
array_values(array_unique($this->paths_from_file[$val_md5sum]));
+ } else {
+ $paths = array();
}
-
+
+ $metadata['report_date'] =
phpgwapi_datetime::date_to_timestamp(date('Y-m-d'));
+ $metadata['title'] = $file_data['name'];
+ $metadata['descr'] = $file_data['desription'];
+ $metadata['path'] = $paths;
+
+ $values_insert = array
+ (
+ 'file_id' => $file_id,
+ 'metadata' => "'" . json_encode($metadata) . "'"
+ );
+
+ $this->db->query("INSERT INTO phpgw_vfs_filedata (" .
implode(',', array_keys($values_insert)) . ') VALUES ('
+ . implode(",", array_values($values_insert)) .
')', __LINE__, __FILE__);
+
return $file_id;
}
Modified:
branches/Version-2_0-branch/property/js/portico/generic_document.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/generic_document.edit.js
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/js/portico/generic_document.edit.js
2017-01-01 18:58:29 UTC (rev 16131)
@@ -103,6 +103,7 @@
function setRelationsComponents(oArgs)
{
var values = {};
+ var related = {};
var select_check = $('.components');
select_check.each(function (i, obj)
@@ -113,11 +114,17 @@
}
});
+ var select_related = $('.components_related');
+ select_related.each(function (i, obj)
+ {
+ related[obj.value] = obj.value;
+ });
+
oArgs['location_id'] = $('#location_id').val();
oArgs['file_id'] = $('#id').val();
var requestUrl = phpGWLink('index.php', oArgs);
- var data = {"items": values};
+ var data = {"items":values, "related":related};
JqueryPortico.execute_ajax(requestUrl, function (result)
{
JqueryPortico.show_message(0, result);
@@ -129,6 +136,7 @@
function setRelationsLocations(oArgs)
{
var values = {};
+ var related = {};
var select_check = $('.locations');
select_check.each(function (i, obj)
@@ -139,11 +147,17 @@
}
});
+ var select_related = $('.locations_related');
+ select_related.each(function (i, obj)
+ {
+ related[obj.value] = obj.value;
+ });
+
oArgs['type_id'] = $('#type_id').val();
oArgs['file_id'] = $('#id').val();
var requestUrl = phpGWLink('index.php', oArgs);
- var data = {"items": values};
+ var data = {"items":values, "related":related};
JqueryPortico.execute_ajax(requestUrl, function (result)
{
JqueryPortico.show_message(1, result);
Modified: branches/Version-2_0-branch/property/js/portico/import_components.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/import_components.js
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/js/portico/import_components.js
2017-01-01 18:58:29 UTC (rev 16131)
@@ -5,7 +5,8 @@
$('.processing-sheet').hide();
$('.processing-start-line').hide();
$('.processing-columns').hide();
- $('.processing-import-relations').hide();
+ //$('.processing-import-relations').hide();
+ $('.processing-relations').hide();
$('.processing-save').hide();
$('.get-profile').hide();
@@ -94,43 +95,121 @@
);
});
- $('#import_components_files').on('click', function ()
+ $('#relations_step_1').on('click', function ()
{
+ if ($('input:radio[name=with_components_check]:checked').val()
== 1)
+ {
+ if ($('#excel_files').val() == '')
+ {
+ alert('no file selected');
+ return false;
+ }
+ }
+
+ $('#responsiveTabsRelations').responsiveTabs('activate', 1);
+ });
+
+ $('#relations_step_2').on('click', function ()
+ {
var oArgs = {menuaction:
'property.uiimport_components.import_component_files'};
var requestUrl = phpGWLink('index.php', oArgs, true);
- if ($('#excel_files').val() === '')
+ if ($('#location_item_id').val() === '')
{
- alert('no file selected');
+ alert('Choose Location');
return false;
+ }
+
+ if ($('input:radio[name=compressed_file_check]:checked').val()
== 1 && $('#compressed_file_name').val() == '')
+ {
+ alert('Enter the name of the compressed file');
+ return false;
}
- if ($('#location_item_id').val() === '')
+ var form = document.forms.namedItem("form_files");
+ var form_data = new FormData(form);
+
+ if ($('input:radio[name=with_components_check]:checked').val()
== 1)
{
- alert('Choose Location');
+ if ($('#excel_files').val() == '')
+ {
+ alert('no file selected');
+ return false;
+ }
+ var file_data = $('#excel_files').prop('files')[0];
+ form_data.append('file', file_data);
+ }
+
+ if (isSendingData())
+ {
return false;
- }
+ }
+ //form_data.append('attribute_name_component_id',
$('#attribute_name_component_id').val());
+ form_data.append('location_code', $('#location_code').val());
+ form_data.append('location_item_id',
$('#location_item_id').val());
+ form_data.append('compressed_file_check',
$('input:radio[name=compressed_file_check]:checked').val());
+ form_data.append('with_components_check',
$('input:radio[name=with_components_check]:checked').val());
+ form_data.append('compressed_file_name',
$('#compressed_file_name').val());
+ form_data.append('preview', 1);
+
+ $('.processing-relations').show();
+
+ $.ajax({
+ url: requestUrl,
+ cache: false,
+ contentType: false,
+ processData: false,
+ data: form_data,
+ type: 'post',
+ dataType: 'json'
+ })
+ .done(function(result) {
+ JqueryPortico.show_message(5, result);
+ $('#responsiveTabsRelations').responsiveTabs('enable',
2);
+
$('#responsiveTabsRelations').responsiveTabs('activate', 2);
+ $('#message4').empty();
+ //$('#import_components_files').prop('disabled', true);
+ })
+ .fail(function() {
+ alert( "error" );
+ })
+ .always(function() {
+ statusSend = false;
+ $('.processing-relations').hide();
+ });
+ });
- if ($('#attribute_name_component_id').val() === '')
+ $('#save_relations').on('click', function ()
+ {
+ var oArgs = {menuaction:
'property.uiimport_components.import_component_files'};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ /*if ($('#excel_files').val() === '')
{
- alert('Choose attribute name for Component ID');
+ alert('no file selected');
return false;
- }
+ }*/
+ if ($('#location_item_id').val() === '')
+ {
+ alert('Choose Location');
+ return false;
+ }
+
if (isSendingData())
{
return false;
}
var form = document.forms.namedItem("form_files");
- var file_data = $('#excel_files').prop('files')[0];
var form_data = new FormData(form);
- form_data.append('file', file_data);
+
form_data.append('attribute_name_component_id',
$('#attribute_name_component_id').val());
form_data.append('location_code', $('#location_code').val());
form_data.append('location_item_id',
$('#location_item_id').val());
+ form_data.append('with_components_check',
$('input:radio[name=with_components_check]:checked').val());
- $('.processing-import-relations').show();
+ $('.processing-relations').show();
$.ajax({
url: requestUrl,
@@ -139,14 +218,18 @@
processData: false,
data: form_data,
type: 'post',
- dataType: 'json',
- success: function (result)
- {
- statusSend = false;
- $('.processing-import-relations').hide();
- JqueryPortico.show_message(4, result);
-
//$('#import_components_files').prop('disabled', true);
- }
+ dataType: 'json'
+ })
+ .done(function(result) {
+ JqueryPortico.show_message(4, result);
+ //$('#import_components_files').prop('disabled', true);
+ })
+ .fail(function() {
+ alert( "error" );
+ })
+ .always(function() {
+ statusSend = false;
+ $('.processing-relations').hide();
});
});
@@ -548,7 +631,7 @@
{
$('#profile_selected').empty();
$('#profile_selected').append($("#profile_list
option:selected").text());
- $('#cod_profile_selected').val($('#profile_selected').val());
+ $('#cod_profile_selected').val($("#profile_list").val());
if ($('#profile_list').val())
{
Modified: branches/Version-2_0-branch/property/js/portico/project.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/project.edit.js
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/js/portico/project.edit.js
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/js/portico/workorder.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/workorder.edit.js
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/js/portico/workorder.edit.js
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/templates/base/cat_sub_select.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/cat_sub_select.xsl
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/templates/base/cat_sub_select.xsl
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/templates/base/columns.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/columns.xsl
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/templates/base/columns.xsl
2017-01-01 18:58:29 UTC (rev 16131)
@@ -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/Version-2_0-branch/property/templates/base/condition_survey.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/condition_survey.xsl
2017-01-01 18:51:30 UTC (rev 16130)
+++ branches/Version-2_0-branch/property/templates/base/condition_survey.xsl
2017-01-01 18:58:29 UTC (rev 16131)
@@ -2,332 +2,264 @@
<!-- add / edit -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
- <div class="content">
- <xsl:call-template name="jquery_phpgw_i18n"/>
+ <xsl:call-template name="jquery_phpgw_i18n"/>
- <div id="survey_edit_tabview">
+ <div id="survey_edit_tabview">
- <h1>
- <xsl:value-of select="php:function('lang',
'condition survey')" />
- </h1>
+ <h1>
+ <xsl:value-of select="php:function('lang', 'condition
survey')" />
+ </h1>
- <xsl:variable name="action_url">
- <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:property.uicondition_survey.save')" />
- </xsl:variable>
+ <xsl:variable name="action_url">
+ <xsl:value-of select="php:function('get_phpgw_link',
'/index.php', 'menuaction:property.uicondition_survey.save')" />
+ </xsl:variable>
- <xsl:value-of select="validator"/>
+ <xsl:value-of select="validator"/>
- <form name="form" class="pure-form pure-form-aligned"
id="form" action="{$action_url}" method="post" ENCTYPE="multipart/form-data">
+ <form name="form" class="pure-form pure-form-aligned" id="form"
action="{$action_url}" method="post" ENCTYPE="multipart/form-data">
- <dl>
- <xsl:choose>
- <xsl:when test="msgbox_data !=
''">
- <dt>
-
<xsl:call-template name="msgbox"/>
- </dt>
- </xsl:when>
- </xsl:choose>
- </dl>
+ <dl>
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <dt>
+ <xsl:call-template
name="msgbox"/>
+ </dt>
+ </xsl:when>
+ </xsl:choose>
+ </dl>
- <div id="tab-content">
+ <div id="tab-content">
- <xsl:value-of
disable-output-escaping="yes" select="tabs"/>
+ <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
- <div id="generic">
+ <div id="generic">
- <fieldset>
- <xsl:choose>
- <xsl:when
test="survey/id!=''">
- <div
class="pure-control-group">
-
<label>
-
<xsl:value-of select="php:function('lang', 'id')" />
-
</label>
-
<xsl:value-of select="survey/id"/>
-
<input type="hidden" name="id" value="{survey/id}"/>
+ <fieldset>
+ <xsl:choose>
+ <xsl:when
test="survey/id!=''">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'id')" />
+ </label>
+
<xsl:value-of select="survey/id"/>
+ <input
type="hidden" name="id" value="{survey/id}"/>
- </div>
- </xsl:when>
- </xsl:choose>
+ </div>
+ </xsl:when>
+ </xsl:choose>
- <xsl:choose>
- <xsl:when
test="location_data2!=''">
-
<xsl:choose>
-
<xsl:when test="editable = 1">
-
<xsl:call-template name="location_form2"/>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:call-template name="location_view2"/>
-
</xsl:otherwise>
-
</xsl:choose>
- </xsl:when>
- </xsl:choose>
-
- <div
class="pure-control-group">
- <label
for="name">
-
<xsl:value-of select="php:function('lang', 'name')" />
- </label>
+ <xsl:choose>
+ <xsl:when
test="location_data2!=''">
<xsl:choose>
<xsl:when test="editable = 1">
-
<input id="title" name='values[title]' type="text" value="{survey/title}">
-
<xsl:attribute name="data-validation">
-
<xsl:text>required</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a
title !')"/>
-
</xsl:attribute>
-
</input>
+
<xsl:call-template name="location_form2"/>
</xsl:when>
<xsl:otherwise>
-
<xsl:value-of select="survey/title" />
+
<xsl:call-template name="location_view2"/>
</xsl:otherwise>
</xsl:choose>
- </div>
+ </xsl:when>
+ </xsl:choose>
- <div
class="pure-control-group" >
- <label
for="name">
-
<xsl:value-of select="php:function('lang', 'description')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<textarea id="descr" rows="6" style="width:40%; resize:none;"
name="values[descr]">
-
<xsl:attribute name="data-validation">
-
<xsl:text>required</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a
description !')"/>
-
</xsl:attribute>
-
<xsl:value-of select="survey/descr" disable-output-escaping="yes"/>
-
</textarea>
-
</xsl:when>
-
<xsl:otherwise>
+ <div class="pure-control-group">
+ <label for="name">
+ <xsl:value-of
select="php:function('lang', 'name')" />
+ </label>
+ <xsl:choose>
+ <xsl:when
test="editable = 1">
+ <input
id="title" name='values[title]' type="text" value="{survey/title}">
+
<xsl:attribute name="data-validation">
+
<xsl:text>required</xsl:text>
+
</xsl:attribute>
+
<xsl:attribute name="data-validation-error-msg">
+
<xsl:value-of select="php:function('lang', 'Please enter a title !')"/>
+
</xsl:attribute>
+ </input>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:value-of select="survey/title" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+
+ <div class="pure-control-group"
>
+ <label for="name">
+ <xsl:value-of
select="php:function('lang', 'description')" />
+ </label>
+ <xsl:choose>
+ <xsl:when
test="editable = 1">
+
<textarea id="descr" rows="6" style="width:40%; resize:none;"
name="values[descr]">
+
<xsl:attribute name="data-validation">
+
<xsl:text>required</xsl:text>
+
</xsl:attribute>
+
<xsl:attribute name="data-validation-error-msg">
+
<xsl:value-of select="php:function('lang', 'Please enter a description
!')"/>
+
</xsl:attribute>
<xsl:value-of select="survey/descr" disable-output-escaping="yes"/>
-
</xsl:otherwise>
- </xsl:choose>
- </div>
+
</textarea>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:value-of select="survey/descr" disable-output-escaping="yes"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
- <div
class="pure-control-group">
- <label
for="category">
-
<xsl:value-of select="php:function('lang', 'category')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<select id="cat_id" name="values[cat_id]">
-
<xsl:attribute name="data-validation">
-
<xsl:text>required</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a
category !')"/>
-
</xsl:attribute>
-
<xsl:apply-templates select="categories/options"/>
-
</select>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:for-each select="categories/options">
-
<xsl:if test="selected = 'selected' or selected = 1">
-
<xsl:value-of disable-output-escaping="yes" select="name"/>
-
</xsl:if>
-
</xsl:for-each>
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div
class="pure-control-group">
- <label
for="multiplier">
-
<xsl:value-of select="php:function('lang', 'multiplier')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<input id="multiplier" name='values[multiplier]' type="text"
value="{survey/multiplier}">
-
<xsl:attribute name="data-validation">
-
<xsl:text>number</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-allowing">
-
<xsl:text>float</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a
multiplier !')"/>
-
</xsl:attribute>
-
</input>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:value-of select="survey/multiplier"/>
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div
class="pure-control-group">
- <label
for="date">
-
<xsl:value-of select="php:function('lang', 'date')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<input id="report_date" name='values[report_date]' type="text"
value="{survey/report_date}"
-
data-validation="date" data-validation-format="dd/mm/yyyy"/>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:value-of select="survey/report_date"/>
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div
class="pure-control-group">
- <label
for="status">
-
<xsl:value-of select="php:function('lang', 'status')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<select id="status_id" name="values[status_id]">
-
<xsl:attribute name="data-validation">
-
<xsl:text>required</xsl:text>
-
</xsl:attribute>
-
<xsl:attribute name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a
status !')"/>
-
</xsl:attribute>
-
<xsl:apply-templates select="status_list/options"/>
-
</select>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:for-each select="status_list/options">
-
<xsl:if test="selected = 'selected' or selected = 1">
-
<xsl:value-of disable-output-escaping="yes" select="name"/>
-
</xsl:if>
-
</xsl:for-each>
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div
class="pure-control-group">
- <label
for="coordinator">
-
<xsl:value-of select="lang_coordinator" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<!--div class="autocomplete"-->
-
<input type="hidden" id="coordinator_id" name="values[coordinator_id]"
value="{survey/coordinator_id}"/>
-
<input type="text" id="coordinator_name" name="values[coordinator_name]"
value="{survey/coordinator_name}">
-
</input>
-
<div id="coordinator_container"/>
-
<!--/div-->
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:value-of select="survey/coordinator_name" />
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div
class="pure-control-group">
- <label
for="vendor">
-
<xsl:value-of select="php:function('lang', 'vendor')" />
- </label>
- <xsl:choose>
-
<xsl:when test="editable = 1">
-
<!--div class="autocomplete"-->
-
<input type="hidden" id="vendor_id" name="values[vendor_id]"
value="{survey/vendor_id}"/>
-
<input type="text" id="vendor_name" name="values[vendor_name]"
value="{survey/vendor_name}">
-
</input>
-
<div id="vendor_container"/>
-
<!--/div-->
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:value-of select="survey/vendor_name" />
-
</xsl:otherwise>
- </xsl:choose>
- </div>
-
-
- </fieldset>
- </div>
-
- <div id="documents">
- <script type="text/javascript">
-
- var survey_id =
'<xsl:value-of select='survey/id'/>';
- var multi_upload_parans
= <xsl:value-of select="multi_upload_parans"/>;
-
-
this.show_related_requests = function()
- {
- var oArgs =
{menuaction:'property.uirequest.index', nonavbar:1,
condition_survey_id:survey_id};
- var requestUrl =
phpGWLink('index.php', oArgs);
-
TINY.box.show({iframe:requestUrl,
boxid:'frameless',width:screen.width*.9,height:screen.height*.5,fixed:false,maskid:'darkmask',maskopacity:40,
mask:true, animate:true, close: true});
- }
- </script>
-
<div class="pure-control-group">
-
- <label>
- <xsl:value-of
select="php:function('lang', 'files')"/>
+ <label for="category">
+ <xsl:value-of
select="php:function('lang', 'category')" />
</label>
- <!--div
style="clear:both;" id="datatable-container_0"></div-->
- <xsl:for-each
select="datatable_def">
- <xsl:if
test="container = 'datatable-container_0'">
-
<xsl:call-template name="table_setup">
-
<xsl:with-param name="container" select ='container'/>
-
<xsl:with-param name="requestUrl" select ='requestUrl' />
-
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
-
<xsl:with-param name="tabletools" select ='tabletools' />
-
<xsl:with-param name="config" select ='config' />
-
</xsl:call-template>
- </xsl:if>
- </xsl:for-each>
<xsl:choose>
<xsl:when
test="editable = 1">
-
<xsl:call-template name="file_upload"/>
+ <select
id="cat_id" name="values[cat_id]">
+
<xsl:attribute name="data-validation">
+
<xsl:text>required</xsl:text>
+
</xsl:attribute>
+
<xsl:attribute name="data-validation-error-msg">
+
<xsl:value-of select="php:function('lang', 'Please enter a category
!')"/>
+
</xsl:attribute>
+
<xsl:apply-templates select="categories/options"/>
+
</select>
</xsl:when>
+ <xsl:otherwise>
+
<xsl:for-each select="categories/options">
+
<xsl:if test="selected = 'selected' or selected = 1">
+
<xsl:value-of disable-output-escaping="yes" select="name"/>
+
</xsl:if>
+
</xsl:for-each>
+ </xsl:otherwise>
</xsl:choose>
</div>
- </div>
- <div id="request">
+
<div class="pure-control-group">
- <label>
- <a
href="javascript:show_related_requests();">
-
<xsl:attribute name="title">
-
<xsl:value-of select="php:function('lang', 'details')"/>
-
</xsl:attribute>
-
<xsl:value-of select="php:function('lang', 'details')"/>
- </a>
+ <label for="multiplier">
+ <xsl:value-of
select="php:function('lang', 'multiplier')" />
</label>
+ <xsl:choose>
+ <xsl:when
test="editable = 1">
+ <input
id="multiplier" name='values[multiplier]' type="text"
value="{survey/multiplier}">
+
<xsl:attribute name="data-validation">
+
<xsl:text>number</xsl:text>
+
</xsl:attribute>
+
<xsl:attribute name="data-validation-allowing">
+
<xsl:text>float</xsl:text>
+
</xsl:attribute>
+
<xsl:attribute name="data-validation-error-msg">
+
<xsl:value-of select="php:function('lang', 'Please enter a multiplier
!')"/>
+
</xsl:attribute>
+ </input>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:value-of select="survey/multiplier"/>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
+
<div class="pure-control-group">
- <label>
- <xsl:variable
name="lang_new_request">
-
<xsl:value-of select="php:function('lang', 'new record')" />
- </xsl:variable>
- <a
href="javascript:document.load_new_request_form.submit();">
-
<xsl:attribute name="title">
-
<xsl:value-of select="$lang_new_request"/>
-
</xsl:attribute>
-
<xsl:value-of select="$lang_new_request"/>
- </a>
+ <label for="date">
+ <xsl:value-of
select="php:function('lang', 'date')" />
</label>
+ <xsl:choose>
+ <xsl:when
test="editable = 1">
+ <input
id="report_date" name='values[report_date]' type="text"
value="{survey/report_date}"
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16131] Stable: Merge 16100:16130 from trunk,
sigurdne <=