Пример #1
0
 public function editCustomRecord($parameters)
 {
     $parameters['packages'] = Package::all();
     $date = new \DateTime();
     $parameters['lastRun'] = $date->setTimestamp($parameters['object']->last_run_011)->format('d-m-Y H:i:s');
     $parameters['nextRun'] = $date->setTimestamp($parameters['object']->next_run_011)->format('d-m-Y H:i:s');
     return $parameters;
 }
Пример #2
0
 public static function getRecords($args)
 {
     $query = Package::query();
     if (isset($args['active_012'])) {
         $query->where('active_012', $args['active_012']);
     }
     if (isset($args['orderBy'])) {
         $query->orderBy($args['orderBy']['column'], $args['orderBy']['order']);
     }
     return $query->get();
 }
Пример #3
0
 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postLogin(Request $request)
 {
     $this->validate($request, ['user' => 'required', 'password' => 'required']);
     $credentials = $request->only('user', 'password');
     if (auth('pulsar')->attempt($credentials, $request->has('remember'))) {
         // check if user has access
         if (!auth('pulsar')->user()->access_010) {
             auth('pulsar')->logout();
             return redirect($this->loginPath)->withInput($request->only('user', 'remember'))->withErrors(['loginErrors' => 3]);
         }
         // set user access control list
         session(['userAcl' => AclLibrary::getProfileAcl(auth('pulsar')->user()->profile_id_010)]);
         // check if user has permission to access
         if (!is_allowed('pulsar', 'access')) {
             auth('pulsar')->logout();
             return redirect($this->loginPath)->withInput($request->only('user', 'remember'))->withErrors(['loginErrors' => 2]);
         }
         session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
         session(['baseLang' => Lang::getBaseLang()]);
         return redirect()->intended($this->redirectTo);
     }
     return redirect($this->loginPath)->withInput($request->only('user', 'remember'))->withErrors(['loginErrors' => 1]);
 }
Пример #4
0
 public function updateCustomRecord($parameters)
 {
     Package::where('id_012', $parameters['id'])->update(['name_012' => $this->request->input('name'), 'folder_012' => $this->request->input('folder'), 'active_012' => $this->request->input('active', 0), 'sorting_012' => $this->request->input('sorting')]);
     // update object packages from session
     session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
 }
 /**
  * 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']);
     }
 }
Пример #6
0
 public function run()
 {
     Package::insert([['id_012' => '1', 'name_012' => 'Pulsar', 'folder_012' => '', 'sorting_012' => 1, 'active_012' => '1'], ['id_012' => '2', 'name_012' => 'Pulsar Administration Package', 'folder_012' => 'pulsar', 'sorting_012' => 2, 'active_012' => '1']]);
 }
Пример #7
0
 public function run()
 {
     Package::insert([['id_012' => '9', 'name_012' => 'CRM Package', 'folder_012' => 'crm', 'sorting_012' => 9, 'active_012' => false]]);
 }
 public function run()
 {
     Package::insert([['id_012' => '11', 'name_012' => 'Booking Package', 'folder_012' => 'booking', 'sorting_012' => 11, 'active_012' => false]]);
 }
 public function run()
 {
     Package::insert([['id_012' => '8', 'name_012' => 'Octopus Package', 'folder_012' => 'octopus', 'sorting_012' => 8, 'active_012' => false]]);
 }
Пример #10
0
 public function run()
 {
     Package::insert([['id_012' => '7', 'name_012' => 'Hotels Package', 'folder_012' => 'hotels', 'sorting_012' => 7, 'active_012' => false]]);
 }
Пример #11
0
 public function run()
 {
     Package::insert([['id_012' => '12', 'name_012' => 'Market Package', 'folder_012' => 'market', 'sorting_012' => 9, 'active_012' => false]]);
 }
Пример #12
0
 public function run()
 {
     Package::insert([['id_012' => '5', 'name_012' => 'Comunik Package', 'folder_012' => 'comunik', 'sorting_012' => 5, 'active_012' => false]]);
 }
Пример #13
0
 /**
  *  Patterns function to replace their values
  *
  * @access	public
  * @param   array   $data
  * @param   string  $index
  * @return  array
  */
 private static function replaceWildcard($data, $index)
 {
     $comunikPackage = Package::where('folder', 'comunik')->first();
     // check if comunik package is publish
     if (!is_null($comunikPackage) && $comunikPackage->active_012) {
         $data[$index] = str_replace("#link#", route('previewComunikEmailCampaign', ['campaign' => '#campaign#', 'historyId' => '#historyId#']), $data[$index]);
         $data[$index] = str_replace("#unsubscribe#", route('getUnsubscribeComunikContact', ['contactKey' => '#contactKey#']), $data[$index]);
         $data[$index] = str_replace("#pixel#", url(config('pulsar.name')) . config('comunik.trackPixel'), $data[$index]);
     }
     // Message body
     if (isset($data['contactKey'])) {
         $data[$index] = str_replace("#contactKey#", $data['contactKey'], $data[$index]);
     }
     // Contact coded ID, to track (comunik)
     if (isset($data['company'])) {
         $data[$index] = str_replace("#company#", $data['company'], $data[$index]);
     }
     // Company name (comunik)
     if (isset($data['name'])) {
         $data[$index] = str_replace("#name#", $data['name'], $data[$index]);
     }
     // Contact name (comunik)
     if (isset($data['surname'])) {
         $data[$index] = str_replace("#surname#", $data['surname'], $data[$index]);
     }
     // Contact surname (comunik)
     if (isset($data['birthDate'])) {
         $data[$index] = str_replace("#birthDate#", $data['birthDate'], $data[$index]);
     }
     // birth date (comunik)
     if (isset($data['email'])) {
         $data[$index] = str_replace("#email#", $data['email'], $data[$index]);
     }
     // Contact email (comunik)
     if (isset($data['campaign'])) {
         $data[$index] = str_replace("#campaign#", $data['campaign'], $data[$index]);
     }
     // Campaign coded ID, to track (comunik)
     if (isset($data['historyId'])) {
         $data[$index] = str_replace("#historyId#", $data['historyId'], $data[$index]);
     }
     // Sending coded ID, to track (comunik)
     $data[$index] = str_replace("#date#", date(config('pulsar.datePattern')), $data[$index]);
     // Current date
     // function designed to replace the word #subject# in the title of HTML templates
     if (isset($data['subject'])) {
         $data[$index] = str_replace("#subject#", $data['subject'], $data[$index]);
     }
     return $data;
 }
 public function run()
 {
     Package::insert([['id_012' => '6', 'name_012' => 'Projects Package', 'folder_012' => 'projects', 'sorting_012' => 6, 'active_012' => false]]);
 }
Пример #15
0
 public function run()
 {
     Package::insert([['id_012' => '14', 'name_012' => 'Spas Package', 'folder_012' => 'spas', 'sorting_012' => 14, 'active_012' => false]]);
 }
Пример #16
0
 public function run()
 {
     Package::insert([['id_012' => '13', 'name_012' => 'CMS Package', 'folder_012' => 'cms', 'sorting_012' => 13, 'active_012' => false]]);
 }
Пример #17
0
 public function run()
 {
     Package::insert([['id_012' => '4', 'name_012' => 'Forms Package', 'folder_012' => 'forms', 'sorting_012' => 4, 'active_012' => false]]);
 }
 public function run()
 {
     Package::insert([['id_012' => '15', 'name_012' => 'Wineries Package', 'folder_012' => 'wineries', 'sorting_012' => 15, 'active_012' => false]]);
 }
Пример #19
0
 public function editCustomRecord($parameters)
 {
     $parameters['packages'] = Package::all();
     return $parameters;
 }