|
@@ -98,23 +98,15 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
$whmcs = App::self();
|
|
$whmcs = App::self();
|
|
|
$productID = $whmcs->get_req_var('id');
|
|
$productID = $whmcs->get_req_var('id');
|
|
|
try {
|
|
try {
|
|
|
- $customFieldIDs = Capsule::table('tblcustomfields')
|
|
|
|
|
|
|
+ $customFieldIDsObj = Capsule::table('tblcustomfields')
|
|
|
->where('relid', '=', $productID)
|
|
->where('relid', '=', $productID)
|
|
|
->select('id')
|
|
->select('id')
|
|
|
->get();
|
|
->get();
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $productID,
|
|
|
|
|
- "Debug",
|
|
|
|
|
- $customFieldIDs
|
|
|
|
|
- );
|
|
|
|
|
- Capsule::table('tblcustomfields')
|
|
|
|
|
- ->where('relid', '=', $productID)
|
|
|
|
|
- ->delete();
|
|
|
|
|
|
|
+ $customFieldIDs = recursiveFindAll($customFieldIDsObj, 'id');
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[0] ? $customFieldIDs[0] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'givenname | Vorname',
|
|
'fieldname' => 'givenname | Vorname',
|
|
@@ -125,8 +117,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[1] ? $customFieldIDs[1] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'sn | Nachname',
|
|
'fieldname' => 'sn | Nachname',
|
|
@@ -137,8 +130,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[2] ? $customFieldIDs[2] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'username | E-Mail Name',
|
|
'fieldname' => 'username | E-Mail Name',
|
|
@@ -149,8 +143,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[3] ? $customFieldIDs[3] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'maildomain | Mail Domaine',
|
|
'fieldname' => 'maildomain | Mail Domaine',
|
|
@@ -162,8 +157,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[4] ? $customFieldIDs[4] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'password | Password',
|
|
'fieldname' => 'password | Password',
|
|
@@ -174,8 +170,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[5] ? $customFieldIDs[5] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'pwrepeat | Password wiederholen',
|
|
'fieldname' => 'pwrepeat | Password wiederholen',
|
|
@@ -186,8 +183,9 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
Capsule::table('tblcustomfields')
|
|
Capsule::table('tblcustomfields')
|
|
|
- ->insert(
|
|
|
|
|
|
|
+ ->updateOrInsert(
|
|
|
array(
|
|
array(
|
|
|
|
|
+ 'id' => $customFieldIDs[6] ? $customFieldIDs[6] : '',
|
|
|
'type' => 'product',
|
|
'type' => 'product',
|
|
|
'relid' => $productID,
|
|
'relid' => $productID,
|
|
|
'fieldname' => 'cos | Class of Service',
|
|
'fieldname' => 'cos | Class of Service',
|