add user password reset, add series image switch, add image licences, redesign exclude filters
This commit is contained in:
@@ -130,14 +130,16 @@ if ( $0 =~ /aggregate.*?\.cgi$/ ) {
|
||||
$list->{project_title} = '' unless ( defined $list->{project_title} );
|
||||
$content =~ s/(<(div|span)\s+id="calcms_title".*?>).*?(<\/(div|span)>)/$list->{project_title}/g;
|
||||
|
||||
my $title = $list->{program} || '';
|
||||
$title .= ' - ' . $list->{series_name} if ( ( defined $list->{series_name} ) && ( $list->{series_name} ne '' ) );
|
||||
$title .= ' - ' . $list->{title} if ( ( defined $list->{title} ) && ( $list->{title} ne '' ) );
|
||||
$title = ' | ' . $title if ( $title ne '' );
|
||||
$title .= 'Programmplan';
|
||||
$title .= ' | ' . $list->{project_title} if $list->{project_title} ne '';
|
||||
my $values = [];
|
||||
for my $value ($list->{'program'}, $list->{'series_name'}, $list->{'title'}, $list->{'location'}, $list->{'project_title'}){
|
||||
next unless defined $value;
|
||||
next if $value eq '';
|
||||
push @$values, $value;
|
||||
}
|
||||
|
||||
#$content=~s/(<title>)(.*?)(<\/title>)/$1$title$3/;
|
||||
my $title = join (' - ', @$values);
|
||||
|
||||
$content=~s/(<title>)(.*?)(<\/title>)/$1$title$3/;
|
||||
|
||||
$js = '';
|
||||
if ( ( defined $list->{event_id} ) && ( $list->{event_id} ne '' ) ) {
|
||||
|
||||
@@ -74,8 +74,8 @@ sub getProjects {
|
||||
my $config = shift;
|
||||
|
||||
my $excludedProjects = {};
|
||||
if ( defined $config->{filter}->{exclude_projects} ) {
|
||||
for my $project ( split( /\,/, $config->{filter}->{exclude_projects} ) ) {
|
||||
if ( defined $config->{filter}->{projects_to_exclude} ) {
|
||||
for my $project ( split( /\,/, $config->{filter}->{projects_to_exclude} ) ) {
|
||||
$project =~ s/^\s+//g;
|
||||
$project =~ s/\s+$//g;
|
||||
$excludedProjects->{$project} = 1;
|
||||
|
||||
@@ -1,8 +1,51 @@
|
||||
/*
|
||||
include in your web page:
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/agenda_files/css/calcms.css" />
|
||||
* {font-size:1em !important;}
|
||||
*/
|
||||
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu7GxKOzY.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFW50bbck.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0b.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
#page * {
|
||||
font-family: Roboto, serif !important;
|
||||
}
|
||||
|
||||
#page p {
|
||||
font-family: Open Sans, serif !important;
|
||||
}
|
||||
|
||||
/* fix drupal */
|
||||
input{
|
||||
max-width:20em;
|
||||
@@ -134,22 +177,100 @@ a{
|
||||
margin-left:1.7rem;
|
||||
}
|
||||
|
||||
#calcms_list .event{
|
||||
display:flex;
|
||||
flex-direction: row;
|
||||
width:100%;
|
||||
justify-content: space-between;
|
||||
border-bottom:1px solid rgba(100,100,100,0.24);
|
||||
hyphens: none;
|
||||
cursor:pointer;
|
||||
background:rgba(200, 200, 200, 0.2);
|
||||
color:#666;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
|
||||
#calcms_list .event:hover{
|
||||
background:rgba(200, 200, 200, 0.3);
|
||||
}
|
||||
|
||||
#calcms_list .date{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#calcms_list .time{
|
||||
width:10%;
|
||||
min-width:5rem;
|
||||
padding:1rem;
|
||||
padding-right:0;
|
||||
text-align:center;
|
||||
font-size:1.1rem;
|
||||
}
|
||||
|
||||
#calcms_list .summary{
|
||||
width:70%;
|
||||
padding:1rem;
|
||||
padding-right:0;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
#calcms_list .title{
|
||||
font-weight:bold;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
#calcms_list .title a{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#calcms_list .location{
|
||||
width:20%;
|
||||
padding:1rem;
|
||||
font-weight:100;
|
||||
text-align:center;
|
||||
color:rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
@media all and (max-width: 959px) {
|
||||
#calcms_list .summary{
|
||||
width:90%;
|
||||
}
|
||||
#calcms_list .location {
|
||||
width:0;
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 800px) {
|
||||
#calcms_list .excerpt{
|
||||
width:0;
|
||||
display:none;
|
||||
}
|
||||
#calcms_list .location {
|
||||
width:0;
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
|
||||
#calcms_list .excerpt{
|
||||
margin-left:3rem;
|
||||
margin-top:6px;
|
||||
max-height:5em;
|
||||
max-height:3.9rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color:rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
#calcms_list .event.running:hover{
|
||||
opacity:0.9;
|
||||
}
|
||||
|
||||
#calcms_list .event.running,
|
||||
#calcms_list .event.running .excerpt,
|
||||
#calcms_list .event.running .location,
|
||||
#calcms_list .event.running a{
|
||||
color:#fff;
|
||||
background:#aaa;
|
||||
background:#007acc;
|
||||
}
|
||||
|
||||
#calcms_list .comments.submitted{
|
||||
@@ -157,36 +278,45 @@ a{
|
||||
}
|
||||
|
||||
#calcms_list .submitted{
|
||||
margin-left:3.2rem;
|
||||
}
|
||||
|
||||
#calcms_list .title{
|
||||
margin-bottom:1em;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#calcms_list .content img{
|
||||
text-align:left;
|
||||
font-size:1.5em;
|
||||
margin-bottom:20px;
|
||||
border:0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#calcms_list .content figure{
|
||||
float:right;
|
||||
margin-left: 1em;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
#calcms_list .content figcaption{
|
||||
font-size:12px;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
#calcms_list .event{
|
||||
padding:1rem;
|
||||
padding-right:0.5rem;
|
||||
border-bottom:1rem solid #fff;
|
||||
hyphens: none;
|
||||
cursor:pointer;
|
||||
background:#eee;
|
||||
color:#666;
|
||||
max-height:8rem;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
#calcms_list .piradio,
|
||||
#calcms_list .dt64,
|
||||
#calcms_list .galerie,
|
||||
#calcms_list .studiolottumstrasse,
|
||||
#calcms_list .ansage,
|
||||
#calcms_list .potsdam,
|
||||
#calcms_list .colabo{
|
||||
color:#333;
|
||||
}
|
||||
|
||||
#calcms_list .blnfm,
|
||||
#calcms_list .multicultfm,
|
||||
#calcms_list .ohrfunk,
|
||||
#calcms_list .twenfm,
|
||||
#calcms_list .offenerkanalberlin,
|
||||
#calcms_list .studioansage,
|
||||
#calcms_list .studiorebootfm,
|
||||
#calcms_list .frrapo,
|
||||
#calcms_list .klubradio{
|
||||
color:#666;
|
||||
}
|
||||
|
||||
#calcms_list hr{
|
||||
margin:1em 0;
|
||||
@@ -583,6 +713,12 @@ a#calcms_search_show_details #plus{
|
||||
background-color:#f0f0f0;
|
||||
}
|
||||
|
||||
#calcms_calendar table tbody td.calcms_today,
|
||||
#calcms_calendar table tbody td.calcms_today a{
|
||||
background:#007acc;
|
||||
color:white;
|
||||
}
|
||||
|
||||
#calcms_calendar table td.selected{
|
||||
background:#eee;
|
||||
font-weight:bold;
|
||||
@@ -598,7 +734,7 @@ a#calcms_search_show_details #plus{
|
||||
|
||||
|
||||
|
||||
/* player */
|
||||
/* player
|
||||
#player{
|
||||
border:0;
|
||||
padding:0;
|
||||
@@ -606,9 +742,18 @@ a#calcms_search_show_details #plus{
|
||||
width:180px;
|
||||
overflow:hidden;
|
||||
}
|
||||
*/
|
||||
|
||||
#player{
|
||||
border:0;
|
||||
padding:0;
|
||||
height:64px;
|
||||
}
|
||||
#player:hover{
|
||||
opacity:0.9;
|
||||
}
|
||||
|
||||
/* mobile menu */
|
||||
|
||||
#mobileMenuButton{
|
||||
display:block;
|
||||
position:fixed;
|
||||
@@ -698,3 +843,25 @@ div.update, div.update a{
|
||||
color:#bbb;
|
||||
}
|
||||
*/
|
||||
#listen_radio{
|
||||
width:100%;
|
||||
text-align:left;
|
||||
}
|
||||
#listen_radio iframe{
|
||||
margin-top:1em;
|
||||
}
|
||||
#listen_radio td{
|
||||
border:0;
|
||||
}
|
||||
|
||||
div#content header h1.entry-title{
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 61.5625em) {
|
||||
.site-header {
|
||||
padding: 3rem;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 0rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,13 @@ if ( $0 =~ /events.*?\.cgi$/ ) {
|
||||
#my %params=$cgi->Vars();
|
||||
our $config = config::get('config/config.cgi');
|
||||
|
||||
$params->{template} = '' unless defined $params->{template};
|
||||
$params->{recordings} = 1 if $params->{template} =~ /events_playout/;
|
||||
|
||||
$params->{exclude_locations} = 1;
|
||||
$params->{exclude_projects} = 1;
|
||||
$params->{exclude_event_images} = 1;
|
||||
|
||||
my $request = {
|
||||
url => $ENV{QUERY_STRING},
|
||||
params => {
|
||||
|
||||
@@ -647,9 +647,10 @@ var calcms = (function($) {
|
||||
// show comment for given event id and start time
|
||||
my.showCommentsByEventIdOrEventStart = function showCommentsByEventIdOrEventStart(
|
||||
event_id, event_start) {
|
||||
var url = my.get('comments_url');
|
||||
var url = my.get('comments_url') || '/agenda/kommentare/';
|
||||
if (event_id == '' || event_start == '' || url == '')
|
||||
return false;
|
||||
console.log("showCommentsByEventIdOrEventStart url="+url);
|
||||
|
||||
my.set('comments_event_start', event_start);
|
||||
my.set('comments_event_id', event_id);
|
||||
|
||||
@@ -227,7 +227,6 @@ sub assign_events {
|
||||
template => 'no',
|
||||
limit => 1,
|
||||
archive => 'all',
|
||||
no_exclude => '1'
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
@@ -216,7 +216,6 @@ sub showCalendar {
|
||||
till_date => $till,
|
||||
date_range_include => 1,
|
||||
archive => 'all',
|
||||
no_exclude => '1',
|
||||
};
|
||||
|
||||
# set options depending on switches
|
||||
@@ -1745,8 +1744,9 @@ sub getSeriesEvents {
|
||||
};
|
||||
$request2->{params}->{checked}->{published} = 'all';
|
||||
$request2->{params}->{checked}->{draft} = '1' if $params->{list}==1;
|
||||
delete $request2->{params}->{checked}->{exclude_locations}
|
||||
if ( ( $params->{studio_id} == -1 ) && ( defined $request2->{params}->{checked}->{exclude_locations} ) );
|
||||
|
||||
#delete $request2->{params}->{checked}->{locations_to_exclude}
|
||||
# if ( ( $params->{studio_id} == -1 ) && ( defined $request2->{params}->{checked}->{locations_to_exclude} ) );
|
||||
|
||||
my $events = events::get( $config, $request2 );
|
||||
|
||||
|
||||
@@ -11,16 +11,18 @@ use config;
|
||||
#use template;
|
||||
use auth;
|
||||
use uac;
|
||||
use time;
|
||||
|
||||
#use roles;
|
||||
#use project;
|
||||
#use studios;
|
||||
#use events;
|
||||
use series;
|
||||
use eventOps;
|
||||
|
||||
#use series_schedule;
|
||||
#use series_events;
|
||||
#use series_dates;
|
||||
use series_dates;
|
||||
#use markup;
|
||||
#use URI::Escape;
|
||||
#use Encode;
|
||||
@@ -85,13 +87,129 @@ unless ( $permissions->{create_event_from_schedule} == 1 ) {
|
||||
|
||||
if ( defined $params->{action} ) {
|
||||
|
||||
# assign_series ($config, $request) if ($params->{action} eq 'assign_series');
|
||||
# assign_s ($config, $request) if ($params->{action} eq 'assign_series');
|
||||
}
|
||||
|
||||
#print Dumper($params);
|
||||
show_events( $config, $request );
|
||||
|
||||
sub show_events {
|
||||
sub show_events{
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
my $permissions = $request->{permissions};
|
||||
unless ( $permissions->{assign_series_events} == 1 ) {
|
||||
uac::permissions_denied('assign_series_events');
|
||||
return;
|
||||
}
|
||||
|
||||
my $project_id = $params->{project_id};
|
||||
my $studio_id = $params->{studio_id};
|
||||
my $from_date = $params->{from_date};
|
||||
my $till_date = $params->{till_date};
|
||||
|
||||
$from_date = time::time_to_datetime();
|
||||
if ($from_date=~/(\d\d\d\d\-\d\d\-\d\d \d\d)/){
|
||||
$from_date = $1.':00';
|
||||
}
|
||||
$till_date = time::add_days_to_datetime($from_date, 28);
|
||||
if ($from_date=~/(\d\d\d\d\-\d\d\-\d\d)/){
|
||||
$from_date = $1;
|
||||
}
|
||||
if ($till_date=~/(\d\d\d\d\-\d\d\-\d\d)/){
|
||||
$till_date = $1;
|
||||
}
|
||||
|
||||
print "update from $from_date to $till_date\n";
|
||||
|
||||
my $dates = series_dates::getDatesWithoutEvent(
|
||||
$config, {
|
||||
project_id => $project_id,
|
||||
studio_id => $studio_id,
|
||||
from => $from_date,
|
||||
till => $till_date
|
||||
}
|
||||
);
|
||||
print "<pre>found ".(scalar @$dates)." dates\n";
|
||||
for my $date (@$dates){
|
||||
print $date->{start}."\n";
|
||||
createEvent($config, $request, $date);
|
||||
#return;
|
||||
}
|
||||
}
|
||||
|
||||
sub createEvent{
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
my $date = shift;
|
||||
|
||||
my $permissions = $request->{permissions};
|
||||
my $user = $request->{user};
|
||||
|
||||
$date->{show_new_event_from_schedule} = 1;
|
||||
unless ( $permissions->{create_event_from_schedule} == 1 ) {
|
||||
uac::permissions_denied('create_event_from_schedule');
|
||||
return;
|
||||
}
|
||||
|
||||
$date->{start_date} = $date->{start};
|
||||
my $event = eventOps::getNewEvent($config, $date, 'show_new_event_from_schedule');
|
||||
|
||||
return undef unless defined $event;
|
||||
|
||||
$event->{start_date} = $event->{start};
|
||||
return eventOps::createEvent($request, $event, 'create_event_from_schedule');
|
||||
|
||||
}
|
||||
|
||||
sub check_params {
|
||||
my $params = shift;
|
||||
|
||||
my $checked = {};
|
||||
|
||||
my $debug = $params->{debug} || '';
|
||||
if ( $debug =~ /([a-z\_\,]+)/ ) {
|
||||
$debug = $1;
|
||||
}
|
||||
$checked->{debug} = $debug;
|
||||
|
||||
#actions and roles
|
||||
$checked->{action} = '';
|
||||
if ( defined $params->{action} ) {
|
||||
if ( $params->{action} =~ /^(create_events)$/ ) {
|
||||
$checked->{action} = $params->{action};
|
||||
}
|
||||
}
|
||||
|
||||
#numeric values
|
||||
$checked->{exclude} = 0;
|
||||
for my $param ( 'id', 'project_id', 'studio_id', 'series_id' ) {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^\d+$/ ) ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
}
|
||||
}
|
||||
|
||||
if ( defined $checked->{studio_id} ) {
|
||||
$checked->{default_studio_id} = $checked->{studio_id};
|
||||
} else {
|
||||
$checked->{studio_id} = -1;
|
||||
}
|
||||
|
||||
for my $param ( 'date', 'from_date', 'till_date' ) {
|
||||
$checked->{$param} = time::check_date( $params->{$param} );
|
||||
}
|
||||
|
||||
$checked->{template} = template::check( $params->{template}, 'create_events' );
|
||||
|
||||
return $checked;
|
||||
}
|
||||
|
||||
__DATA__
|
||||
|
||||
https://piradio.de/agenda/planung/create_events.cgi?project_id=1&studio_id=1&from_date=2016-09-01&till_date=2016-10-01
|
||||
|
||||
sub show_events2 {
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
|
||||
@@ -205,7 +323,7 @@ sub getEvents {
|
||||
till_date => $till,
|
||||
date_range_include => 1,
|
||||
archive => 'all',
|
||||
no_exclude => '1',
|
||||
#exclude_locations => '1',
|
||||
};
|
||||
|
||||
my $events = getSeriesEvents( $config, $request, $options, $params );
|
||||
@@ -237,8 +355,10 @@ sub getSeriesEvents {
|
||||
permissions => $request->{permissions}
|
||||
};
|
||||
$request2->{params}->{checked}->{published} = 'all';
|
||||
delete $request2->{params}->{checked}->{exclude_locations}
|
||||
if ( ( $params->{studio_id} == -1 ) && ( defined $request2->{params}->{checked}->{exclude_locations} ) );
|
||||
|
||||
#$request2->{params}->{checked}->{exclude_locations} = 1;
|
||||
#delete $request2->{params}->{checked}->{locations_to_exclude}
|
||||
# if ( ( $params->{studio_id} == -1 ) && ( defined $request2->{params}->{checked}->{locations_to_exclude} ) );
|
||||
|
||||
my $events = events::get( $config, $request2 );
|
||||
|
||||
@@ -265,48 +385,3 @@ sub getSeriesEvents {
|
||||
return $events;
|
||||
}
|
||||
|
||||
sub check_params {
|
||||
my $params = shift;
|
||||
|
||||
my $checked = {};
|
||||
|
||||
my $debug = $params->{debug} || '';
|
||||
if ( $debug =~ /([a-z\_\,]+)/ ) {
|
||||
$debug = $1;
|
||||
}
|
||||
$checked->{debug} = $debug;
|
||||
|
||||
#actions and roles
|
||||
$checked->{action} = '';
|
||||
if ( defined $params->{action} ) {
|
||||
if ( $params->{action} =~ /^(create_events)$/ ) {
|
||||
$checked->{action} = $params->{action};
|
||||
}
|
||||
}
|
||||
|
||||
#numeric values
|
||||
$checked->{exclude} = 0;
|
||||
for my $param ( 'id', 'project_id', 'studio_id', 'series_id' ) {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^\d+$/ ) ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
}
|
||||
}
|
||||
|
||||
if ( defined $checked->{studio_id} ) {
|
||||
$checked->{default_studio_id} = $checked->{studio_id};
|
||||
} else {
|
||||
$checked->{studio_id} = -1;
|
||||
}
|
||||
|
||||
for my $param ( 'date', 'from_date', 'till_date' ) {
|
||||
$checked->{$param} = time::check_date( $params->{$param} );
|
||||
}
|
||||
|
||||
$checked->{template} = template::check( $params->{template}, 'create_events' );
|
||||
|
||||
return $checked;
|
||||
}
|
||||
|
||||
__DATA__
|
||||
|
||||
https://piradio.de/agenda/planung/create_events.cgi?project_id=1&studio_id=1&from_date=2016-09-01&till_date=2016-10-01
|
||||
|
||||
@@ -17,6 +17,10 @@ body #content{
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
#selectImage #content{
|
||||
max-width:none;
|
||||
}
|
||||
|
||||
body,
|
||||
#content input,
|
||||
#content textarea,
|
||||
@@ -27,7 +31,7 @@ body,
|
||||
#content li{
|
||||
font-size:14px;
|
||||
font-size:0.75rem;
|
||||
font-family:sans-serif;
|
||||
font-family:Roboto,sans-serif;
|
||||
}
|
||||
|
||||
#content textarea{
|
||||
@@ -390,6 +394,10 @@ tr.tablesorter-filter-row input{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#content input.error{
|
||||
border-bottom:2px solid #d30000;
|
||||
}
|
||||
|
||||
#content input[type="text"]:focus{
|
||||
border-bottom:2px solid #03a9f4;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#content{
|
||||
margin-top:3em;
|
||||
padding:1em;
|
||||
max-width:1000px;
|
||||
/*max-width:1000px;*/
|
||||
min-height:100%;
|
||||
}
|
||||
|
||||
|
||||
58
website/agenda/planung/css/show-playout.css
Normal file
58
website/agenda/planung/css/show-playout.css
Normal file
@@ -0,0 +1,58 @@
|
||||
#content table,
|
||||
#content tr,
|
||||
#content td,
|
||||
#content div.ok,
|
||||
#content div.warn,
|
||||
#content div.error{
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
table{
|
||||
margin:1em;
|
||||
border-collapse:collapse;
|
||||
empty-cells:show;
|
||||
}
|
||||
|
||||
#content tr,
|
||||
#content td{
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
#content tr{
|
||||
border-top:1px solid #666;
|
||||
}
|
||||
|
||||
|
||||
#content td{
|
||||
padding:3px;
|
||||
font-size:-2;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#content img{
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
#content div.ok,
|
||||
#content div.warn,
|
||||
#content div.error{
|
||||
padding-top:3px;
|
||||
padding-bottom:3px;
|
||||
margin:1px;
|
||||
}
|
||||
|
||||
#content div.ok{
|
||||
background:#4caf50;
|
||||
}
|
||||
|
||||
#content div.warn{
|
||||
background:#ffeb3b;
|
||||
}
|
||||
|
||||
#content div.error{
|
||||
background:#f44336;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ use series_events;
|
||||
use user_stats;
|
||||
use localization;
|
||||
use eventOps;
|
||||
use images;
|
||||
|
||||
binmode STDOUT, ":utf8";
|
||||
|
||||
@@ -167,6 +168,7 @@ sub show_event {
|
||||
uac::print_error("event not found");
|
||||
}
|
||||
#print STDERR "show:".Dumper($event->{draft});
|
||||
#print STDERR "show event".Dumper($event);
|
||||
|
||||
my $editLock = 1;
|
||||
if ( ( defined $permissions->{update_event_after_week} ) && ( $permissions->{update_event_after_week} eq '1' ) ) {
|
||||
@@ -204,7 +206,8 @@ sub show_event {
|
||||
if ( defined $event2 ) {
|
||||
for my $attr (
|
||||
'title', 'user_title', 'excerpt', 'user_excerpt', 'content', 'topic',
|
||||
'image', 'live no_event_sync', 'podcast_url', 'archive_url'
|
||||
'image', 'image_label', 'series_image', 'series_image_label',
|
||||
'live no_event_sync', 'podcast_url', 'archive_url'
|
||||
)
|
||||
{
|
||||
$event->{$attr} = $event2->{$attr};
|
||||
@@ -215,8 +218,8 @@ sub show_event {
|
||||
}
|
||||
|
||||
$event->{rerun} = 1 if ( $event->{rerun} =~ /a-z/ );
|
||||
|
||||
$event->{series_id} = $params->{series_id};
|
||||
|
||||
$event->{duration} = events::get_duration( $config, $event );
|
||||
$event->{durations} = \@durations;
|
||||
if ( defined $event->{duration} ) {
|
||||
@@ -226,7 +229,7 @@ sub show_event {
|
||||
}
|
||||
$event->{start} =~ s/(\d\d:\d\d)\:\d\d/$1/;
|
||||
$event->{end} =~ s/(\d\d:\d\d)\:\d\d/$1/;
|
||||
|
||||
|
||||
# overwrite event with old one
|
||||
#my $series_events=get_series_events($config,{
|
||||
# project_id => $params->{project_id},
|
||||
@@ -260,7 +263,7 @@ sub show_event {
|
||||
series_id => $params->{series_id}
|
||||
}
|
||||
);
|
||||
if ( @$series == 1 ) {
|
||||
if ( scalar(@$series) == 1 ) {
|
||||
$event->{has_single_events} = $series->[0]->{has_single_events};
|
||||
}
|
||||
|
||||
@@ -416,55 +419,7 @@ sub show_new_event {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# check for missing parameters
|
||||
my $required_fields = [ 'project_id', 'studio_id', 'series_id' ];
|
||||
push @$required_fields, 'start_date' if ( $params->{action} eq 'show_new_event_from_schedule' );
|
||||
|
||||
my $event = {};
|
||||
for my $attr (@$required_fields) {
|
||||
unless ( defined $params->{$attr} ) {
|
||||
uac::print_error( "missing " . $attr );
|
||||
return;
|
||||
}
|
||||
$event->{$attr} = $params->{$attr};
|
||||
}
|
||||
|
||||
my $serie = eventOps::setAttributesFromSeriesTemplate( $config, $params, $event );
|
||||
|
||||
if ( $params->{action} eq 'show_new_event_from_schedule' ) {
|
||||
eventOps::setAttributesFromSchedule( $config, $params, $event );
|
||||
} else {
|
||||
eventOps::setAttributesForCurrentTime( $serie, $event );
|
||||
}
|
||||
|
||||
if ( defined $params->{source_event_id} ) {
|
||||
|
||||
#overwrite by existing event (rerun)
|
||||
eventOps::setAttributesFromOtherEvent( $config, $params, $event );
|
||||
}
|
||||
|
||||
$event = events::calc_dates( $config, $event );
|
||||
|
||||
if ( $serie->{has_single_events} eq '1' ) {
|
||||
$event->{has_single_events} = 1;
|
||||
$event->{series_name} = undef;
|
||||
$event->{episode} = undef;
|
||||
}
|
||||
|
||||
#get next episode
|
||||
$event->{episode} = series::get_next_episode(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
series_id => $params->{series_id},
|
||||
}
|
||||
);
|
||||
delete $event->{episode} if $event->{episode} == 0;
|
||||
|
||||
$event->{disable_event_sync} = 1;
|
||||
$event->{published} = 1;
|
||||
$event->{new_event} = 1;
|
||||
my $event = eventOps::getNewEvent($config, $params, $params->{action});
|
||||
|
||||
#copy event to template params
|
||||
for my $key ( keys %$event ) {
|
||||
@@ -574,7 +529,8 @@ sub save_event {
|
||||
}
|
||||
|
||||
#print Dumper($params);
|
||||
my $start = $params->{start_date}, my $end = time::add_minutes_to_datetime( $params->{start_date}, $params->{duration} );
|
||||
my $start = $params->{start_date};
|
||||
my $end = time::add_minutes_to_datetime( $params->{start_date}, $params->{duration} );
|
||||
|
||||
#check permissions
|
||||
my $options = {
|
||||
@@ -601,19 +557,25 @@ sub save_event {
|
||||
my $found = 0;
|
||||
|
||||
#content fields
|
||||
for my $key ( 'content', 'topic', 'title', 'excerpt', 'episode', 'image', 'podcast_url', 'archive_url' ) {
|
||||
for my $key ( 'content', 'topic', 'title', 'excerpt', 'episode',
|
||||
'image', 'series_image', 'image_label', 'series_image_label',
|
||||
'podcast_url', 'archive_url' ) {
|
||||
next unless defined $permissions->{ 'update_event_field_' . $key };
|
||||
if ( $permissions->{ 'update_event_field_' . $key } eq '1' ) {
|
||||
$entry->{$key} = $params->{$key} if defined $params->{$key};
|
||||
next unless defined $params->{$key};
|
||||
$entry->{$key} = $params->{$key};
|
||||
$found++;
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR "event to update1: ".Dumper($entry);
|
||||
|
||||
#user extension fields
|
||||
for my $key ( 'title', 'excerpt' ) {
|
||||
next unless defined $permissions->{ 'update_event_field_' . $key . '_extension' };
|
||||
if ( $permissions->{ 'update_event_field_' . $key . '_extension' } eq '1' ) {
|
||||
$entry->{ 'user_' . $key } = $params->{ 'user_' . $key } if defined $params->{ 'user_' . $key };
|
||||
next unless defined $params->{ 'user_' . $key };
|
||||
$entry->{ 'user_' . $key } = $params->{ 'user_' . $key };
|
||||
$found++;
|
||||
}
|
||||
}
|
||||
@@ -643,6 +605,10 @@ sub save_event {
|
||||
uac::print_error("event not found");
|
||||
return;
|
||||
}
|
||||
|
||||
$entry->{image} = images::normalizeName($entry->{image});
|
||||
$entry->{series_image} = images::normalizeName($entry->{series_image});
|
||||
#print STDERR "event to update2: ".Dumper($entry);
|
||||
|
||||
$config->{access}->{write} = 1;
|
||||
|
||||
@@ -701,119 +667,11 @@ sub create_event {
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
my $permissions = $request->{permissions};
|
||||
my $params = $request->{params}->{checked};
|
||||
my $event = $request->{params}->{checked};
|
||||
my $action = $params->{action};
|
||||
return eventOps::createEvent($request, $event, $action);
|
||||
|
||||
my $checklist = [ 'studio', 'user', 'create_events', 'studio_timeslots' ];
|
||||
if ( $params->{action} eq 'create_event_from_schedule' ) {
|
||||
push @$checklist, 'schedule' if $params->{action} eq 'create_event_from_schedule';
|
||||
}
|
||||
|
||||
my $start = $params->{start_date}, my $end = time::add_minutes_to_datetime( $params->{start_date}, $params->{duration} );
|
||||
|
||||
my $result = series_events::check_permission(
|
||||
$request,
|
||||
{
|
||||
permission => 'create_event,create_event_of_series',
|
||||
check_for => $checklist,
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
series_id => $params->{series_id},
|
||||
start_date => $params->{start_date},
|
||||
draft => $params->{draft},
|
||||
start => $start,
|
||||
end => $end,
|
||||
}
|
||||
);
|
||||
|
||||
#print Dumper(" start_date => $params->{start_date}");
|
||||
unless ( $result eq '1' ) {
|
||||
uac::print_error($result);
|
||||
return undef;
|
||||
}
|
||||
|
||||
#get series name from series
|
||||
my $series = series::get(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
series_id => $params->{series_id},
|
||||
}
|
||||
);
|
||||
if ( @$series != 1 ) {
|
||||
uac::print_error("series not found");
|
||||
return undef;
|
||||
}
|
||||
my $serie = $series->[0];
|
||||
|
||||
#get studio location from studios
|
||||
my $studios = studios::get(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id}
|
||||
}
|
||||
);
|
||||
unless ( defined $studios ) {
|
||||
uac::print_error("studio not found");
|
||||
return undef;
|
||||
}
|
||||
unless ( @$studios == 1 ) {
|
||||
uac::print_error("studio not found");
|
||||
return undef;
|
||||
}
|
||||
my $studio = $studios->[0];
|
||||
|
||||
$config->{access}->{write} = 1;
|
||||
|
||||
#insert event content and save history
|
||||
my $event_id = series_events::insert_event(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio => $studio,
|
||||
serie => $serie,
|
||||
event => $params,
|
||||
user => $params->{presets}->{user}
|
||||
}
|
||||
);
|
||||
uac::print_error("could not insert event") if $event_id <= 0;
|
||||
|
||||
#assign event to series
|
||||
$result = series::assign_event(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
series_id => $params->{series_id},
|
||||
event_id => $event_id
|
||||
}
|
||||
);
|
||||
uac::print_error("could not assign event") unless defined $result;
|
||||
|
||||
#update recurrences
|
||||
my $event = $params;
|
||||
$event->{event_id} = $event_id;
|
||||
series::update_recurring_events( $config, $event );
|
||||
|
||||
# update user stats
|
||||
user_stats::increase(
|
||||
$config,
|
||||
'create_events',
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
series_id => $params->{series_id},
|
||||
user => $params->{presets}->{user}
|
||||
}
|
||||
);
|
||||
|
||||
#forward to edit event
|
||||
#print STDERR Dumper($event_id);
|
||||
#$params->{event_id}=$event_id;
|
||||
uac::print_info("event created");
|
||||
return $event_id;
|
||||
}
|
||||
|
||||
#TODO: replace permission check with download
|
||||
@@ -849,6 +707,7 @@ sub download {
|
||||
event_id => $params->{event_id},
|
||||
template => 'no',
|
||||
limit => 1,
|
||||
#no_exclude => 1
|
||||
}
|
||||
)
|
||||
},
|
||||
@@ -955,7 +814,7 @@ sub check_params {
|
||||
|
||||
#strings
|
||||
for my $param (
|
||||
'series_name', 'title', 'excerpt', 'content', 'topic', 'program', 'category', 'image',
|
||||
'series_name', 'title', 'excerpt', 'content', 'topic', 'program', 'category', 'image', 'series_image',
|
||||
'user_content', 'user_title', 'user_excerpt', 'podcast_url', 'archive_url'
|
||||
)
|
||||
{
|
||||
@@ -985,7 +844,7 @@ sub check_params {
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR Dumper($checked);
|
||||
#print STDERR "event params:".Dumper($checked);
|
||||
return $checked;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use Data::Dumper;
|
||||
|
||||
use File::stat;
|
||||
use Time::localtime;
|
||||
use CGI qw(header param Vars escapeHTML uploadInfo cgi_error);
|
||||
use CGI::Simple;# qw(header param Vars escapeHTML uploadInfo cgi_error);
|
||||
use URI::Escape;
|
||||
|
||||
use time;
|
||||
@@ -67,17 +67,12 @@ $headerParams->{loc} = localization::get( $config, { user => $user, file => 'men
|
||||
template::process( 'print', template::check('ajax_header.html'), $headerParams );
|
||||
return unless defined uac::check( $config, $params, $user_presets );
|
||||
|
||||
#my $base_dir = $config->{locations}->{base_dir};
|
||||
my $local_media_dir = $config->{locations}->{local_media_dir};
|
||||
my $local_media_url = $config->{locations}->{local_media_url};
|
||||
|
||||
#my $local_base_url = $config->{locations}->{local_base_url};
|
||||
|
||||
log::error( $config, 'cannot locate media dir' . $local_media_dir ) unless ( -e $local_media_dir );
|
||||
|
||||
#continue on error
|
||||
uac::permissions_denied('reading from local media dir') unless ( -r $local_media_dir );
|
||||
uac::permissions_denied('writing to local media dir') unless ( -w $local_media_dir );
|
||||
log::error( $config, 'cannot locate media dir' . $local_media_dir ) unless -e $local_media_dir ;
|
||||
uac::permissions_denied('reading from local media dir') unless -r $local_media_dir;
|
||||
uac::permissions_denied('writing to local media dir') unless -w $local_media_dir;
|
||||
|
||||
if ( $params->{delete_image} ne '' ) {
|
||||
delete_image( $config, $request, $user, $local_media_dir );
|
||||
@@ -114,69 +109,73 @@ sub show_image {
|
||||
$config->{access}->{write} = 0;
|
||||
my $dbh = db::connect( $config, undef );
|
||||
|
||||
my $projectId = $params->{project_id};
|
||||
my $studioId = $params->{studio_id};
|
||||
my $selectedFilename = $params->{filename} || '';
|
||||
|
||||
my $filenames = {};
|
||||
my $results = [];
|
||||
|
||||
# add images from series
|
||||
if ( defined $params->{series_id} ) {
|
||||
my $seriesImages = series::get_images( $config, $params );
|
||||
my $seriesImages = series::get_images( $config, {
|
||||
project_id => $projectId,
|
||||
studio_id => $studioId,
|
||||
series_id => $params->{series_id}
|
||||
} );
|
||||
|
||||
for my $image (@$seriesImages) {
|
||||
my $filename = $image->{filename};
|
||||
unless ( defined $filenames->{$filename} ) {
|
||||
|
||||
#print STDERR "add1 $filename\n";
|
||||
push @$results, $image;
|
||||
$filenames->{$filename} = $image;
|
||||
}
|
||||
next if defined $filenames->{$filename};
|
||||
$filenames->{$filename} = $image;
|
||||
push @$results, $image;
|
||||
}
|
||||
}
|
||||
|
||||
#load images matching by search
|
||||
if ( defined $params->{search} ) {
|
||||
if ( $params->{search}=~/\S/ ) {
|
||||
|
||||
#remove filename from search
|
||||
delete $params->{filename};
|
||||
delete $params->{series_id};
|
||||
my $searchImages = images::get( $config, $params );
|
||||
#delete $params->{filename};
|
||||
#delete $params->{series_id};
|
||||
my $searchImages = images::get( $config, {
|
||||
project_id => $projectId,
|
||||
studio_id => $studioId,
|
||||
search => $params->{search}
|
||||
} );
|
||||
|
||||
for my $image (@$searchImages) {
|
||||
my $filename = $image->{filename};
|
||||
unless ( defined $filenames->{$filename} ) {
|
||||
|
||||
#print STDERR "add2 $filename\n";
|
||||
push @$results, $image;
|
||||
$filenames->{$filename} = $image;
|
||||
}
|
||||
next if defined $filenames->{$filename};
|
||||
$filenames->{$filename} = $image;
|
||||
push @$results, $image;
|
||||
}
|
||||
}
|
||||
|
||||
#load selected image, if not already loaded
|
||||
my $selectedImage=undef;
|
||||
if ( $selectedFilename ne '' ) {
|
||||
my $search = $params->{search} || '';
|
||||
|
||||
# use selected image if already loaded
|
||||
my $selectedImage = undef;
|
||||
if ( defined $filenames->{$selectedFilename} ) {
|
||||
$selectedImage = $filenames->{$selectedFilename};
|
||||
} else {
|
||||
|
||||
#now add filename and remove search
|
||||
$params->{filename} = $selectedFilename;
|
||||
delete $params->{search};
|
||||
#print STDERR "getByName:".Dumper($params);
|
||||
|
||||
#put selected image to the top
|
||||
my $imagesByNames = images::get( $config, $params );
|
||||
$selectedImage = $imagesByNames->[0] if ( scalar(@$imagesByNames) > 0 );
|
||||
}
|
||||
my $imagesByNames = images::get( $config, {
|
||||
project_id => $projectId,
|
||||
studio_id => $studioId,
|
||||
filename => $selectedFilename
|
||||
} );
|
||||
#print STDERR Dumper($imagesByNames);
|
||||
$selectedImage = $imagesByNames->[0] if scalar(@$imagesByNames) > 0;
|
||||
}
|
||||
|
||||
my $finalResults = [];
|
||||
|
||||
# put selected image first
|
||||
$selectedFilename = 'not-found';
|
||||
if ( defined $selectedImage ) {
|
||||
push @$finalResults, $selectedImage;
|
||||
$finalResults = [ $selectedImage ];
|
||||
$selectedFilename = $selectedImage->{filename};
|
||||
}
|
||||
|
||||
@@ -185,20 +184,21 @@ sub show_image {
|
||||
push @$finalResults, $image if $image->{filename} ne $selectedFilename;
|
||||
}
|
||||
$results = $finalResults;
|
||||
|
||||
#add search again
|
||||
$params->{search} = $search;
|
||||
}
|
||||
|
||||
if ( $params->{template} =~ /edit/ ) {
|
||||
$results = [ $results->[0] ] || undef;
|
||||
my $result = $results->[0];
|
||||
$result->{missing_licence}=1 unless $result->{licence}=~/\S/;
|
||||
$results = [ $result ] ;
|
||||
}
|
||||
|
||||
if ( defined $results ) {
|
||||
$results = modify_results( $results, $permissions, $user, $local_media_url );
|
||||
}
|
||||
|
||||
my $search = $params->{search} || '';
|
||||
$search =~ s/\%+/ /g;
|
||||
|
||||
my $template_params = {
|
||||
'search' => $search,
|
||||
'images' => $results,
|
||||
@@ -250,18 +250,24 @@ sub save_image {
|
||||
|
||||
my $image = {};
|
||||
$image->{filename} = $params->{save_image};
|
||||
$image->{name} = $params->{update_name} if ( $params->{update_name} ne '' );
|
||||
$image->{description} = $params->{update_description} if ( $params->{update_description} ne '' );
|
||||
$image->{name} = $params->{update_name} if $params->{update_name} ne '' ;
|
||||
$image->{description} = $params->{update_description} if $params->{update_description} ne '' ;
|
||||
$image->{project_id} = $params->{project_id};
|
||||
$image->{studio_id} = $params->{studio_id};
|
||||
$image->{licence} = $params->{licence};
|
||||
$image->{public} = $params->{public};
|
||||
$image->{modified_by} = $user;
|
||||
|
||||
$image->{name} = 'new' if ( $image->{name} eq '' );
|
||||
$image->{name} = 'new' if $image->{name} eq '';
|
||||
|
||||
images::checkLicence($config, $image);
|
||||
|
||||
$config->{access}->{write} = 1;
|
||||
my $dbh = db::connect($config);
|
||||
|
||||
#print STDERR "going to save\n";
|
||||
print STDERR "going to save\n";
|
||||
print STDERR Dumper($image);
|
||||
|
||||
my $entries = images::get(
|
||||
$config,
|
||||
{
|
||||
@@ -271,7 +277,6 @@ sub save_image {
|
||||
}
|
||||
);
|
||||
|
||||
#print STDERR Dumper($entries);
|
||||
if ( scalar @$entries > 1 ) {
|
||||
print_js_error('more than one matching result found');
|
||||
return 0;
|
||||
@@ -283,6 +288,8 @@ sub save_image {
|
||||
my $entry = $entries->[0];
|
||||
if ( defined $entry ) {
|
||||
images::update( $dbh, $image );
|
||||
images::publish( $config, $image->{filename}) if (($image->{public}==1) && ($entry->{public}==0));
|
||||
images::depublish($config, $image->{filename}) if (($image->{public}==0) && ($entry->{public}==1));
|
||||
} else {
|
||||
$image->{created_by} = $user;
|
||||
images::insert( $dbh, $image );
|
||||
@@ -410,7 +417,7 @@ sub check_params {
|
||||
$checked->{search} = $1;
|
||||
}
|
||||
|
||||
for my $attr ( 'update_name', 'update_description' ) {
|
||||
for my $attr ( 'update_name', 'update_description', 'licence' ) {
|
||||
$checked->{$attr} = '';
|
||||
if ( ( defined $params->{$attr} ) && ( $params->{$attr} =~ /^\s*(.+?)\s*$/ ) ) {
|
||||
$checked->{$attr} = $params->{$attr};
|
||||
@@ -427,6 +434,13 @@ sub check_params {
|
||||
}
|
||||
}
|
||||
|
||||
#checkboxes
|
||||
for my $param ( 'public' ) {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /([01])/ ) ) {
|
||||
$checked->{$param} = $1;
|
||||
}
|
||||
}
|
||||
|
||||
#map show to filename, but overwrite if filename given
|
||||
if ( $checked->{show} ne '' ) {
|
||||
$checked->{filename} = $checked->{show};
|
||||
@@ -438,6 +452,7 @@ sub check_params {
|
||||
|
||||
$checked->{from} = time::check_date( $params->{from} );
|
||||
$checked->{till} = time::check_date( $params->{till} );
|
||||
#print STDERR 'checked:'.Dumper ($checked);
|
||||
|
||||
return $checked;
|
||||
}
|
||||
|
||||
@@ -226,11 +226,12 @@ sub update_database {
|
||||
|
||||
my $image = {
|
||||
filename => $params->{filename},
|
||||
name => $params->{name} || 'new',
|
||||
name => $name,
|
||||
description => $params->{description},
|
||||
modified_by => $user,
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id}
|
||||
studio_id => $params->{studio_id},
|
||||
licence => $params->{licence}
|
||||
};
|
||||
|
||||
#connect
|
||||
@@ -238,7 +239,7 @@ sub update_database {
|
||||
my $dbh = db::connect($config);
|
||||
|
||||
my $entries = images::get( $config, { filename => $image->{filename} } );
|
||||
if ( ( defined $entries ) && ( @$entries > 0 ) ) {
|
||||
if ( ( defined $entries ) && ( scalar(@$entries) > 0 ) ) {
|
||||
images::update( $dbh, $image );
|
||||
my $entry = $entries->[0];
|
||||
$params->{image_id} = $entry->{id};
|
||||
@@ -318,16 +319,14 @@ sub process_image {
|
||||
my $md5_filename = shift;
|
||||
my $content = shift;
|
||||
|
||||
my $upload_path = $config->{locations}->{local_media_dir} . 'upload/' . $md5_filename . '.' . $extension;
|
||||
my $thumb_path = $config->{locations}->{local_media_dir} . 'thumbs/' . $md5_filename . '.jpg';
|
||||
my $icon_path = $config->{locations}->{local_media_dir} . 'icons/' . $md5_filename . '.jpg';
|
||||
my $image_path = $config->{locations}->{local_media_dir} . 'images/' . $md5_filename . '.jpg';
|
||||
my $upload_path = images::getInternalPath($config, {type=>'upload', filename=> $md5_filename . '.' . $extension});
|
||||
my $thumb_path = images::getInternalPath($config, {type=>'thumbs', filename=> $md5_filename . '.jpg'});
|
||||
my $icon_path = images::getInternalPath($config, {type=>'icons', filename=> $md5_filename . '.jpg'});
|
||||
my $image_path = images::getInternalPath($config, {type=>'images', filename=> $md5_filename . '.jpg'});
|
||||
|
||||
#copy file to upload space
|
||||
open DAT, '>' . $upload_path or return { error => 'could not save image. ' . $! . " $upload_path" };
|
||||
binmode DAT;
|
||||
print DAT $content;
|
||||
close DAT;
|
||||
my $result=images::writeFile($upload_path, $content);
|
||||
return $result if defined $result->{error};
|
||||
|
||||
#write image
|
||||
my $image = new Image::Magick;
|
||||
@@ -363,7 +362,7 @@ sub process_image {
|
||||
$icon->Write( 'jpg:' . $icon_path );
|
||||
|
||||
unless ( -e $thumb_path ) {
|
||||
return { error => 'could not create thumb nail file!' };
|
||||
return { error => 'could not create thumb file!' };
|
||||
}
|
||||
unless ( -e $icon_path ) {
|
||||
return { error => 'could not create icon file!' };
|
||||
@@ -403,7 +402,7 @@ sub check_params {
|
||||
}
|
||||
|
||||
#string
|
||||
for my $param ( 'debug', 'name', 'description' ) {
|
||||
for my $param ( 'debug', 'name', 'description', 'licence' ) {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^\s*(.+?)\s*$/ ) ) {
|
||||
$checked->{$param} = $1;
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ function changeSeries(seriesId){
|
||||
url += '&event_id='+eventId;
|
||||
url += '&new_series_id='+newSeriesId;
|
||||
url += '&action=reassign_event';
|
||||
//alert(url);
|
||||
|
||||
$.post(
|
||||
url,
|
||||
|
||||
@@ -61,3 +61,4 @@ function showImageUrl(id){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
var windowOffsetX=32;
|
||||
var windowOffsetY=32;
|
||||
|
||||
// choose action depending on selected tab
|
||||
function imageAction(filename){
|
||||
@@ -6,6 +8,7 @@ function imageAction(filename){
|
||||
selectThisImage(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(selectedImageTab=='edit'){
|
||||
editImage(filename);
|
||||
return false;
|
||||
@@ -28,24 +31,33 @@ function selectImage(project_id, studio_id, id, value, imageUrl, series_id){
|
||||
if((series_id!=null)&&(series_id != '')){
|
||||
url+='&series_id='+series_id;
|
||||
}
|
||||
|
||||
if(imageUrl!=null){
|
||||
var filename=imageUrl.split('%2F').pop();
|
||||
url+='&filename='+filename;
|
||||
}
|
||||
var x=$(window).width() - windowOffsetX;
|
||||
var y=$(window).height() - windowOffsetY;
|
||||
hideContent();
|
||||
|
||||
$('#selectImage').load(url);
|
||||
$('#selectImage').dialog({
|
||||
appendTo: "#content",
|
||||
title:"select image",
|
||||
width:"980",
|
||||
height:640
|
||||
width:x,
|
||||
height:y,
|
||||
close: function( event, ui ) {
|
||||
showContent();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// set editor image and image url to selected image
|
||||
function selectThisImage(filename){
|
||||
var url=('/agenda_files/media/thumbs/'+filename);
|
||||
$('#'+selectImageId).val(url);
|
||||
$('#'+selectImageId).val(filename);
|
||||
var url = 'showImage.cgi?project_id='+project_id+'&studio_id='+studio_id+'&filename=' + filename;
|
||||
console.log(url);
|
||||
$('#imagePreview').prop('src',url);
|
||||
|
||||
try{
|
||||
@@ -75,7 +87,34 @@ function searchImage(){
|
||||
$( "#image-tabs" ).tabs();
|
||||
$( "#image-tabs" ).tabs( "option", "active", 1 );
|
||||
});
|
||||
//
|
||||
return false;
|
||||
}
|
||||
|
||||
function hideContent(){
|
||||
|
||||
$(window).resize(function () {
|
||||
$('.ui-dialog').css({
|
||||
'width': $(window).width() - windowOffsetX,
|
||||
'height': $(window).height() - windowOffsetY,
|
||||
'left': windowOffsetX/2+'px',
|
||||
'top': windowOffsetY/2+'px'
|
||||
});
|
||||
}).resize();
|
||||
|
||||
$('.editor').each(
|
||||
function(){
|
||||
$(this).hide();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function showContent(){
|
||||
$('.editor').each(
|
||||
function(){
|
||||
$(this).show();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -84,10 +123,17 @@ function editImage(filename){
|
||||
$("#img_editor").load(
|
||||
'image.cgi?show='+filename+'&template=image_edit.html&project_id='+project_id+'&studio_id='+studio_id,
|
||||
function(){
|
||||
var x=$(window).width() - windowOffsetX;
|
||||
var y=$(window).height() - windowOffsetY;
|
||||
hideContent();
|
||||
|
||||
$('#img_editor').dialog({
|
||||
appendTo: "#content",
|
||||
width:"100%",
|
||||
height:430
|
||||
width:x,
|
||||
height:y,
|
||||
close: function( event, ui ) {
|
||||
showContent();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -96,10 +142,18 @@ function editImage(filename){
|
||||
// open dialog to show image preview
|
||||
function showImage(url){
|
||||
$("#img_image").html('<img src="'+url+'" onclick="$(\'#img_image\').dialog(\'close\');return false;"/>');
|
||||
var x=$(window).width() - windowOffsetX;
|
||||
var y=$(window).height() - windowOffsetY;
|
||||
hideContent();
|
||||
|
||||
$("#img_image").dialog({
|
||||
appendTo: "#content",
|
||||
width:"100%",
|
||||
height:660
|
||||
width:x,
|
||||
height:y,
|
||||
close: function( event, ui ) {
|
||||
showContent();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -121,7 +175,7 @@ function saveImage(id, filename) {
|
||||
var line=lines[index];
|
||||
if(contains(line,'ERROR:')){
|
||||
//add error field
|
||||
if($('#image-tabs .error').length==0){
|
||||
if( $('#image-tabs .error').length==0 ){
|
||||
$('#image-tabs').append('<div class="error"></div>');
|
||||
}
|
||||
$('#image-tabs div.error').append(line);
|
||||
@@ -162,7 +216,7 @@ function hideImageDetails(id,filename){
|
||||
function showImageUrl(id){
|
||||
var el=document.getElementById(id);
|
||||
var input_id=id+'_input';
|
||||
var text='<input id="'+input_id+'" value="{{thumbs/'+id+'|title}}" title="3fach-Klick zum Markieren!">';
|
||||
var text='<input id="'+input_id+'" value="{{'+id+'|title}}" title="3fach-Klick zum Markieren!">';
|
||||
if (el.innerHTML==text){
|
||||
el.innerHTML='';
|
||||
}else{
|
||||
|
||||
14
website/agenda/planung/js/show-playout.js
Normal file
14
website/agenda/planung/js/show-playout.js
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
function showTable(){
|
||||
$('#playout-table').tablesorter({
|
||||
widgets: ["filter"],
|
||||
usNumberFormat : false
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(
|
||||
function(){
|
||||
showTable();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -52,4 +52,15 @@ msgstr "Editor-Link"
|
||||
msgid "label_search_hits"
|
||||
msgstr "Treffer"
|
||||
|
||||
msgid "label_author"
|
||||
msgstr "Author"
|
||||
|
||||
msgid "label_licence"
|
||||
msgstr "Lizenz"
|
||||
|
||||
msgid "label_public"
|
||||
msgstr "veröffentlicht"
|
||||
|
||||
msgid "label_licence_missing"
|
||||
msgstr "bitte eintragen"
|
||||
|
||||
|
||||
@@ -49,3 +49,6 @@ msgstr "Import"
|
||||
msgid "help"
|
||||
msgstr "Hilfe"
|
||||
|
||||
msgid "images"
|
||||
msgstr "Bilder"
|
||||
|
||||
|
||||
@@ -52,3 +52,15 @@ msgstr "Editor-Link"
|
||||
msgid "label_search_hits"
|
||||
msgstr "hits"
|
||||
|
||||
msgid "label_licence"
|
||||
msgstr "licence"
|
||||
|
||||
msgid "label_author"
|
||||
msgstr "author"
|
||||
|
||||
msgid "label_public"
|
||||
msgstr "published"
|
||||
|
||||
msgid "label_licence_missing"
|
||||
msgstr "please fill in"
|
||||
|
||||
|
||||
@@ -49,3 +49,6 @@ msgstr "Import"
|
||||
msgid "help"
|
||||
msgstr "Help"
|
||||
|
||||
msgid "images"
|
||||
msgstr "Images"
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ if ( defined $params->{action} ) {
|
||||
unassign_event( $config, $request ) if ( $params->{action} eq 'unassign_event' );
|
||||
if ( $params->{action} eq 'reassign_event' ) {
|
||||
my $result = reassign_event( $config, $request );
|
||||
return if $result == 1;
|
||||
return if defined $result;
|
||||
}
|
||||
|
||||
# save_scan ($config, $request) if ($params->{action} eq 'save_scan');
|
||||
@@ -427,6 +427,13 @@ sub save_series {
|
||||
#print STDERR Dumper($entry);
|
||||
$config->{access}->{write} = 1;
|
||||
my $result = series::update( $config, $entry );
|
||||
|
||||
series_events::update_series_images($config,{
|
||||
project_id => $entry->{project_id},
|
||||
studio_id => $entry->{studio_id},
|
||||
series_id => $entry->{series_id},
|
||||
series_image => $params->{image}
|
||||
});
|
||||
|
||||
user_stats::increase(
|
||||
$config,
|
||||
@@ -581,11 +588,13 @@ sub assign_event {
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
|
||||
print STDERR "assign event\n";
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
my $permissions = $request->{permissions};
|
||||
unless ( $permissions->{assign_series_events} == 1 ) {
|
||||
uac::permissions_denied('assign_series_events');
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $entry = {};
|
||||
@@ -594,9 +603,10 @@ sub assign_event {
|
||||
$entry->{$attr} = $params->{$attr};
|
||||
} else {
|
||||
uac::print_error( $attr . ' not given!' );
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
#print STDERR "found all parameters:\n".Dumper($entry);
|
||||
|
||||
# check if event exists,
|
||||
# this has to use events::get, since it cannot check for series_id
|
||||
@@ -606,10 +616,11 @@ sub assign_event {
|
||||
checked => events::check_params(
|
||||
$config,
|
||||
{
|
||||
event_id => $entry->{event_id},
|
||||
template => 'no',
|
||||
limit => 1,
|
||||
archive => 'all'
|
||||
event_id => $entry->{event_id},
|
||||
template => 'no',
|
||||
limit => 1,
|
||||
archive => 'all',
|
||||
# no_exclude => 1
|
||||
}
|
||||
)
|
||||
},
|
||||
@@ -617,10 +628,15 @@ sub assign_event {
|
||||
permissions => $request->{permissions}
|
||||
};
|
||||
$request2->{params}->{checked}->{published} = 'all';
|
||||
my $events = events::get( $config, $request2 );
|
||||
my $event = $events->[0];
|
||||
|
||||
#print STDERR Dumper($event);
|
||||
my $events = events::get( $config, $request2 );
|
||||
#print STDERR "found events:".Dumper($events);
|
||||
if (scalar (@$events) != 1){
|
||||
uac::print_error("no event found for event_id=$entry->{event_id}, archive=all");
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $event = $events->[0];
|
||||
|
||||
#is series assigned to studio
|
||||
my $result = series_events::check_permission(
|
||||
@@ -721,7 +737,7 @@ sub unassign_event {
|
||||
my $permissions = $request->{permissions};
|
||||
unless ( $permissions->{assign_series_events} == 1 ) {
|
||||
uac::permissions_denied('assign_series_events');
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $entry = {};
|
||||
@@ -730,7 +746,7 @@ sub unassign_event {
|
||||
$entry->{$attr} = $params->{$attr};
|
||||
} else {
|
||||
uac::print_error( $attr . ' not given!' );
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,7 +764,7 @@ sub unassign_event {
|
||||
uac::print_error(
|
||||
"event $entry->{event_id} not found for project_id=$entry->{project_id}, studio_id=$entry->{studio_id}, series_id=$entry->{series_id}"
|
||||
);
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#print Dumper($event);
|
||||
@@ -801,13 +817,13 @@ sub reassign_event {
|
||||
my $permissions = $request->{permissions};
|
||||
unless ( $permissions->{assign_series_events} == 1 ) {
|
||||
uac::permissions_denied('assign_series_events');
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
for my $attr ( 'project_id', 'studio_id', 'series_id', 'new_series_id', 'event_id' ) {
|
||||
unless ( defined $params->{$attr} ) {
|
||||
uac::print_error( $attr . ' not given!' );
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,17 +835,24 @@ sub reassign_event {
|
||||
|
||||
$request->{params}->{checked}->{series_id} = $new_series_id;
|
||||
my $result = assign_event( $config, $request );
|
||||
if ( $result == 1 ) {
|
||||
$request->{params}->{checked}->{series_id} = $series_id;
|
||||
$result = unassign_event( $config, $request );
|
||||
}
|
||||
if ( $result == 1 ) {
|
||||
my $url =
|
||||
'event.cgi?project_id=' . $project_id . '&studio_id=' . $studio_id . '&series_id=' . $new_series_id . '&event_id=' . $event_id;
|
||||
print qq{<meta http-equiv="refresh" content="0; url=$url" />} . "\n";
|
||||
delete $params->{getBack};
|
||||
return 1;
|
||||
}
|
||||
unless (defined $result){
|
||||
uac::print_error("could not assign event");
|
||||
return undef;
|
||||
}
|
||||
|
||||
$request->{params}->{checked}->{series_id} = $series_id;
|
||||
$result = unassign_event( $config, $request );
|
||||
unless (defined $result){
|
||||
uac::print_error("could not unassign event");
|
||||
return undef;
|
||||
}
|
||||
|
||||
#print STDERR " event\n";
|
||||
my $url =
|
||||
'event.cgi?project_id=' . $project_id . '&studio_id=' . $studio_id . '&series_id=' . $new_series_id . '&event_id=' . $event_id;
|
||||
print qq{<meta http-equiv="refresh" content="0; url=$url" />} . "\n";
|
||||
delete $params->{getBack};
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub add_user {
|
||||
@@ -921,15 +944,30 @@ sub list_series {
|
||||
|
||||
my $project_id = $params->{project_id};
|
||||
my $studio_id = $params->{studio_id};
|
||||
|
||||
my $studios = studios::get(
|
||||
$config,
|
||||
{
|
||||
project_id => $project_id,
|
||||
studio_id => $studio_id
|
||||
}
|
||||
);
|
||||
|
||||
my $studio_by_id = {};
|
||||
for my $studio (@$studios) {
|
||||
$studio_by_id->{ $studio->{id} } = $studio;
|
||||
}
|
||||
my $studio = $studio_by_id->{ $studio_id };
|
||||
|
||||
my $series_conditions = {
|
||||
project_id => $project_id,
|
||||
studio_id => $studio_id
|
||||
};
|
||||
my $series = series::get_event_age( $config, $series_conditions );
|
||||
|
||||
my $newSeries = [];
|
||||
my $oldSeries = [];
|
||||
for my $serie ( sort { lc $a->{series_name} cmp lc $b->{series_name} } (@$series) ) {
|
||||
|
||||
if ( $serie->{days_over} > 30 ) {
|
||||
push @$oldSeries, $serie;
|
||||
} else {
|
||||
@@ -940,6 +978,10 @@ sub list_series {
|
||||
$params->{newSeries} = $newSeries;
|
||||
$params->{oldSeries} = $oldSeries;
|
||||
|
||||
$params->{image} = studios::getImageById($config, {project_id => $project_id, studio_id => $studio_id} ) if ( (!defined $params->{image}) || ($params->{image} eq '') );
|
||||
$params->{image} = project::getImageById($config, {project_id => $project_id} ) if ( (!defined $params->{image}) || ($params->{image} eq '') );
|
||||
#print STDERR Dumper $params->{image};
|
||||
|
||||
$params->{loc} = localization::get( $config, { user => $params->{presets}->{user}, file => 'all,series' } );
|
||||
template::process( 'print', $params->{template}, $params );
|
||||
}
|
||||
@@ -1035,6 +1077,11 @@ sub show_series {
|
||||
|
||||
my $location = $studio->{location};
|
||||
|
||||
# set default image from studio
|
||||
$serie->{image} = studios::getImageById($config, {project_id => $project_id, studio_id => $studio_id} ) if ( (!defined $serie->{image}) || ($serie->{image} eq '') );
|
||||
$serie->{image} = project::getImageById($config, {project_id => $project_id} ) if ( (!defined $serie->{image}) || ($serie->{image} eq '') );
|
||||
#print STDERR Dumper $serie->{image};
|
||||
|
||||
#add users
|
||||
$serie->{series_users} = series::get_users(
|
||||
$config,
|
||||
@@ -1221,7 +1268,7 @@ sub check_params {
|
||||
}
|
||||
}
|
||||
|
||||
for my $param ( 'series_name', 'title', 'excerpt', 'content', 'topic', 'image',
|
||||
for my $param ( 'series_name', 'title', 'excerpt', 'content', 'topic', 'image', 'image_label',
|
||||
'assign_event_series_name', 'assign_event_title', 'comment', 'podcast_url', 'archive_url' )
|
||||
{
|
||||
if ( defined $params->{$param} ) {
|
||||
|
||||
146
website/agenda/planung/showImage.cgi
Normal file
146
website/agenda/planung/showImage.cgi
Normal file
@@ -0,0 +1,146 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
use warnings "all";
|
||||
use strict;
|
||||
use Data::Dumper;
|
||||
|
||||
use params;
|
||||
use config;
|
||||
use log;
|
||||
use template;
|
||||
use auth;
|
||||
use uac;
|
||||
|
||||
#use roles;
|
||||
#use project;
|
||||
#use studios;
|
||||
#use events;
|
||||
#use series;
|
||||
use images;
|
||||
|
||||
#use series_schedule;
|
||||
#use series_events;
|
||||
#use series_dates;
|
||||
#use markup;
|
||||
#use URI::Escape;
|
||||
#use Encode;
|
||||
use localization;
|
||||
|
||||
binmode STDOUT, ":utf8";
|
||||
|
||||
my $r = shift;
|
||||
( my $cgi, my $params, my $error ) = params::get($r);
|
||||
|
||||
my $config = config::get('../config/config.cgi');
|
||||
my $debug = $config->{system}->{debug};
|
||||
my ( $user, $expires ) = auth::get_user( $cgi, $config );
|
||||
return if ( ( !defined $user ) || ( $user eq '' ) );
|
||||
|
||||
my $user_presets = uac::get_user_presets(
|
||||
$config,
|
||||
{
|
||||
project_id => $params->{project_id},
|
||||
studio_id => $params->{studio_id},
|
||||
user => $user
|
||||
}
|
||||
);
|
||||
$params->{default_studio_id} = $user_presets->{studio_id};
|
||||
$params->{studio_id} = $params->{default_studio_id}
|
||||
if ( ( !( defined $params->{action} ) ) || ( $params->{action} eq '' ) || ( $params->{action} eq 'login' ) );
|
||||
$params->{project_id} = $user_presets->{project_id}
|
||||
if ( ( !( defined $params->{action} ) ) || ( $params->{action} eq '' ) || ( $params->{action} eq 'login' ) );
|
||||
|
||||
my $request = {
|
||||
url => $ENV{QUERY_STRING} || '',
|
||||
params => {
|
||||
original => $params,
|
||||
checked => check_params($params),
|
||||
},
|
||||
};
|
||||
$request = uac::prepare_request( $request, $user_presets );
|
||||
log::init($request);
|
||||
|
||||
$params = $request->{params}->{checked};
|
||||
|
||||
#process header
|
||||
|
||||
return unless uac::check( $config, $params, $user_presets ) == 1;
|
||||
showImage( $config, $request );
|
||||
|
||||
#TODO: filter by published, draft
|
||||
sub showImage {
|
||||
my $config = shift;
|
||||
my $request = shift;
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
my $permissions = $request->{permissions};
|
||||
unless ( $permissions->{read_event} == 1 ) {
|
||||
uac::permissions_denied('read_image');
|
||||
return;
|
||||
}
|
||||
|
||||
unless (defined $params->{filename}){
|
||||
uac::permissions_denied('missing filename');
|
||||
return;
|
||||
}
|
||||
|
||||
my $filename = images::getInternalPath($config, $params);
|
||||
unless (-e $filename){
|
||||
uac::permissions_denied("read $filename");
|
||||
return;
|
||||
}
|
||||
|
||||
my $image=images::readFile($filename);
|
||||
if (defined $image->{error}){
|
||||
uac::permissions_denied("read $filename, $image->{error}");
|
||||
return;
|
||||
}
|
||||
|
||||
binmode STDOUT;
|
||||
print "Content-type:image/jpeg; charset=UTF-8;\n\n";
|
||||
print $image->{content};
|
||||
return;
|
||||
}
|
||||
|
||||
sub check_params {
|
||||
my $params = shift;
|
||||
|
||||
my $checked = {};
|
||||
|
||||
my $debug = $params->{debug} || '';
|
||||
if ( $debug =~ /([a-z\_\,]+)/ ) {
|
||||
$debug = $1;
|
||||
}
|
||||
$checked->{debug} = $debug;
|
||||
|
||||
#numeric values
|
||||
for my $param ( 'filename') {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^[A-Za-z\_\-\.\d\/]+$/ ) ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
$checked->{$param} =~s/^.*\///g;
|
||||
}
|
||||
}
|
||||
|
||||
$checked->{type}='thumbs';
|
||||
for my $param ( 'type') {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^(thumbs|images|icons)$/ ) ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
}
|
||||
}
|
||||
|
||||
#numeric values
|
||||
for my $param ( 'project_id', 'studio_id', 'series_id', 'event_id') {
|
||||
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^[\-\d]+$/ ) ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
}
|
||||
}
|
||||
|
||||
if ( defined $checked->{studio_id} ) {
|
||||
$checked->{default_studio_id} = $checked->{studio_id};
|
||||
} else {
|
||||
$checked->{studio_id} = -1;
|
||||
}
|
||||
|
||||
return $checked;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
<div> <a href="projects.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.projects></a> </div>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF .allow.update_image_others>
|
||||
<div> <a href="image.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.images></a> </div>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF .allow.scan_series_events>
|
||||
<div> <a href="assignments.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.import></a> </div>
|
||||
</TMPL_IF>
|
||||
|
||||
@@ -384,7 +384,7 @@
|
||||
<tr>
|
||||
<td class="label">description</td>
|
||||
<td>
|
||||
<img src="<TMPL_VAR image>" style="float:right;padding-left:1em">
|
||||
<img style="float:right;padding-left:1em" src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR image>">
|
||||
<div><TMPL_VAR topic</div>
|
||||
<div><TMPL_VAR html_content escape=0></div>
|
||||
</td>
|
||||
@@ -452,9 +452,11 @@
|
||||
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR event_id>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image ESCAPE=url>','<TMPL_VAR series_id>');return false;"
|
||||
style="padding:0;"
|
||||
>
|
||||
<img id="imagePreview" src="<TMPL_VAR image>">
|
||||
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR studio_id>&filename=<TMPL_VAR image>&type=icon">
|
||||
</button>
|
||||
<input id="image_<TMPL_VAR event_id>" name="image" value="<TMPL_VAR image>" class="image" style="float:right" placeholder="<TMPL_VAR .loc.label_image>">
|
||||
<input type="hidden" name="series_image" value="<TMPL_VAR series_image>" >
|
||||
<!--(series_image:<TMPL_VAR series_image>,image=<TMPL_VAR image>)-->
|
||||
</TMPL_IF>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<button onclick="selectImage('<TMPL_VAR .project_id>','<TMPL_VAR .studio_id>','image_<TMPL_VAR .series_id>','<TMPL_VAR series_name escape=HTML>','<TMPL_VAR image escape=URL>','<TMPL_VAR series_id>');return false;"
|
||||
style="padding:0;float:left"
|
||||
>
|
||||
<img id="imagePreview" src="<TMPL_VAR image>">
|
||||
<img id="imagePreview" src="showImage.cgi?project_id=<TMPL_VAR .project_id>&studioId=<TMPL_VAR .studio_id>&filename=<TMPL_VAR image>&type=icon">
|
||||
</button>
|
||||
<input id="image_<TMPL_VAR .series_id>" name="image" value="<TMPL_VAR image>" class="image" placeholder="<TMPL_VAR .loc.template_image>">
|
||||
</TMPL_IF>
|
||||
@@ -444,7 +444,7 @@
|
||||
<TMPL_LOOP events>
|
||||
<tr id="event_<TMPL_VAR event_id>">
|
||||
<TMPL_IF .allow.read_image>
|
||||
<td class="logo"><img src="<TMPL_VAR image>" width="33" height="33"></td>
|
||||
<td class="logo"><img width="33" height="33" src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR image>"></td>
|
||||
</TMPL_IF>
|
||||
<td class="weekday"><TMPL_VAR weekday_short_name></td>
|
||||
<td class="date"><TMPL_VAR start_date></td>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
$("#image-tabs").tabs({
|
||||
activate: function(event, ui){
|
||||
if (ui==null) return;
|
||||
selectedImageTab=getSelectedTab('image-tabs');
|
||||
selectedImageTab = getSelectedTab('image-tabs');
|
||||
|
||||
<TMPL_IF .allow.create_image>
|
||||
if(selectedImageTab=="upload"){
|
||||
@@ -100,7 +100,7 @@
|
||||
<TMPL_LOOP images>
|
||||
<div class="image"
|
||||
id="img_<TMPL_VAR id>"
|
||||
style="background-image:url('<TMPL_VAR thumb_url>')"
|
||||
style="background-image:url('showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR filename>')"
|
||||
title="<TMPL_VAR description>"
|
||||
onclick="imageAction('<TMPL_VAR filename>');return false;"
|
||||
>
|
||||
|
||||
@@ -2,11 +2,51 @@
|
||||
<head>
|
||||
<link type="text/css" href="css/admin.css" rel="stylesheet"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<script>
|
||||
|
||||
function updateCheckBox(selector, value){
|
||||
$(selector).attr('value', value)
|
||||
if (value==1){
|
||||
$(selector).prop( "checked", true );
|
||||
} else {
|
||||
$(selector).prop( "checked", false );
|
||||
}
|
||||
}
|
||||
|
||||
function updatePublicCheckbox(elem){
|
||||
console.log(elem.prop('checked'))
|
||||
if (elem.prop('checked')){
|
||||
console.log( 'set public' );
|
||||
updateCheckBox(elem, 1);
|
||||
}else{
|
||||
console.log( 'unset public' );
|
||||
updateCheckBox(elem, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(
|
||||
function(){
|
||||
var publicCheckbox=$("#img_editor input[name='public']");
|
||||
|
||||
updatePublicCheckbox( publicCheckbox );
|
||||
publicCheckbox.change(
|
||||
function(){
|
||||
updatePublicCheckbox($(this));
|
||||
}
|
||||
)
|
||||
console.log("image handler initialized");
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<TMPL_LOOP images>
|
||||
<form id="save_img_<TMPL_VAR id>"
|
||||
method="post" action="image.cgi"
|
||||
method="post"
|
||||
action="image.cgi"
|
||||
onsubmit="saveImage('<TMPL_VAR id>','<TMPL_VAR filename>');return false;"
|
||||
style="float:left"
|
||||
>
|
||||
@@ -15,9 +55,10 @@
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="5"><a href="<TMPL_VAR image_url>" onclick="showImage('<TMPL_VAR image_url>');return false;"><img src="<TMPL_VAR thumb_url>" /></a></td>
|
||||
<td><TMPL_VAR .loc.label_name></td>
|
||||
<td><input value="<TMPL_VAR name escape=0>" name="update_name" class="field"></td>
|
||||
<td rowspan="99"><a href="<TMPL_VAR image_url>" onclick="showImage('<TMPL_VAR image_url>');return false;"
|
||||
><img src="showImage.cgi?project_id=<TMPL_VAR project_id>&studioId=<TMPL_VAR .studio_id>&type=icon&filename=<TMPL_VAR filename>" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><TMPL_VAR .loc.label_description></td>
|
||||
@@ -33,21 +74,25 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><TMPL_VAR .loc.label_editor_link></td>
|
||||
<td><input value="{{thumbs/<TMPL_VAR filename escape=0>|<TMPL_VAR name>}}" class="field"/></td>
|
||||
<td><input value="{{<TMPL_VAR filename escape=0>|<TMPL_VAR name>}}" class="field" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><TMPL_VAR .loc.label_author>/<TMPL_VAR .loc.label_licence></td>
|
||||
<td><input name="licence" value="<TMPL_VAR licence>" class="field<TMPL_IF missing_licence> error</TMPL_IF>" placeholder="<TMPL_VAR .loc.label_licence_missing>"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><TMPL_VAR .loc.label_public></td>
|
||||
<td><input type="checkbox" name="public" <TMPL_IF public>checked="checked" value="1"<TMPL_ELSE>value="0"</TMPL_IF> /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td />
|
||||
<td>
|
||||
<TMPL_IF name="update_image">
|
||||
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
|
||||
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>" />
|
||||
<input type="hidden" name="save_image" value="<TMPL_VAR filename escape=0>" />
|
||||
<button onclick="this.submit"><TMPL_VAR .loc.button_save></button/>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF name="delete_image">
|
||||
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
|
||||
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>" />
|
||||
<button onclick="askDeleteImage('img_<TMPL_VAR id escape=0>','<TMPL_VAR filename escape=0>');return false;"><TMPL_VAR .loc.button_delete></button>
|
||||
</TMPL_IF>
|
||||
</td>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
Content-type:text/html; charset=UTF-8;
|
||||
|
||||
<html>
|
||||
<body>
|
||||
<TMPL_LOOP images>
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title><TMPL_VAR .doc.title></title>
|
||||
<script src="js/page_leave_handler.js" type="text/javascript"></script>
|
||||
|
||||
<style>
|
||||
.mailHeader{
|
||||
background:#ccc;
|
||||
}
|
||||
|
||||
.mailSubject{
|
||||
border-bottom:2px solid #ccc;
|
||||
}
|
||||
|
||||
.mailBody{
|
||||
white-space:pre;
|
||||
border-top:2px solid #ccc;
|
||||
}
|
||||
|
||||
.done{
|
||||
background:#cfc;
|
||||
}
|
||||
|
||||
table#events td:nth-of-type(1){
|
||||
width:15em;
|
||||
}
|
||||
|
||||
table#events td:nth-of-type(2){
|
||||
width:60em;
|
||||
}
|
||||
|
||||
td.action, input.action{
|
||||
width:5em;
|
||||
}
|
||||
|
||||
form input{
|
||||
width:50em;
|
||||
}
|
||||
|
||||
form textarea{
|
||||
width:50em;
|
||||
height:14em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var region='<TMPL_VAR loc.region>';
|
||||
var event_id='<TMPL_VAR event_id>';
|
||||
var selectImageId='';
|
||||
<TMPL_IF .event_edited>
|
||||
$(document).ready(
|
||||
function(){
|
||||
if ($('div.error').length>0) return;
|
||||
if(comeFromCalendar()) getBack();
|
||||
}
|
||||
);
|
||||
</TMPL_IF>
|
||||
|
||||
$(document).ready(
|
||||
function(){
|
||||
$("#forms form").submit(
|
||||
function( event ) {
|
||||
event.preventDefault();
|
||||
var $form = $( this );
|
||||
var posting = $.post("notify_events.cgi", $form.serialize());
|
||||
posting.done(
|
||||
function( data ) {
|
||||
var content = $( data ).find( "#content" );
|
||||
$('#result').html(content);
|
||||
var formId=$form.attr('id');
|
||||
$('#'+formId+" .mailHeader").addClass("done");
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="result" style="display:none"> </div>
|
||||
|
||||
<div id="forms">
|
||||
<TMPL_LOOP events>
|
||||
<form id="event_<TMPL_VAR event_id>">
|
||||
<input type="hidden" name="project_id" value="<TMPL_VAR project_id>">
|
||||
<input type="hidden" name="studio_id" value="<TMPL_VAR studio_id>">
|
||||
<input type="hidden" name="series_id" value="<TMPL_VAR series_id>">
|
||||
<input type="hidden" name="event_id" value="<TMPL_VAR event_id>">
|
||||
<input type="hidden" name="action" value="send">
|
||||
|
||||
<table id="events">
|
||||
<tr id="header_<TMPL_VAR event_id>" class="mailHeader">
|
||||
<td><b><TMPL_VAR start></b></td>
|
||||
<td><b><TMPL_VAR full_title></b> | <TMPL_IF live>live</TMPL_IF> <TMPL_IF preproduction>preproduction</TMPL_IF> <TMPL_IF playout>playout</TMPL_IF></td>
|
||||
|
||||
<TMPL_IF noRecipient>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Warning</td>
|
||||
<td><div class="error">no recipient configured at series!</div></td>
|
||||
</tr>
|
||||
|
||||
<TMPL_ELSE>
|
||||
|
||||
<td class="action"><input class="button" type="submit" name="action" value="send"></td>
|
||||
</tr>
|
||||
|
||||
<TMPL_IF mail.Subject>
|
||||
<tr>
|
||||
<td>Subject</td>
|
||||
<td class="mailSubject"><input name="subject" value="<TMPL_VAR mail.Subject>"></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.To>
|
||||
<tr>
|
||||
<td>To</td>
|
||||
<td><input name="to" value="<TMPL_VAR mail.To>"></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.From>
|
||||
<tr>
|
||||
<td>From</td>
|
||||
<td><TMPL_VAR mail.From></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.Cc>
|
||||
<tr>
|
||||
<td>Cc</td>
|
||||
<td><input name="cc" value="<TMPL_VAR mail.Cc>"></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.Reply-To>
|
||||
<tr>
|
||||
<td>Reply-To</td>
|
||||
<td><TMPL_VAR mail.Reply-To></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF mail.data>
|
||||
<tr>
|
||||
<td>Content</td>
|
||||
<td class="mailBody"><textarea name="content" ><TMPL_VAR mail.data></textarea></td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
|
||||
</TMPL_IF>
|
||||
</table>
|
||||
</form>
|
||||
</TMPL_LOOP>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,8 +12,9 @@ var region='<TMPL_VAR loc.region>';
|
||||
<button onclick="add_series('<TMPL_VAR series_name>')"><TMPL_VAR .loc.button_add_series></button>
|
||||
<div id="edit_new" class="editor" style="display:none;clear:both">
|
||||
<form method="post" action="series.cgi">
|
||||
<input type="hidden" name="project_id" value="<TMPL_VAR project_id>">
|
||||
<input type="hidden" name="studio_id" value="<TMPL_VAR studio_id>">
|
||||
<input type="hidden" name="project_id" value="<TMPL_VAR .project_id>">
|
||||
<input type="hidden" name="studio_id" value="<TMPL_VAR .studio_id>">
|
||||
<input type="hidden" name="image" value="<TMPL_VAR .image>">
|
||||
|
||||
<div class="formField">
|
||||
<div class="label"><TMPL_VAR .loc.label_name></div>
|
||||
|
||||
@@ -200,7 +200,13 @@ sub update_user {
|
||||
return;
|
||||
}
|
||||
|
||||
return unless ( check_password( $params->{user_password} ) );
|
||||
my $users= uac::get_users($config, {email => $params->{email}});
|
||||
if (scalar (@$users) > 0){
|
||||
error('There is already a user registered for the given email address');
|
||||
return;
|
||||
}
|
||||
|
||||
return unless password_request::checkPassword( $params->{user_password} ) ;
|
||||
|
||||
if ( $params->{user_password} ne $params->{user_password2} ) {
|
||||
error('password mismatch');
|
||||
@@ -236,76 +242,17 @@ sub change_password {
|
||||
my $params = $request->{params}->{checked};
|
||||
my $permissions = $request->{permissions};
|
||||
|
||||
unless ( ( defined $userName ) || ( $userName eq '' ) ) {
|
||||
uac::print_error('user not found');
|
||||
return;
|
||||
}
|
||||
my $result = password_requests::changePassword($config, $request, $userName);
|
||||
|
||||
my $user = uac::get_user( $config, $userName );
|
||||
|
||||
unless ( ( defined $user ) && ( defined $user->{id} ) && ( $user->{id} ne '' ) ) {
|
||||
uac::print_error('user id not found');
|
||||
return;
|
||||
}
|
||||
|
||||
unless ( check_password( $params->{user_password} ) ) {
|
||||
error('password does not meet requirements');
|
||||
}
|
||||
|
||||
if ( $params->{user_password} ne $params->{user_password2} ) {
|
||||
error('entered passwords do not match');
|
||||
}
|
||||
|
||||
print STDERR "error at changing password:" . Dumper($errors);
|
||||
|
||||
if ( @$errors == 0 ) {
|
||||
my $crypt = auth::crypt_password( $params->{user_password} );
|
||||
$user = { id => $user->{id} };
|
||||
$user->{salt} = $crypt->{salt};
|
||||
$user->{pass} = $crypt->{crypt};
|
||||
|
||||
#print '<pre>'.Dumper($user).'</pre>';
|
||||
$config->{access}->{write} = 1;
|
||||
uac::update_user( $config, $user );
|
||||
$config->{access}->{write} = 0;
|
||||
print STDERR "password changed for $params->{presets}->{user}\n";
|
||||
}
|
||||
$params->{errors} = $errors; #join("<br>", (map {$_>{error}} (@$errors)) );
|
||||
$params->{loc} = localization::get( $config, { user => $params->{presets}->{user}, file => 'users' } );
|
||||
$params->{errors} = $result->{error} if defined $result->{error};
|
||||
$params->{info} = $result->{success} if defined $result->{success};
|
||||
$params->{loc} = localization::get( $config, { user => $params->{presets}->{user}, file => 'users' } );
|
||||
uac::set_template_permissions( $permissions, $params );
|
||||
|
||||
#print Dumper($permissions);
|
||||
template::process( 'print', template::check('change_password'), $params );
|
||||
}
|
||||
|
||||
sub check_password {
|
||||
my $password = shift;
|
||||
unless ( defined $password || $password eq '' ) {
|
||||
error("password is empty");
|
||||
return;
|
||||
}
|
||||
if ( length($password) < 8 ) {
|
||||
error("password to short");
|
||||
return 0;
|
||||
}
|
||||
unless ( $password =~ /[a-z]/ ) {
|
||||
error("password should contains at least one small character");
|
||||
return 0;
|
||||
}
|
||||
unless ( $password =~ /[A-Z]/ ) {
|
||||
error("password should contains at least one big character");
|
||||
return 0;
|
||||
}
|
||||
unless ( $password =~ /[0-9]/ ) {
|
||||
error("password should contains at least one number");
|
||||
return 0;
|
||||
}
|
||||
unless ( $password =~ /[^a-zA-Z0-9]/ ) {
|
||||
error("password should contains at least one special character");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub delete_user {
|
||||
my $config = shift;
|
||||
@@ -473,7 +420,16 @@ sub check_params {
|
||||
$checked->{studio_id} = -1;
|
||||
}
|
||||
|
||||
for my $param ( 'user_name', 'user_full_name', 'user_email', 'user_password', 'user_password2' ) {
|
||||
for my $param ( 'user_name', 'user_full_name', 'user_email') {
|
||||
if ( defined $params->{$param} ) {
|
||||
my $value = $params->{$param};
|
||||
$value =~s/^\s+//g;
|
||||
$value =~s/\s+$//g;
|
||||
$checked->{$param} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
for my $param ( 'user_password', 'user_password2' ) {
|
||||
if ( defined $params->{$param} ) {
|
||||
$checked->{$param} = $params->{$param};
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ sub getProjects {
|
||||
my $projects = project::get_sorted($config);
|
||||
|
||||
my $excludedProjects = {};
|
||||
if ( defined $config->{filter}->{exclude_projects} ) {
|
||||
for my $project ( split( /\,/, $config->{filter}->{exclude_projects} ) ) {
|
||||
if ( defined $config->{filter}->{projects_to_exclude} ) {
|
||||
for my $project ( split( /\,/, $config->{filter}->{projects_to_exclude} ) ) {
|
||||
$project =~ s/^\s+//g;
|
||||
$project =~ s/\s+$//g;
|
||||
$excludedProjects->{$project} = 1;
|
||||
@@ -126,9 +126,9 @@ sub getSeriesNames {
|
||||
my $bind_values = [];
|
||||
|
||||
my @conds = ();
|
||||
if ( defined $config->{filter}->{exclude_locations} ) {
|
||||
if ( defined $config->{filter}->{locations_to_exclude} ) {
|
||||
my @exclude = ();
|
||||
for my $location ( split( /\,/, $config->{filter}->{exclude_locations} ) ) {
|
||||
for my $location ( split( /\,/, $config->{filter}->{locations_to_exclude} ) ) {
|
||||
$location =~ s/^\s+//g;
|
||||
$location =~ s/\s+$//g;
|
||||
push @exclude, '?';
|
||||
@@ -137,9 +137,9 @@ sub getSeriesNames {
|
||||
push @conds, 'location not in (' . join( ',', @exclude ) . ')';
|
||||
}
|
||||
|
||||
if ( defined $config->{filter}->{exclude_projects} ) {
|
||||
if ( defined $config->{filter}->{projects_to_exclude} ) {
|
||||
my @exclude = ();
|
||||
for my $project ( split( /\,/, $config->{filter}->{exclude_projects} ) ) {
|
||||
for my $project ( split( /\,/, $config->{filter}->{projects_to_exclude} ) ) {
|
||||
$project =~ s/^\s+//g;
|
||||
$project =~ s/\s+$//g;
|
||||
push @exclude, '?';
|
||||
|
||||
@@ -37,16 +37,32 @@
|
||||
|
||||
<TMPL_IF program> (<TMPL_VAR program>)</TMPL_IF>
|
||||
</div>
|
||||
<div class="content" >
|
||||
<div class="content description" >
|
||||
<TMPL_VAR excerpt > <TMPL_VAR user_excerpt >
|
||||
<TMPL_IF excerpt><hr><TMPL_ELSE><TMPL_IF user_excerpt><hr></TMPL_IF></TMPL_IF>
|
||||
|
||||
<TMPL_IF no_image_in_text>
|
||||
<p>
|
||||
<a href="<TMPL_VAR image>">
|
||||
<img alt="<TMPL_VAR series_name>" src="<TMPL_VAR thumb>">
|
||||
<TMPL_IF .hide_event_images>
|
||||
<a href="<TMPL_VAR series_image_url>">
|
||||
<figure>
|
||||
<TMPL_IF series_thumb_url>
|
||||
<img alt="<TMPL_VAR series_name>" src="<TMPL_VAR series_thumb_url>">
|
||||
<TMPL_IF series_image_label><figcaption>Bild:<TMPL_VAR series_image_label></figcaption></TMPL_IF>
|
||||
</TMPL_IF>
|
||||
</figure>
|
||||
</a>
|
||||
</p>
|
||||
<TMPL_ELSE>
|
||||
<a href="<TMPL_VAR image_url>">
|
||||
<figure>
|
||||
<TMPL_IF thumb_url>
|
||||
<img alt="<TMPL_VAR series_name>" src="<TMPL_VAR thumb_url>">
|
||||
<TMPL_IF image_label><figcaption>Bild:<TMPL_VAR image_label></figcaption></TMPL_IF>
|
||||
</TMPL_IF>
|
||||
</figure>
|
||||
</a>
|
||||
</TMPL_IF>
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_VAR topic ESCAPE=0><TMPL_VAR content ESCAPE=0>
|
||||
<TMPL_IF recurrence_date><a href="<TMPL_VAR recurrence>.html">Wiederholung vom <TMPL_VAR recurrence_date></a></TMPL_IF>
|
||||
</div>
|
||||
|
||||
@@ -22,23 +22,30 @@
|
||||
<TMPL_VAR weekday_short_name>, <TMPL_VAR start_date_name><TMPL_IF project_title> - <TMPL_VAR project_title></TMPL_IF>
|
||||
</div>
|
||||
</TMPL_IF>
|
||||
|
||||
<div id="event_<TMPL_VAR event_id>" class="event<TMPL_IF location_css> <TMPL_VAR location_css></TMPL_IF><TMPL_IF is_running> running</TMPL_IF>"
|
||||
onclick="window.location.href='<TMPL_VAR cache_base_url>/<TMPL_VAR .controllers.event>/<TMPL_VAR event_id>.html#<TMPL_VAR event_uri escape=url>'"
|
||||
>
|
||||
<span class="summary title" title="Mehr Infos zur Sendung">
|
||||
<TMPL_VAR start_time_name><TMPL_IF name="__last__"> - <TMPL_VAR end_time_name></TMPL_IF> |
|
||||
<a href="<TMPL_VAR cache_base_url>/<TMPL_VAR .controllers.event>/<TMPL_VAR event_id>.html#<TMPL_VAR event_uri escape=url>"
|
||||
><TMPL_VAR full_title></a>
|
||||
<span style="float:right;font-weight:100"><TMPL_IF location_mapped><TMPL_VAR location_mapped></TMPL_IF></span>
|
||||
|
||||
<span class="time"><TMPL_VAR start_time_name><TMPL_IF name="__last__"> - <TMPL_VAR end_time_name></TMPL_IF></span>
|
||||
|
||||
<span class="summary" title="Mehr Infos zur Sendung">
|
||||
|
||||
<a href="<TMPL_VAR cache_base_url>/<TMPL_VAR .controllers.event>/<TMPL_VAR event_id>.html#<TMPL_VAR event_uri escape=url>">
|
||||
<span class="title"><TMPL_VAR full_title></span>
|
||||
</a>
|
||||
<div class="excerpt"><TMPL_VAR excerpt> <TMPL_VAR user_excerpt> </div>
|
||||
|
||||
<TMPL_UNLESS no_comment>
|
||||
<a href="<TMPL_VAR cache_base_url>/<TMPL_VAR .controllers.event>/<TMPL_VAR event_id>.html#<TMPL_VAR event_uri>#comments"
|
||||
>
|
||||
<span class="submitted<TMPL_IF comment_count> comments</TMPL_IF>"><TMPL_VAR comment_count> Kommentar<TMPL_UNLESS one_comment>e</TMPL_UNLESS></span>
|
||||
</a>
|
||||
</TMPL_UNLESS>
|
||||
</span>
|
||||
|
||||
<div class="excerpt"><TMPL_VAR excerpt> <TMPL_VAR user_excerpt></div>
|
||||
<TMPL_UNLESS no_comment>
|
||||
<a href="<TMPL_VAR cache_base_url>/<TMPL_VAR .controllers.event>/<TMPL_VAR event_id>.html#<TMPL_VAR event_uri>#comments"
|
||||
>
|
||||
<span class="submitted<TMPL_IF comment_count> comments</TMPL_IF>"><TMPL_VAR comment_count> Kommentar<TMPL_UNLESS one_comment>e</TMPL_UNLESS></span>
|
||||
</a>
|
||||
</TMPL_UNLESS>
|
||||
<span class="location"><TMPL_VAR location_mapped></span>
|
||||
|
||||
</div>
|
||||
</TMPL_IF>
|
||||
</TMPL_LOOP>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<div class="title">
|
||||
<TMPL_VAR start_time_name><br />
|
||||
<TMPL_VAR series_name><TMPL_UNLESS series_name>kaputt: <TMPL_VAR title></TMPL_UNLESS>
|
||||
<TMPL_VAR series_name><TMPL_UNLESS series_name>!<TMPL_VAR title></TMPL_UNLESS>
|
||||
</div>
|
||||
|
||||
<span class="dtstart"><TMPL_VAR start></span>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
Options -Indexes -FollowSymLinks -MultiViews -ExecCGI
|
||||
#Order allow,deny
|
||||
#allow from all
|
||||
Options -Indexes +FollowSymLinks +MultiViews -ExecCGI
|
||||
Require all granted
|
||||
|
||||
<IfModule mod_expires.c>
|
||||
|
||||
Reference in New Issue
Block a user