Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
62d3494
Date Range picker updated to restrict future datetime
dakshhmehta Oct 14, 2019
d2eeec7
Updated dependancy for eventy
dakshhmehta Oct 22, 2019
30c9e7e
AuthController added
dakshhmehta Nov 7, 2019
1ad859a
Merge branch 'master' of github.com:dakshhmehta/AsgardCMS-Rarv-Module
dakshhmehta Nov 7, 2019
43cf6f7
Added route as well
dakshhmehta Nov 7, 2019
265ee65
Update for date picker to support future dates
dakshhmehta Nov 17, 2019
45417f0
Bump symfony/http-foundation from 3.4.21 to 3.4.36
dependabot[bot] Dec 4, 2019
6fada3b
Changed to dev-master for eventy package.
dakshhmehta Dec 24, 2019
1b448ad
Merge pull request #1 from dakshhmehta/dependabot/composer/symfony/ht…
dakshhmehta Dec 24, 2019
b1f0329
Required field * mark added and added support to use components
dakshhmehta Dec 24, 2019
263bf6f
Fix retriving value of select field
dakshhmehta Dec 24, 2019
faedb56
Resolve and support for custom value for table
dakshhmehta Dec 24, 2019
5978d64
Merge branch 'master' of github.com:dakshhmehta/AsgardCMS-Rarv-Module
dakshhmehta Dec 26, 2019
b1c09a6
Index system variable introduced, disabled links are hidden now
dakshhmehta Dec 30, 2019
0aab8a4
Fixed icon support and * for required field for textGroup field
dakshhmehta Dec 30, 2019
3940dc5
DateTimeField updated and fixed column issue for dropdown field
dakshhmehta Jan 10, 2020
da65715
Textarea macro and view updated to print index
dakshhmehta Feb 27, 2020
199dd54
Module views now registered to use from theme
dakshhmehta Mar 2, 2020
f618592
Fix import in vue components
dakshhmehta Mar 9, 2020
4f19ab7
Handling the view with custom field can be set with custom view handler
dakshhmehta Mar 17, 2020
df36f5a
TExportable tables are now supported
dakshhmehta Mar 21, 2020
775a9a5
Removed testbench from dependancy
dakshhmehta Mar 22, 2020
88f879b
CBumping the laravel excel version
dakshhmehta Mar 22, 2020
932aaf6
CBumping the laravel excel version
dakshhmehta Mar 22, 2020
beb7a90
Made with public
dakshhmehta Mar 28, 2020
dbb79a8
Added the mass deletion functionality
dakshhmehta Apr 1, 2020
164efdd
Code cleanup
dakshhmehta Apr 1, 2020
d5fd6fd
SMS API URL is now dynamic, if not set uses RI API Server, fixed the …
dakshhmehta May 15, 2020
1a694a7
SMS Channel now uses notifiable with SMSable to get mobile number whe…
dakshhmehta May 15, 2020
1e07248
SMS Channel switched to use file_get_contents to avoid SSL certificat…
dakshhmehta May 15, 2020
9ffd88c
Added helper function for ajax buttons
dakshhmehta May 28, 2020
c5f4039
Tags Input added, entity is available in setValue on field
dakshhmehta Jun 25, 2020
6f548f6
Added only table view for custom placement
dakshhmehta Jul 24, 2020
103cee4
Support custom design for table view path
dakshhmehta Jul 24, 2020
0b52a8f
Added CRUDController for quick scaffolding of Resource controller for…
dakshhmehta Jul 31, 2020
7b663af
WIP: Translatable text field and converted Form spec to phpunit
dakshhmehta Aug 12, 2020
9fc7386
Field spec converted to phpunit
dakshhmehta Aug 12, 2020
79d82d1
Translatable textbox are now supported
dakshhmehta Aug 12, 2020
8dfbcf5
Hidden print class added
dakshhmehta Nov 8, 2020
469ec66
Updated with more hidden-print class
dakshhmehta Nov 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
!.gitignore
composer.lock
!.gitignore
6 changes: 5 additions & 1 deletion Assets/js/components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import Vue from 'vue';

Vue.component('ri-datepicker', require('./components/DateRangePicker.vue'));
import DateRangePicker from "./components/DateRangePicker";
//import ActionableSelect from "./components/ActionableSelect";

Vue.component('ri-datepicker', DateRangePicker);
// Vue.component('ri-actionable-select', ActionableSelect);
41 changes: 41 additions & 0 deletions Assets/js/components/ActionableSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<div>
This is component body.
<select v-model="input" @change="valueChanged">
<slot></slot>
</select>
</div>
</template>

<script>
export default {
props: {
url: {
type: String,
required: true,
},
method: {
type: String,
default: 'PUT',
},
value: {
type: [String, Number],
default: '',
}
},
data(){
return {
input: ''
}
},
mounted(){
alert('Hello 2');
this.input = this.value;
},
methods: {
valueChanged(){
console.log(this.input);
}
}
}
</script>
26 changes: 21 additions & 5 deletions Assets/js/components/DateRangePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,37 @@
:picker-options="pickerOptions2">
</el-date-picker>
<el-date-picker
v-if="type == 'date'"
v-else-if="type == 'date' && is_future"
:name="name"
format="dd-MM-yyyy"
:placeholder="placeholder"
v-model="val"
>
</el-date-picker>
<el-date-picker
v-else-if="type == 'date'"
:name="name"
format="dd-MM-yyyy"
:placeholder="placeholder"
:picker-options="pickerOptions1"
v-model="val"
>
</el-date-picker>
</div>
</template>

<script>
export default {
props: ['value','name', 'type', 'placeholder'],
props: ['value','name', 'type', 'placeholder', 'is_future'],
mounted(){
console.log(this.type)
this.val = this.value
},
data() {
return {
val: null,
return {
pickerOptions2: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [{
text: 'Last week',
onClick(picker) {
Expand All @@ -60,6 +70,12 @@
}
}]
},
pickerOptions1: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
val: null,
};
}
};
Expand Down
40 changes: 40 additions & 0 deletions Assets/js/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$(document).ready(() => {
$(".ajax-link").click(function (e) {
e.preventDefault();

var href = $(this).data('url');
var method = $(this).data('method') || 'GET';
var isClickable = $(e.target).is(":disabled");

console.log(isClickable);

if(isClickable == false){
$.ajax({
method: method,
url: href,
success: function (res) {
$(e.target).prop('disabled', false);
if (res.error == true) {
app.$notify.error({title: 'Error!', message: res.message});
return false;
}

app.$notify.success({message: res.message});

if(res.changeText != undefined){
$(e.target).html(res.changeText);
}

if(res.disableBtn != undefined){
$(e.target).data('clickable', res.disableBtn);

if(res.disableBtn == 1){
$(e.target).prop('disabled', true);
$(e.target).attr("disabled", "disabled");
}
}
}
});
}
});
})
16 changes: 16 additions & 0 deletions Button/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class Button implements \ArrayAccess
protected $icon;
protected $attributes = [];

protected $class = '';

public $weight = 0;

protected $permission = true;
Expand Down Expand Up @@ -199,4 +201,18 @@ public function setPolicy($policy)

return $this;
}

// @todo Test
public function setClass($class)
{
$this->class = $class;

return $this;
}

// @todo Test
public function getClass()
{
return $this->class;
}
}
25 changes: 25 additions & 0 deletions Button/Repositories/ExportButton.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Modules\Rarv\Button\Repositories;

use Modules\Rarv\Button\Button;
use Modules\Rarv\Table\Table;

class ExportButton extends Button
{
private $table;
protected $label = 'Export';
protected $icon = 'fa fa-download';
protected $color = 'info';

public function __construct(Table $table)
{
$this->table = $table;
}

public function getUrl($object = null)
{
$query = array_merge(request()->all(), ['export' => 'yes']);
return route('admin.' . $this->table->getModule() . '.index', $query);
}
}
57 changes: 32 additions & 25 deletions Channels/SMSChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,46 @@ public function send($notifiable, Notification $notification)
{
$message = $notification->toSMS($notifiable);

$api_url = config('asgard.rarv.config.sms_api_url');
// First attempt to use the URL provided in setting, if not provided,
// fall back to use from config file, which is RI's API link.
$api_url = setting('rarv::sms_http_api_url', null, false);
if ($api_url == false) {
$api_url = config('asgard.rarv.config.sms_api_url');
}


$api_url = str_replace('##mobileNo##', $message->getMobileNo(), $api_url);
$api_url = str_replace('##senderId##', setting('rarv::sender_id'), $api_url);
$api_url = str_replace('##apiKey##', setting('rarv::api_key'), $api_url);
$api_url = str_replace('##message##', urlencode($message->getMessage()), $api_url);

\Log::debug($api_url);

// Get cURL resource
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_PORT => "80",
CURLOPT_URL => trim($api_url),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Cache-Control: no-cache",
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

\Log::debug($response);
\Log::debug($err);
// $curl = curl_init();

// curl_setopt_array($curl, array(
// CURLOPT_PORT => "80",
// CURLOPT_URL => trim($api_url),
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 30,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "GET",
// CURLOPT_HTTPHEADER => array(
// "Cache-Control: no-cache",
// ),
// ));

// $response = curl_exec($curl);
// $err = curl_error($curl);

// curl_close($curl);

$response = file_get_contents($api_url);

\Log::debug('SMS Response '.$response);
// \Log::debug('SMS Error '.$err);

return $response;
}
Expand Down
4 changes: 4 additions & 0 deletions Config/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
'description' => 'SMS - Sender ID',
'view' => 'text',
],
'sms_http_api_url' => [
'description' => 'SMS - HTTP API URL',
'view' => 'text',
]
];
7 changes: 7 additions & 0 deletions Contracts/CanBePrintedOnCover.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Modules\Rarv\Contracts;

interface CanBePrintedOnCover {
public function coverText():string;
}
7 changes: 7 additions & 0 deletions Contracts/SMSable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Modules\Rarv\Contracts;

interface SMSable {
public function getMobileNo() : string;
}
Loading