10,
2
);
+
add_filter(
GLM_MEMBERS_PACKAGING_PLUGIN_SLUG .'-dashboard-widget',
function ( $member = null ) {
- //$content = GLM_MEMBERS_PACKAGING_PLUGIN_SLUG;
+ $packagingIndexPage = GLM_MEMBERS_PACKAGING_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-packaging-index&glm_action=index';
+ $packagesTable = GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX . "packages";
$content = [
'title' => 'Packaging',
'buttons' => [
'order' => -1,
- 'type' => 'buttons',
+ 'component' => 'buttons',
'buttons' => [
'add-package' => [
'content' => 'Add Package',
- 'url' => '#AP',
+ 'url' => $packagingIndexPage . "&option=add",
'classes' => '',
],
- 'second-button' => [
- 'content' => 'Do Other Stuff',
- 'url' => '#DOS',
- 'classes' => '',
- 'styles' => 'top: 50px;',
- ]
],
],
'quickLinks' => [
'order' => 0,
- 'type' => 'quickLinks',
+ 'component' => 'quickLinks',
'quickLinks' => [
'dashboard' => [
'content' => 'Dashboard',
- 'url' => '#dbd',
+ 'url' => $packagingIndexPage . "&option=dashboard",
],
'search' => [
'content' => 'Advanced Search',
- 'url' => '#DOS',
+ 'url' => $packagingIndexPage . "&option=search",
],
'settings' => [
'content' => 'Settings',
],
'entityAmount' => [
'order' => 1,
- 'type' => 'entityAmount',
- 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+ 'component' => 'entityAmount',
+ 'table' => $packagesTable,
+ 'url' => $packagingIndexPage . "&option=search",
],
'textSearch' => [
'order' => 2,
- 'type' => 'textSearch',
- 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+ 'component' => 'textSearch',
+ 'table' => $packagesTable,
'fields' => [
'id',
'title',
]
],
'pending' => [
+ 'title' => "Pending Packages",
+ 'slug' => "pending-packages",
'order' => 3,
- 'type' => 'list',
- 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
- 'fields' => [
- 'id',
- 'title',
- ],
- 'where' => 'status = '.$this->config['status_numb']['Pending']
+ 'component' => 'list',
+ 'table' => $packagesTable,
+ 'fields' => "id, title, ref_dest",
+ 'where' => 'status = '.$this->config['status_numb']['Pending'],
],
'expired' => [
+ 'title' => "Expired Packages",
+ 'slug' => "expired-packages",
'order' => 4,
- 'type' => 'list',
- 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
- 'fields' => [
- 'id',
- 'title',
- ],
+ 'component' => 'list',
+ 'table' => $packagesTable,
+ 'fields' => "id, title, ref_dest",
+ // 'fields' => [
+ // 'id',
+ // 'title',
+ // 'ref_dest',
+ // ],
//'where' => 'status = '.$this->config['status_numb']['Expired']
]
];