Changeset 5955


Ignore:
Timestamp:
Apr 24, 2010, 11:48:13 PM (10 years ago)
Author:
nikrou
Message:

Feature 1156 fixed : add privacy level to photo bulk manager in unit mode

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_unit.php

    r5933 r5955  
    6363    $data = array();
    6464
    65     $data{'id'} = $row['id'];
    66     $data{'name'} = $_POST['name-'.$row['id']];
    67     $data{'author'} = $_POST['author-'.$row['id']];
    68 
    69     foreach (array('name', 'author') as $field)
     65    $data['id'] = $row['id'];
     66    $data['name'] = $_POST['name-'.$row['id']];
     67    $data['author'] = $_POST['author-'.$row['id']];
     68    $data['level'] = $_POST['level-'.$row['id']];
     69
     70    foreach (array('name', 'author', 'level') as $field)
    7071    {
    7172      if (!empty($_POST[$field.'-'.$row['id']]))
    7273      {
    73         $data{$field} = strip_tags($_POST[$field.'-'.$row['id']]);
     74        $data[$field] = strip_tags($_POST[$field.'-'.$row['id']]);
    7475      }
    7576    }
     
    7778    if ($conf['allow_html_descriptions'])
    7879    {
    79       $data{'comment'} = @$_POST['description-'.$row['id']];
     80      $data['comment'] = @$_POST['description-'.$row['id']];
    8081    }
    8182    else
    8283    {
    83       $data{'comment'} = strip_tags(@$_POST['description-'.$row['id']]);
     84      $data['comment'] = strip_tags(@$_POST['description-'.$row['id']]);
    8485    }
    8586
     
    8889      if ('set' == $_POST['date_creation_action-'.$row['id']])
    8990      {
    90         $data{'date_creation'} =
     91        $data['date_creation'] =
    9192          $_POST['date_creation_year-'.$row['id']]
    9293            .'-'.$_POST['date_creation_month-'.$row['id']]
     
    9596      else if ('unset' == $_POST['date_creation_action-'.$row['id']])
    9697      {
    97         $data{'date_creation'} = '';
     98        $data['date_creation'] = '';
    9899      }
    99100    }
    100101    else
    101102    {
    102       $data{'date_creation'} = $row['date_creation'];
     103      $data['date_creation'] = $row['date_creation'];
    103104    }
    104105
     
    117118    array(
    118119      'primary' => array('id'),
    119       'update' => array('name','author','comment','date_creation')
     120      'update' => array('name','author','level','comment','date_creation')
    120121      ),
    121122    $datas
     
    138139ksort($month_list);
    139140
     141$tpl_options = array();
     142foreach ($conf['available_permission_levels'] as $level)
     143{
     144  $tpl_options[$level] = l10n( sprintf('Level %d', $level) );
     145}
     146
    140147$template->assign(
    141148  array(
    142149    'CATEGORIES_NAV'=>$page['title'],
    143 
    144150    'U_ELEMENTS_PAGE'
    145151    =>$base_url.get_query_string_diff(array('display','start')),
    146 
    147152    'U_GLOBAL_MODE'
    148153    =>
     
    150155    .get_query_string_diff(array('mode','display'))
    151156    .'&mode=global',
    152 
    153     'F_ACTION'=>$base_url.get_query_string_diff(array()),
    154    
    155     'month_list' => $month_list
     157    'F_ACTION'=>$base_url.get_query_string_diff(array()),   
     158    'month_list' => $month_list,
     159    'level_options' => $tpl_options
    156160    )
    157161  );
     
    196200
    197201  $query = '
    198 SELECT id,path,tn_ext,name,date_creation,comment,author,file
     202SELECT id,path,tn_ext,name,date_creation,comment,author,level,file
    199203  FROM '.IMAGES_TABLE.'
    200204  WHERE id IN ('.implode(',', $page['cat_elements_id']).')
     
    206210  while ($row = pwg_db_fetch_assoc($result))
    207211  {
    208     // echo '<pre>'; print_r($row); echo '</pre>';
    209212    array_push($element_ids, $row['id']);
    210213
     
    236239        'ID' => $row['id'],
    237240        'TN_SRC' => $src,
    238         'LEGEND' =>
    239           !empty($row['name']) ?
     241        'LEGEND' => !empty($row['name']) ?
    240242            $row['name'] : get_name_from_file($row['file']),
    241243        'U_EDIT' =>
    242244            PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
    243245            '&amp;image_id='.$row['id'],
    244         'NAME' => @$row['name'],
    245         'AUTHOR' => @$row['author'],
    246         'DESCRIPTION' => @$row['comment'],
     246        'NAME' => !empty($row['name'])?$row['name']:'',
     247        'AUTHOR' => !empty($row['author'])?$row['author']:'',
     248        'LEVEL' => !empty($row['level'])?$row['level']:'',
     249        'DESCRIPTION' => !empty($row['comment'])?$row['comment']:'',
    247250        'DATE_CREATION_YEAR' => $year,
    248251        'DATE_CREATION_MONTH' => (int)$month,
    249252        'DATE_CREATION_DAY' => (int)$day,
    250 
    251253        'TAGS' => $tag_selection,
    252254        )
  • trunk/admin/themes/default/template/element_set_unit.tpl

    r5931 r5955  
    102102      </td>
    103103    </tr>
     104    <tr>
     105      <td><strong>{'Minimum privacy level'|@translate}</strong></td>
     106      <td>
     107        <label><input type="radio" name="level_action" value="leave" checked="checked">{'leave'|@translate}</label>
     108        <label><input type="radio" name="level_action" value="set" id="level_action_set">{'set to'|@translate}</label>
     109        <select onchange="document.getElementById('level_action_set').checked = true;" name="level-{$element.ID}" size="1">
     110          {html_options options=$level_options selected=$element.LEVEL}
     111        </select>
     112      </td>
     113    </tr>
    104114
    105115    <tr>
Note: See TracChangeset for help on using the changeset viewer.