Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Add Buyers to Joomla Groups for VirtueMart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VirtueMart
Add Buyers to Joomla Groups for VirtueMart
Commits
4ac82bc3
Commit
4ac82bc3
authored
10 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
First steps with upgrading to VM3
parent
44871073
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+3
-2
3 additions, 2 deletions
Makefile
buyer_assign_group.php
+23
-7
23 additions, 7 deletions
buyer_assign_group.php
buyer_assign_group.xml
+13
-5
13 additions, 5 deletions
buyer_assign_group.xml
with
39 additions
and
14 deletions
Makefile
+
3
−
2
View file @
4ac82bc3
BASE
=
buyer_assign_group
BASE
=
buyer_assign_group
PLUGINTYPE
=
vmcustom
PLUGINTYPE
=
vmcustom
ZIPBASE
=
opentools_vm2
ZIPBASE
=
opentools_vm2
VERSION
=
1.
1
VERSION
=
1.
2
PLUGINFILES
=
$(
BASE
)
.php
$(
BASE
)
.script.php
$(
BASE
)
.xml index.html
PLUGINFILES
=
$(
BASE
)
.php
$(
BASE
)
.script.php
$(
BASE
)
.xml index.html
...
@@ -9,6 +9,7 @@ TRANSLATIONS=$(call wildcard,language/*/*.plg_$(PLUGINTYPE)_$(BASE).*ini) langua
...
@@ -9,6 +9,7 @@ TRANSLATIONS=$(call wildcard,language/*/*.plg_$(PLUGINTYPE)_$(BASE).*ini) langua
# INDEXFILES=$(BASE)/index.html
# INDEXFILES=$(BASE)/index.html
INDEXFILES
=
$(
call wildcard,language/
**
/index.html
)
$(
call wildcard,elements/
*
.html
)
INDEXFILES
=
$(
call wildcard,language/
**
/index.html
)
$(
call wildcard,elements/
*
.html
)
ELEMENTS
=
$(
call wildcard,elements/
*
)
ELEMENTS
=
$(
call wildcard,elements/
*
)
FIELDS
=
$(
call wildcard,fields/
*
)
# TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) $(BASE)/index.html $(BASE)/tmpl/index.html
# TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) $(BASE)/index.html $(BASE)/tmpl/index.html
# ASSETS=$(call wildcard,$(BASE)/assets/*.png) $(call wildcard,$(BASE)/assets/*.css)
# ASSETS=$(call wildcard,$(BASE)/assets/*.png) $(call wildcard,$(BASE)/assets/*.css)
ZIPFILE
=
plg_
$(
ZIPBASE
)
_
$(
BASE
)
_v
$(
VERSION
)
.zip
ZIPFILE
=
plg_
$(
ZIPBASE
)
_
$(
BASE
)
_v
$(
VERSION
)
.zip
...
@@ -16,7 +17,7 @@ ZIPFILE=plg_$(ZIPBASE)_$(BASE)_v$(VERSION).zip
...
@@ -16,7 +17,7 @@ ZIPFILE=plg_$(ZIPBASE)_$(BASE)_v$(VERSION).zip
zip
:
$(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(TMPLFILES)
zip
:
$(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(TMPLFILES)
@
echo
"Packing all files into distribution file
$(
ZIPFILE
)
:"
@
echo
"Packing all files into distribution file
$(
ZIPFILE
)
:"
@
zip
-r
$(
ZIPFILE
)
$(
PLUGINFILES
)
$(
TRANSLATIONS
)
$(
ELEMENTS
)
$(
INDEXFILES
)
$(
TMPLFILES
)
$(
ASSETS
)
@
zip
-r
$(
ZIPFILE
)
$(
PLUGINFILES
)
$(
TRANSLATIONS
)
$(
ELEMENTS
)
$(
FIELDS
)
$(
INDEXFILES
)
$(
TMPLFILES
)
$(
ASSETS
)
clean
:
clean
:
rm
-f
$(
ZIPFILE
)
rm
-f
$(
ZIPFILE
)
...
...
This diff is collapsed.
Click to expand it.
buyer_assign_group.php
+
23
−
7
View file @
4ac82bc3
...
@@ -25,8 +25,12 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
...
@@ -25,8 +25,12 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
'shopper_groups_remove'
=>
array
(
array
(),
'array'
),
'shopper_groups_remove'
=>
array
(
array
(),
'array'
),
'purchased_status'
=>
array
(
array
(),
'array'
),
'purchased_status'
=>
array
(
array
(),
'array'
),
);
);
$this
->
setConfigParameterable
(
'custom_params'
,
$varsToPush
);
if
(
!
defined
(
'VM_VERSION'
)
or
VM_VERSION
<
3
){
$this
->
onStoreInstallPluginTable
(
$this
->
_psType
);
$this
->
setConfigParameterable
(
'custom_params'
,
$varsToPush
);
}
else
{
$this
->
setConfigParameterable
(
'customfield_params'
,
$varsToPush
);
}
// $this->onStoreInstallPluginTable($this->_psType);
}
}
/**
/**
...
@@ -36,14 +40,19 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
...
@@ -36,14 +40,19 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
function
plgVmOnProductEdit
(
$field
,
$product_id
,
&
$row
,
&
$retValue
)
{
function
plgVmOnProductEdit
(
$field
,
$product_id
,
&
$row
,
&
$retValue
)
{
if
(
$field
->
custom_element
!=
$this
->
_name
)
return
''
;
if
(
$field
->
custom_element
!=
$this
->
_name
)
return
''
;
$html
=
''
;
$html
=
''
;
$this
->
parseCustomParams
(
$field
);
if
(
!
defined
(
'VM_VERSION'
)
or
VM_VERSION
<
3
){
$this
->
parseCustomParams
(
$field
);
// Not needed in VM3!
$paramName
=
'custom_param'
;
}
else
{
$paramName
=
'customfield_params'
;
}
$html
.
=
'<table class="admintable">'
;
$html
.
=
'<table class="admintable">'
;
$html
.
=
VmHTML
::
row
(
array
(
'JHTML'
,
'_'
),
'VMCUSTOM_BUYER_GROUP_JOOMLA'
,
'access.usergroup'
,
'custom_param
['
.
$row
.
'][joomla_groups][]'
,
$field
->
joomla_groups
,
' multiple data-placeholder=" "'
,
false
);
$html
.
=
VmHTML
::
row
(
array
(
'JHTML'
,
'_'
),
'VMCUSTOM_BUYER_GROUP_JOOMLA'
,
'access.usergroup'
,
$paramName
.
'
['
.
$row
.
'][joomla_groups][]'
,
$field
->
joomla_groups
,
' multiple data-placeholder=" "'
,
false
);
$html
.
=
VmHTML
::
row
(
array
(
'JHTML'
,
'_'
),
'VMCUSTOM_BUYER_GROUP_JOOMLA_REMOVE'
,
'access.usergroup'
,
'custom_param
['
.
$row
.
'][joomla_groups_remove][]'
,
$field
->
joomla_groups_remove
,
' multiple data-placeholder=" "'
,
true
);
$html
.
=
VmHTML
::
row
(
array
(
'JHTML'
,
'_'
),
'VMCUSTOM_BUYER_GROUP_JOOMLA_REMOVE'
,
'access.usergroup'
,
$paramName
.
'
['
.
$row
.
'][joomla_groups_remove][]'
,
$field
->
joomla_groups_remove
,
' multiple data-placeholder=" "'
,
true
);
$html
.
=
VmHTML
::
row
(
array
(
'ShopFunctions'
,
'renderShopperGroupList'
),
'VMCUSTOM_BUYER_GROUP_SHOPPER'
,
$field
->
shopper_groups
,
TRUE
,
'custom_param
['
.
$row
.
'][shopper_groups][]'
,
' '
);
$html
.
=
VmHTML
::
row
(
array
(
'ShopFunctions'
,
'renderShopperGroupList'
),
'VMCUSTOM_BUYER_GROUP_SHOPPER'
,
$field
->
shopper_groups
,
TRUE
,
$paramName
.
'
['
.
$row
.
'][shopper_groups][]'
,
' '
);
$html
.
=
VmHTML
::
row
(
array
(
'ShopFunctions'
,
'renderShopperGroupList'
),
'VMCUSTOM_BUYER_GROUP_SHOPPER_REMOVE'
,
$field
->
shopper_groups_remove
,
TRUE
,
'custom_param
['
.
$row
.
'][shopper_groups_remove][]'
,
' '
);
$html
.
=
VmHTML
::
row
(
array
(
'ShopFunctions'
,
'renderShopperGroupList'
),
'VMCUSTOM_BUYER_GROUP_SHOPPER_REMOVE'
,
$field
->
shopper_groups_remove
,
TRUE
,
$paramName
.
'
['
.
$row
.
'][shopper_groups_remove][]'
,
' '
);
$html
.
=
'</table></fieldset>'
;
$html
.
=
'</table></fieldset>'
;
$retValue
.
=
$html
;
$retValue
.
=
$html
;
...
@@ -59,9 +68,16 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
...
@@ -59,9 +68,16 @@ class plgVmCustomBuyer_Assign_Group extends vmCustomPlugin {
return
$this
->
onStoreInstallPluginTable
(
$psType
,
$name
);
return
$this
->
onStoreInstallPluginTable
(
$psType
,
$name
);
}
}
// VM2 Compat:
function
plgVmDeclarePluginParamsCustom
(
$psType
,
$name
,
$id
,
&
$data
){
function
plgVmDeclarePluginParamsCustom
(
$psType
,
$name
,
$id
,
&
$data
){
return
$this
->
declarePluginParams
(
'custom'
,
$name
,
$id
,
$data
);
return
$this
->
declarePluginParams
(
'custom'
,
$name
,
$id
,
$data
);
}
}
function
plgVmDeclarePluginParamsCustomVM3
(
&
$data
){
return
$this
->
declarePluginParams
(
'custom'
,
$data
);
}
function
plgVmGetTablePluginParams
(
$psType
,
$name
,
$id
,
&
$xParams
,
&
$varsToPush
){
return
$this
->
getTablePluginParams
(
$psType
,
$name
,
$id
,
$xParams
,
$varsToPush
);
}
function
plgVmSetOnTablePluginParamsCustom
(
$name
,
$id
,
&
$table
){
function
plgVmSetOnTablePluginParamsCustom
(
$name
,
$id
,
&
$table
){
return
$this
->
setOnTablePluginParams
(
$name
,
$id
,
$table
);
return
$this
->
setOnTablePluginParams
(
$name
,
$id
,
$table
);
...
...
This diff is collapsed.
Click to expand it.
buyer_assign_group.xml
+
13
−
5
View file @
4ac82bc3
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<
install
version=
"
1
.5"
type=
"plugin"
group=
"vmcustom"
method=
"upgrade"
>
<
extension
version=
"
2
.5"
type=
"plugin"
group=
"vmcustom"
method=
"upgrade"
>
<name>
VMCUSTOM_BUYER_GROUP
</name>
<name>
VMCUSTOM_BUYER_GROUP
</name>
<creationDate>
2014-04-07
</creationDate>
<creationDate>
2014-04-07
</creationDate>
<author>
Reinhold Kainhofer
</author>
<author>
Reinhold Kainhofer
</author>
<authorUrl>
http://www.open-tools.net/
</authorUrl>
<authorUrl>
http://www.open-tools.net/
</authorUrl>
<copyright>
Copyright (C) 2013-2014 Reinhold Kainhofer. All rights reserved.
</copyright>
<copyright>
Copyright (C) 2013-2014 Reinhold Kainhofer. All rights reserved.
</copyright>
<license>
http://www.gnu.org/licenses/gpl.html GNU/GPL v3+
</license>
<license>
http://www.gnu.org/licenses/gpl.html GNU/GPL v3+
</license>
<version>
1.
1
</version>
<version>
1.
2
</version>
<description>
VMCUSTOM_BUYER_GROUP_DESC
</description>
<description>
VMCUSTOM_BUYER_GROUP_DESC
</description>
<files>
<files>
<filename
plugin=
"buyer_assign_group"
>
buyer_assign_group.php
</filename>
<filename
plugin=
"buyer_assign_group"
>
buyer_assign_group.php
</filename>
...
@@ -14,17 +14,25 @@
...
@@ -14,17 +14,25 @@
<filename>
index.html
</filename>
<filename>
index.html
</filename>
<folder>
language
</folder>
<folder>
language
</folder>
<folder>
elements
</folder>
<folder>
elements
</folder>
<folder>
fields
</folder>
</files>
</files>
<languages
folder=
"language"
>
<languages
folder=
"language"
>
<language
tag=
"en-GB"
>
en-GB/en-GB.plg_vmcustom_buyer_assign_group.ini
</language>
<language
tag=
"en-GB"
>
en-GB/en-GB.plg_vmcustom_buyer_assign_group.ini
</language>
<language
tag=
"en-GB"
>
en-GB/en-GB.plg_vmcustom_buyer_assign_group.sys.ini
</language>
<language
tag=
"en-GB"
>
en-GB/en-GB.plg_vmcustom_buyer_assign_group.sys.ini
</language>
</languages>
</languages>
<scriptfile>
buyer_assign_group.script.php
</scriptfile>
<scriptfile>
buyer_assign_group.script.php
</scriptfile>
<vmconfig>
<fields
name=
"params"
addfieldpath=
"/administrator/components/com_virtuemart/fields/"
>
<fieldset
name=
"order_status"
addfieldpath=
"/plugins/vmcustom/buyer_assign_group/fields/"
>
<field
name=
"purchased_status"
type=
"orderstatus"
default=
"C,S"
multiple=
"multiple"
label=
"VMCUSTOM_BUYER_GROUP_STATUS"
description=
"VMCUSTOM_BUYER_GROUP_STATUS_DESC"
/>
</fieldset>
</fields>
</vmconfig>
<params
addpath=
"/plugins/vmcustom/buyer_assign_group/elements/"
/>
<params
addpath=
"/plugins/vmcustom/buyer_assign_group/elements/"
/>
<params
addpath=
"/administrator/components/com_virtuemart/elements/"
>
<params
addpath=
"/administrator/components/com_virtuemart/elements/"
>
<param
type=
"vmjpluginwarning"
/>
<param
type=
"vmjpluginwarning"
/>
<param
name=
"purchased_status"
type=
"vmorderstates"
default=
"C,S"
multiple=
"multiple"
label=
"VMCUSTOM_BUYER_GROUP_STATUS"
description=
"VMCUSTOM_BUYER_GROUP_STATUS_DESC"
/>
<param
name=
"purchased_status"
type=
"vmorderstates"
default=
"C,S"
multiple=
"multiple"
label=
"VMCUSTOM_BUYER_GROUP_STATUS"
description=
"VMCUSTOM_BUYER_GROUP_STATUS_DESC"
/>
</params>
</params>
</install>
</extension>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment