/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $response = \Syscover\Pulsar\Models\Resource::find('admin-report');
     if ($response == null) {
         \Syscover\Pulsar\Models\Resource::create(['id_007' => 'admin-report', 'name_007' => 'Reports', 'package_id_007' => '2']);
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $response = \Syscover\Pulsar\Models\Resource::find('market-tpv-paypal-web-profile');
     if ($response == null) {
         \Syscover\Pulsar\Models\Resource::create(['id_007' => 'market-tpv-paypal-web-profile', 'name_007' => 'TPVs -- PayPal -- Web profile', 'package_id_007' => '12']);
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $resource = Resource::builder()->find('forms-master-tables');
     if ($resource == null) {
         Resource::create(['id_007' => 'forms-master-tables', 'name_007' => 'Master tables', 'package_id_007' => '4']);
     }
 }
Example #4
0
 public static function getRecords($args)
 {
     $query = Resource::join('001_012_package', '001_007_resource.package_id_007', '=', '001_012_package.id_012');
     if (isset($args['active_012'])) {
         $query->where('active_012', $args['active_012']);
     }
     if (isset($args['whereIn'])) {
         $query->whereIn($args['whereIn']['column'], $args['whereIn']['ids']);
     }
     return $query->get();
 }
Example #5
0
 /**
  *  Function instance the acl of a particular profile
  *
  * @access	public
  * @param   integer     $profile
  * @return	\Zend\Permissions\Acl\Acl
  */
 public static function getProfileAcl($profile)
 {
     $acl = new AclLibrary();
     // get all resources in application
     $resources = Resource::all();
     // get all permissions fron this profile
     $permissions = Permission::getRecord($profile);
     // set profile id
     $acl->addRole(new Role($profile));
     // add resources to acl element
     foreach ($resources as $resource) {
         $acl->addResource(new AclResource($resource->id_007));
     }
     // add resources to acl element
     foreach ($permissions as $permission) {
         $acl->allow($profile, $permission->resource_id_009, $permission->action_id_009);
     }
     return $acl;
 }
Example #6
0
 public function setAllPermissions()
 {
     // get parameters from url route
     $parameters = $this->request->route()->parameters();
     $profile = Profile::find($parameters['id']);
     $resources = Resource::all();
     $actions = Action::all();
     $permissions = [];
     foreach ($resources as $resource) {
         foreach ($actions as $action) {
             $permissions[] = ['profile_id_009' => $parameters['id'], 'resource_id_009' => $resource->id_007, 'action_id_009' => $action->id_008];
         }
     }
     Permission::deleteRecordsProfile($parameters['id']);
     Permission::insert($permissions);
     // if profile it's same that our profile, overwrite ours permissions
     if ($profile->id_006 == auth('pulsar')->user()->profile_id_010) {
         session(['userAcl' => AclLibrary::getProfileAcl(auth('pulsar')->user()->profile_id_010)]);
     }
     return redirect()->route($this->routeSuffix, $parameters)->with(['msg' => 1, 'txtMsg' => trans('pulsar::pulsar.message_create_all_permissions', ['profile' => $profile->name_006])]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'spas', 'name_007' => 'Spas Package', 'package_id_007' => '14'], ['id_007' => 'spas-spa', 'name_007' => 'Spas', 'package_id_007' => '14']]);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (Resource::where('id_007', 'admin-attachment-mime')->count() == 0 && Package::where('id_012', 2)->count() == 1) {
         Resource::create(['id_007' => 'admin-attachment-mime', 'name_007' => 'Attachments - Attachment Mime', 'package_id_007' => '2']);
     }
 }
 public function run()
 {
     Resource::insert([['id_007' => 'comunik', 'name_007' => 'Comunik Package', 'package_id_007' => '5'], ['id_007' => 'comunik-contact', 'name_007' => 'Contacts', 'package_id_007' => '5'], ['id_007' => 'comunik-group', 'name_007' => 'Groups', 'package_id_007' => '5'], ['id_007' => 'comunik-email-campaign', 'name_007' => 'Email services -- Campaigns', 'package_id_007' => '5'], ['id_007' => 'comunik-email-sending', 'name_007' => 'Email services -- Sendings', 'package_id_007' => '5'], ['id_007' => 'comunik-email-template', 'name_007' => 'Email services -- Templates', 'package_id_007' => '5'], ['id_007' => 'comunik-email-message', 'name_007' => 'Email services -- Messages', 'package_id_007' => '5'], ['id_007' => 'comunik-email-pattern', 'name_007' => 'Email patterns -- Patterns', 'package_id_007' => '5'], ['id_007' => 'comunik-email-preference', 'name_007' => 'Email services -- Preferences', 'package_id_007' => '5']]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'wineries', 'name_007' => 'Wineries Package', 'package_id_007' => '15'], ['id_007' => 'wineries-winery', 'name_007' => 'Winery', 'package_id_007' => '15']]);
 }
Example #11
0
 public function updateCustomRecord($parameters)
 {
     Resource::where('id_007', $parameters['id'])->update(['id_007' => $this->request->input('id'), 'package_id_007' => $this->request->input('package'), 'name_007' => $this->request->input('name')]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'projects', 'name_007' => 'Projects Package', 'package_id_007' => '6'], ['id_007' => 'projects-project', 'name_007' => 'Project', 'package_id_007' => '6'], ['id_007' => 'projects-todo', 'name_007' => 'Todo', 'package_id_007' => '6'], ['id_007' => 'projects-user-todo', 'name_007' => 'User Todo', 'package_id_007' => '6'], ['id_007' => 'projects-billing', 'name_007' => 'Billing', 'package_id_007' => '6'], ['id_007' => 'projects-history', 'name_007' => 'History', 'package_id_007' => '6'], ['id_007' => 'projects-invoiced', 'name_007' => 'Invoiced', 'package_id_007' => '6'], ['id_007' => 'projects-user-history', 'name_007' => 'User history', 'package_id_007' => '6'], ['id_007' => 'projects-preference', 'name_007' => 'Preferences', 'package_id_007' => '6']]);
 }
Example #13
0
 public function run()
 {
     Resource::insert([['id_007' => 'market', 'name_007' => 'Market Package', 'package_id_007' => '12'], ['id_007' => 'market-cart-price-rule', 'name_007' => 'Marketing -- Cart price rule', 'package_id_007' => '12'], ['id_007' => 'market-category', 'name_007' => 'Categories', 'package_id_007' => '12'], ['id_007' => 'market-order', 'name_007' => 'Orders', 'package_id_007' => '12'], ['id_007' => 'market-order-status', 'name_007' => 'Order status', 'package_id_007' => '12'], ['id_007' => 'market-payment-method', 'name_007' => 'Payment methods', 'package_id_007' => '12'], ['id_007' => 'market-product', 'name_007' => 'Products', 'package_id_007' => '12'], ['id_007' => 'market-tax', 'name_007' => 'Taxes', 'package_id_007' => '12'], ['id_007' => 'market-tax-customer', 'name_007' => 'Taxes -- Customer class tax', 'package_id_007' => '12'], ['id_007' => 'market-tax-customer-group', 'name_007' => 'Taxes -- Group Customer class tax', 'package_id_007' => '12'], ['id_007' => 'market-tax-product', 'name_007' => 'Taxes -- Product class tax', 'package_id_007' => '12'], ['id_007' => 'market-tax-rate-zone', 'name_007' => 'Taxes -- Tax rate zone', 'package_id_007' => '12'], ['id_007' => 'market-tax-rule', 'name_007' => 'Taxes -- Tax rule', 'package_id_007' => '12'], ['id_007' => 'market-tpv', 'name_007' => 'TPVs', 'package_id_007' => '12'], ['id_007' => 'market-tpv-paypal', 'name_007' => 'TPVs -- PayPal', 'package_id_007' => '12'], ['id_007' => 'market-tpv-paypal-setting', 'name_007' => 'TPVs -- PayPal -- Setting', 'package_id_007' => '12'], ['id_007' => 'market-tpv-paypal-web-profile', 'name_007' => 'TPVs -- PayPal -- Web profile', 'package_id_007' => '12']]);
 }
 public function editCustomRecord($parameters)
 {
     $parameters['resources'] = Resource::builder()->where('active_012', true)->whereIn('id_007', config('pulsar.resourcesAttachments'))->get();
     return $parameters;
 }
 public function run()
 {
     Resource::insert([['id_007' => 'forms', 'name_007' => 'Forms Package', 'package_id_007' => '4'], ['id_007' => 'forms-state', 'name_007' => 'States', 'package_id_007' => '4'], ['id_007' => 'forms-form', 'name_007' => 'Forms', 'package_id_007' => '4'], ['id_007' => 'forms-forward', 'name_007' => 'Forwards', 'package_id_007' => '4'], ['id_007' => 'forms-record', 'name_007' => 'Records', 'package_id_007' => '4'], ['id_007' => 'forms-comment', 'name_007' => 'Comments', 'package_id_007' => '4'], ['id_007' => 'forms-preference', 'name_007' => 'Preferences', 'package_id_007' => '4'], ['id_007' => 'forms-master-tables', 'name_007' => 'Master tables', 'package_id_007' => '4']]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'booking', 'name_007' => 'Booking Package', 'package_id_007' => '11'], ['id_007' => 'booking-preference', 'name_007' => 'Preferences', 'package_id_007' => '11'], ['id_007' => 'booking-voucher', 'name_007' => 'Vouchers', 'package_id_007' => '11'], ['id_007' => 'booking-booking', 'name_007' => 'Bookings', 'package_id_007' => '11'], ['id_007' => 'booking-booking-draft', 'name_007' => 'Bookings draft', 'package_id_007' => '11'], ['id_007' => 'booking-master-tables', 'name_007' => 'Master tables', 'package_id_007' => '11'], ['id_007' => 'booking-campaign', 'name_007' => 'Campaigns', 'package_id_007' => '11'], ['id_007' => 'booking-place', 'name_007' => 'Places', 'package_id_007' => '11'], ['id_007' => 'booking-family', 'name_007' => 'Families', 'package_id_007' => '11'], ['id_007' => 'booking-product-prefix', 'name_007' => 'Product prefix', 'package_id_007' => '11']]);
 }
Example #17
0
 public function run()
 {
     Resource::insert([['id_007' => 'crm', 'name_007' => 'CRM Package', 'package_id_007' => '9'], ['id_007' => 'crm-customer', 'name_007' => 'Customers', 'package_id_007' => '9'], ['id_007' => 'crm-group', 'name_007' => 'Groups', 'package_id_007' => '9']]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'hotels', 'name_007' => 'Hotels Package', 'package_id_007' => '7'], ['id_007' => 'hotels-hotel', 'name_007' => 'Hotels', 'package_id_007' => '7'], ['id_007' => 'hotels-room', 'name_007' => 'Rooms', 'package_id_007' => '7'], ['id_007' => 'hotels-environment', 'name_007' => 'Environments', 'package_id_007' => '7'], ['id_007' => 'hotels-decoration', 'name_007' => 'Decorations', 'package_id_007' => '7'], ['id_007' => 'hotels-relationship', 'name_007' => 'Relationship', 'package_id_007' => '7'], ['id_007' => 'hotels-service', 'name_007' => 'Services', 'package_id_007' => '7'], ['id_007' => 'hotels-publication', 'name_007' => 'Publications', 'package_id_007' => '7']]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'octopus', 'name_007' => 'Octopus Package', 'package_id_007' => '8'], ['id_007' => 'octopus-preference', 'name_007' => 'Preferences', 'package_id_007' => '8'], ['id_007' => 'octopus-family', 'name_007' => 'Family', 'package_id_007' => '8'], ['id_007' => 'octopus-brand', 'name_007' => 'Brand', 'package_id_007' => '8'], ['id_007' => 'octopus-product', 'name_007' => 'Product', 'package_id_007' => '8'], ['id_007' => 'octopus-laboratory', 'name_007' => 'Laboratory', 'package_id_007' => '8'], ['id_007' => 'octopus-company', 'name_007' => 'Company', 'package_id_007' => '8'], ['id_007' => 'octopus-customer', 'name_007' => 'Customer', 'package_id_007' => '8'], ['id_007' => 'octopus-shop', 'name_007' => 'Point of sale', 'package_id_007' => '8'], ['id_007' => 'octopus-address', 'name_007' => 'Address from point of sale', 'package_id_007' => '8'], ['id_007' => 'octopus-request', 'name_007' => 'Request', 'package_id_007' => '8'], ['id_007' => 'octopus-supervisor-request', 'name_007' => 'Supervisor Request', 'package_id_007' => '8'], ['id_007' => 'octopus-order', 'name_007' => 'Order', 'package_id_007' => '8'], ['id_007' => 'octopus-laboratory-order', 'name_007' => 'Laboratory Order', 'package_id_007' => '8'], ['id_007' => 'octopus-stock', 'name_007' => 'Stock', 'package_id_007' => '8'], ['id_007' => 'octopus-supervisor-stock', 'name_007' => 'Supervisor Stock', 'package_id_007' => '8'], ['id_007' => 'octopus-laboratory-stock', 'name_007' => 'Laboratory Stock', 'package_id_007' => '8'], ['id_007' => 'octopus-delegate-stock', 'name_007' => 'Delegate Stock', 'package_id_007' => '8'], ['id_007' => 'octopus-master-tables', 'name_007' => 'Master tables', 'package_id_007' => '8']]);
 }
 public function run()
 {
     Resource::insert([['id_007' => 'admin', 'name_007' => 'Administration Package', 'package_id_007' => '2'], ['id_007' => 'admin-dashboard', 'name_007' => 'Dashboard', 'package_id_007' => '2'], ['id_007' => 'admin-country', 'name_007' => 'Countries', 'package_id_007' => '2'], ['id_007' => 'admin-country-at1', 'name_007' => 'Countries -- Territorial Areas 1', 'package_id_007' => '2'], ['id_007' => 'admin-country-at2', 'name_007' => 'Countries -- Territorial Areas 2', 'package_id_007' => '2'], ['id_007' => 'admin-country-at3', 'name_007' => 'Countries -- Territorial Areas 3', 'package_id_007' => '2'], ['id_007' => 'admin-cron', 'name_007' => 'Cron task', 'package_id_007' => '2'], ['id_007' => 'admin-email-account', 'name_007' => 'Email accounts', 'package_id_007' => '2'], ['id_007' => 'admin-google-services', 'name_007' => 'Google Services', 'package_id_007' => '2'], ['id_007' => 'admin-lang', 'name_007' => 'Languages', 'package_id_007' => '2'], ['id_007' => 'admin-package', 'name_007' => 'Packages', 'package_id_007' => '2'], ['id_007' => 'admin-perm', 'name_007' => 'Permissions', 'package_id_007' => '2'], ['id_007' => 'admin-perm-action', 'name_007' => 'Permissions -- Actions', 'package_id_007' => '2'], ['id_007' => 'admin-perm-perm', 'name_007' => 'Permissions -- Permissions', 'package_id_007' => '2'], ['id_007' => 'admin-perm-profile', 'name_007' => 'Permissions -- Profiles', 'package_id_007' => '2'], ['id_007' => 'admin-perm-resource', 'name_007' => 'Permissions -- Resources', 'package_id_007' => '2'], ['id_007' => 'admin-user', 'name_007' => 'Users', 'package_id_007' => '2'], ['id_007' => 'admin-attachment', 'name_007' => 'Attachments', 'package_id_007' => '2'], ['id_007' => 'admin-attachment-family', 'name_007' => 'Attachments - Attachment Families', 'package_id_007' => '2'], ['id_007' => 'admin-attachment-mime', 'name_007' => 'Attachments - Attachments Mimes', 'package_id_007' => '2'], ['id_007' => 'admin-attachment-library', 'name_007' => 'Attachments - Library', 'package_id_007' => '2'], ['id_007' => 'admin-field', 'name_007' => 'Custom fields', 'package_id_007' => '2'], ['id_007' => 'admin-field-value', 'name_007' => 'Custom fields - Values', 'package_id_007' => '2'], ['id_007' => 'admin-field-group', 'name_007' => 'Custom fields - Groups', 'package_id_007' => '2'], ['id_007' => 'admin-report', 'name_007' => 'Reports', 'package_id_007' => '2'], ['id_007' => 'pulsar', 'name_007' => 'Pulsar', 'package_id_007' => '1']]);
 }