summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5e2a78)
raw | patch | inline | side by side (parent: e5e2a78)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Nov 2005 06:58:10 +0000 (06:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Nov 2005 06:58:10 +0000 (06:58 +0000) |
Added status selection.
new icons unsed for hold unhold active ...
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2012 594d385d-05f5-0310-b6e9-bd551577e9d8
new icons unsed for hold unhold active ...
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2012 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/addons/mailqueue/class_mailqueue.inc b/plugins/addons/mailqueue/class_mailqueue.inc
index a296c68afe39cbbf30e71faf51e141c62bf17e6a..b464958535970ae2b568744627685cce583a578e 100644 (file)
var $Page = 0;
var $EntriesPerPage = 20;
+ var $Stat = "all";
var $OrderBy = "Arrival";
var $SortType = "up";
/* get the query cmd */
$this->mailQueueScript = $this->config->current['MAILQUEUESCRIPTPATH'];
-
+
$this->Server = "all";
}
$r_cmd = preg_replace("/%action/" ,"remove" ,$this->mailQueueScript);
$r_cmd = preg_replace("/%server/" ,$_GET['server'] ,$r_cmd);
$r_cmd = preg_replace("/%id/" ,$_GET['id'] ,$r_cmd);
- print $r_cmd;
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
}
$r_cmd = preg_replace("/%action/" ,"hold" ,$this->mailQueueScript);
$r_cmd = preg_replace("/%server/" ,$_GET['server'] ,$r_cmd);
$r_cmd = preg_replace("/%id/" ,$_GET['id'] ,$r_cmd);
- print $r_cmd;
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
}
$r_cmd = preg_replace("/%action/" ,"requeue" ,$this->mailQueueScript);
$r_cmd = preg_replace("/%server/" ,$_GET['server'] ,$r_cmd);
$r_cmd = preg_replace("/%id/" ,$_GET['id'] ,$r_cmd);
- print $r_cmd;
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
}
- if(isset($_POST['requeue_all'])){
- $r_cmd = preg_replace("/%action/" ,"requeue" ,$this->mailQueueScript);
- $r_cmd = preg_replace("/%server/" ,$this->Server ,$r_cmd);
- $r_cmd = preg_replace("/%id/" ,"all" ,$r_cmd);
- print $r_cmd;
+ $se = $this->getServer();
+ unset($se['all']);
+ $se_str = "";
+ foreach($se as $server) {
+ $se_str .= $server." ";
+ }
+ if(isset($_POST['requeue_all'])){
+ $r_cmd = preg_replace("/%action/" , "requeue" ,$this->mailQueueScript);
+ $r_cmd = preg_replace("/%server/" , $se_str ,$r_cmd);
+ $r_cmd = preg_replace("/%id/" , "all" ,$r_cmd);
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
if(isset($_POST['hold_all'])){
- $r_cmd = preg_replace("/%action/" ,"hold" ,$this->mailQueueScript);
- $r_cmd = preg_replace("/%server/" ,$this->Server ,$r_cmd);
- $r_cmd = preg_replace("/%id/" ,"all" ,$r_cmd);
- print $r_cmd;
+ $r_cmd = preg_replace("/%action/" , "hold" ,$this->mailQueueScript);
+ $r_cmd = preg_replace("/%server/" , $se_str ,$r_cmd);
+ $r_cmd = preg_replace("/%id/" , "all" ,$r_cmd);
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
+ if(isset($_POST['unhold_all'])){
+ $r_cmd = preg_replace("/%action/" , "unhold" ,$this->mailQueueScript);
+ $r_cmd = preg_replace("/%server/" , $se_str ,$r_cmd);
+ $r_cmd = preg_replace("/%id/" , "all" ,$r_cmd);
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
+ }
if(isset($_POST['remove_all'])){
- $r_cmd = preg_replace("/%action/" ,"remove" ,$this->mailQueueScript);
- $r_cmd = preg_replace("/%server/" ,$this->Server,$r_cmd);
- $r_cmd = preg_replace("/%id/" ,"" ,$r_cmd);
- print $r_cmd;
-
+ $r_cmd = preg_replace("/%action/" , "remove" ,$this->mailQueueScript);
+ $r_cmd = preg_replace("/%server/" , $se_str ,$r_cmd);
+ $r_cmd = preg_replace("/%id/" , "all" ,$r_cmd);
+ if(!shell_exec($r_cmd)){
+ print_red(sprintf(_("Please check your 'gosa.conf' the given '%s' can't be executed."),$r_cmd));
+ }
}
/* Filter data with the given */
$mailQueueParser->OrderBy($this->OrderBy,$this->SortType);
$mailQueueParser->OnlyDaysAgo($this->Time);
$mailQueueParser->CreateDate();
+
+ if($this->Stat == "hold"){
+ $mailQueueParser->Search(true,array("Hold"),true);
+ }
+ if($this->Stat == "unhold"){
+ $mailQueueParser->Search(false,array("Hold"),true);
+ }
+ if($this->Stat == "active"){
+ $mailQueueParser->Search(true,array("Active"),true);
+ }
+ if($this->Stat == "nonactive"){
+ $mailQueueParser->Search(false,array("Active"),true);
+ }
+
$mailQueueParser->Search($this->Search,array("MailID","Size","Sender","Recipient","Error","Arrival"));
/* */
$entries = $mailQueueParser->GetAll();
$smarty->assign("entries" , array_slice($entries,$this->Page,20));
$smarty->assign("plug" , "?plug=".$_GET['plug']);
+ $smarty->assign("r_stats" , $this->getStats());
+ $smarty->assign("stats" , array_flip($this->getStats()));
+ $smarty->assign("stat" , $this->Stat);
$smarty->assign("p_server" , $this->Server);
$smarty->assign("p_servers" , $this->getServer());
$smarty->assign("p_serverKeys" , array_flip($this->getServer()));
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=goMailServer)",array("cn"));
while($tmp = $ldap->fetch()){
- $ret[$tmp['cn'][0]]= $tmp['cn'][0];
+ $ret[$tmp['cn'][0]]= $tmp['cn'][0];
}
return($ret);
}
if(isset($_POST['search_for'])){
$this->Search = $_POST['search_for'];
}
+ if(isset($_POST['Stat'])){
+ $this->Stat = $_POST['Stat'];
+ }
if((isset($_GET['start']))&&(is_numeric($_GET['start']))&&($_GET['start']>=0)){
$this->Page = $_GET['start'];
}
}
+ function getStats()
+ {
+ return(array(
+ "all" =>_("All"),
+ "hold" =>_("Hold"),
+ "unhold" =>_("Un hold"),
+ "active" =>_("Active"),
+ "nonactive" =>_("Not active")
+ ));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/plugins/addons/mailqueue/class_parseMailQueue.inc b/plugins/addons/mailqueue/class_parseMailQueue.inc
index 0d0b6def4076f5a651b038dfe0c203b6beb7478f..b510cb3a7922294a90df9393a88cbb1cbf2efade 100644 (file)
/* Only keep entries that contains the $filter
* in any of the given $fields
*/
- function Search($filter,$fields)
+ function Search($filter,$fields,$bool = false)
{
/* Go through all entries */
foreach($this->a_parsedData as $key => $data){
$found = false;
foreach($fields as $attr){
- if(preg_match("/".str_replace("*",".*",$filter)."/i",$data[$attr])){
+ if(($bool)&&($data[$attr]==$filter)){
+ $found = true;
+ }elseif(preg_match("/".str_replace("*",".*",$filter)."/i",$data[$attr])){
$found= true;
}
}
$s_Error = $s_buffer[1];
$s_Recipient = $s_buffer[2];
+ /*
+ * The message is in the active queue, i.e. the message is
+ selected for delivery.
+
+ ! The message is in the hold queue, i.e. no further deliv-delivery
+ ery attempt will be made until the mail is taken off
+ hold.
+ */
+
+ $s_Hold = false;
+ if(preg_match("/\!/",$s_mailID)){
+ $s_mailID = preg_replace("/\!/","",$s_mailID);
+ $s_Hold = "true";
+ }
+
+ $s_Active = false;
+ if(preg_match("/\*/",$s_mailID)){
+ $s_mailID = preg_replace("/\*/","",$s_mailID);
+ $s_Active = true;
+ }
+
/* Append data */
$this->a_parsedData[$s_mailID."-".$server]['Server'] = $server;
$this->a_parsedData[$s_mailID."-".$server]['MailID'] = $s_mailID;
$this->a_parsedData[$s_mailID."-".$server]['Arrival'] = $s_Arrival;
$this->a_parsedData[$s_mailID."-".$server]['Sender'] = $s_Sender;
$this->a_parsedData[$s_mailID."-".$server]['Recipient'] = $s_Recipient;
+ $this->a_parsedData[$s_mailID."-".$server]['Hold'] = $s_Hold;
+ $this->a_parsedData[$s_mailID."-".$server]['Active'] = $s_Active;
$this->a_parsedData[$s_mailID."-".$server]['Error'] = $this->_parseError($s_Error);
}
return($this->a_parsedData);
index c950f53fd2269fb29fac1d61caa2f6a85920b507..6875357bd3a989ab1d4108939f14d5c01960c44e 100644 (file)
</div>
<div class="contentboxb">
<p class="contentboxb" style="border-top: 1px solid rgb(176, 176, 176); padding-top: 5px;">
- <img alt="" src="images/search.png" align="middle" border="0">
- {t}Search for{/t}
- <input name="search_for" size="25" maxlength="60" value="{$search_for}" title="{t}Please enter a search string here.{/t}" onchange="mainform.submit()">
- in
+ <div >
+ <table width="100%">
+ <tr>
+ <td>
+ <img alt="{t}Search{/t}" src="images/search.png" align="middle" border="0">
+ {t}Search for{/t}
+ <input name="search_for" size="25" maxlength="60" value="{$search_for}" title="{t}Please enter a search string here.{/t}" onchange="mainform.submit()">
+ in
<select size="1" name="p_server" title="{t}Select a server{/t}" onchange="mainform.submit()">
- {html_options values=$p_serverKeys output=$p_servers selected=$p_server}
+ {html_options values=$p_serverKeys output=$p_servers selected=$p_server}
</select>
- {t}within the last{/t}
+ {t}with status{/t} :
+ <select size="1" name="Stat" onchange="mainform.submit()">
+ {html_options values=$stats output=$r_stats selected=$stat}
+ </select>
+ {t}within the last{/t}
<select size="1" name="p_time" onchange="mainform.submit()">
- {html_options values=$p_timeKeys output=$p_times selected=$p_time}
- </select>
-
- <input name="search" value="Search" type="submit">
- <input name="remove_all" value="{t}Remove all{/t}" type="submit">
- <input name="requeue_all" value="{t}Requeue all{/t}" type="submit">
- <input name="hold_all" value="{t}Hold all{/t}" type="submit">
+ {html_options values=$p_timeKeys output=$p_times selected=$p_time}
+ </select>
+
+ <input name="search" value="Search" type="submit">
+ </td>
+ <td width="10%">
+ <input name="remove_all" src="images/edittrash.png" value="{t}Remove all{/t}" type="image"
+ title="{t}Remove all shown entries from queue.{/t}">
+ <input name="requeue_all" src="images/mailq_requeue.png" value="{t}Requeue all{/t}" type="image"
+ title="{t}Requeue all shown entries.{/t}">
+ <input name="hold_all" src="images/mailq_hold.png" value="{t}Hold all{/t}" type="image"
+ title="{t}Set all shown entries to status hold.{/t}">
+ <input name="unhold_all" src="images/mailq_unhold.png" value="{t}Hold all{/t}" type="image"
+ title="{t}Set all shown entries to status unhold.{/t}">
+ </td>
+ <tr>
+ </table>
+ </div>
</p>
</div>
<br>
+
{if $all_ok != "true"}
<b>{t}Search returned no results{/t}...</b>
{else}
{else}
<tr style="height: 22px; background-color: rgb(245, 245, 245);">
{/if}
- <td>{$entries[$key].MailID}</td>
+ <td>{if $entries[$key].Active == true}
+ <img src="images/mailq_active.png" border=0 alt="{t}active{/t}">
+ {/if}
+ {$entries[$key].MailID}</td>
<td>{$entries[$key].Server}</td>
<td>{$entries[$key].Size}</td>
<td>{$entries[$key].Arrival}</td>
<td>{$entries[$key].Sender}</td>
<td>{$entries[$key].Recipient}</td>
<td titel="{$entries[$key].Error}">{$entries[$key].Error}</td>
- <td><a href="{$plug}&act=del&id={$entries[$key].MailID}&server={$entries[$key].Server}"><img src="images/edittrash.png" border=0 alt="deleted"></a></td>
- <td><a href="{$plug}&act=hold&id={$entries[$key].MailID}&server={$entries[$key].Server}"><img src="images/edittrash.png" border=0 alt="deleted"></a></td>
- <td><a href="{$plug}&act=requeue&id={$entries[$key].MailID}&server={$entries[$key].Server}"><img src="images/edittrash.png" border=0 alt="deleted"></a></td>
+ <td>
+ <a href="{$plug}&act=del&id={$entries[$key].MailID}&server={$entries[$key].Server}">
+ <img src="images/edittrash.png" border=0 alt="{t}delete{/t}">
+ </a>
+ </td>
+ {if $entries[$key].Hold == true}
+ <td>
+ <a href="{$plug}&act=unhold&id={$entries[$key].MailID}&server={$entries[$key].Server}">
+ <img src="images/mailq_unhold.png" border=0 alt="{t}unhold{/t}">
+ </a>
+ </td>
+ {else}
+ <td>
+ <a href="{$plug}&act=hold&id={$entries[$key].MailID}&server={$entries[$key].Server}">
+ <img src="images/mailq_hold.png" border=0 alt="{t}hold{/t}">
+ </a>
+ </td>
+ {/if}
+ <td>
+ <a href="{$plug}&act=requeue&id={$entries[$key].MailID}&server={$entries[$key].Server}">
+ <img src="images/mailq_requeue.png" border=0 alt="{t}requeue{/t}">
+ </a>
+ </td>
</tr>
{counter}
{/foreach}