Index: /trunk/admin/configuration.php
===================================================================
--- /trunk/admin/configuration.php	(revision 848)
+++ /trunk/admin/configuration.php	(revision 849)
@@ -165,6 +165,4 @@
     $history_yes = ($conf['log']=='true')?'checked="checked"':'';
     $history_no  = ($conf['log']=='false')?'checked="checked"':'';
-    $notif_yes = ($conf['mail_notification']=='true')?'checked="checked"':'';
-    $notif_no = ($conf['mail_notification']=='false')?'checked="checked"':'';
     $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
     $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
@@ -180,6 +178,4 @@
         'L_CONF_HISTORY'=>$lang['history'],
         'L_CONF_HISTORY_INFO'=>$lang['conf_log_info'],
-        'L_CONF_NOTIFICATION'=>$lang['conf_notification'],
-        'L_CONF_NOTIFICATION_INFO'=>$lang['conf_notification_info'],
         'L_CONF_GALLERY_LOCKED'=>$lang['conf_gallery_locked'],
         'L_CONF_GALLERY_LOCKED_INFO'=>$lang['conf_gallery_locked_info'],
@@ -189,6 +185,4 @@
         'HISTORY_YES'=>$history_yes,
         'HISTORY_NO'=>$history_no,
-        'NOTIFICATION_YES'=>$notif_yes,
-        'NOTIFICATION_NO'=>$notif_no,
         'GALLERY_LOCKED_YES'=>$lock_yes,
         'GALLERY_LOCKED_NO'=>$lock_no,
Index: /trunk/admin/waiting.php
===================================================================
--- /trunk/admin/waiting.php	(revision 848)
+++ /trunk/admin/waiting.php	(revision 849)
@@ -31,47 +31,108 @@
 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
 //--------------------------------------------------------------------- updates
-if ( isset( $_POST['submit'] ) )
+
+if (isset($_POST))
 {
-  $query = 'SELECT * FROM '.WAITING_TABLE;
-  $query.= " WHERE validated = 'false';";
-  $result = pwg_query( $query );
-  while ( $row = mysql_fetch_array( $result ) )
-  {
-    $key = 'validate-'.$row['id'];
-    if ( isset( $_POST[$key] ) )
+  $to_validate = array();
+  $to_reject = array();
+  
+  if (isset($_POST['submit']))
+  {    
+    foreach (explode(',', $_POST['list']) as $waiting_id)
     {
-      if ( $_POST[$key] == 'true' )
+      if (isset($_POST['action-'.$waiting_id]))
       {
-        // The uploaded element was validated, we have to set the
-        // "validated" field to "true"
-        $query = 'UPDATE '.WAITING_TABLE;
-        $query.= " SET validated = 'true'";
-        $query.= ' WHERE id = '.$row['id'];
-        $query.= ';';
-        pwg_query( $query );
-      }
-      else
-      {
-        // The uploaded element was refused, we have to delete its reference
-        // in the database and to delete the element as well.
-        $query = 'DELETE FROM '.WAITING_TABLE;
-        $query.= ' WHERE id = '.$row['id'];
-        $query.= ';';
-        pwg_query( $query );
-        // deletion of the associated files
-        $dir = get_complete_dir( $row['storage_category_id'] );
-        unlink( $dir.$row['file'] );
-        if (isset($row['tn_ext']) and $row['tn_ext'] != '' )
+        switch ($_POST['action-'.$waiting_id])
         {
-          $thumbnail = $conf['prefix_thumbnail'];
-          $thumbnail.= get_filename_wo_extension( $row['file'] );
-          $thumbnail.= '.'.$row['tn_ext'];
-          $url = $dir.'thumbnail/'.$thumbnail;
-          unlink( $url );
+          case 'reject' :
+          {
+            array_push($to_reject, $waiting_id);
+            break;
+          }
+          case 'validate' :
+          {
+            array_push($to_validate, $waiting_id);
+            break;
+          }
         }
       }
     }
   }
-  array_push($infos, $lang['waiting_update']);
+  else if (isset($_POST['validate-all']))
+  {
+    $to_validate = explode(',', $_POST['list']);
+  }
+  else if (isset($_POST['reject-all']))
+  {
+    $to_reject = explode(',', $_POST['list']);
+  }
+
+  if (count($to_validate) > 0)
+  {
+    $query = '
+UPDATE '.WAITING_TABLE.'
+  SET validated = \'true\'
+  WHERE id IN ('.implode(',', $to_validate).')
+;';
+    pwg_query($query);
+
+    array_push(
+      $page['infos'],
+      sprintf(
+        l10n('%d waiting pictures validated'),
+        count($to_validate)
+        )
+      );
+  }
+
+  if (count($to_reject) > 0)
+  {
+    // The uploaded element was refused, we have to delete its reference in
+    // the database and to delete the element as well.
+    $query = '
+SELECT id, storage_category_id, file, tn_ext
+  FROM '.WAITING_TABLE.'
+  WHERE id IN ('.implode(',', $to_reject).')
+;';
+    $result = pwg_query($query);
+    while($row = mysql_fetch_array($result))
+    {
+      $dir = get_complete_dir($row['storage_category_id']);
+      unlink($dir.$row['file']);
+      if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+      {
+        unlink(
+          get_thumbnail_src(
+            $dir.$row['file'],
+            $row['tn_ext']
+            )
+          );
+      }
+      else if (@is_file(get_thumbnail_src($dir.$row['file'], 'jpg')))
+      {
+        unlink(
+          get_thumbnail_src(
+            $dir.$row['file'],
+            'jpg'
+            )
+          );
+      }
+    }
+    
+    $query = '
+DELETE
+  FROM '.WAITING_TABLE.'
+  WHERE id IN ('.implode(',', $to_reject).')
+;';
+    pwg_query($query);
+
+    array_push(
+      $page['infos'],
+      sprintf(
+        l10n('%d waiting pictures rejected'),
+        count($to_reject)
+        )
+      );
+  }
 }
 
@@ -93,4 +154,6 @@
 //---------------------------------------------------------------- form display
 $cat_names = array();
+$list = array();
+
 $query = 'SELECT * FROM '.WAITING_TABLE;
 $query.= " WHERE validated = 'false'";
@@ -114,14 +177,20 @@
   if ( $i++ % 2== 0 ) $class='row2';
   
-  $template->assign_block_vars('picture' ,array(
-    'WAITING_CLASS'=>$class,
-    'CATEGORY_IMG'=>$cat_names[$row['storage_category_id']]['display_name'],
-    'ID_IMG'=>$row['id'],
-	'DATE_IMG'=>format_date( $row['date'], 'unix', true ),
-	'FILE_IMG'=>$row['file'],
-	'PREVIEW_URL_IMG'=>$preview_url, 
-	'UPLOAD_EMAIL'=>$row['mail_address'],
-	'UPLOAD_USERNAME'=>$row['username']
-	));
+  $template->assign_block_vars(
+    'picture',
+    array(
+      'WAITING_CLASS'=>$class,
+      'CATEGORY_IMG'=>$cat_names[$row['storage_category_id']]['display_name'],
+      'ID_IMG'=>$row['id'],
+      'DATE_IMG' => date('Y-m-d H:i:s', $row['date']),
+      'FILE_TITLE'=>$row['file'],
+      'FILE_IMG' =>
+        (strlen($row['file']) > 10) ?
+          (substr($row['file'], 0, 10)).'...' : $row['file'],
+      'PREVIEW_URL_IMG'=>$preview_url, 
+      'UPLOAD_EMAIL'=>$row['mail_address'],
+      'UPLOAD_USERNAME'=>$row['username']
+      )
+    );
 
   // is there an existing associated thumnail ?
@@ -134,10 +203,25 @@
     $url.= 'thumbnail/'.$thumbnail;
 	
-    $template->assign_block_vars('picture.thumbnail' ,array(
-	  'PREVIEW_URL_TN_IMG'=>$url,
-	  'FILE_TN_IMG'=>$thumbnail
-	  ));
-  }
+    $template->assign_block_vars(
+      'picture.thumbnail',
+      array(
+        'PREVIEW_URL_TN_IMG' => $url,
+        'FILE_TN_IMG' =>
+          (strlen($thumbnail) > 10) ?
+            (substr($thumbnail, 0, 10)).'...' : $thumbnail,
+        'FILE_TN_TITLE' => $thumbnail
+        )
+      );
+  }
+
+  array_push($list, $row['id']);
 }
+
+$template->assign_vars(
+  array(
+    'LIST' => implode(',', $list)
+    )
+  );
+  
 //----------------------------------------------------------- sending html code
 $template->assign_var_from_handle('ADMIN_CONTENT', 'waiting');
Index: /trunk/doc/ChangeLog
===================================================================
--- /trunk/doc/ChangeLog	(revision 848)
+++ /trunk/doc/ChangeLog	(revision 849)
@@ -1,2 +1,10 @@
+2005-08-25 Pierrick LE GALL
+
+	* deletion : no mail notification anymore. Feature replaced by RSS
+	feed notification.
+
+	* improvement : on waiting pictures management. Ability to
+	validate all or reject all in one clic.
+
 2005-08-21 Pierrick LE GALL
 
Index: /trunk/include/functions.inc.php
===================================================================
--- /trunk/include/functions.inc.php	(revision 848)
+++ /trunk/include/functions.inc.php	(revision 849)
@@ -434,46 +434,4 @@
 }
 
-// notify sends a email to every admin of the gallery
-function notify( $type, $infos = '' )
-{
-  global $conf;
-
-  $headers = 'From: <'.$conf['mail_webmaster'].'>'."\n";
-  $headers.= 'Reply-To: '.$conf['mail_webmaster']."\n";
-  $headers.= 'X-Mailer: PhpWebGallery, PHP '.phpversion();
-
-  $options = '-f '.$conf['mail_webmaster'];
-  // retrieving all administrators
-  $query = 'SELECT username,mail_address,language';
-  $query.= ' FROM '.USERS_TABLE;
-  $query.= " WHERE status = 'admin'";
-  $query.= ' AND mail_address IS NOT NULL';
-  $query.= ';';
-  $result = pwg_query( $query );
-  while ( $row = mysql_fetch_array( $result ) )
-  {
-    $to = $row['mail_address'];
-    include( PHPWG_ROOT_PATH.'language/'.$row['language'].'/common.lang.php' );
-    $content = $lang['mail_hello']."\n\n";
-    switch ( $type )
-    {
-    case 'upload' :
-      $subject = $lang['mail_new_upload_subject'];
-      $content.= $lang['mail_new_upload_content'];
-      break;
-    case 'comment' :
-      $subject = $lang['mail_new_comment_subject'];
-      $content.= $lang['mail_new_comment_content'];
-      break;
-    }
-    $infos = str_replace( '&nbsp;',  ' ', $infos );
-    $infos = str_replace( '&minus;', '-', $infos );
-    $content.= "\n\n".$infos;
-    $content.= "\n\n-- \nPhpWebGallery ".PHPWG_VERSION;
-    $content = wordwrap( $content, 72 );
-    @mail( $to, $subject, $content, $headers, $options );
-  }
-}
-
 function pwg_write_debug()
 {
Index: /trunk/install/config.sql
===================================================================
--- /trunk/install/config.sql	(revision 848)
+++ /trunk/install/config.sql	(revision 849)
@@ -16,5 +16,4 @@
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_validation','false','administrators validate users comments before becoming visible');
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_forall','false','even guest not registered can post comments');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('mail_notification','false','automated mail notification for adminsitrators');
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_image_line','5','Number of images displayed per row');
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_line_page','3','Number of rows displayed per page');
Index: /trunk/picture.php
===================================================================
--- /trunk/picture.php	(revision 848)
+++ /trunk/picture.php	(revision 849)
@@ -388,20 +388,4 @@
       $template->assign_block_vars('information',
                                    array('INFORMATION'=>$message));
-      // notification to the administrators
-      if ( $conf['mail_notification'] )
-      {
-        // find any related category (can be unreachable to this admin)
-        $category = $related_categories[0];
-        // locally, we change the $conf['level_separator']
-        $conf_separator = $conf['level_separator'];
-        $conf['level_separator'] = ' > ';
-        $cat_name = get_cat_display_name_cache($category['uppercats'],
-                                               '',
-                                               false);
-        $conf['level_separator'] = $conf_separator;
-        
-        $cat_name = strip_tags( $cat_name );
-        notify( 'comment', $cat_name.' > '.$picture['current']['name']);
-      }
     }
     else
Index: /trunk/template/cclear/admin/configuration.tpl
===================================================================
--- /trunk/template/cclear/admin/configuration.tpl	(revision 848)
+++ /trunk/template/cclear/admin/configuration.tpl	(revision 849)
@@ -23,9 +23,4 @@
 	<td class="row1"><input type="radio" class="radio" name="log" value="true" {general.HISTORY_YES} />{L_YES}&nbsp;&nbsp;
 	<input type="radio" class="radio" name="log" value="false" {general.HISTORY_NO} />{L_NO}</td>
-  </tr>
-  <tr>
-    <td><strong>{general.L_CONF_NOTIFICATION}&nbsp;:</strong><br /><span class="small">{general.L_CONF_NOTIFICATION_INFO}</span></td>
-	<td class="row1"><input type="radio" class="radio" name="mail_notification" value="true" {general.NOTIFICATION_YES} />{L_YES}&nbsp;&nbsp;
-	<input type="radio" class="radio" name="mail_notification" value="false" {general.NOTIFICATION_NO} />{L_NO}</td>
   </tr>
   <tr>
Index: /trunk/template/cclear/admin/update.tpl
===================================================================
--- /trunk/template/cclear/admin/update.tpl	(revision 848)
+++ /trunk/template/cclear/admin/update.tpl	(revision 849)
@@ -12,10 +12,10 @@
   <li class="update_summary_err">{update.NB_ERRORS} {L_UPDATE_NB_ERRORS}</li>
 </ul>
-<!-- BEGIN errors -->
+<!-- BEGIN update_errors -->
 <h3>{L_UPDATE_ERROR_LIST_TITLE}</h3>
 <ul>
-  <!-- BEGIN error -->
-  <li>[{update.errors.error.ELEMENT}] {update.errors.error.LABEL}</li>
-  <!-- END error -->
+  <!-- BEGIN update_error -->
+  <li>[{update.update_errors.update_error.ELEMENT}] {update.update_errors.update_error.LABEL}</li>
+  <!-- END update_error -->
 </ul>
 <h3>{L_UPDATE_ERRORS_CAPTION}</h3>
@@ -24,13 +24,13 @@
   <li><strong>PWG-UPDATE-2</strong> : {L_UPDATE_MISSING_TN_INFO} {{PICTURE_EXT_LIST}}</li>
 </ul>
-<!-- END errors -->
-<!-- BEGIN infos -->
+<!-- END update_errors -->
+<!-- BEGIN update_infos -->
 <h3>{L_UPDATE_INFOS_TITLE}</h3>
 <ul>
-  <!-- BEGIN info -->
-  <li>[{update.infos.info.ELEMENT}] {update.infos.info.LABEL}</li>
-  <!-- END info -->
+  <!-- BEGIN update_info -->
+  <li>[{update.update_infos.update_info.ELEMENT}] {update.update_infos.update_info.LABEL}</li>
+  <!-- END update_info -->
 </ul>
-<!-- END infos -->
+<!-- END update_infos -->
 <!-- END update -->
 
@@ -46,35 +46,42 @@
 <h3>{L_UPDATE_TITLE}</h3>
 <form action="{F_ACTION}" method="post" id="update">
-  <ul>
-    <li>
-      {L_UPDATE_SYNC_FILES}
-      <ul>
-        <li><input type="radio" name="sync" value="dirs" {SYNC_DIRS_CHECKED} /> {L_UPDATE_SYNC_DIRS}</li>
-        <li><input type="radio" name="sync" value="files" {SYNC_ALL_CHECKED} /> {L_UPDATE_SYNC_ALL}</li>
-        <li><input type="checkbox" name="display_info" value="1" {DISPLAY_INFO_CHECKED} /> {L_UPDATE_DISPLAY_INFO}</li>
-        <li><input type="checkbox" name="simulate" value="1" checked="checked" /> {L_UPDATE_SIMULATE}</li>
-      </ul>
-    </li>
-    <li>
-      {L_UPDATE_SYNC_METADATA}. {L_USED_METADATA} : {METADATA_LIST}.
-      <ul>
-        <li><input type="radio" name="sync" value="metadata_new" /> {L_UPDATE_SYNC_METADATA_NEW}</li>
-        <li><input type="radio" name="sync" value="metadata_all" /> {L_UPDATE_SYNC_METADATA_ALL}</li>
-      </ul>
-    </li>
-    <li>
-      {L_UPDATE_CATS_SUBSET}<br />
-      <select style="width:500px" name="cat" size="10">
-        <!-- BEGIN category_option -->
-        <option {introduction.category_option.SELECTED} value="{introduction.category_option.VALUE}">{introduction.category_option.OPTION}</option>
-        <!-- END category_option -->
-      </select>
-      <input type="checkbox" name="subcats-included" value="1" {SUBCATS_INCLUDED_CHECKED} /> {L_SEARCH_SUBCATS_INCLUDED}
-    </li>
-  </ul>
-  <p>
+
+  <fieldset>
+    <legend>{L_UPDATE_SYNC_FILES}</legend>
+
+    <ul>
+      <li><label><input type="radio" name="sync" value="dirs" {SYNC_DIRS_CHECKED} /> {L_UPDATE_SYNC_DIRS}</label></li>
+      <li><label><input type="radio" name="sync" value="files" {SYNC_ALL_CHECKED} /> {L_UPDATE_SYNC_ALL}</label></li>
+      <li><label><input type="checkbox" name="display_info" value="1" {DISPLAY_INFO_CHECKED} /> {L_UPDATE_DISPLAY_INFO}</label></li>
+      <li><label><input type="checkbox" name="simulate" value="1" checked="checked" /> {L_UPDATE_SIMULATE}</label></li>
+    </ul>
+  </fieldset>
+
+  <fieldset>
+    <legend>{L_UPDATE_SYNC_METADATA}</legend>
+    <p> {L_USED_METADATA} : {METADATA_LIST}.</p>
+    <ul>
+      <li><label><input type="radio" name="sync" value="metadata_new" /> {L_UPDATE_SYNC_METADATA_NEW}</label></li>
+      <li><label><input type="radio" name="sync" value="metadata_all" /> {L_UPDATE_SYNC_METADATA_ALL}</label></li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    <legend>{L_UPDATE_CATS_SUBSET}</legend>
+  
+    <select style="width:500px" name="cat" size="10">
+      <!-- BEGIN category_option -->
+      <option {introduction.category_option.SELECTED} value="{introduction.category_option.VALUE}">{introduction.category_option.OPTION}</option>
+      <!-- END category_option -->
+    </select>
+  
+    <label><input type="checkbox" name="subcats-included" value="1" {SUBCATS_INCLUDED_CHECKED} /> {L_SEARCH_SUBCATS_INCLUDED}</label>
+  </fieldset>
+
+  <p class="bottomButtons">
     <input type="submit" value="{L_SUBMIT}" name="submit" class="bouton" />
     <input type="reset"  value="{L_RESET}"  name="reset"  class="bouton" />
   </p>
+
 </form>
 <!-- END introduction -->
Index: /trunk/template/cclear/admin/waiting.tpl
===================================================================
--- /trunk/template/cclear/admin/waiting.tpl	(revision 848)
+++ /trunk/template/cclear/admin/waiting.tpl	(revision 849)
@@ -3,4 +3,7 @@
 
 <form action="{F_ACTION}" method="post" id="waiting">
+
+  <input type="hidden" name="list" value="{LIST}" />
+
   <table style="width:100%;" >
     <tr class="throw">
@@ -17,9 +20,9 @@
       <td class="{picture.WAITING_CLASS}" style="white-space:nowrap;">{picture.DATE_IMG}</td>
       <td class="{picture.WAITING_CLASS}" style="white-space:nowrap;">
-        <a target="_blank" href="{picture.PREVIEW_URL_IMG}">{picture.FILE_IMG}</a>
+        <a target="_blank" href="{picture.PREVIEW_URL_IMG}" title="{picture.FILE_TITLE}">{picture.FILE_IMG}</a>
       </td>
       <td class="{picture.WAITING_CLASS}" style="white-space:nowrap;">
         <!-- BEGIN thumbnail -->
-        <a target="_blank" href="{picture.thumbnail.PREVIEW_URL_TN_IMG}">{picture.thumbnail.FILE_TN_IMG}</a>
+        <a target="_blank" href="{picture.thumbnail.PREVIEW_URL_TN_IMG}" title="{picture.thumbnail.FILE_TN_TITLE}">{picture.thumbnail.FILE_TN_IMG}</a>
         <!-- END thumbnail -->
       </td>
@@ -28,13 +31,17 @@
       </td>
       <td class="{picture.WAITING_CLASS}" style="white-space:nowrap;">
-        <input type="radio" name="validate-{picture.ID_IMG}" value="true" />{L_SUBMIT}
-        <input type="radio" name="validate-{picture.ID_IMG}" value="false" />{L_DELETE}
+        <label><input type="radio" name="action-{picture.ID_IMG}" value="validate" /> {lang:Validate}</label>
+        <label><input type="radio" name="action-{picture.ID_IMG}" value="reject" /> {lang:Reject}</label>
       </td>
     </tr>
     <!-- END picture -->
   </table>
-  <p>
-    <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" />
-    <input type="reset" name="reset" value="{L_RESET}" class="bouton" />
+
+  <p class="bottomButtons">
+    <input type="submit" name="submit" value="{lang:Submit}" />
+    <input type="submit" name="validate-all" value="{lang:Validate All}" />
+    <input type="submit" name="reject-all" value="{lang:Reject All}" />
+    <input type="reset" value="{lang:Reset}" />
   </p>
+
 </form>
Index: /trunk/upload.php
===================================================================
--- /trunk/upload.php	(revision 848)
+++ /trunk/upload.php	(revision 849)
@@ -213,9 +213,4 @@
     pwg_query( $query );
     $page['waiting_id'] = mysql_insert_id();
-    // mail notification for administrators
-    if ( $conf['mail_notification'] )
-    {
-      notify( 'upload' );
-    }
   }
 }
@@ -277,5 +272,5 @@
 
 $username = !empty($_POST['username'])?$_POST['username']:$user['username'];
-$mail_address = !empty($_POST['mail_address'])?$_POST['mail_address']:$user['mail_address'];
+$mail_address = !empty($_POST['mail_address'])?$_POST['mail_address']:@$user['mail_address'];
 $name = !empty($_POST['name'])?$_POST['name']:'';
 $author = !empty($_POST['author'])?$_POST['author']:'';
