Category : octobercms

I added the following configurations at config/app.php file: ‘STATUS’ => [ ‘PENDING’ => [‘LABEL’=>’Pending’, ‘VALUE’=>0], ‘PACKAGING’ => [‘LABEL’=>’Packing Done’, ‘VALUE’=>1], ‘PICKUP’ => [‘LABEL’=>’Assign to Pickup’, ‘VALUE’=>2], ‘REPICKUP’ => [‘LABEL’=>’Reassign to Pickup’, ‘VALUE’=>3], ‘PICKUPDONE’ => [‘LABEL’=>’Pickup Done’, ‘VALUE’=>4], ‘ASSIGNTODELEVER’ => [‘LABEL’=>’Assign to Deliver’, ‘VALUE’=> 5], ‘REASSIGNTODELEVER’ => [‘LABEL’=>’Reassign to Deliver’, ‘VALUE’=> 6], ‘DELIVERED’ => [‘LABEL’=>’Delivered’, ‘VALUE’=> ..

Read more

I use october CMS and trying to extend some futures on one of the modules. I have settings column in my DB, that have several fields. But when user type something in this fields goes to DB like JSON : {"about":"dsadasdas","nickname":"bojko"} or {"nickname":"qnica","about":"test"} When i try to dispalay this in profile page {{ueuser.user.settings}} first gives ..

Read more

I have to set some constant values to use anywhere of the application. How can I set this constant. I am trying as follows: I set the STATUS constant at layouts/admin.htm function onStart() { if(!Auth::getUser()){ Flash::error($this[‘theme_lang’][‘not_allowed’]); return Redirect::intended(‘login’); } $this[‘STATUS’] = [ ‘PENDING’ => 0, ‘PACKAGING’ => 1, ‘PICKUP’ => 2, ‘REPICKUP’ => 3, ‘PICKUPDONE’ ..

Read more

E.g I need to add to my relation strings Like this format: Name Sername (the post) and the post I need to take from another table (at this relation i have only post_id). How can I take post.title using fields.yaml file? professors: label: Преподаватель descriptionFrom: description span: auto required: 1 type: relation select: concat(name, ‘ ..

Read more

Model definition: class DeliveryCharge extends Model { /** * @var string The database table used by the model. */ public $table = ‘delivery_charges’; /** * @var array Validation rules */ public $rules = [ ]; protected $casts = [ "locations" => "json", "time_charges" => "json", ]; public $belongsTo = [ ‘districts’ => [ ‘RainLabLocationModelsDistrict’, ‘otherKey’ ..

Read more

I’m trying to sort table using AJAX ScheduleC.php public function onSort() { $groupId = (int)post(‘groupid’); $professorId = (int)post(‘professorid’); $schedules = Schedule::orderBy(‘date’, ‘desc’)->get(); if (($groupId) && ($groupId!=’-1′)) { $this->sortByGroup($groupId, $schedules); } if (($professorId) && ($professorId!=’-1′)) { $this->sortByProfessor($professorId, $schedules); } $this->schedule = $this->page[‘schedule’] = $schedules; return $this->page[‘schedule’]; } default.php <div id="schedule-table-container"> {% partial ‘@schedule-table’ %} </div> schedule.js ..

Read more

I am trying to sort lessons by group name (in component). I take group_id by Post method using Ajax and trying to get similar lessons, but the returned array is empty. Schedule.php: public $belongsTo = [ ‘discipline’ => ‘TitamikCioModelsDiscipline’, ‘auditorium’ => ‘TitamikCioModelsAuditorium’, ‘professors’ => ‘TitamikCioModelsProfessor’, ‘groups’ => ‘TitamikCioModelsGroup’, ]; Group.php: public $hasMany = [ ‘direction’ ..

Read more

I have the following partial file structure: dashboard –forrced_popup_form –client_type.htm –forced_popup_modal.htm Now I am calling partial from admin.htm layout as follows: {% partial ‘dashboard/forced_popup_modal’ popupFor = ‘client_type’ %} And I want to include client_type.htm partial from forced_popup_modal.htm as follows: {% partial ‘dashboard/forced_popup_form/’+{{client_type}} %} I am getting an error. May be I am trying to pass ..

Read more

I’m trying to upload image-file from frontend in OctoberCMS I have a model Person and relation: public $attachOne = [ ‘photo’ => ‘SystemModelsFile’ ]; In php-block with upload form: public function onUploadImage() { $person = Person::where(‘id’, ‘=’, $this->param(‘id’))->first(); $person->photo = Input::file(‘avatar’); $person->save(); } And my template: <form method="POST" action="/persons/person/{{person.id}}" accept-charset="UTF-8" enctype="multipart/form-data"> <input type="hidden" name="_handler" value="onUploadImage"> ..

Read more

I use OctoberCms (laravel). This uses own Filesystem https://octobercms.info/docs/services-filesystem-cdn/ That is why I need to take generated $pdf as a string, and than use Storage::put(‘docs/kek.pdf’, $pdf); public function onGeneratePdf() { $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont(‘Arial’,’B’,16); $pdf->Cell(40,10,’Hello World!’); $pdf->Output(”,’S’); // I also use $pdf->Output(‘S’); Storage::put(‘docs/kek.pdf’, $pdf); return $pdf; } But it isn’t works, because Output() ..

Read more

I have the following raw sql which is perfectly working: $data = Request::all(); extract($data); $coverageAreaInMile = 2 ; $nearByShop = DB::select( "SELECT shop.id as shopId, shop_category.id as catId, favourites.user_id, favourites.status, (3956 * 2 * ASIN(SQRT( POWER(SIN(( $lat – lat) * pi()/180 / 2), 2) +COS( $lat * pi()/180) * COS(lat * pi()/180) * POWER(SIN(( $lng ..

Read more

I already installed my own plugin then add my schema in graphql/schema.graphql with vendor:publish command. This is my configuration register settings in plugin.php public function register() { App::register(‘NuwaveLighthouseLighthouseServiceProvider’); App::register(‘MLLGraphQLPlaygroundGraphQLPlaygroundServiceProvider’); } but in /graphql-playground always return Server cannot be reached and JSON.parse: unexpected character line at line 1 column 1. anyone can solve my problem ? ..

Read more

since a composer update I got this error when I run php artisan route:list : [SymfonyComponentDebugExceptionFatalThrowableError] Class name must be a valid object or a string I ran some tests and this is the lines where the error should but i don’t see why: use BusinessbecauseUsersControllersUsers; Route::get(‘/users/update/created_at’, Users::class .’@update_users_created_at’); Do you have any idea why ..

Read more

I’m developing landing page with October CMS and using Static Pages plugin. Here is my header.htm file with navigation: <div class="header" id="header"> <div class="container"> <div class="header__inner"> <div class="header__logo"> <img src="{{ ‘assets/img/logo.svg’|theme }}" alt="logo" class="logo"> </div> <nav class="nav" id="nav"> {% partial ‘menu-items’ items=staticMenu.menuItems class=’nav__list’ %} </nav> </div> </div> </div> Question is how to modify basic menu-items.htm ..

Read more