[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16213] Stable: Merge 16143:16212 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16213] Stable: Merge 16143:16212 from trunk |
Date: |
Tue, 31 Jan 2017 14:59:08 -0500 (EST) |
Revision: 16213
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16213
Author: sigurdne
Date: 2017-01-31 14:59:07 -0500 (Tue, 31 Jan 2017)
Log Message:
-----------
Stable: Merge 16143:16212 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/activitycalendarfrontend/inc/class.hook_helper.inc.php
branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
branches/Version-2_0-branch/booking/inc/class.uimetasettings.inc.php
branches/Version-2_0-branch/bookingfrontend/change.php
branches/Version-2_0-branch/bookingfrontend/inc/class.hook_helper.inc.php
branches/Version-2_0-branch/bookingfrontend/setup/default_records.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.menu.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.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.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.vendor.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
branches/Version-2_0-branch/eventplanner/setup/default_records.inc.php
branches/Version-2_0-branch/eventplanner/setup/phpgw_no.lang
branches/Version-2_0-branch/eventplanner/setup/setup.inc.php
branches/Version-2_0-branch/eventplanner/setup/tables_current.inc.php
branches/Version-2_0-branch/eventplanner/setup/tables_update.inc.php
branches/Version-2_0-branch/eventplanner/templates/base/application.xsl
branches/Version-2_0-branch/eventplanner/templates/base/application_info.xsl
branches/Version-2_0-branch/eventplanner/templates/base/booking.xsl
branches/Version-2_0-branch/eventplanner/templates/base/config.tpl
branches/Version-2_0-branch/eventplanner/templates/base/customer.xsl
branches/Version-2_0-branch/eventplanner/templates/base/vendor.xsl
branches/Version-2_0-branch/mobilefrontend/inc/class.hook_helper.inc.php
branches/Version-2_0-branch/phpgwapi/inc/auth/class.auth_customsso.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.acl.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.categories.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.config.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.db.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.db_pdo.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.locations.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.login.inc.php
branches/Version-2_0-branch/phpgwapi/inc/class.sessions.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.uicommon_jquery.inc.php
branches/Version-2_0-branch/phpgwapi/inc/sso/include_login.inc.php
branches/Version-2_0-branch/phpgwapi/js/jquery/file-upload/css/jquery.fileupload-custom.css
branches/Version-2_0-branch/phpgwapi/js/jquery/mmenu/core/css/jquery.mmenu.all.css
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/base/datatable_jquery.xsl
branches/Version-2_0-branch/phpgwapi/templates/bookingfrontend/head.inc.php
branches/Version-2_0-branch/phpgwapi/templates/pure/css/HISTORY.md
branches/Version-2_0-branch/phpgwapi/templates/pure/css/LICENSE.md
branches/Version-2_0-branch/phpgwapi/templates/pure/css/README.md
branches/Version-2_0-branch/phpgwapi/templates/pure/css/base-context-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/base-context.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/base-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/base.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/buttons-core-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/buttons-core.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/buttons-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/buttons.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/forms-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/forms-nr-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/forms-nr.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/forms.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-core-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-core.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-responsive-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-responsive-old-ie-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-responsive-old-ie.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-responsive.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-units-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids-units.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/grids.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-core-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-core.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-dropdown-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-dropdown.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-horizontal-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-horizontal.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-scrollable-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-scrollable.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-skin-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus-skin.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/menus.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/pure-extension.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/pure-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/pure-nr-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/pure-nr.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/pure.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/tables-min.css
branches/Version-2_0-branch/phpgwapi/templates/pure/css/tables.css
branches/Version-2_0-branch/phpgwapi/templates/pure/head.tpl
branches/Version-2_0-branch/phpgwapi/templates/pure/navbar.inc.php
branches/Version-2_0-branch/property/inc/class.bocondition_survey.inc.php
branches/Version-2_0-branch/property/inc/class.socondition_survey.inc.php
branches/Version-2_0-branch/property/inc/class.soentity.inc.php
branches/Version-2_0-branch/property/inc/class.sogeneric_.inc.php
branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
branches/Version-2_0-branch/property/inc/class.solocation.inc.php
branches/Version-2_0-branch/property/inc/class.uibudget.inc.php
branches/Version-2_0-branch/property/inc/class.uicondition_survey.inc.php
branches/Version-2_0-branch/property/inc/class.uientity.inc.php
branches/Version-2_0-branch/property/inc/class.uiimport_components.inc.php
branches/Version-2_0-branch/property/inc/class.uiinvoice2.inc.php
branches/Version-2_0-branch/property/inc/class.uilocation.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_melding.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/admin_entity.edit_category.js
branches/Version-2_0-branch/property/js/portico/ajax_invoice.js
branches/Version-2_0-branch/property/js/portico/import_components.js
branches/Version-2_0-branch/property/setup/phpgw_no.lang
branches/Version-2_0-branch/property/templates/base/admin_entity.xsl
branches/Version-2_0-branch/property/templates/base/multi_upload_file.xsl
branches/Version-2_0-branch/property/templates/base/tenant_claim.xsl
branches/Version-2_0-branch/registration/inc/class.boreg.inc.php
branches/Version-2_0-branch/registration/inc/class.uireg.inc.php
branches/Version-2_0-branch/registration/setup/phpgw_no.lang
branches/Version-2_0-branch/registration/setup/setup.inc.php
branches/Version-2_0-branch/registration/templates/base/config.tpl
branches/Version-2_0-branch/registration/templates/base/tos.tpl
branches/Version-2_0-branch/rental/inc/class.boemail_out.inc.php
branches/Version-2_0-branch/rental/inc/class.socontract_price_item.inc.php
branches/Version-2_0-branch/rental/inc/class.soemail_out.inc.php
branches/Version-2_0-branch/rental/inc/class.soparty.inc.php
branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
branches/Version-2_0-branch/rental/inc/class.uiemail_out.inc.php
branches/Version-2_0-branch/rental/inc/model/class.email_out.inc.php
branches/Version-2_0-branch/rental/setup/phpgw_no.lang
branches/Version-2_0-branch/rental/templates/base/email_out.xsl
Added Paths:
-----------
branches/Version-2_0-branch/eventplanner/inc/class.bocustomer_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.boevents.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.bopermission.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.socustomer_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.soevents.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.sopermission.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uicustomer_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uievents.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uipermission.inc.php
branches/Version-2_0-branch/eventplanner/inc/hook_config.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.customer_report.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.events.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.permission.inc.php
branches/Version-2_0-branch/eventplanner/js/portico/events.index.js
branches/Version-2_0-branch/eventplanner/js/portico/permission.edit.js
branches/Version-2_0-branch/eventplanner/templates/base/events.xsl
branches/Version-2_0-branch/eventplanner/templates/base/permission.xsl
branches/Version-2_0-branch/eventplanner/templates/base/report.xsl
branches/Version-2_0-branch/eventplannerfrontend/
branches/Version-2_0-branch/phpgwapi/templates/frontend/
branches/Version-2_0-branch/rental/inc/class.uilookup.inc.php
branches/Version-2_0-branch/rental/js/rental/email_out.edit.js
Removed Paths:
-------------
branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
branches/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
branches/Version-2_0-branch/eventplanner/templates/base/vendor_report.xsl
Property Changed:
----------------
branches/Version-2_0-branch/
branches/Version-2_0-branch/booking/
branches/Version-2_0-branch/bookingfrontend/
Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch 2017-01-31 19:59:07 UTC (rev 16213)
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/dev-syncromind:13653
-/branches/dev-syncromind-2:14933-16129
+/branches/dev-syncromind-2:14933-16188
/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,16132-16140,16142
\ No newline at end of property
+/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,16132-16140,16142,16144-16212
\ No newline at end of property
Modified:
branches/Version-2_0-branch/activitycalendarfrontend/inc/class.hook_helper.inc.php
===================================================================
---
branches/Version-2_0-branch/activitycalendarfrontend/inc/class.hook_helper.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++
branches/Version-2_0-branch/activitycalendarfrontend/inc/class.hook_helper.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -30,23 +30,34 @@
*/
class activitycalendarfrontend_hook_helper
{
+ private $perform_action = false;
- public function set_cookie_domain()
+ public function __construct()
{
$script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
-
+
if(preg_match('/activitycalendarfrontend/',
$script_path))
{
- //get from local config
- $config = CreateObject('phpgwapi.config',
'activitycalendarfrontend');
- $config->read();
+ $this->perform_action = true;
+ }
+ }
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+ public function set_cookie_domain()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
- if
(!empty($config->config_data['cookie_domain']))
- {
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
- }
- }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'activitycalendarfrontend');
+ $config->read();
+
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+
+ if (!empty($config->config_data['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
+ }
}
}
\ No newline at end of file
Modified: branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
===================================================================
--- branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/admin/inc/class.uiaccounts.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -108,7 +108,7 @@
&&
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::EDIT, 'admin')
&&
!$GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
{
- return;
+ return $this->jquery_results(array('results' =>
array(), 'total_records' => 0));
}
$type = phpgw::get_var('type');
Index: branches/Version-2_0-branch/booking
===================================================================
--- branches/Version-2_0-branch/booking 2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/booking 2017-01-31 19:59:07 UTC (rev 16213)
Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
-/branches/dev-syncromind-2/booking:14933-16129
+/branches/dev-syncromind-2/booking:14933-16188
/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
\ No newline at end of property
+/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,16144-16212
\ No newline at end of property
Modified: branches/Version-2_0-branch/booking/inc/class.uimetasettings.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uimetasettings.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/booking/inc/class.uimetasettings.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -22,7 +22,9 @@
public function index()
{
- $config = CreateObject('phpgwapi.config', 'booking');
+ $appname = phpgw::get_var('appname');
+ $appname = $appname ? $appname : 'booking';
+ $config = CreateObject('phpgwapi.config', $appname);
$config->read();
if ($_SERVER['REQUEST_METHOD'] == 'POST')
Index: branches/Version-2_0-branch/bookingfrontend
===================================================================
--- branches/Version-2_0-branch/bookingfrontend 2017-01-31 16:01:32 UTC (rev
16212)
+++ branches/Version-2_0-branch/bookingfrontend 2017-01-31 19:59:07 UTC (rev
16213)
Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
-/branches/dev-syncromind-2/bookingfrontend:14933-16129
+/branches/dev-syncromind-2/bookingfrontend:14933-16188
/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
\ No newline at end of property
+/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,16144-16212
\ No newline at end of property
Modified: branches/Version-2_0-branch/bookingfrontend/change.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/change.php 2017-01-31
16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/bookingfrontend/change.php 2017-01-31
19:59:07 UTC (rev 16213)
@@ -16,10 +16,10 @@
include_once('../header.inc.php');
$GLOBALS['phpgw']->sessions = createObject('phpgwapi.sessions');
}
+ $config = createobject('phpgwapi.config', 'bookingfrontend')->read();
+ $login = $config['anonymous_user'];
+ $passwd = $config['anonymous_passwd'];
- $login = "bookingguest";
- $passwd = "bkbooking";
-
$_POST['submitit'] = "";
$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,
$passwd);
$GLOBALS['phpgw']->session->appsession('tenant_id', 'property',
$tenant_id);
Modified:
branches/Version-2_0-branch/bookingfrontend/inc/class.hook_helper.inc.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/inc/class.hook_helper.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/bookingfrontend/inc/class.hook_helper.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -31,23 +31,33 @@
class bookingfrontend_hook_helper
{
+ private $perform_action = false;
- public function set_cookie_domain()
+ public function __construct()
{
$script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
-
+
if(preg_match('/bookingfrontend/', $script_path))
{
- //get from local config
- $config = CreateObject('phpgwapi.config',
'bookingfrontend');
- $config->read();
+ $this->perform_action = true;
+ }
+ }
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+ public function set_cookie_domain()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'bookingfrontend');
+ $config->read();
- if
(!empty($config->config_data['cookie_domain']))
- {
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
- }
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+
+ if (!empty($config->config_data['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
}
}
}
\ No newline at end of file
Modified:
branches/Version-2_0-branch/bookingfrontend/setup/default_records.inc.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/setup/default_records.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/bookingfrontend/setup/default_records.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -13,12 +13,14 @@
if (!$GLOBALS['phpgw']->accounts->exists('bookingguest')) // no guest
account already exists
{
+ $passwd = $GLOBALS['phpgw']->common->randomstring(6) . "ABab1!";
+
$GLOBALS['phpgw_info']['server']['password_level'] = '8CHAR';
$account = new phpgwapi_user();
$account->lid = 'bookingguest';
$account->firstname = 'booking';
$account->lastname = 'Guest';
- $account->passwd = 'bkbooking';
+ $account->passwd = $passwd;
$account->enabled = true;
$account->expires = -1;
$bookingguest = $GLOBALS['phpgw']->accounts->create($account,
array(), array(), $modules);
@@ -25,6 +27,12 @@
$preferences = createObject('phpgwapi.preferences');
$preferences->set_account_id($bookingguest);
- $preferences->add('bookingfrontend', 'template_set',
'bkbooking');
+ $preferences->add('common', 'template_set', 'bookingfrontend');
$preferences->save_repository(true, $GLOBALS['type']);
+
+ $config = CreateObject('phpgwapi.config', 'bookingfrontend');
+ $config->read();
+ $config->value('anonymous_user', 'bookingguest');
+ $config->value('anonymous_passwd', $passwd);
+ $config->save_repository();
}
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bobooking.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -68,6 +68,7 @@
public function read($params)
{
+ $status_text = array(lang('inactive'), lang('active'));
if(empty($params['filters']['active']))
{
$params['filters']['active'] = 1;
@@ -84,6 +85,7 @@
$entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
$entry['from_'] =
$GLOBALS['phpgw']->common->show_date($entry['from_']);
$entry['to_'] =
$GLOBALS['phpgw']->common->show_date($entry['to_']);
+ $entry['status'] =
$status_text[$entry['active']];
}
return $values;
}
@@ -104,7 +106,59 @@
public function update_active_status( $ids, $action )
{
- return
eventplanner_sobooking::get_instance()->update_active_status($ids, $action);
+ if($action == 'enable' && $ids)
+ {
+ $_ids = array();
+ $application_id =
eventplanner_sobooking::get_instance()->read_single($ids[0],
true)->application_id;
+
+ $application =
createObject('eventplanner.boapplication')->read_single($application_id);
+ $params = array();
+ $params['filters']['active'] = 1;
+ $params['filters']['application_id'] =
$application_id;
+
+ $bookings =
eventplanner_sobooking::get_instance()->read($params);
+
+ $number_of_active =
(int)$bookings['total_records'];
+ $limit = (int)$application->num_granted_events;
+
+
+ foreach ($ids as $id)
+ {
+ if($limit > $number_of_active)
+ {
+ $_ids[] = $id;
+ $number_of_active ++;
+ }
+ else
+ {
+ $message = lang('maximum of
granted events are reached');
+
phpgwapi_cache::message_set($message, 'error');
+ break;
+ }
+ }
+ }
+ else if ($action == 'delete' && $ids)
+ {
+ foreach ($ids as $id)
+ {
+ $booking =
eventplanner_sobooking::get_instance()->read_single($id, true);
+ if(!$booking->customer_id)
+ {
+ $_ids[] = $id;
+ }
+ else
+ {
+ $message = lang('can not delete
booking with customer');
+
phpgwapi_cache::message_set($message, 'error');
+ }
+ }
+ }
+ else
+ {
+ $_ids = $ids;
+ }
+
+ return
eventplanner_sobooking::get_instance()->update_active_status($_ids, $action);
}
public function update_schedule( $id, $from_ )
Copied:
branches/Version-2_0-branch/eventplanner/inc/class.bocustomer_report.inc.php
(from rev 16212, trunk/eventplanner/inc/class.bocustomer_report.inc.php)
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/class.bocustomer_report.inc.php
(rev 0)
+++
branches/Version-2_0-branch/eventplanner/inc/class.bocustomer_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,112 @@
+<?php
+ /**
+ * phpGroupWare
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
+ * @internal
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id:$
+ */
+
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('eventplanner.socustomer_report');
+
+ include_class('eventplanner', 'customer_report', 'inc/model/');
+
+ class eventplanner_bocustomer_report extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public $cats;
+
+ public function __construct()
+ {
+ $this->fields =
eventplanner_customer_report::get_fields();
+ $this->acl_location =
eventplanner_customer_report::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$bo == null)
+ {
+ self::$bo = new
eventplanner_bocustomer_report();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_socustomer_report::get_instance()->store($object);
+ $this->store_post_commit($object);
+ return $ret;
+ }
+
+ public function read($params)
+ {
+ if (isset($params['filters']['category_id']) &&
$params['filters']['category_id'] > 0)
+ {
+ $category_id =
$params['filters']['category_id'];
+ $cat_list = $this->cats->return_sorted_array(0,
false, '', '', '', false, $category_id, false);
+ $cat_filter = array($category_id);
+ foreach ($cat_list as $_category)
+ {
+ $cat_filter[] = $_category['id'];
+ }
+ $params['filters']['category_id'] = $cat_filter;
+ }
+
+ $values =
eventplanner_socustomer_report::get_instance()->read($params);
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
+ $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_socustomer_report::get_instance()->read_single($id,
$return_object);
+ }
+ else
+ {
+ $values = new eventplanner_customer_report();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/class.boevents.inc.php
(from rev 16212, trunk/eventplanner/inc/class.boevents.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.boevents.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.boevents.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,115 @@
+<?php
+ /**
+ * phpGroupWare
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
+ * @internal
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id:$
+ */
+
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('eventplanner.soevents');
+
+ include_class('eventplanner', 'application', 'inc/model/');
+
+ class eventplanner_boevents extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public $cats;
+
+ public function __construct()
+ {
+ $this->fields = eventplanner_application::get_fields();
+ $this->acl_location =
eventplanner_application::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$bo == null)
+ {
+ self::$bo = new eventplanner_boevents();
+ }
+ return self::$bo;
+ }
+
+ /**
+ * Nothing to store - just reporting
+ * @param type $object
+ */
+ public function store($object)
+ {
+ }
+
+ public function read($params)
+ {
+ if (isset($params['filters']['category_id']) &&
$params['filters']['category_id'] > 0)
+ {
+ $category_id =
$params['filters']['category_id'];
+ $cat_list = $this->cats->return_sorted_array(0,
false, '', '', '', false, $category_id, false);
+ $cat_filter = array($category_id);
+ foreach ($cat_list as $_category)
+ {
+ $cat_filter[] = $_category['id'];
+ }
+ $params['filters']['category_id'] = $cat_filter;
+ }
+
+ $values =
eventplanner_soevents::get_instance()->read($params);
+ $status_text =
eventplanner_application::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ $entry['status'] =
$status_text[$entry['status']];
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
+ $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
+ $entry['case_officer_id'] =
$entry['case_officer_id'] ?
$GLOBALS['phpgw']->accounts->get($entry['case_officer_id'])->__toString() : '';
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ if ($id)
+ {
+ $values =
eventplanner_soevents::get_instance()->read_single($id, $return_object);
+ }
+ else
+ {
+ $values = new eventplanner_application();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/class.bopermission.inc.php
(from rev 16212, trunk/eventplanner/inc/class.bopermission.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bopermission.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bopermission.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,123 @@
+<?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 permission
+ * @version $Id:$
+ */
+
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ phpgw::import_class('phpgwapi.bocommon');
+ phpgw::import_class('eventplanner.sopermission');
+
+ include_class('eventplanner', 'permission', 'inc/model/');
+
+ class eventplanner_bopermission extends phpgwapi_bocommon
+ {
+ protected static
+ $bo,
+ $fields,
+ $acl_location;
+
+ public function __construct()
+ {
+ $this->fields = eventplanner_permission::get_fields();
+ $this->acl_location =
eventplanner_permission::acl_location;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$bo == null)
+ {
+ self::$bo = new eventplanner_bopermission();
+ }
+ return self::$bo;
+ }
+
+ public function store($object)
+ {
+ $this->store_pre_commit($object);
+ $ret =
eventplanner_sopermission::get_instance()->store($object);
+ $this->store_post_commit($object);
+ return $ret;
+ }
+
+ public function read($params)
+ {
+ if(empty($params['filters']['active']))
+ {
+ $params['filters']['active'] = 1;
+ }
+ else
+ {
+ unset($params['filters']['active']);
+ }
+
+ $organization_number =
phpgw::get_var('organization_number', 'bool');
+ $values =
eventplanner_sopermission::get_instance()->read($params);
+ // $status_text =
eventplanner_permission::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ foreach ($values['results'] as &$entry)
+ {
+ // $entry['status'] =
$status_text[$entry['status']];
+ if($organization_number)
+ {
+ $entry['name'] .= "
[{$entry['organization_number']}]";
+ }
+ $entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
+ $entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
+ }
+ return $values;
+ }
+
+ public function read_single($id, $return_object = true)
+ {
+ phpgw::import_class('eventplanner.sovendor');
+ phpgw::import_class('eventplanner.socustomer');
+
+ if ($id)
+ {
+ $values =
eventplanner_sopermission::get_instance()->read_single($id, $return_object);
+ //Temporary hack...
+ if($values->object_type == 'vendor')
+ {
+ $object =
eventplanner_sovendor::get_instance()->read_single($values->object_id,
$return_object);
+ }
+ if($values->object_type == 'customer')
+ {
+ $object =
eventplanner_socustomer::get_instance()->read_single($values->object_id,
$return_object);
+ }
+ $values->object_name = $object->name;
+ }
+ else
+ {
+ $values = new eventplanner_permission();
+ }
+
+ return $values;
+ }
+ }
\ No newline at end of file
Deleted: branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.boresource.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -1,98 +0,0 @@
-<?php
- /**
- * phpGroupWare
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License v2 or later
- * @internal
- * @package eventplanner
- * @subpackage resource
- * @version $Id:$
- */
-
- /*
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
- phpgw::import_class('phpgwapi.bocommon');
- phpgw::import_class('eventplanner.soresource');
-
- include_class('eventplanner', 'resource', 'inc/model/');
-
- class eventplanner_boresource extends phpgwapi_bocommon
- {
- protected static
- $bo,
- $fields,
- $acl_location;
-
- public function __construct()
- {
- $this->fields = eventplanner_resource::get_fields();
- $this->acl_location =
eventplanner_resource::acl_location;
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- if (self::$bo == null)
- {
- self::$bo = new eventplanner_boresource();
- }
- return self::$bo;
- }
-
- public function store($object)
- {
- $this->store_pre_commit($object);
- $ret =
eventplanner_soresource::get_instance()->store($object);
- $this->store_post_commit($object);
- return $ret;
- }
-
- public function read($params)
- {
- $values =
eventplanner_soresource::get_instance()->read($params);
- $status_text = eventplanner_resource::get_status_list();
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- foreach ($values['results'] as &$entry)
- {
- $entry['status'] =
$status_text[$entry['status']];
- $entry['entry_date'] =
$GLOBALS['phpgw']->common->show_date($entry['entry_date']);
- $entry['date_start'] =
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
- $entry['date_end'] =
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
- $entry['executive_officer'] =
$entry['executive_officer'] ?
$GLOBALS['phpgw']->accounts->get($entry['executive_officer'])->__toString() :
'';
- }
- return $values;
- }
-
- public function read_single($id, $return_object = true)
- {
- if ($id)
- {
- $values =
eventplanner_soresource::get_instance()->read_single($id, $return_object);
- }
- else
- {
- $values = new eventplanner_resource();
- }
-
- return $values;
- }
- }
\ No newline at end of file
Modified: branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bovendor.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -86,7 +86,7 @@
// $entry['status'] =
$status_text[$entry['status']];
if($organization_number)
{
- $entry['name'] .= "
[{$entry['vendor_organization_number']}]";
+ $entry['name'] .= "
[{$entry['organization_number']}]";
}
$entry['created'] =
$GLOBALS['phpgw']->common->show_date($entry['created']);
$entry['modified'] =
$GLOBALS['phpgw']->common->show_date($entry['modified']);
Modified: branches/Version-2_0-branch/eventplanner/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.menu.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.menu.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -62,11 +62,22 @@
{
$menus['admin'] = array
(
+ 'index' => array
+ (
+ 'text' => lang('Configuration'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index',
+ 'appname' =>
'eventplanner'))
+ ),
'acl' => array(
'text' =>
$GLOBALS['phpgw']->translation->translate('Configure Access Permissions',
array(), true),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl',
'acl_app' =>
'eventplanner'))
),
+ 'permission' => array
+ (
+ 'text' => lang('permission'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uipermission.index') )
+ ),
'list_atrribs' => array(
'text' =>
$GLOBALS['phpgw']->translation->translate('custom fields', array(), true),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute',
@@ -151,10 +162,10 @@
'text' => lang('application'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.index'))
),
- 'resource' => array(
- 'text' => lang('resource'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uiresource.index")),
- 'image' => array('resource', 'navbar'),
+ 'events' => array(
+ 'text' => lang('events'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"eventplanner.uievents.index")),
+ 'image' => array('events', 'navbar'),
),
'customer' => array(
'text' => lang('customer'),
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.soapplication.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -37,6 +37,7 @@
{
parent::__construct('eventplanner_application',
eventplanner_application::get_fields());
$this->acl_location =
eventplanner_application::acl_location;
+ $this->use_acl = true;
$this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
$this->cats->supress_info = true;
}
@@ -55,7 +56,76 @@
return self::$so;
}
+ public function _get_cols_and_joins( $filters = array() )
+ {
+ $cols_joins = parent::_get_cols_and_joins($filters);
+ $cols = $cols_joins[0];
+ $joins = $cols_joins[1];
+
+ $joins[] = " JOIN eventplanner_vendor on
eventplanner_vendor.id=eventplanner_application.vendor_id";
+
+ return array($cols, $joins);
+ }
+
+
+ function get_acl_condition( )
+ {
+ $clause = '';
+
+ if($this->use_acl && $this->currentapp &&
$this->acl_location)
+ {
+ $paranthesis = false;
+
+ $grants =
$this->acl->get_grants2($this->currentapp, $this->acl_location);
+ $public_user_list = array();
+ if (is_array($grants['accounts']) &&
$grants['accounts'])
+ {
+ foreach($grants['accounts'] as $user =>
$_right)
+ {
+ $public_user_list[] = $user;
+ }
+ unset($user);
+ reset($public_user_list);
+ $clause .=
"({$this->table_name}.owner_id IN(" . implode(',', $public_user_list) . ")";
+ $paranthesis = true;
+ }
+
+ $public_group_list = array();
+ if (is_array($grants['groups']) &&
$grants['groups'])
+ {
+ foreach($grants['groups'] as $user =>
$_right)
+ {
+ $public_group_list[] = $user;
+ }
+ unset($user);
+ reset($public_group_list);
+ $where = $public_user_list ? 'OR' :
'AND';
+ if(!$paranthesis)
+ {
+ $clause .='(';
+ }
+ $clause .= " $where
phpgw_group_map.group_id IN(" . implode(',', $public_group_list) . ")";
+
+ $paranthesis = true;
+ }
+
+ if($this->currentapp == 'eventplannerfrontend')
+ {
+ $where = $clause ? 'OR' : 'AND';
+ $org_id =
phpgw::get_var('org_id','string' , 'SESSION', -1);
+ $clause .= " {$where}
eventplanner_vendor.organization_number = '{$org_id}'";
+ }
+
+ if($paranthesis)
+ {
+ $clause .=')';
+ }
+ }
+
+ return $clause;
+ }
+
protected function populate( array $data )
{
$object = new eventplanner_application();
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sobooking.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -139,18 +139,25 @@
{
case 'disable':
$sql = "UPDATE eventplanner_booking SET
active = 0";
+ $where = 'WHERE';
break;
case 'enable':
$sql = "UPDATE eventplanner_booking SET
active = 1";
+ $where = 'WHERE';
break;
+ case 'delete':
+ $sql = "DELETE FROM
eventplanner_booking WHERE customer_id IS NULL";
+ $where = 'AND';
+ break;
+
default:
throw new Exception("action {$action}
not supported");
break;
}
- $sql .= 'WHERE id IN(' . implode(',', $ids) . ')';
+ $sql .= " {$where} id IN(". implode(',', $ids) . ')';
$this->db->transaction_begin();
$this->db->query($sql,__LINE__,__FILE__);
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.socustomer.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -27,6 +27,7 @@
* @version $Id: $
*/
phpgw::import_class('phpgwapi.socommon');
+ include_class('eventplanner', 'customer', 'inc/model/');
class eventplanner_socustomer extends phpgwapi_socommon
{
Copied:
branches/Version-2_0-branch/eventplanner/inc/class.socustomer_report.inc.php
(from rev 16212, trunk/eventplanner/inc/class.socustomer_report.inc.php)
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/class.socustomer_report.inc.php
(rev 0)
+++
branches/Version-2_0-branch/eventplanner/inc/class.socustomer_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,138 @@
+<?php
+ /**
+ * phpGroupWare - property: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_socustomer_report extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+
parent::__construct('eventplanner_booking_customer_report',
eventplanner_customer_report::get_fields());
+ $this->acl_location =
eventplanner_customer_report::acl_location;
+ $this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
+ $this->cats->supress_info = true;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.socustomer_report');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_customer_report();
+ foreach ($this->fields as $field => $field_info)
+ {
+ $object->set_field($field, $data[$field]);
+ }
+
+ return $object;
+ }
+
+ function get_category_name( $cat_id )
+ {
+ static $category_name = array();
+
+ if (!isset($category_name[$cat_id]))
+ {
+ $category = $this->cats->return_single($cat_id);
+ $category_name[$cat_id] = $category[0]['name'];
+ }
+ return $category_name[$cat_id];
+ }
+
+ protected function update( $object )
+ {
+ $this->db->transaction_begin();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $original =
$this->read_single($object->get_id());//returned as array()
+ foreach ($this->fields as $field => $params)
+ {
+ $new_value = $object->$field;
+ $old_value = $original[$field];
+ if (!empty($params['history']) && ($new_value
!= $old_value))
+ {
+ $label = !empty($params['label']) ?
lang($params['label']) : $field;
+ switch ($field)
+ {
+ case 'status':
+ $old_value =
$status_text[$old_value];
+ $new_value =
$status_text[$new_value];
+ break;
+ case 'date_start':
+ case 'date_end':
+ $old_value =
$GLOBALS['phpgw']->common->show_date($old_value, $dateformat);
+ $new_value =
$GLOBALS['phpgw']->common->show_date($new_value, $dateformat);
+
+ break;
+ case 'case_officer_id':
+ $old_value = $old_value
? $GLOBALS['phpgw']->accounts->get($old_value)->__toString() : '';
+ $new_value = $new_value
? $GLOBALS['phpgw']->accounts->get($new_value)->__toString() : '';
+ break;
+ case 'category_id':
+ $old_value = $old_value
? $this->get_category_name($old_value) : '';
+ $new_value = $new_value
? $this->get_category_name($new_value) : '';
+ break;
+ default:
+ break;
+ }
+ $value_set = array
+ (
+ 'customer_report_id' =>
$object->get_id(),
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
+ 'type' => 'history',
+ );
+
+ $this->db->query( 'INSERT INTO
eventplanner_customer_report_comment (' . implode( ',', array_keys( $value_set
) ) . ') VALUES ('
+ . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
+ }
+
+ }
+
+ parent::update($object);
+
+ return $this->db->transaction_commit();
+ }
+
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/class.soevents.inc.php
(from rev 16212, trunk/eventplanner/inc/class.soevents.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.soevents.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.soevents.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,63 @@
+<?php
+ /**
+ * phpGroupWare - property: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.soapplication');
+
+ class eventplanner_soevents extends eventplanner_soapplication
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->use_acl = false;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.soevents');
+ }
+ return self::$so;
+ }
+
+
+
+
+ protected function update( $object )
+ {
+ //nothing;
+ }
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/class.sopermission.inc.php
(from rev 16212, trunk/eventplanner/inc/class.sopermission.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sopermission.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sopermission.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,116 @@
+<?php
+ /**
+ * phpGroupWare - property: a part of a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage permission
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.socommon');
+
+ class eventplanner_sopermission extends phpgwapi_socommon
+ {
+
+ protected static $so;
+
+ public function __construct()
+ {
+ parent::__construct('eventplanner_permission',
eventplanner_permission::get_fields());
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('eventplanner.sopermission');
+ }
+ return self::$so;
+ }
+
+
+ protected function populate( array $data )
+ {
+ $object = new eventplanner_permission();
+ foreach ($this->fields as $field => $field_info)
+ {
+ $object->set_field($field, $data[$field]);
+ }
+
+ return $object;
+ }
+
+ protected function update( $object )
+ {
+ $this->db->transaction_begin();
+ // $status_text =
eventplanner_permission::get_status_list();
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $lang_active = lang('active');
+ $lang_inactive = lang('inactive');
+
+ $original =
$this->read_single($object->get_id());//returned as array()
+ foreach ($this->fields as $field => $params)
+ {
+ $new_value = $object->$field;
+ $old_value = $original[$field];
+ if (!empty($params['history']) && ($new_value
!= $old_value))
+ {
+ $label = !empty($params['label']) ?
lang($params['label']) : $field;
+ switch ($field)
+ {
+ case 'status':
+ $old_value =
$status_text[$old_value];
+ $new_value =
$status_text[$new_value];
+ break;
+ case 'active':
+ $old_value = $old_value
? $lang_active : $lang_inactive;
+ $new_value = $new_value
? $lang_active : $lang_inactive;
+ break;
+ default:
+ break;
+ }
+ $value_set = array
+ (
+ 'permission_id' =>
$object->get_id(),
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
+ 'type' => 'history',
+ );
+
+ $this->db->query( 'INSERT INTO
eventplanner_permission_comment (' . implode( ',', array_keys( $value_set ) )
. ') VALUES ('
+ . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
+ }
+
+ }
+
+ parent::update($object);
+
+ return $this->db->transaction_commit();
+ }
+
+ }
\ No newline at end of file
Deleted: branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.soresource.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -1,120 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a part of a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this resource was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
- phpgw::import_class('phpgwapi.socommon');
-
- class eventplanner_soresource extends phpgwapi_socommon
- {
-
- protected static $so;
-
- public function __construct()
- {
- parent::__construct('eventplanner_resource',
eventplanner_resource::get_fields());
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- if (self::$so == null)
- {
- self::$so =
CreateObject('eventplanner.soresource');
- }
- return self::$so;
- }
-
-
- protected function populate( array $data )
- {
- $object = new eventplanner_resource();
- foreach ($this->fields as $field => $field_info)
- {
- $object->set_field($field, $data[$field]);
- }
-
- return $object;
- }
-
- protected function update( $object )
- {
- $this->db->transaction_begin();
- $status_text = eventplanner_resource::get_status_list();
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $original =
$this->read_single($object->get_id());//returned as array()
- foreach ($this->fields as $field => $params)
- {
- $new_value = $object->$field;
- $old_value = $original[$field];
- if (!empty($params['history']) && ($new_value
!= $old_value))
- {
- $label = !empty($params['label']) ?
lang($params['label']) : $field;
- switch ($field)
- {
- case 'status':
- $old_value =
$status_text[$old_value];
- $new_value =
$status_text[$new_value];
- break;
- case 'date_start':
- case 'date_end':
- $old_value =
$GLOBALS['phpgw']->common->show_date($old_value, $dateformat);
- $new_value =
$GLOBALS['phpgw']->common->show_date($new_value, $dateformat);
-
- break;
- case 'executive_officer':
- $old_value = $old_value
? $GLOBALS['phpgw']->accounts->get($old_value)->__toString() : '';
- $new_value = $new_value
? $GLOBALS['phpgw']->accounts->get($new_value)->__toString() : '';
- break;
- default:
- break;
- }
- $value_set = array
- (
- 'resource_id' =>
$object->get_id(),
- 'time' => time(),
- 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
- 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
- 'type' => 'history',
- );
-
- $this->db->query( 'INSERT INTO
eventplanner_resource_comment (' . implode( ',', array_keys( $value_set ) )
. ') VALUES ('
- . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
- }
-
- }
-
- parent::update($object);
-
- return $this->db->transaction_commit();
- }
-
- }
\ No newline at end of file
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -38,6 +38,7 @@
'add' => true,
'index' => true,
'query' => true,
+ 'get_list'=> true,
'view' => true,
'edit' => true,
'save' => true,
@@ -45,17 +46,19 @@
protected
$fields,
- $permissions;
+ $permissions,
+ $currentapp;
public function __construct()
{
parent::__construct();
- self::set_active_menu('eventplanner::application');
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('application');
$this->bo = createObject('eventplanner.boapplication');
$this->cats = & $this->bo->cats;
$this->fields = eventplanner_application::get_fields();
$this->permissions =
eventplanner_application::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
self::set_active_menu("{$this->currentapp}::application");
}
private function get_status_options( $selected = 0 )
@@ -80,8 +83,9 @@
$combos[] = array(
'type' => 'autocomplete',
'name' => 'vendor',
- 'app' => 'eventplanner',
+ 'app' => $this->currentapp,
'ui' => 'vendor',
+ 'function' => 'get_list',
'label_attr' => 'name',
'text' => lang('vendor') . ':',
'requestGenerator' => 'requestWithVendorFilter'
@@ -145,11 +149,11 @@
),
'datatable' => array(
'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uiapplication.index',
+ 'menuaction' =>
"{$this->currentapp}.uiapplication.index",
'phpgw_return_as' => 'json'
)),
'allrows' => true,
- 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uiapplication.add')),
+ 'new_item' =>
self::link(array('menuaction' => "{$this->currentapp}.uiapplication.add")),
'editor_action' => '',
'field' => parent::_get_fields()
)
@@ -175,9 +179,9 @@
(
'my_name' => 'view',
'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link( array
(
- 'menuaction' =>
'eventplanner.uiapplication.view'
+ 'menuaction' =>
"{$this->currentapp}.uiapplication.view"
)),
'parameters' => json_encode($parameters)
);
@@ -186,14 +190,14 @@
(
'my_name' => 'edit',
'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uiapplication.edit'
+ 'menuaction' =>
"{$this->currentapp}.uiapplication.edit"
)),
'parameters' => json_encode($parameters)
);
- self::add_javascript('eventplanner', 'portico',
'application.index.js');
+ self::add_javascript('eventplannerfrontend', 'portico',
'application.index.js');
phpgwapi_jquery::load_widget('numberformat');
self::render_template_xsl('datatable_jquery', $data);
@@ -206,7 +210,7 @@
public function edit( $values = array(), $mode = 'edit' )
{
$active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
- $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
+ // $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
if (empty($this->permissions[PHPGW_ACL_ADD]))
{
phpgw::no_access();
@@ -221,8 +225,9 @@
$id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
$application = $this->bo->read_single($id);
}
+ $config = CreateObject('phpgwapi.config',
'eventplanner')->read();
+ $default_category =
!empty($config['default_application_category']) ?
$config['default_application_category'] : null;
-
$tabs = array();
$tabs['first_tab'] = array(
'label' => lang('application'),
@@ -282,9 +287,9 @@
array('key' => 'id', 'label' => lang('id'),
'sortable' => true, 'resizeable' => true,'formatter' =>
'JqueryPortico.formatLink'),
array('key' => 'from_', 'label' =>
lang('From'), 'sortable' => false, 'resizeable' => true),
array('key' => 'to_', 'label' => lang('To'),
'sortable' => false, 'resizeable' => true),
- array('key' => 'active', 'label' =>
lang('active'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'status', 'label' =>
lang('status'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'customer_name', 'label' =>
lang('who'), 'sortable' => true, 'resizeable' => true),
array('key' => 'location', 'label' =>
lang('location'), 'sortable' => false, 'resizeable' => true),
- array('key' => 'customer_name', 'label' =>
lang('who'), 'sortable' => true, 'resizeable' => true),
array('key' => 'comment', 'label' =>
lang('Note'), 'sortable' => false, 'resizeable' => true),
array('key' => 'application_id', 'hidden' =>
true),
);
@@ -315,6 +320,13 @@
onActionsClick('disable');"
),
array(
+ 'my_name' => 'delete',
+ 'text' => lang('delete'),
+ 'type' => 'custom',
+ 'custom_code' => "
+
onActionsClick('delete');"
+ ),
+ array(
'my_name' => 'edit',
'text' => lang('edit'),
'type' => 'custom',
@@ -325,7 +337,7 @@
$datatable_def[] = array(
'container' => 'datatable-container_1',
- 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'eventplanner.uibooking.query',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uibooking.query",
'filter_application_id' => $id,
'filter_active' => 1,
'phpgw_return_as' => 'json'))),
@@ -375,14 +387,14 @@
// die();
$data = array(
'datatable_def' => $datatable_def,
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiapplication.index',)),
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uiapplication.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uiapplication.index",)),
'application' => $application,
- 'new_vendor_url' =>
self::link(array('menuaction' => 'eventplanner.uivendor.add')),
+ 'new_vendor_url' =>
self::link(array('menuaction' => "{$this->currentapp}.uivendor.add")),
'list_case_officer' => array('options' =>
$case_officer_options),
'cat_select' =>
$this->cats->formatted_xslt_list(array(
'select_name' => 'category_id',
- 'selected' =>
$application->category_id,
+ 'selected' =>
$application->category_id ? $application->category_id : $default_category,
'use_acl' => $this->_category_acl,
'required' => true)),
'status_list' => array('options' =>
$this->get_status_options($application->status)),
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -38,6 +38,7 @@
'add' => true,
'index' => true,
'query' => true,
+ 'get_list'=> true,
'view' => true,
'edit' => true,
'save' => true,
@@ -47,16 +48,18 @@
);
protected
$fields,
- $permissions;
+ $permissions,
+ $currentapp;
public function __construct()
{
parent::__construct();
- self::set_active_menu('eventplanner::booking');
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('booking');
$this->bo = createObject('eventplanner.bobooking');
$this->fields = eventplanner_booking::get_fields();
$this->permissions =
eventplanner_booking::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ self::set_active_menu("{$this->currentapp}::booking");
}
public function index()
@@ -83,8 +86,9 @@
array(
'type' =>
'autocomplete',
'name' =>
'application',
- 'app' =>
'eventplanner',
+ 'app' =>
$this->currentapp,
'ui' =>
'application',
+ 'function' =>
'get_list',
'label_attr' =>
'title',
'text' =>
lang('application') . ':',
'requestGenerator' => 'requestWithApplicationFilter'
@@ -101,7 +105,7 @@
),
'datatable' => array(
'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uibooking.index',
+ 'menuaction' =>
"{$this->currentapp}.uibooking.index",
'phpgw_return_as' => 'json'
)),
'allrows' => true,
@@ -124,9 +128,9 @@
(
'my_name' => 'view',
'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uibooking.view'
+ 'menuaction' =>
"{$this->currentapp}.uibooking.view"
)),
'parameters' => json_encode($parameters)
);
@@ -135,9 +139,9 @@
(
'my_name' => 'edit',
'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uibooking.edit'
+ 'menuaction' =>
"{$this->currentapp}.uibooking.edit"
)),
'parameters' => json_encode($parameters)
);
@@ -229,7 +233,7 @@
$datatable_def[] = array(
'container' => 'datatable-container_1',
- 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'eventplanner.uivendor_report.query',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uivendor_report.query",
'filter_booking_id' => $id,
'filter_active' => 1,
'phpgw_return_as' => 'json'))),
@@ -255,12 +259,12 @@
'type' => 'custom',
'className' => 'add',
'custom_code' => "
-
add_report('vendor');"
+
add_report('customer');"
)
);
$datatable_def[] = array(
'container' => 'datatable-container_2',
-// 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'eventplanner.uicustomer_report.query',
+// 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uicustomer_report.query",
// 'filter_booking_id' => $id,
// 'filter_active' => 1,
// 'phpgw_return_as' => 'json'))),
@@ -299,22 +303,35 @@
}
}
+
+
+
+ $application_url = self::link(array('menuaction' =>
"{$this->currentapp}.uiapplication.edit", 'id' => $booking->application_id));
+ $lang_application = lang('application');
+ if($this->currentapp == 'eventplannerfrontend')
+ {
+ $application_url =
self::link(array('menuaction' => "{$this->currentapp}.uievents.edit", 'id' =>
$booking->application_id));
+ $lang_application = lang('event');
+ }
+
+
$data = array(
'datatable_def' => $datatable_def,
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uibooking.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uibooking.index',)),
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uibooking.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uibooking.index",)),
'booking' => $booking,
'application' => $application,
'application_type_list' =>
$application_type_list,
- 'new_customer_url' =>
self::link(array('menuaction' => 'eventplanner.uicustomer.add')),
- 'application_url' =>
self::link(array('menuaction' => 'eventplanner.uiapplication.edit', 'id' =>
$booking->application_id)),
- 'customer_url' => self::link(array('menuaction'
=> 'eventplanner.uicustomer.edit', 'id' => $booking->customer_id)),
+ 'new_customer_url' =>
self::link(array('menuaction' => "{$this->currentapp}.uicustomer.add")),
+ 'application_url' => $application_url,
+ 'lang_application' => $lang_application,
+ 'customer_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer.edit", 'id' => $booking->customer_id)),
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab
);
phpgwapi_jquery::formvalidator_generate(array());
- self::add_javascript('eventplanner', 'portico',
'booking.edit.js');
+ self::add_javascript($this->currentapp, 'portico',
'booking.edit.js');
phpgwapi_jquery::load_widget('autocomplete');
self::render_template_xsl(array('booking',
'datatable_inline'), array($mode => $data));
}
@@ -344,11 +361,11 @@
}
else
{
- return array
- (
+ $messages = phpgwapi_cache::message_get(true);
+ return array(
'status_kode' => 'error',
'status' => lang('error'),
- 'msg' => lang('messages_form_error')
+ 'msg' => $messages ? $messages :
lang('did not validate')
);
}
}
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uicustomer.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -46,16 +46,18 @@
protected
$fields,
- $permissions;
+ $permissions,
+ $currentapp;
public function __construct()
{
parent::__construct();
- self::set_active_menu('eventplanner::customer');
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('customer');
$this->bo = createObject('eventplanner.bocustomer');
$this->fields = eventplanner_customer::get_fields();
$this->permissions =
eventplanner_customer::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ self::set_active_menu("{$this->currentapp}::customer");
}
private function get_category_options( $selected = 0 )
@@ -107,7 +109,7 @@
'list' =>
$this->get_category_options()
),
array(
- 'type' =>
'checkbox',
+ 'type' =>
$this->currentapp == 'eventplanner' ? 'checkbox' : 'hidden',
'name' =>
'filter_active',
'text' =>
lang('showall'),
'value' => 1,
@@ -118,11 +120,11 @@
),
'datatable' => array(
'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uicustomer.index',
+ 'menuaction' =>
"{$this->currentapp}.uicustomer.index",
'phpgw_return_as' => 'json'
)),
'allrows' => true,
- 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uicustomer.add')),
+ 'new_item' =>
self::link(array('menuaction' => "{$this->currentapp}.uicustomer.add")),
'editor_action' => '',
'field' => parent::_get_fields()
)
@@ -141,9 +143,9 @@
(
'my_name' => 'view',
'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uicustomer.view'
+ 'menuaction' =>
"{$this->currentapp}.uicustomer.view"
)),
'parameters' => json_encode($parameters)
);
@@ -152,9 +154,9 @@
(
'my_name' => 'edit',
'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uicustomer.edit'
+ 'menuaction' =>
"{$this->currentapp}.uicustomer.edit"
)),
'parameters' => json_encode($parameters)
);
@@ -224,8 +226,8 @@
$data = array(
'datatable_def' => $datatable_def,
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uicustomer.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uicustomer.index',)),
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer.index",)),
'customer' => $customer,
'category_list' => array('options' =>
$this->get_category_options( $customer->category_id )),
'mode' => $mode,
@@ -233,7 +235,7 @@
'value_active_tab' => $active_tab
);
phpgwapi_jquery::formvalidator_generate(array());
- self::add_javascript('eventplanner', 'portico',
'customer.edit.js');
+ self::add_javascript('eventplannerfrontend', 'portico',
'validate.js');
self::render_template_xsl(array('customer',
'datatable_inline'), array($mode => $data));
}
Copied:
branches/Version-2_0-branch/eventplanner/inc/class.uicustomer_report.inc.php
(from rev 16212, trunk/eventplanner/inc/class.uicustomer_report.inc.php)
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/class.uicustomer_report.inc.php
(rev 0)
+++
branches/Version-2_0-branch/eventplanner/inc/class.uicustomer_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,263 @@
+<?php
+/**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+// include_class('eventplanner', 'customer_report', 'inc/model/');
+
+ class eventplanner_uicustomer_report extends phpgwapi_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ );
+
+ protected
+ $fields,
+ $permissions,
+ $custom_fields,
+ $currentapp;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('customer report');
+ $this->bo =
createObject('eventplanner.bocustomer_report');
+ $this->cats = & $this->bo->cats;
+ $this->fields =
eventplanner_customer_report::get_fields();
+ $this->permissions =
eventplanner_customer_report::get_instance()->get_permission_array();
+ $this->custom_fields =
eventplanner_customer_report::get_instance()->get_custom_fields();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
self::set_active_menu("{$this->currentapp}::customer_report");
+ }
+
+
+ private function _get_filters()
+ {
+ $combos = array();
+ $combos[] = array(
+ 'type' => 'autocomplete',
+ 'name' => 'customer',
+ 'app' => 'eventplanner',
+ 'ui' => 'customer',
+ 'label_attr' => 'name',
+ 'text' => lang('customer') . ':',
+ 'requestGenerator' => 'requestWithVendorFilter'
+ );
+
+ return $combos;
+
+ }
+ public function index()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ phpgwapi_jquery::load_widget('autocomplete');
+
+ $function_msg = lang('customer report');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.index",
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ // 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uicustomer_report.add')),
+ 'editor_action' => '',
+ 'field' => parent::_get_fields()
+ )
+ );
+
+ $filters = $this->_get_filters();
+
+ foreach ($filters as $filter)
+ {
+ array_unshift($data['form']['toolbar']['item'],
$filter);
+ }
+
+ $parameters = array(
+ 'parameter' => array(
+ array(
+ 'name' => 'id',
+ 'source' => 'id'
+ )
+ )
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'view',
+ 'text' => lang('show'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.view"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uicustomer_report.edit"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'customer_report.index.js');
+ phpgwapi_jquery::load_widget('numberformat');
+
+ self::render_template_xsl('datatable_jquery', $data);
+ }
+
+ /*
+ * Edit the price item with the id given in the http variable
'id'
+ */
+
+ public function edit( $values = array(), $mode = 'edit' )
+ {
+ $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ if (!empty($values['object']))
+ {
+ $customer_report = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $customer_report = $this->bo->read_single($id);
+ }
+
+ $booking_id = $customer_report->booking_id ?
$customer_report->booking_id : phpgw::get_var('booking_id', 'int');
+ $booking =
createObject('eventplanner.bobooking')->read_single($booking_id);
+
+ $application =
createObject('eventplanner.boapplication')->read_single($booking->application_id);
+ $application_type_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'application_type'));
+ $types = (array)$application->types;
+ if($types)
+ {
+ foreach ($application_type_list as
&$application_type)
+ {
+ foreach ($types as $type)
+ {
+ if((!empty($type['type_id']) &&
$type['type_id'] == $application_type['id']) || ($type ==
$application_type['id']))
+ {
+
$application_type['selected'] = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ $custom_values = $customer_report->json_representation
? $customer_report->json_representation : array();
+ $custom_fields =
createObject('booking.custom_fields','eventplanner');
+ $fields = $this->custom_fields;
+ foreach ($fields as $attrib_id => &$attrib)
+ {
+ $attrib['value'] =
isset($custom_values[$attrib['name']]) ? $custom_values[$attrib['name']] : null;
+
+ if (isset($attrib['choice']) &&
is_array($attrib['choice']) && $attrib['value'])
+ {
+ foreach ($attrib['choice'] as &$choice)
+ {
+ if (is_array($attrib['value']))
+ {
+ $choice['selected'] =
in_array($choice['id'], $attrib['value']) ? 1 : 0;
+ }
+ else
+ {
+ $choice['selected'] =
$choice['id'] == $attrib['value'] ? 1 : 0;
+ }
+ }
+ }
+ }
+// _debug_array($fields);
+ $organized_fields =
$custom_fields->organize_fields(eventplanner_customer_report::acl_location,
$fields);
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('customer report'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+ $data = array(
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer_report.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uicustomer_report.index",)),
+ 'report' => $customer_report,
+ 'booking' => $booking,
+ 'application' => $application,
+ 'application_type_list' =>
$application_type_list,
+ 'booking_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uibooking.edit", 'id' => $booking->id, 'active_tab' =>
'reports')),
+ 'mode' => $mode,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab,
+ 'attributes_group' => $organized_fields,
+ );
+ phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
+ phpgwapi_jquery::load_widget('autocomplete');
+ // self::add_javascript('eventplanner', 'portico',
'customer_report.edit.js');
+
self::render_template_xsl(array('report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
+ }
+
+
+ public function save()
+ {
+ parent::save();
+ }
+
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/class.uievents.inc.php
(from rev 16212, trunk/eventplanner/inc/class.uievents.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uievents.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uievents.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,279 @@
+<?php
+/**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage events
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'events', 'inc/model/');
+
+ class eventplanner_uievents extends phpgwapi_uicommon
+ {
+ public $public_functions = array(
+ 'index' => true,
+ 'query' => true,
+ 'edit' => true
+ );
+
+ protected
+ $fields,
+ $permissions,
+ $currentapp;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('events');
+ $this->bo = createObject('eventplanner.boevents');
+ $this->cats = & $this->bo->cats;
+ $this->fields = eventplanner_events::get_fields();
+ unset($this->fields['modified']);
+ unset($this->fields['created']);
+ unset($this->fields['contact_email']);
+ unset($this->fields['case_officer_name']);
+ $this->permissions =
eventplanner_events::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ self::set_active_menu("{$this->currentapp}::events");
+ }
+
+ private function get_status_options( $selected = 0 )
+ {
+ $status_options = array();
+ $status_list = eventplanner_events::get_status_list();
+
+ foreach ($status_list as $_key => $_value)
+ {
+ $status_options[] = array(
+ 'id' => $_key,
+ 'name' => $_value,
+ 'selected' => $_key == $selected ? 1 : 0
+ );
+ }
+ return $status_options;
+ }
+
+ private function _get_filters()
+ {
+ $combos = array();
+ $combos[] = array(
+ 'type' => 'autocomplete',
+ 'name' => 'vendor',
+ 'app' => $this->currentapp,
+ 'ui' => 'vendor',
+ 'function' => 'get_list',
+ 'label_attr' => 'name',
+ 'text' => lang('vendor') . ':',
+ 'requestGenerator' => 'requestWithVendorFilter'
+ );
+
+ $categories =
$this->cats->formatted_xslt_list(array('format' => 'filter',
+ 'selected' => $this->cat_id, 'globals'
=> true, 'use_acl' => $this->_category_acl));
+ $default_value = array('cat_id' => '', 'name' =>
lang('no category'));
+ array_unshift($categories['cat_list'], $default_value);
+
+ $_categories = array();
+ foreach ($categories['cat_list'] as $_category)
+ {
+ $_categories[] = array('id' =>
$_category['cat_id'], 'name' => $_category['name']);
+ }
+
+ $combos[] = array('type' => 'filter',
+ 'name' => 'filter_category_id',
+ 'extra' => '',
+ 'text' => lang('category'),
+ 'list' => $_categories
+ );
+
+ return $combos;
+
+ }
+ public function index()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ phpgwapi_jquery::load_widget('autocomplete');
+
+ $function_msg = lang('events');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
"{$this->currentapp}.uievents.index",
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'editor_action' => '',
+ 'field' => parent::_get_fields()
+ )
+ );
+
+ $filters = $this->_get_filters();
+
+ foreach ($filters as $filter)
+ {
+ array_unshift($data['form']['toolbar']['item'],
$filter);
+ }
+
+ $parameters = array(
+ 'parameter' => array(
+ array(
+ 'name' => 'id',
+ 'source' => 'id'
+ )
+ )
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'view',
+ 'text' => lang('show'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uievents.edit"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'events.index.js');
+ phpgwapi_jquery::load_widget('numberformat');
+
+ self::render_template_xsl('datatable_jquery', $data);
+ }
+
+
+ public function edit( )
+ {
+ $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('show');
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ $id = phpgw::get_var('id', 'int');
+ $application = $this->bo->read_single($id);
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('event'),
+ 'link' => '#first_tab',
+ 'function' => "set_tab('first_tab')"
+ );
+
+
+ $dates_def = array(
+ array('key' => 'id', 'label' => lang('id'),
'sortable' => true, 'resizeable' => true,'formatter' =>
'JqueryPortico.formatLink'),
+ array('key' => 'from_', 'label' =>
lang('From'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'to_', 'label' => lang('To'),
'sortable' => false, 'resizeable' => true),
+ array('key' => 'status', 'label' =>
lang('status'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'customer_name', 'label' =>
lang('who'), 'sortable' => true, 'resizeable' => true),
+ array('key' => 'location', 'label' =>
lang('location'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'comment', 'label' =>
lang('Note'), 'sortable' => false, 'resizeable' => true),
+ array('key' => 'application_id', 'hidden' =>
true),
+ );
+
+
+
+ $datatable_def[] = array(
+ 'container' => 'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
"{$this->currentapp}.uibooking.query",
+ 'filter_application_id' => $id,
+ // 'filter_active' => 1,
+ 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $dates_def,
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
+ $application_type_list =
execMethod('eventplanner.bogeneric.get_list', array('type' =>
'application_type'));
+ $types = (array)$application->types;
+ if($types)
+ {
+ foreach ($application_type_list as
&$application_type)
+ {
+ foreach ($types as $type)
+ {
+ if((!empty($type['type_id']) &&
$type['type_id'] == $application_type['id']) || ($type ==
$application_type['id']))
+ {
+
$application_type['selected'] = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ $category =
$this->cats->return_single($application->category_id);
+
+ $data = array(
+ 'datatable_def' => $datatable_def,
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uievents.index",)),
+ 'application' => $application,
+ 'category_name' => $category[0]['name'],
+ 'status_list' => array('options' =>
$this->get_status_options($application->status)),
+ 'application_type_list' =>
$application_type_list,
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab
+ );
+ self::render_template_xsl(array('events',
'application_info', 'datatable_inline'), array('edit' => $data));
+ }
+
+
+ public function save()
+ {
+ //Nothing to do here
+ return false;
+ }
+
+
+ public function query()
+ {
+ $params = $this->bo->build_default_read_params();
+ $params['filters']['status'] =
eventplanner_events::STATUS_APPROVED;
+ $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
Copied: branches/Version-2_0-branch/eventplanner/inc/class.uipermission.inc.php
(from rev 16212, trunk/eventplanner/inc/class.uipermission.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uipermission.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uipermission.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,233 @@
+<?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 permission was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage permission
+ * @version $Id: $
+ */
+ phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.datetime');
+
+ include_class('eventplanner', 'permission', 'inc/model/');
+
+ class eventplanner_uipermission extends phpgwapi_uicommon
+ {
+
+ public $public_functions = array(
+ 'add' => true,
+ 'index' => true,
+ 'query' => true,
+ 'view' => true,
+ 'edit' => true,
+ 'save' => true,
+ 'object' => true
+ );
+
+ protected
+ $fields,
+ $permissions,
+ $currentapp;
+
+ public function __construct()
+ {
+ parent::__construct();
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('permission');
+ $this->bo = createObject('eventplanner.bopermission');
+ $this->fields = eventplanner_permission::get_fields();
+ $this->permissions =
eventplanner_permission::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
self::set_active_menu("{$this->currentapp}::permission");
+ }
+
+ private function get_category_options( $selected = 0 )
+ {
+ $category_list = array();
+ $category_list[] = array('id' => '','name' =>
lang('select'));
+ $category_list[] = array('id' => 'customer', 'name' =>
lang('customer'));
+ // $category_list[] = array('id' => 'vendor', 'name' =>
lang('vendor'));
+
+ foreach ($category_list as $option)
+ {
+ $options['selected'] = $option['id'] ==
$selected ? 1 : 0;
+ }
+ return $category_list;
+ }
+
+ public function index()
+ {
+ if (empty($this->permissions[PHPGW_ACL_READ]))
+ {
+ phpgw::no_access();
+ }
+
+ if (phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ phpgwapi_jquery::load_widget('autocomplete');
+
+ $function_msg = lang('permission');
+
+ $data = array(
+ 'datatable_name' => $function_msg,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ array(
+ 'type' =>
'filter',
+ 'name' =>
'filter_object_type',
+ 'text' =>
lang('category'),
+ 'list' =>
$this->get_category_options()
+ )
+ )
+ )
+ ),
+ 'datatable' => array(
+ 'source' => self::link(array(
+ 'menuaction' =>
"{$this->currentapp}.uipermission.index",
+ 'phpgw_return_as' => 'json'
+ )),
+ 'allrows' => true,
+ 'new_item' =>
self::link(array('menuaction' => "{$this->currentapp}.uipermission.add")),
+ 'editor_action' => '',
+ 'field' => parent::_get_fields()
+ )
+ );
+
+ $parameters = array(
+ 'parameter' => array(
+ array(
+ 'name' => 'id',
+ 'source' => 'id'
+ )
+ )
+ );
+
+ $data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'edit',
+ 'text' => lang('edit'),
+ 'action' => self::link(array
+ (
+ 'menuaction' =>
"{$this->currentapp}.uipermission.edit"
+ )),
+ 'parameters' => json_encode($parameters)
+ );
+
+ self::add_javascript('eventplanner', 'portico',
'permission.index.js');
+ phpgwapi_jquery::load_widget('numberformat');
+
+ self::render_template_xsl('datatable_jquery', $data);
+ }
+
+ /*
+ * Edit the price item with the id given in the http variable
'id'
+ */
+
+ public function edit( $values = array(), $mode = 'edit' )
+ {
+ $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
+ $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
+ if (empty($this->permissions[PHPGW_ACL_ADD]))
+ {
+ phpgw::no_access();
+ }
+
+ if (!empty($values['object']))
+ {
+ $permission = $values['object'];
+ }
+ else
+ {
+ $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
+ $permission = $this->bo->read_single($id);
+ }
+
+ $tabs = array();
+ $tabs['first_tab'] = array(
+ 'label' => lang('permission'),
+ 'link' => '#first_tab'
+ );
+
+ $category_list = $this->get_category_options(
$permission->object_type );
+ unset($category_list[0]);
+
+ $data = array(
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uipermission.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uipermission.index",)),
+ 'permission' => $permission,
+ 'object_type_list' => array('options' =>
$category_list),
+ 'subject_list' => array('options' =>
$this->get_subjet($permission->subject_id)),
+ 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+ 'value_active_tab' => $active_tab
+ );
+
+ phpgwapi_jquery::load_widget('autocomplete');
+ phpgwapi_jquery::formvalidator_generate(array());
+ self::add_javascript('eventplanner', 'portico',
'permission.edit.js');
+ self::render_template_xsl(array('permission'),
array('edit' => $data));
+ }
+
+ public function save()
+ {
+ parent::save();
+ }
+
+ public function object()
+ {
+ $object_type = phpgw::get_var('object_type');
+
+ switch ($object_type)
+ {
+ case 'customer':
+ return
createObject('eventplanner.uicustomer')->get_list();
+ break;
+ case 'vendor':
+ return
createObject('eventplanner.uivendor')->get_list();
+ break;
+ default:
+ break;
+ }
+ }
+
+ public function get_subjet($selected = 0)
+ {
+ $users =
(array)$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_READ, 'run',
'eventplanner');
+
+ $user_list = array();
+ $user_list[] = array('id' => '','name' =>
lang('select'));
+ foreach ($users as $user)
+ {
+ $name = (isset($user['account_lastname']) ?
$user['account_lastname'] . ' ' : '') . $user['account_firstname'];
+ $user_list[] = array
+ (
+ 'id' => $user['account_id'],
+ 'name' => $name,
+ 'selected' => $user['account_id'] ==
$selected ? 1 : 0
+ );
+ }
+ return $user_list;
+ }
+ }
\ No newline at end of file
Deleted: branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiresource.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -1,312 +0,0 @@
-<?php
-/**
- * phpGroupWare - eventplanner: a part of a Facilities Management
System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
- phpgw::import_class('phpgwapi.uicommon');
- phpgw::import_class('phpgwapi.datetime');
-
- include_class('eventplanner', 'resource', 'inc/model/');
- use eventplanner_resource;
-
- class eventplanner_uiresource extends phpgwapi_uicommon
- {
-
- public $public_functions = array(
- 'add' => true,
- 'index' => true,
- 'query' => true,
- 'view' => true,
- 'edit' => true,
- 'save' => true,
- );
-
- protected
- $fields,
- $composite_types,
- $payment_methods,
- $permissions;
-
- public function __construct()
- {
- parent::__construct();
- self::set_active_menu('eventplanner::resource');
- $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('resource');
- $this->bo = createObject('eventplanner.boresource');
- $this->fields = eventplanner_resource::get_fields();
- $this->permissions =
eventplanner_resource::get_instance()->get_permission_array();
- }
-
- private function get_status_options( $selected = 0 )
- {
- $status_options = array();
- $status_list = eventplanner_resource::get_status_list();
-
- $status_options[] = array(
- 'id' => '',
- 'name' => lang('all')
- );
-
- foreach ($status_list as $_key => $_value)
- {
- $status_options[] = array(
- 'id' => $_key,
- 'name' => $_value,
- 'selected' => $_key == $selected ? 1 : 0
- );
- }
- return $status_options;
- }
-
-
- public function index()
- {
- if (empty($this->permissions[PHPGW_ACL_READ]))
- {
- phpgw::no_access();
- }
-
- if (phpgw::get_var('phpgw_return_as') == 'json')
- {
- return $this->query();
- }
-
- phpgwapi_jquery::load_widget('autocomplete');
-
- $status_options = $this->get_status_options();
- $function_msg = lang('resource');
-
- $data = array(
- 'datatable_name' => $function_msg,
- 'form' => array(
- 'toolbar' => array(
- 'item' => array(
- array(
- 'type' =>
'filter',
- 'name' =>
'filter_status',
- 'text' =>
lang('status'),
- 'list' =>
$status_options
- ),
- array('type' =>
'autocomplete',
- 'name' =>
'ecodimb',
- 'app' =>
'property',
- 'ui' =>
'generic',
- 'label_attr' =>
'descr',
- // 'show_id'=>
true,
- 'text' =>
lang('dimb') . ':',
-
'requestGenerator' => 'requestWithDimbFilter',
- ),
- )
- )
- ),
- 'datatable' => array(
- 'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uiresource.index',
- 'phpgw_return_as' => 'json'
- )),
- 'allrows' => true,
- 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uiresource.add')),
- 'editor_action' => '',
- 'field' => parent::_get_fields()
- )
- );
-
- $parameters = array(
- 'parameter' => array(
- array(
- 'name' => 'id',
- 'source' => 'id'
- )
- )
- );
-
- $data['datatable']['actions'][] = array
- (
- 'my_name' => 'view',
- 'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
- (
- 'menuaction' =>
'eventplanner.uiresource.view'
- )),
- 'parameters' => json_encode($parameters)
- );
-
- $data['datatable']['actions'][] = array
- (
- 'my_name' => 'edit',
- 'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
- (
- 'menuaction' =>
'eventplanner.uiresource.edit'
- )),
- 'parameters' => json_encode($parameters)
- );
-
- self::add_javascript('eventplanner', 'portico',
'resource.index.js');
- phpgwapi_jquery::load_widget('numberformat');
-
- self::render_template_xsl('datatable_jquery', $data);
- }
-
- /*
- * Edit the price item with the id given in the http variable
'id'
- */
-
- public function edit( $values = array(), $mode = 'edit' )
- {
- $active_tab = !empty($values['active_tab']) ?
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST',
'first_tab');
- $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('edit');
- if (empty($this->permissions[PHPGW_ACL_ADD]))
- {
- phpgw::no_access();
- }
-
- if (!empty($values['object']))
- {
- $resource = $values['object'];
- }
- else
- {
- $id = !empty($values['id']) ? $values['id'] :
phpgw::get_var('id', 'int');
- $resource = $this->bo->read_single($id);
- }
-
- if (empty($this->permissions[PHPGW_ACL_EDIT]))
- {
- $step = 1;
- }
- else if ($resource->get_id())
- {
- $step = 2;
- }
-
- $tabs = array();
- $tabs['first_tab'] = array(
- 'label' => lang('resource'),
- 'link' => '#first_tab',
- 'function' => "set_tab('first_tab')"
- );
- $tabs['party'] = array(
- 'label' => lang('party'),
- 'link' => '#party',
- 'function' => "set_tab('party')"
- );
- if($step > 1)
- {
- $tabs['assignment'] = array(
- 'label' => lang('assignment'),
- 'link' => '#assignment',
- 'function' => "set_tab('assignment')"
- );
- }
-
- $composite_types = array();
- foreach ($this->composite_types as $_key => $_value)
- {
- $composite_types[] = array('id' => $_key,
'name' => $_value);
- }
-
- $payment_methods = array();
- foreach ($this->payment_methods as $_key => $_value)
- {
- $payment_methods[] = array('id' => $_key,
'name' => $_value);
- }
-
- $bocommon = CreateObject('property.bocommon');
-
- $GLOBALS['phpgw']->jqcal->add_listener('date_start');
- $GLOBALS['phpgw']->jqcal->add_listener('date_end');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start');
-
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end');
-
- $accounts =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, '.resource',
'eventplanner');
- $executive_officer_options[] = array('id' => '', 'name'
=> lang('nobody'), 'selected' => 0);
- foreach ($accounts as $account)
- {
- $executive_officer_options[] = array(
- 'id' => $account['account_id'],
- 'name' =>
$GLOBALS['phpgw']->accounts->get($account['account_id'])->__toString(),
- 'selected' => ($account['account_id']
== $resource->executive_officer) ? 1 : 0
- );
- }
- $comments = (array)$resource->comments;
- foreach ($comments as $key => &$comment)
- {
- $comment['value_count'] = $key +1;
- $comment['value_date'] =
$GLOBALS['phpgw']->common->show_date($comment['time']);
- }
-
- $comments_def = array(
- array('key' => 'value_count', 'label' => '#',
'sortable' => true, 'resizeable' => true),
- array('key' => 'value_date', 'label' =>
lang('Date'), 'sortable' => true, 'resizeable' => true),
- array('key' => 'author', 'label' =>
lang('User'), 'sortable' => true, 'resizeable' => true),
- array('key' => 'comment', 'label' =>
lang('Note'), 'sortable' => true, 'resizeable' => true)
- );
-
- $datatable_def[] = array(
- 'container' => 'datatable-container_0',
- 'requestUrl' => "''",
- 'ColumnDefs' => $comments_def,
- 'data' => json_encode($comments),
- 'config' => array(
- array('disableFilter' => true),
- array('disablePagination' => true)
- )
- );
-
- $data = array(
- 'datatable_def' => $datatable_def,
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiresource.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uiresource.index',)),
- 'resource' => $resource,//->toArray(),
- 'list_executive_officer' => array('options' =>
$executive_officer_options),
- 'step' => $step,
- 'value_ecodimb_descr' =>
ExecMethod('property.bogeneric.get_single_attrib_value', array(
- 'type' => 'dimb',
- 'id' => $resource->ecodimb_id,
- 'attrib_name' => 'descr')
- ),
- 'district_list' => array('options' =>
$bocommon->select_district_list('', $resource->district_id)),
- 'composite_type_list' => array('options' =>
$bocommon->select_list($resource->composite_type_id, $composite_types)),
- 'payment_method_list' => array('options' =>
$bocommon->select_list($resource->payment_method, $payment_methods)),
- 'status_list' => array('options' =>
$this->get_status_options($resource->status)),
- 'mode' => $mode,
- 'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
- 'value_active_tab' => $active_tab
- );
- phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
- phpgwapi_jquery::load_widget('autocomplete');
- self::add_javascript('eventplanner', 'portico',
'resource.edit.js');
- self::render_template_xsl(array('resource',
'datatable_inline'), array($mode => $data));
- }
-
-
-// public function save()
-// {
-// parent::save();
-// }
-
- }
\ No newline at end of file
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uivendor.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -41,20 +41,23 @@
'view' => true,
'edit' => true,
'save' => true,
+ 'get_list' => true
);
protected
$fields,
- $permissions;
+ $permissions,
+ $currentapp;
public function __construct()
{
parent::__construct();
- self::set_active_menu('eventplanner::vendor');
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('vendor');
$this->bo = createObject('eventplanner.bovendor');
$this->fields = eventplanner_vendor::get_fields();
$this->permissions =
eventplanner_vendor::get_instance()->get_permission_array();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ self::set_active_menu("{$this->currentapp}::vendor");
}
private function get_category_options( $selected = 0 )
@@ -106,7 +109,7 @@
'list' =>
$this->get_category_options()
),
array(
- 'type' =>
'checkbox',
+ 'type' =>
$this->currentapp == 'eventplanner' ? 'checkbox' : 'hidden',
'name' =>
'filter_active',
'text' =>
lang('showall'),
'value' => 1,
@@ -117,11 +120,11 @@
),
'datatable' => array(
'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uivendor.index',
+ 'menuaction' =>
"{$this->currentapp}.uivendor.index",
'phpgw_return_as' => 'json'
)),
'allrows' => true,
- 'new_item' =>
self::link(array('menuaction' => 'eventplanner.uivendor.add')),
+ 'new_item' =>
self::link(array('menuaction' => "{$this->currentapp}.uivendor.add")),
'editor_action' => '',
'field' => parent::_get_fields()
)
@@ -140,9 +143,9 @@
(
'my_name' => 'view',
'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uivendor.view'
+ 'menuaction' =>
"{$this->currentapp}.uivendor.view"
)),
'parameters' => json_encode($parameters)
);
@@ -151,9 +154,9 @@
(
'my_name' => 'edit',
'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uivendor.edit'
+ 'menuaction' =>
"{$this->currentapp}.uivendor.edit"
)),
'parameters' => json_encode($parameters)
);
@@ -223,8 +226,8 @@
$data = array(
'datatable_def' => $datatable_def,
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor.index',)),
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor.index",)),
'vendor' => $vendor,
'category_list' => array('options' =>
$this->get_category_options( $vendor->category_id )),
'mode' => $mode,
@@ -232,7 +235,7 @@
'value_active_tab' => $active_tab
);
phpgwapi_jquery::formvalidator_generate(array());
- self::add_javascript('eventplanner', 'portico',
'vendor.edit.js');
+ self::add_javascript('eventplannerfrontend', 'portico',
'validate.js');
self::render_template_xsl(array('vendor',
'datatable_inline'), array($mode => $data));
}
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -29,7 +29,7 @@
phpgw::import_class('phpgwapi.uicommon');
phpgw::import_class('phpgwapi.datetime');
- include_class('eventplanner', 'vendor_report', 'inc/model/');
+// include_class('eventplanner', 'vendor_report', 'inc/model/');
class eventplanner_uivendor_report extends phpgwapi_uicommon
{
@@ -46,12 +46,12 @@
protected
$fields,
$permissions,
- $custom_fields;
+ $custom_fields,
+ $currentapp;
public function __construct()
{
parent::__construct();
- self::set_active_menu('eventplanner::vendor_report');
$GLOBALS['phpgw_info']['flags']['app_header'] .= '::' .
lang('vendor report');
$this->bo =
createObject('eventplanner.bovendor_report');
$this->cats = & $this->bo->cats;
@@ -58,6 +58,8 @@
$this->fields =
eventplanner_vendor_report::get_fields();
$this->permissions =
eventplanner_vendor_report::get_instance()->get_permission_array();
$this->custom_fields =
eventplanner_vendor_report::get_instance()->get_custom_fields();
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
self::set_active_menu("{$this->currentapp}::vendor_report");
}
@@ -103,7 +105,7 @@
),
'datatable' => array(
'source' => self::link(array(
- 'menuaction' =>
'eventplanner.uivendor_report.index',
+ 'menuaction' =>
"{$this->currentapp}.uivendor_report.index",
'phpgw_return_as' => 'json'
)),
'allrows' => true,
@@ -133,9 +135,9 @@
(
'my_name' => 'view',
'text' => lang('show'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uivendor_report.view'
+ 'menuaction' =>
"{$this->currentapp}.uivendor_report.view"
)),
'parameters' => json_encode($parameters)
);
@@ -144,9 +146,9 @@
(
'my_name' => 'edit',
'text' => lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
+ 'action' => self::link(array
(
- 'menuaction' =>
'eventplanner.uivendor_report.edit'
+ 'menuaction' =>
"{$this->currentapp}.uivendor_report.edit"
)),
'parameters' => json_encode($parameters)
);
@@ -234,13 +236,13 @@
);
$data = array(
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor_report.save')),
- 'cancel_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'eventplanner.uivendor_report.index',)),
- 'vendor_report' => $vendor_report,
+ 'form_action' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor_report.save")),
+ 'cancel_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uivendor_report.index",)),
+ 'report' => $vendor_report,
'booking' => $booking,
'application' => $application,
'application_type_list' =>
$application_type_list,
- 'booking_url' => self::link(array('menuaction'
=> 'eventplanner.uibooking.edit', 'id' => $booking->id, 'active_tab' =>
'reports')),
+ 'booking_url' => self::link(array('menuaction'
=> "{$this->currentapp}.uibooking.edit", 'id' => $booking->id, 'active_tab' =>
'reports')),
'mode' => $mode,
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
'value_active_tab' => $active_tab,
@@ -248,8 +250,8 @@
);
phpgwapi_jquery::formvalidator_generate(array('date',
'security', 'file'));
phpgwapi_jquery::load_widget('autocomplete');
- self::add_javascript('eventplanner', 'portico',
'vendor_report.edit.js');
-
self::render_template_xsl(array('vendor_report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
+ // self::add_javascript('eventplanner', 'portico',
'vendor_report.edit.js');
+
self::render_template_xsl(array('report','application_info',
'datatable_inline', 'attributes_form'), array($mode => $data));
}
Copied: branches/Version-2_0-branch/eventplanner/inc/hook_config.inc.php (from
rev 16212, trunk/eventplanner/inc/hook_config.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/hook_config.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/hook_config.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,44 @@
+<?php
+ /**
+ * Eventplanner - configuration hook
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2000-2009 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @package phpgroupware
+ * @subpackage eventplanner
+ * @category hooks
+ * @version $Id: hook_config.inc.php 15466 2016-08-15 17:36:10Z
sigurdne $
+ */
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ /**
+ * Get HTML listbox with categories that are candidates for the dimb
responsibility_1
+ *
+ * @param $config
+ * @return string HTML listbox to be placed in a table
+ */
+ function default_application_category( $config )
+ {
+ $cats = CreateObject('phpgwapi.categories', -1, 'eventplanner',
'.application');
+ $cats->supress_info = true;
+
+ $selected = isset($config['default_application_category']) ?
$config['default_application_category'] : null;
+ $cat_select = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+ $cat_select .= $cats->formatted_list(array('selected' =>
$selected));
+ return $cat_select;
+ }
+
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-31 16:01:32 UTC (rev 16212)
+++
branches/Version-2_0-branch/eventplanner/inc/model/class.application.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -48,6 +48,7 @@
$vendor_id,
$vendor_name,
$status,
+ $num_granted_events,
$created,
$modified,
$secret,
@@ -121,7 +122,9 @@
public static function get_fields($debug = true)
{
- $fields = array(
+ $currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+ $fields = array(
'id' => array('action'=> PHPGW_ACL_READ,
'type' => 'int',
'label' => 'id',
@@ -128,11 +131,6 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
- 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'label' => 'active',
- 'history' => true,
- ),
'display_in_dashboard' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'bool'),
'category_id' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
@@ -139,9 +137,9 @@
'type' => 'int',
'label' => 'category',
'history' => true),
- 'status' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'num_granted_events' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int',
- 'label' => 'status',
+ 'label' => 'number of granted events',
'history' => true
),
'created' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD,
@@ -159,8 +157,6 @@
'label' => 'secret',
'sortable' => false,
),
-/* 'frontend_modified' => array('action'=>
PHPGW_ACL_READ,
- 'type' => 'date'),*/
'owner_id' => array('action'=> PHPGW_ACL_ADD,
'type' => 'int',
'required' => false
@@ -227,24 +223,6 @@
'column' => 'name'
)
),
- 'case_officer_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'required' => true,
- 'label' => 'case officer',
- 'sortable' => true,
- 'history' => true,
- ),
- 'case_officer_name' => array('action'=>
PHPGW_ACL_READ,
- 'type' => 'string',
- 'query' => true,
- 'label' => 'case officer',
- 'join' => array(
- 'table' => 'phpgw_accounts',
- 'fkey' => 'case_officer_id',
- 'key' => 'account_id',
- 'column' => 'account_lid'
- )
- ),
'types' => array(
'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int', 'required' => true,
@@ -254,21 +232,6 @@
'column' => array(
'type_id' =>
array('type' => 'int', 'required' => true)),
)),
- 'comments' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'manytomany' => array(
- 'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_application_comment',
- 'key' => 'application_id',
- 'column' => array('time',
'author', 'comment', 'type'),
- 'order' => array('sort' =>
'time', 'dir' => 'ASC')
- )),
- 'comment' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'related' => true,
- ),
'date_start' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'date',
'label' => 'date start',
@@ -293,7 +256,7 @@
),
'timespan' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
- 'label' => 'timespan',
+ 'label' => 'event timespan',
'required' => true,
'history' => true,
),
@@ -376,15 +339,64 @@
'raider' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'string',
'required' => false,
- ),
-/*
- 'company_name' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- )*/
+ )
);
+ if($currentapp == 'eventplanner')
+ {
+ $backend_fields = array(
+ 'case_officer_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'required' => true,
+ 'label' => 'case officer',
+ 'sortable' => true,
+ 'history' => true,
+ ),
+ 'case_officer_name' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'case officer',
+ 'join' => array(
+ 'table' =>
'phpgw_accounts',
+ 'fkey' =>
'case_officer_id',
+ 'key' => 'account_id',
+ 'column' =>
'account_lid'
+ )
+ ),
+ 'active' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'active',
+ 'history' => true,
+ ),
+ 'status' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'status',
+ 'history' => true
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_application_comment',
+ 'key' =>
'application_id',
+ 'column' =>
array('time', 'author', 'comment', 'type'),
+ 'order' => array('sort'
=> 'time', 'dir' => 'ASC')
+ )),
+ 'comment' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'related' => true,
+ ),
+ );
+
+ foreach ($backend_fields as $key => $field_info)
+ {
+ $fields[$key] = $field_info;
+ }
+ }
+
+
if($debug)
{
foreach ($fields as $field => $field_info)
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active,
$completed,
$cost,
@@ -96,6 +97,10 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
'type' => 'int',
'history' => true
@@ -241,6 +246,7 @@
{
$entity->status =
eventplanner_booking::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
if (empty($entity->completed))
@@ -259,6 +265,39 @@
}
+ protected function doValidate( $entity, &$errors )
+ {
+ $application =
createObject('eventplanner.boapplication')->read_single($entity->application_id);
+ $params = array();
+ $params['filters']['active'] = 1;
+ $params['filters']['application_id'] =
$entity->application_id;
+
+ $bookings =
eventplanner_sobooking::get_instance()->read($params);
+
+ if($entity->customer_id) // update
+ {
+ $test_total_tecords =
(int)$bookings['total_records'];
+ }
+ else // new entry
+ {
+ $test_total_tecords =
(int)$bookings['total_records'] + 1;
+ }
+
+ if($test_total_tecords >
(int)$application->num_granted_events)
+ {
+ $errors['num_granted_events'] = lang('maximum
of granted events are reached');
+ }
+
+ $date_start = date('Ymd',$application->date_start);
+ $date_end = date('Ymd',$application->date_end);
+ $from_ = date('Ymd',$entity->from_);
+
+ if($from_ < $date_start || $from_ > $date_end)
+ {
+ $errors['from_'] = lang('date is outside the
scope');
+ }
+ }
+
protected function generate_secret( $length = 10 )
{
return substr(base64_encode(rand(1000000000,
9999999999)), 0, $length);
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active,
$category_id,
$created,
@@ -52,7 +53,7 @@
$address_2,
$zip_code,
$city,
- $customer_organization_number,
+ $organization_number,
$contact_name,
$contact_email,
$contact_phone,
@@ -59,9 +60,6 @@
$account_number,
$description,
$remark,
- // $customer_identifier_type,
- // $customer_ssn,
-
$comments,
$comment;
@@ -95,7 +93,9 @@
public static function get_fields($debug = true)
{
- $fields = array(
+ $currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+ $fields = array(
'id' => array('action'=> PHPGW_ACL_READ,
'type' => 'int',
'label' => 'id',
@@ -102,9 +102,9 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
- 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
'type' => 'int',
- 'history' => true
+ 'required' => false
),
'category_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int'
@@ -180,45 +180,46 @@
'query' => true,
'label' => 'contact phone',
),
-/* 'customer_identifier_type' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'label' => 'customer_identifier_type',
- ),
- 'customer_ssn' => array(
+ 'organization_number' => array(
'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'string',
- 'required' => false,
- 'query' => true,
- 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
- 'label' => 'customer_ssn'
- ),*/
- 'customer_organization_number' => array(
- 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'string',
'required' => true,
'query' => true,
'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
- 'label' => 'organization_number'
- ),
- 'comments' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'manytomany' => array(
- 'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_customer_comment',
- 'key' => 'customer_id',
- 'column' => array('time',
'author', 'comment', 'type'),
- 'order' => array('sort' =>
'time', 'dir' => 'ASC')
- )),
- 'comment' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'related' => true,
+ 'label' => 'organization number'
)
);
+ if($currentapp == 'eventplanner')
+ {
+ $backend_fields = array(
+ 'active' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'history' => true
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_vendor_comment',
+ 'key' => 'vendor_id',
+ 'column' =>
array('time', 'author', 'comment', 'type'),
+ 'order' => array('sort'
=> 'time', 'dir' => 'ASC')
+ )),
+ 'comment' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'related' => true,
+ )
+ );
+
+ foreach ($backend_fields as $key => $field_info)
+ {
+ $fields[$key] = $field_info;
+ }
+ }
+
if($debug)
{
foreach ($fields as $field => $field_info)
@@ -247,21 +248,19 @@
'type' => 'comment'
);
}
- if (!empty($entity->customer_organization_number))
+ if (!empty($entity->organization_number))
{
- $entity->customer_organization_number =
str_replace(' ', '', $entity->customer_organization_number);
+ $entity->organization_number = str_replace(' ',
'', $entity->organization_number);
}
$entity->modified = time();
$entity->active = (int)$entity->active;
- if($entity->get_id())
+ if(!$entity->get_id())
{
- }
- else
- {
$entity->status =
eventplanner_customer::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
}
Copied:
branches/Version-2_0-branch/eventplanner/inc/model/class.customer_report.inc.php
(from rev 16212, trunk/eventplanner/inc/model/class.customer_report.inc.php)
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/model/class.customer_report.inc.php
(rev 0)
+++
branches/Version-2_0-branch/eventplanner/inc/model/class.customer_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,181 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage customer_report
+ * @version $Id: $
+ */
+ phpgw::import_class('eventplanner.bocustomer_report');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_customer_report extends phpgwapi_model
+ {
+
+ const acl_location = '.customer_report';
+
+ protected
+ $id,
+ $owner_id,
+ $booking_id,
+ $booking_location,
+ $created,
+ $json_representation;
+ static $custom_fields = array();
+ protected $field_of_responsibility_name = '.customer_report';
+
+ public function __construct( int $id = null )
+ {
+ parent::__construct((int)$id);
+ $this->field_of_responsibility_name =
self::acl_location;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ return new eventplanner_customer_report();
+ }
+
+ public static function get_custom_fields()
+ {
+ static $custom_fields = array();
+ if(!$custom_fields)
+ {
+ $custom_fields =
$GLOBALS['phpgw']->custom_fields->find('eventplanner', self::acl_location, 0,
'', 'ASC', 'attrib_sort', true, true);
+ }
+ return $custom_fields;
+ }
+
+ public function get_organized_fields()
+ {
+ if (!$this->custom_fields)
+ {
+ $this->custom_fields =
createObject('booking.custom_fields',
'eventplanner')->get_organized_fields(self::acl_location);
+ }
+ return $this->custom_fields;
+ }
+
+ public static function get_fields( $debug = true )
+ {
+ $fields = array(
+ 'id' => array('action' => PHPGW_ACL_READ,
+ 'type' => 'int',
+ 'label' => 'id',
+ 'sortable' => true,
+ 'formatter' =>
'JqueryPortico.formatLink',
+ ),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
+ 'booking_id' => array('action' => PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'booking',
+ 'sortable' => true,
+ 'required' => true,
+ ),
+ 'booking_location' => array('action' =>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'location',
+ 'join' => array(
+ 'table' =>
'eventplanner_booking',
+ 'fkey' => 'booking_id',
+ 'key' => 'id',
+ 'column' => 'location'
+ )
+ ),
+ 'created' => array('action' => PHPGW_ACL_READ |
PHPGW_ACL_ADD,
+ 'type' => 'date',
+ 'label' => 'created',
+ 'sortable' => true,
+ ),
+ 'json_representation' => array('action' =>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'json',
+ 'sortable' => false,
+ ),
+ );
+
+ if ($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+ if
(!property_exists('eventplanner_customer_report', $field))
+ {
+ phpgwapi_cache::message_set('$'
. "{$field},", 'error');
+ }
+ }
+ }
+ return $fields;
+ }
+
+ /**
+ * Implement in subclasses to perform actions on entity before
validation
+ */
+ protected function preValidate( &$entity )
+ {
+ if (!empty($entity->comment))
+ {
+ $entity->comment_input = array(
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $entity->comment,
+ 'type' => 'comment'
+ );
+ }
+ $entity->modified = time();
+ $entity->active = (int)$entity->active;
+
+ if (!$entity->get_id())
+ {
+ $entity->created = time();
+ $entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ }
+ }
+
+ protected function generate_secret( $length = 10 )
+ {
+ return substr(base64_encode(rand(1000000000,
9999999999)), 0, $length);
+ }
+
+ public function serialize()
+ {
+ return self::toArray();
+ }
+
+ public function store()
+ {
+ return
eventplanner_bocustomer_report::get_instance()->store($this);
+ }
+
+ public function read_single( $id )
+ {
+ return
eventplanner_bocustomer_report::get_instance()->read_single($id, true);
+ }
+ }
\ No newline at end of file
Copied: branches/Version-2_0-branch/eventplanner/inc/model/class.events.inc.php
(from rev 16212, trunk/eventplanner/inc/model/class.events.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.events.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.events.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,54 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage application
+ * @version $Id: $
+ */
+
+ include_class('eventplanner', 'application', 'inc/model/');
+
+ class eventplanner_events extends eventplanner_application
+ {
+
+ const acl_location = '.events';
+
+ protected $field_of_responsibility_name = '.events';
+
+ public function __construct( int $id = null )
+ {
+ parent::__construct((int)$id);
+ $this->field_of_responsibility_name =
self::acl_location;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ return new eventplanner_events();
+ }
+ }
Copied:
branches/Version-2_0-branch/eventplanner/inc/model/class.permission.inc.php
(from rev 16212, trunk/eventplanner/inc/model/class.permission.inc.php)
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.permission.inc.php
(rev 0)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.permission.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -0,0 +1,157 @@
+<?php
+ /**
+ * phpGroupWare - eventplanner: a part of a Facilities Management
System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2017 Free Software Foundation, Inc.
http://www.fsf.org/
+ * This file is part of phpGroupWare.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package eventplanner
+ * @subpackage permission
+ * @version $Id: $
+ */
+
+ phpgw::import_class('eventplanner.bopermission');
+
+ include_class('phpgwapi', 'model', 'inc/model/');
+
+ class eventplanner_permission extends phpgwapi_model
+ {
+
+ const acl_location = '.admin';
+
+ protected
+ $id,
+ $subject_id,
+ $object_id,
+ $object_type,
+ $permission,
+ $subject_name;
+
+ protected $field_of_responsibility_name = '.admin';
+
+ public function __construct( int $id = null )
+ {
+ parent::__construct((int)$id);
+ $this->field_of_responsibility_name =
self::acl_location;
+ }
+
+ /**
+ * Implementing classes must return an instance of itself.
+ *
+ * @return the class instance.
+ */
+ public static function get_instance()
+ {
+ return new eventplanner_permission();
+ }
+
+ public static function get_status_list()
+ {
+ }
+
+ public static function get_fields($debug = true)
+ {
+
+ $fields = array(
+ 'id' => array('action'=> PHPGW_ACL_READ,
+ 'type' => 'int',
+ 'label' => 'id',
+ 'sortable'=> true,
+ 'formatter' =>
'JqueryPortico.formatLink',
+ ),
+ 'subject_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => true
+ ),
+ 'object_id' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'label' => 'object id',
+ 'required' => true
+ ),
+ 'object_type' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_ADD,
+ 'type' => 'string',
+ 'label' => 'object type',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'permission' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'label' => 'permission',
+ 'required' => true,
+ 'query' => true,
+ ),
+ 'subject_name' => array('action'=>
PHPGW_ACL_READ,
+ 'type' => 'string',
+ 'query' => true,
+ 'label' => 'user',
+ 'join' => array(
+ 'table' => 'phpgw_accounts',
+ 'fkey' => 'subject_id',
+ 'key' => 'account_id',
+ 'column' => 'account_lid'
+ )
+ )
+ );
+
+
+ if($debug)
+ {
+ foreach ($fields as $field => $field_info)
+ {
+
if(!property_exists('eventplanner_permission', $field))
+ {
+
phpgwapi_cache::message_set('$'."{$field},", 'error');
+ }
+
+ }
+ }
+ return $fields;
+ }
+
+ /**
+ * Implement in subclasses to perform actions on entity before
validation
+ */
+ protected function preValidate( &$entity )
+ {
+ $permission = (array) phpgw::get_var('permission',
'int');
+
+ $entity->permission = 0;//reset
+ foreach ($permission as $key => $value)
+ {
+ $entity->permission += $value;
+ }
+ }
+
+
+ public function serialize()
+ {
+ return self::toArray();
+ }
+
+ public function store()
+ {
+ return
eventplanner_bopermission::get_instance()->store($this);
+ }
+
+ public function read_single($id)
+ {
+ return
eventplanner_bopermission::get_instance()->read_single($id, true);
+ }
+ }
Deleted:
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.resource.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -1,197 +0,0 @@
-<?php
- /**
- * phpGroupWare - eventplanner: a part of a Facilities Management
System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2016 Free Software Foundation, Inc.
http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package eventplanner
- * @subpackage resource
- * @version $Id: $
- */
-
- phpgw::import_class('eventplanner.boresource');
-
- include_class('phpgwapi', 'model', 'inc/model/');
-
- class eventplanner_resource extends phpgwapi_model
- {
- const STATUS_REGISTERED = 1;
- const STATUS_PENDING = 2;
- const STATUS_REJECTED = 3;
- const STATUS_APPROVED = 4;
-
- const acl_location = '.resource';
-
- protected
- $id,
- $status,
- $category_id,
- $category_name,
- $date_start,
- $date_end,
- $active,
- $name,
- $description,
- $comment,
- $comments,
- $comment_input,
- $entry_date,
- $executive_officer;
-
- protected $field_of_responsibility_name;
-
- public function __construct( int $id = null )
- {
- parent::__construct((int)$id);
- $this->field_of_responsibility_name =
self::acl_location;
- }
-
- /**
- * Implementing classes must return an instance of itself.
- *
- * @return the class instance.
- */
- public static function get_instance()
- {
- return new eventplanner_resource();
- }
-
- public static function get_status_list()
- {
- return array(
- self::STATUS_REGISTERED => lang('registered'),
- self::STATUS_PENDING => lang('pending'),
- self::STATUS_REJECTED => lang('rejected'),
- self::STATUS_APPROVED => lang('approved')
- );
- }
-
-
- public static function get_fields($debug = true)
- {
- $fields = array(
- 'id' => array('action'=> PHPGW_ACL_READ,
- 'type' => 'int',
- 'label' => 'id',
- 'sortable'=> true,
- 'formatter' =>
'JqueryPortico.formatLink',
- ),
- 'category_id' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'label' => 'category',
- ),
- 'category_name' => array(
- 'action'=> PHPGW_ACL_READ,
- 'type' => 'string',
- 'label' => 'category',
- 'join' => array(
- 'table' =>
'eventplanner_resource_category',
- 'fkey' => 'category_id',
- 'key' => 'id',
- 'column' => 'name'
- )
- ),
- 'date_start' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
- 'type' => 'date'),
- 'date_end' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'date'),
- 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'bool'),
- 'name' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'query' => true,
- 'label' => 'name',
- ),
- 'description' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'query' => true,
- 'label' => 'description',
- ),
- 'comments' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'manytomany' => array(
- 'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_resource_comment',
- 'key' => 'resource_id',
- 'column' => array('time',
'author', 'comment', 'type'),
- 'order' => array('sort' =>
'time', 'dir' => 'ASC')
- )),
- 'comment' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'related' => true,
- ),
- 'executive_officer' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'int',
- 'label' => 'executive_officer',
- 'sortable' => true,
- 'history' => true,
- ),
-
- 'entry_date' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD,
- 'type' => 'int',
- 'label' => 'entry_date',
- 'sortable' => true,
- ),
- );
-
- if($debug)
- {
- foreach ($fields as $field => $field_info)
- {
-
if(!property_exists('eventplanner_resource', $field))
- {
- phpgwapi_cache::message_set("$field
is missing from model-definition", 'error');
- }
-
- }
- }
- return $fields;
- }
-
- /**
- * Implement in subclasses to perform actions on entity before
validation
- */
- protected function preValidate( &$entity )
- {
- }
-
- public function serialize()
- {
- return self::toArray();
- }
-
- public function store()
- {
- return
eventplanner_boresource::get_instance()->store($this);
- }
-
- public function read_single($id)
- {
- return
eventplanner_boresource::get_instance()->read_single($id, true);
- }
- }
Modified:
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-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -42,6 +42,7 @@
protected
$id,
+ $owner_id,
$active = 1,
$category_id,
$created,
@@ -52,7 +53,7 @@
$address_2,
$zip_code,
$city,
- $vendor_organization_number,
+ $organization_number,
$contact_name,
$contact_email,
$contact_phone,
@@ -59,9 +60,6 @@
$account_number,
$description,
$remark,
- // $vendor_identifier_type,
- // $vendor_ssn,
-
$comments,
$comment;
@@ -95,7 +93,9 @@
public static function get_fields($debug = true)
{
- $fields = array(
+ $currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+ $fields = array(
'id' => array('action'=> PHPGW_ACL_READ,
'type' => 'int',
'label' => 'id',
@@ -102,9 +102,9 @@
'sortable'=> true,
'formatter' =>
'JqueryPortico.formatLink',
),
- 'active' => array('action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
'type' => 'int',
- 'history' => true
+ 'required' => false
),
'category_id' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'int'
@@ -180,45 +180,47 @@
'query' => true,
'label' => 'contact phone',
),
-/* 'vendor_identifier_type' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'required' => true,
- 'label' => 'vendor_identifier_type',
- ),
- 'vendor_ssn' => array(
+ 'organization_number' => array(
'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
'type' => 'string',
- 'required' => false,
- 'query' => true,
- 'sf_validator' =>
createObject('booking.sfValidatorNorwegianSSN', array('full_required' =>
false)),
- 'label' => 'vendor_ssn'
- ),*/
- 'vendor_organization_number' => array(
- 'action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'string',
'required' => true,
'query' => true,
'sf_validator' =>
createObject('booking.sfValidatorNorwegianOrganizationNumber', array(),
array('invalid' => '%field% is invalid')),
- 'label' => 'organization_number'
+ 'label' => 'organization number'
),
- 'comments' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'manytomany' => array(
- 'input_field' =>
'comment_input',
- 'table' =>
'eventplanner_vendor_comment',
- 'key' => 'vendor_id',
- 'column' => array('time',
'author', 'comment', 'type'),
- 'order' => array('sort' =>
'time', 'dir' => 'ASC')
- )),
- 'comment' => array(
- 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
- 'type' => 'string',
- 'related' => true,
- )
);
+ if($currentapp == 'eventplanner')
+ {
+ $backend_fields = array(
+ 'active' => array('action'=>
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+ 'type' => 'int',
+ 'history' => true
+ ),
+ 'comments' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'manytomany' => array(
+ 'input_field' =>
'comment_input',
+ 'table' =>
'eventplanner_vendor_comment',
+ 'key' => 'vendor_id',
+ 'column' =>
array('time', 'author', 'comment', 'type'),
+ 'order' => array('sort'
=> 'time', 'dir' => 'ASC')
+ )),
+ 'comment' => array(
+ 'action'=> PHPGW_ACL_ADD |
PHPGW_ACL_EDIT,
+ 'type' => 'string',
+ 'related' => true,
+ )
+ );
+
+ foreach ($backend_fields as $key => $field_info)
+ {
+ $fields[$key] = $field_info;
+ }
+ }
+
+
if($debug)
{
foreach ($fields as $field => $field_info)
@@ -255,6 +257,7 @@
{
$entity->status =
eventplanner_vendor::STATUS_REGISTERED;
$entity->secret = self::generate_secret();
+ $entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
}
}
Modified:
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
===================================================================
---
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
2017-01-31 16:01:32 UTC (rev 16212)
+++
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
2017-01-31 19:59:07 UTC (rev 16213)
@@ -37,6 +37,7 @@
protected
$id,
+ $owner_id,
$booking_id,
$booking_location,
$created,
@@ -60,18 +61,14 @@
return new eventplanner_vendor_report();
}
- public function set_custom_fields()
+ public static function get_custom_fields()
{
- $this->custom_fields =
$GLOBALS['phpgw']->custom_fields->find('eventplanner', self::acl_location, 0,
'', 'ASC', 'attrib_sort', true, true);
- }
-
- public function get_custom_fields()
- {
- if (!$this->custom_fields)
+ static $custom_fields = array();
+ if(!$custom_fields)
{
- $this->set_custom_fields();
+ $custom_fields =
$GLOBALS['phpgw']->custom_fields->find('eventplanner', self::acl_location, 0,
'', 'ASC', 'attrib_sort', true, true);
}
- return $this->custom_fields;
+ return $custom_fields;
}
public function get_organized_fields()
@@ -92,6 +89,10 @@
'sortable' => true,
'formatter' =>
'JqueryPortico.formatLink',
),
+ 'owner_id' => array('action'=> PHPGW_ACL_ADD,
+ 'type' => 'int',
+ 'required' => false
+ ),
'booking_id' => array('action' => PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
'type' => 'int',
'label' => 'booking',
@@ -153,9 +154,8 @@
if (!$entity->get_id())
{
$entity->created = time();
+ $entity->secret = self::generate_secret();
$entity->owner_id =
$GLOBALS['phpgw_info']['user']['account_id'];
- $entity->status =
eventplanner_vendor_report::STATUS_REGISTERED;
- $entity->secret = self::generate_secret();
}
}
Modified:
branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
===================================================================
--- branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
2017-01-31 16:01:32 UTC (rev 16212)
+++ branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
2017-01-31 19:59:07 UTC (rev 16213)
@@ -20,7 +20,14 @@
{
return;
}
+ var id = $("#application_id").val();
+ if (id > 0)
+ {
+ document.form.submit();
+ return;
+ }
+
if (active_tab === 'first_tab')
{
$('#tab-content').responsiveTabs('activate', 1);
@@ -143,6 +150,8 @@
check_button_names = function ()
{
var tab = $("#active_tab").val();
+ var id = $("#application_id").val();
+
if (tab === 'calendar')
{
$("#floating-box").hide();
@@ -150,8 +159,16 @@
}
else if (tab === 'first_tab')
{
- $("#save_button").val(lang['next']);
- $("#save_button_bottom").val(lang['next']);
+ if (id > 0)
+ {
+ $("#save_button").val(lang['save']);
+ $("#save_button_bottom").val(lang['save']);
+ }
+ else
+ {
+ $("#save_button").val(lang['next']);
+ $("#save_button_bottom").val(lang['next']);
+ }
$("#floating-box").show();
$("#submit_group_bottom").show();
}
@@ -214,7 +231,7 @@
var requestUrl = phpGWLink('index.php', oArgs, true);
var htmlString = '';
$("#receipt").html("");
- var data = {from_: from_, active: 1};
+ var data = {from_: from_, active: 1};
JqueryPortico.execute_ajax(requestUrl,
function (result)
@@ -223,12 +240,23 @@
{
$("#from_").val('');
htmlString += "<div class=\"msg_good\">";
+ htmlString += result.msg;
}
else
{
htmlString += "<div class=\"error\">";
+ var msg = result.msg;
+ if (typeof (msg) == 'object')
+ {
+ htmlString += msg['error'][0]['msg'];
+ }
+ else
+ {
+ htmlString += result.msg;
+ }
}
- htmlString += result.msg;
+
+
htmlString += '</div>';
$("#receipt").html(htmlString);
@@ -235,7 +263,7 @@
JqueryPortico.updateinlineTableHelper('datatable-container_1');
}, data, "POST", "json"
- );
+ );
};
@@ -273,7 +301,7 @@
JqueryPortico.updateinlineTableHelper('datatable-container_1');
}, data, "POST", "json"
- );
+ );
};
@@ -332,12 +360,21 @@
{
$("#from_").val('');
htmlString += "<div
class=\"msg_good\">";
+ htmlString += result.msg;
}
else
{
htmlString += "<div class=\"error\">";
+ var msg = result.msg;
+ if (typeof (msg) == 'object')
+ {
+ htmlString +=
msg['error'][0]['msg'];
+ }
+ else
+ {
+ htmlString += result.msg;
+ }
}
- htmlString += result.msg;
htmlString += '</div>';
$("#receipt").html(htmlString);
@@ -344,6 +381,6 @@
JqueryPortico.updateinlineTableHelper('datatable-container_1');
}, data, "POST", "json"
- );
+ );
}
};
Copied: branches/Version-2_0-branch/eventplanner/js/portico/events.index.js
(from rev 16212, trunk/eventplanner/js/portico/events.index.js)
===================================================================
--- branches/Version-2_0-branch/eventplanner/js/portico/events.index.js
(rev 0)
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16213] Stable: Merge 16143:16212 from trunk,
sigurdne <=