Revision 32

Date:
2010/06/09 10:07:13
Author:
ahitrov@rambler.ru
Revision Log:
Коррективы в установке ImageMagick
Инлайновое редактирование и отображение дополнительных полей в контрольке связи
Механизм связей - убраны лишние элементы в форме источника
Files:

Legend:

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

     
    26 26 % if ( @props ) {
    27 27 % foreach my $prop ( @props ) {
    28 28 % my $field = $prop->{attr};
    29 % if ( exists $prop->{inline} ) {
    30 % $inline_status = 1;
    31 % if ( $prop->{type} =~ /^(string|integer|float)$/ ) {
    32 <td><input type="text" name="<% 'update_'.$link->id.'_'.$field %>" value="<% $link->$field |h %>" style="<% $prop->{inline_width} ? 'width:'.$prop->{inline_width}.'px;' : 'width:65px; ' %> <% $prop->{inline_style} || '' %>"></td>
    33 % } elsif ($prop->{type} eq 'checkbox') {
    34 % my $checked = $link->$field ? ' checked' : '';
    35 <td align="center"><input type="checkbox" name="<% 'update_'.$link->id.'_'.$field %>"<% $checked %>>
    36 % } elsif ($prop->{type} eq 'select') {
    37 % my $options = {};
    38 % if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$link->class}))) {
    39 % %{ $options } = %{ $toopi->{$link->class} };
    40 % }
    41 % my $values = $options->{$prop->{attr}};
    42 <td><select name="<% 'update_'.$link->id.'_'.$field %>">
    43 % if ( ref $values eq 'ARRAY' ) {
    44 % foreach my $val ( @$values ) {
    45 % my $selected = $val eq $link->$field ? ' selected' : '';
    46 <option value="<% $val %>"<% $selected %>><% $val %>
    47 % }
    48 % }
    49 </select>
    50 % } elsif ($prop->{type} eq 'status') {
    51 % my $cases = $prop->{cases};
    52 % if ( ref $cases eq 'ARRAY' ) {
    53 <td><select name="<% 'update_'.$link->id.'_'.$field %>" style="<% $prop->{inline_width} ? 'width:'.$prop->{inline_width}.'px;' : '' %> <% $prop->{inline_style} || '' %>">
    54 % foreach my $case ( @$cases ) {
    55 % my $selected = $case->[0] eq $link->$field ? ' selected' : '';
    56 <option value="<% $case->[0] %>"<% $selected %>><% $case->[1] %>
    57 % }
    58 </select>
    59 % }
    60
    61 % }
    62 % } else {
    29 63 <td><% $link->$field %></td>
    64 % }
    30 65 % }
    31 66 % }
    32 <td><a href="link.html?class=<% $link->class %>&id=<% $link->id %>" target="_blank">редактировать</a></td>
    33 </tr>
    67 <td><a href="link.html?class=<% $link->class %>&id=<% $link->id %>" target="_blank">редактировать</a>
    68 % if ( $inline_status ) {
    69 <input type="hidden" name="update_<% $link->id %>_class" value="<% $link->class %>">
    70 % }
    71 </td></tr>
    34 72 % }
    35 73 </table>
    36 74 % if ( @$links ) {
     
    42 80 % } else {
    43 81 <input type="hidden" name="dest_class" value="<% $links->[0]->class %>">
    44 82 % }
    83 % if ( $inline_status ) {
    84 <input type="submit" name="update" value="Сохранить изменения" class="input_btn">
    85 % }
    45 86 <input type="submit" value="Удалить выбранные связи документа" class="input_btn"></div>
    46 87 % }
    47 88 </form>
     
    59 100 return unless ref $docs;
    60 101 return unless ref $links eq 'ARRAY' && @$links;
    61 102
    103 my $inline_status = 0;
    62 104 my $document = $destination || $source;
    63 105 my @props = $links->[0]->structure;
    64 106 @props = sort { $a->{column} <=> $b->{column} } grep { $_->{attr} ne 'class' && $_->{type} =~ /string|integer/ } grep { $_->{column} } @props;
    107 my $toopi = $project->links();
    65 108
    66 109 </%init>
  • utf8/core/comps/contenido/links/source.html

     
    72 72 <fieldset>
    73 73 <legend>Список связей</legend>
    74 74
    75 <table class="tform" width="100%">
    76 <tr><td>
    75 77 <form action="link_add.html" name="destform" target="_top" method="post" onsubmit="return CheckDest();">
    76 78 <div id="link_list"></div>
    77 79
    78 <table class="tform" width="100%">
    79 <tr><td>
    80 <form action="link_add.html" name="destform" target="_top" method="post" onsubmit="return CheckDest();">
    81 <select multiple name="destinations" size="20" style="width:100%">
    82 </select>
    83 <p>К источнику будут привязаны только выделенные документы.</p>
    84 80 <input type="hidden" name="class" value="<% $class %>">
    85 81 <input type="hidden" name="source_id" value="<% $source_id %>">
    86 82 <input type="hidden" name="source_class" value="<% $source_class %>">
    87 <input type="button" value="Выделить все" onclick="SelectAllDest();">
    88 <input type="button" value="Удалить лишнее" onclick="DeleteDest();">
    89 83 <input type="submit" value="Связать выбранное">
    90 84 </td></tr>
    91 85 </table>
  • utf8/core/comps/contenido/store_document_links.html

     
    4 4 $class => undef
    5 5 $source_class => undef
    6 6 $dest_class => undef
    7 $update => undef
    7 8
    8 9 </%ARGS>
    9 10
    10 11
    11 12 <%init>
    12 if ($id)
    13 {
    13 if ($id) {
    14 14 my $document = $keeper->get_document_by_id($id, class=>$class);
    15 15
    16 my @link_args = ();
    17 if ( exists $ARGS{links} && ref $ARGS{links} eq 'ARRAY' ) {
    18 @link_args = @{ $ARGS{links} }
    19 } elsif ( exists $ARGS{links} ) {
    20 @link_args = ( $ARGS{links} );
    21 }
    16 if ( $update ) {
    22 17
    23 my %nlinks = ();
    24 foreach my $name (@link_args)
    25 {
    26 if ($name =~ /^link_(\d+)_(\d+)_(.*)$/)
    18 my %updated;
    19 while ( my ($field, $value) = each %ARGS ) {
    20 if ( $field =~ /^update_(\d+)_(\w+)$/ ) {
    21 my $oid = $1;
    22 my $attr = $2;
    23 $updated{$oid}{$attr} = $value;
    24 }
    25 }
    26 my %classes = map { $_->{class} => 1 } values %updated;
    27 foreach my $update_class ( keys %classes ) {
    28 my @ids;
    29 while ( my ($oid, $attr) = each %updated) {
    30 push @ids, $oid if $attr->{class} eq $update_class;
    31 }
    32 my @objects = $keeper->get_links (
    33 id => \@ids,
    34 class => $update_class
    35 ) if @ids;
    36 foreach my $object ( @objects ) {
    37 my $fields = $updated{$object->id};
    38 my @props = grep { exists $_->{inline} && $_->{inline} } $object->structure;
    39 if ( ref $fields eq 'HASH' ) {
    40 foreach my $prop ( @props ) {
    41 my $attr = $prop->{attr};
    42 my $value = ref $fields && exists $fields->{$attr} ? $fields->{$attr} : undef;
    43 if ( $prop->{db_type} eq 'float' ) {
    44 for ( $value ) {
    45 s/\,/\./;
    46 s/^\s+//;
    47 s/\s+$//;
    48 }
    49 }
    50 if ( $prop->{type} eq 'checkbox' ) {
    51 $value = $value ? 1 : undef;
    52 }
    53
    54 $object->$attr($value);
    55 }
    56 $object->store;
    57 }
    58 }
    59 }
    60
    61 } else {
    62 my @link_args = ();
    63 if ( exists $ARGS{links} && ref $ARGS{links} eq 'ARRAY' ) {
    64 @link_args = @{ $ARGS{links} }
    65 } elsif ( exists $ARGS{links} ) {
    66 @link_args = ( $ARGS{links} );
    67 }
    68
    69 my %nlinks = ();
    70 foreach my $name (@link_args)
    27 71 {
    28 my ($id, $dest_id, $lclass) = ($1, $2, $3);
    29 if ( $id && $lclass ) {
    30 my $link = $keeper->get_link_by_id ($id,
    31 class => $lclass,
    32 );
    33 $link->delete if ref $link;
    72 if ($name =~ /^link_(\d+)_(\d+)_(.*)$/)
    73 {
    74 my ($id, $dest_id, $lclass) = ($1, $2, $3);
    75 if ( $id && $lclass ) {
    76 my $link = $keeper->get_link_by_id ($id,
    77 class => $lclass,
    78 );
    79 $link->delete if ref $link;
    80 }
    34 81 }
    35 82 }
    36 83 }
  • utf8/core/ports/all/ImageMagick/GNUmakefile

     
    1 1 ##############################################################################
    2 2 # $HeadURL: http://svn.dev.rambler.ru/Contenido/branches/utf8/ports/all/ImageMagick/GNUmakefile $
    3 # $Id: GNUmakefile 1077 2007-10-09 09:48:29Z lonerr $
    3 # $Id: GNUmakefile 1549 2010-06-08 14:23:45Z lonerr $
    4 4 ###############################################################################
    5 5
    6 6 PORTVERSION = 6.2.7-8
    7 CONFIGURE_ENV = CPPFLAGS="$${CPPFLAGS} -I${PREFIX}/include" LDFLAGS="$${LDFLAGS} -L${PREFIX}/lib"
    7 CONFIGURE_ENV = CPPFLAGS="-I${PREFIX}/include $${CPPFLAGS}" LDFLAGS="$${LDFLAGS} -L${PREFIX}/lib"
    8 8 CONFIGURE_ARGS = --prefix=${PREFIX} --without-perl --without-threads --with-jpeg
    9 PORT_DEPENDS = jpeg
    9 CONFIGURE_POSTCMD = ${MAKE_RECURSIVE} post-configure
    10 PORT_DEPENDS = jpeg libpng
    10 11
    11 12 MASTER_POST_SITES = ftp://ftp.imagemagick.org/pub/ImageMagick/ \
    12 13 ftp://gd.tuwien.ac.at/pub/graphics/ImageMagftp://ftp.carnet.hr/misc/imagemagick/ \
     
    21 22
    22 23 WRKSRC = ${WRKDIR}/${PORTNAME}-${shell perl -e 'print +(split "-", "${PORTVERSION}")[0]'}
    23 24
    25 post-configure:
    26 cd ${WRKSRC} && pwd && sed -i .orig -E 's|^(CPPFLAGS =)(.*)|\1 -I${PREFIX}/include \2|' Makefile
    24 27
    28
    25 29 include ../../etc/ports.mk