Added status, copy and delete sync between admin_view linked views (admin_fields, admin_fields_conditions).

This commit is contained in:
2017-10-22 01:55:16 +02:00
parent a19b410adc
commit ea650f5fc1
241 changed files with 445 additions and 263 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 192 of this MVC
@build 16th October, 2017
@version @update number 202 of this MVC
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@ -878,6 +878,27 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!parent::delete($pks))
{
return false;
}
// we must also delete the linked admin fields and admin fields conditions
if (ComponentbuilderHelper::checkArray($pks))
{
// get the linked IDs
if ($fields = ComponentbuilderHelper::getVars('admin_fields', $pks, 'admin_view', 'id'))
{
// load the model
$fieldModel = ComponentbuilderHelper::getModel('admin_fields');
// delete the linked field
$fieldModel->delete($fields);
}
// get the linked IDs
if ($conditions = ComponentbuilderHelper::getVars('admin_fields_conditions', $pks, 'admin_view', 'id'))
{
// load the model
$conditionModel = ComponentbuilderHelper::getModel('admin_fields_conditions');
// delete the linked field
$conditionModel->delete($conditions);
}
}
return true;
@ -898,6 +919,27 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!parent::publish($pks, $value))
{
return false;
}
// we must also delete the linked admin fields and admin fields conditions
if (ComponentbuilderHelper::checkArray($pks))
{
// get the linked IDs
if ($fields = ComponentbuilderHelper::getVars('admin_fields', $pks, 'admin_view', 'id'))
{
// load the model
$fieldModel = ComponentbuilderHelper::getModel('admin_fields');
// change publish state
$fieldModel->publish($fields, $value);
}
// get the linked IDs
if ($conditions = ComponentbuilderHelper::getVars('admin_fields_conditions', $pks, 'admin_view', 'id'))
{
// load the model
$conditionModel = ComponentbuilderHelper::getModel('admin_fields_conditions');
// change publish state
$conditionModel->publish($conditions, $value);
}
}
return true;
@ -1139,6 +1181,26 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Add the new ID to the array
$newIds[$pk] = $newId;
}
if (ComponentbuilderHelper::checkArray($newIds))
{
foreach($newIds as $oldID => $newID)
{
// get the linked ID
if ($field = ComponentbuilderHelper::getVar('admin_fields', $oldID, 'admin_view', 'id'))
{
// copy fields to new admin view
ComponentbuilderHelper::copyItem(/*id->*/ $field, /*table->*/ 'admin_fields', /*change->*/ array('admin_view' => $newID));
}
// get the linked ID
if ($condition = ComponentbuilderHelper::getVar('admin_fields_conditions', $oldID, 'admin_view', 'id'))
{
// copy conditions to new admin view
ComponentbuilderHelper::copyItem(/*id->*/ $condition, /*table->*/ 'admin_fields_conditions', /*change->*/ array('admin_view' => $newID));
}
}
}
// Clean the cache
$this->cleanCache();

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 192 of this MVC
@build 16th October, 2017
@version @update number 202 of this MVC
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage component.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage components.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customadminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfilelist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dbtables.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicget.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ftps.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage lang.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage maingets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage matchfield.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage targetfields.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage viewtabs.php

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 192 of this MVC
@build 16th October, 2017
@version @update number 202 of this MVC
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 20th October, 2017
@build 21st October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import_joomla_components.php