TT#54205 TT#54264 TT#54351 TT#54263 TT#54206 Timesets events representation fixes

Change-Id: I0553e8786c28d564d56891d40a5faa5f827eddc0
changes/51/27851/9
Irina Peshinskaya 6 years ago
parent 82e3ce898b
commit 3d524defe7

@ -153,9 +153,9 @@ sub edit :Chained('base') :PathPart('edit') {
calendarfile => $posted ? $upload : undef,
};
my $item = NGCP::Panel::Utils::TimeSet::get_timeset(c => $c, timeset => $c->stash->{timeset_rs});
$item->{reseller}{id} = delete $params->{reseller_id};
$item = merge($item, $c->session->{created_objects});
my $timeset = NGCP::Panel::Utils::TimeSet::get_timeset(c => $c, timeset => $c->stash->{timeset_rs});
$timeset->{reseller}{id} = delete $timeset->{reseller_id};
$timeset = merge($timeset, $c->session->{created_objects});
my $form;
if($c->user->roles eq "admin") {
@ -166,7 +166,7 @@ sub edit :Chained('base') :PathPart('edit') {
$form->process(
posted => $posted,
params => $params,
item => $item,
item => $timeset,
);
NGCP::Panel::Utils::Navigation::check_form_buttons(
c => $c,
@ -261,9 +261,9 @@ sub event_list :Chained('base') :PathPart('event') :CaptureArgs(0) {
$c->stash->{event_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
{ name => 'id', search => 1, title => $c->loc('#') },
{ name => 'time_set_id', search => 1, title => $c->loc('Time Set #') },
{ name => 'time_set_id', 'visible' => 0, 'title' => 'Time Set #' },
{ name => 'comment', search => 1, title => $c->loc('Comment') },
{ name => 'periods_ical.rrule_ical', search => 0, accessor => "ical", title => $c->loc('iCal')},#, literal_sql => '""'
{ name => 'periods_ical.rrule_ical', search => 0, accessor => "ical", title => $c->loc('Rules')},#, literal_sql => '""'
]);
$c->stash(template => 'timeset/event_list.tt');

@ -90,7 +90,7 @@ has_field 'start.time' => (
#dtend
has_field 'end' => (
type => 'Compound',
label => 'Event stop ',
label => 'Stop ',
do_label => 1,
do_wrapper => 1,
tags => {
@ -131,7 +131,6 @@ has_field 'end.time' => (
do_wrapper => 1,
tags => {
inline => 1,
after_element =>
},
wrapper_class => [qw/ngcp-inline-control ngcp-end-control ngcp-datetimepicker-input/],
);
@ -208,9 +207,10 @@ has_field 'repeat.freq' => (
sub frequency_options {
my %values = ('secondly' => 'Second', 'minutely' => 'Minute', 'hourly' => 'Hour', 'daily' => 'Day', 'weekly' => 'Week', 'monthly' => 'Month', 'yearly' => 'Year');
my @freq_order = qw/daily weekly monthly yearly hourly minutely secondly/;
my $options = [
{ value => 'no', label => 'None (run once)' },
map { +{value => $_, label => $values{$_} }; } keys %values
map { +{value => $_, label => $values{$_} }; } @freq_order
];
}
@ -652,7 +652,7 @@ sub custom_set_values {
$fif->{repeat}->{freq} = $values->{freq};
$fif->{repeat}->{interval} = $values->{interval};
} else {
$fif->{repeat}->{freq} ne 'no';
$fif->{repeat}->{freq} = 'no';
}
if ($values->{count}) {
@ -670,7 +670,9 @@ sub custom_set_values {
my @join_fields = qw/bymonthday byminute byweekno bysecond bymonth byhour/;
foreach my $join_field (@join_fields) {
$fif->{$join_field} = [split(/,/, $values->{$join_field})];
if ($values->{$join_field}) {
$fif->{$join_field} = [split(/,/, $values->{$join_field})];
}
}
if ($values->{byday}) {
if ($values->{byday} =~ /^(?:(?:MO|TU|WE|TH|FR|SA|SU),?)+$/) {#

@ -12,7 +12,10 @@ use constant CALENDAR_MIME_TYPE => 'text/calendar';
sub get_calendar_file_name {
my %params = @_;
my($c, $timeset) = @params{qw/c timeset/};
return $timeset->name.'_'.$timeset->id;
my $name = $timeset->name;
#replacement not collapsed intentionally
$name =~s/[^[:alnum:] ]/_/g;
return $name.'_'.$timeset->id;
}
sub delete_timeset {

@ -188,7 +188,7 @@ $( document ).ready(function() {
}
</style>
[% site_config.title = c.loc('Time Set Event') -%]
[% site_config.title = c.loc('Time set "[_1]" - Events', timeset.name) -%]
[%
helper.name = c.loc('Time Set Event');
@ -214,6 +214,7 @@ $( document ).ready(function() {
helper.top_buttons = [
{ name = c.loc('Create Event'), uri = c.uri_for_action('/timeset/event_create', [c.req.captures.0] ), icon = 'icon-star' },
{ name = c.loc('Upload iCalendar events'), uri = c.uri_for_action('/timeset/event_upload',[c.req.captures.0]), icon = 'icon-star' },
{ name = c.loc('Download iCalendar'), uri = c.uri_for_action('/timeset/download', [c.req.captures.0]), icon = 'icon-th-list'},
];
END;

@ -15,7 +15,6 @@
UNLESS c.user.read_only;
helper.dt_buttons = [
{ name = c.loc('Events'), uri = "/timeset/'+full.id+'/event", class = 'btn-small btn-tertiary', icon = 'icon-th-list' },
{ name = c.loc('Download'), uri = "/timeset/'+full.id+'/download", class = 'btn-small btn-primary', icon = 'icon-th-list' },
{ name = c.loc('Edit'), uri = "/timeset/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
{ name = c.loc('Delete'), uri = "/timeset/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
];

@ -1 +1 @@
<label id="[%vars.field.full_name%].label" class="control-label" style="width:100px;" data-toggle-on="" data-toggle-off="[%c.loc('Endless event')%]"> </label> <div class="sw_actions pull-right controls"><a id="[%vars.field.full_name%].label.control" class="btn btn-small btn-primary" style="visibility:visible;" href="javascript:toggleEndField('[%vars.field.full_name%]');void(0);" data-toggle-on="[%c.loc('Endless event')%]" data-toggle-off="[%c.loc('Customize..')%]"> </a> </div>
<label id="[%vars.field.full_name%].label" class="control-label" style="width: 0px; margin: 0px; padding: 0px;" data-toggle-on="" data-toggle-off=""> </label> <div class="sw_actions pull-right controls" style="margin-left: 0px; padding-left: 0px;"><a id="[%vars.field.full_name%].label.control" class="btn btn-small btn-primary" style="visibility:visible;" href="javascript:toggleEndField('[%vars.field.full_name%]');void(0);" data-toggle-on="[%c.loc('None')%]" data-toggle-off="[%c.loc('Set')%]"> </a> </div>

@ -1,3 +1,3 @@
<div class="sw_actions pull-right controls" style="width: 120px;"><a id="[%vars.field.full_name%].label" class="btn btn-small btn-primary ngcp-label-field-switch" data-field="[%vars.field.full_name%]" style="visibility:visible;">[%c.loc(vars.field.label)%]</a> </div>
<div class="sw_actions pull-right controls" style="width: 120px;"><a id="invert_field.[%vars.field.full_name%]" class="btn btn-mini btn-secondary" data-field="[%vars.field.full_name%]" style="visibility:visible;">[%c.loc('Invert selection')%]</a> </div>
<div class="sw_actions pull-right controls" style="width: 120px;padding-top: 5px;"><a id="invert_field.[%vars.field.full_name%]" class="btn btn-mini btn-secondary" data-field="[%vars.field.full_name%]" style="visibility:visible;">[%c.loc('Invert selection')%]</a> </div>
<div class="sw_actions pull-right controls" style="width: 120px;"><a id="clear_field.[%vars.field.full_name%]" class="btn btn-mini btn-secondary" data-field="[%vars.field.full_name%]" style="visibility:visible;">[%c.loc('Clear')%]</a> </div>

Loading…
Cancel
Save