Revision 440

Date:
2014/09/05 17:41:48
Author:
ahitrov
Revision Log:
Object edit form date check.
$document->delete now deletes multimedia_multi attachments.
Script template now contains code for plugins init
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/core/comps/contenido/components/obj_list_js.msn

     
    138 138 document.form.obj_list_dest_id[i].selected = true;
    139 139 }
    140 140 }
    141 var Check_day;
    142 var Check_mon;
    143 var Check_year;
    144 % foreach my $prop ( $object->structure ) {
    145 % if ( !($prop->{hidden} || $prop->{readonly} || $prop->{auto}) && ($prop->{type} eq 'datetime' || $prop->{type} eq 'date') ) {
    146 % my $name = $prop->{attr};
    147 Check_day = oForm.<% $name %>_day.value;
    148 Check_mon = oForm.<% $name %>_month.value;
    149 Check_year = oForm.<% $name %>_year.value;
    150 if ( ((Check_mon == 4 || Check_mon == 6 || Check_mon == 9 || Check_mon == 11) && Check_day > 30) ||
    151 (Check_year % 4 > 0 && Check_mon == 2 && Check_day > 28) || (Check_year % 4 == 0 && Check_mon == 2 && Check_day > 29) ) {
    152 alert('Дата [<% $prop->{attr} %>] указана неверно');
    153 oForm.<% $name %>_day.focus();
    154 return false;
    155 }
    156 % }
    157 % }
    141 158
    142 159 return true;
    143 160 }
  • utf8/core/comps/contenido/components/object_form.msn

     
    5 5 <div style="text-align:right;"><& '/contenido/components/object_context_form.msn', object => $object &></div>
    6 6 % }
    7 7
    8 <form enctype="multipart/form-data" action="<% $PROTOS->{$proto}->[1] %>" method="POST" name="form" onSubmit="javascript:Save()">
    8 <form enctype="multipart/form-data" action="<% $PROTOS->{$proto}->[1] %>" method="POST" name="form" onSubmit="return Save(this)">
    9 9 <table border="0" width="100%" cellspacing="0" cellpadding="6">
    10 10 <tr>
    11 11 <td style="font-size:110%;">
  • utf8/core/lib/Contenido/Object.pm

     
    674 674 }
    675 675 }
    676 676 }
    677 } elsif ( $prop->{type} eq 'multimedia_multi' ) {
    678 for ( 1..100 ) {
    679 next unless exists $att->{"file_$_"};
    680 my $file = $att->{"file_$_"};
    681 if ( ref $file && exists $file->{filename} && $file->{filename} ) {
    682 Contenido::File::remove( $file->{filename} );
    683 }
    684 }
    677 685 } elsif ( $prop->{type} eq 'multimedia_new' ) {
    678 686 if ( ref $att && exists $att->{filename} && $att->{filename} ) {
    679 687 Contenido::File::remove( $att->{filename} );
  • utf8/core/skel/project/services/script.tmpl

     
    24 24 #PidFile->new($keeper, compat=>1); # db-based locking (run only on one host)
    25 25 #PidFile->new($keeper, compat=>1, per_host=>1); # db-based locking (run on whole cluster)
    26 26
    27 # Plugins init
    28 #for my $plugin ( split(/\s+/, $state->plugins) ) {
    29 # my $class = $plugin.'::Apache';
    30 # eval { $class->child_init(); };
    31 # if ( $@ ) {
    32 # $log->error("Не могу выполнить метод child_init плагина $plugin ($class) по причине '$@'");
    33 # }
    34 #}
    35
    27 36 ############################################
    28 37 # please use:
    29 38 # $state->{log_dir} for logging