summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a02398e)
raw | patch | inline | side by side (parent: a02398e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Sep 2008 13:51:19 +0000 (13:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Sep 2008 13:51:19 +0000 (13:51 +0000) |
-You can now vie Header informations
-Page selector works now
-Server name is correctly displyed.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12380 594d385d-05f5-0310-b6e9-bd551577e9d8
-Page selector works now
-Server name is correctly displyed.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12380 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
index b9dc7cf0f05891fa5e5f6b8483ca05c72d7281cb..a4ced417a762b3423ae6cb6713138efd6d2d05da 100644 (file)
if($action == "header"){
/* Create table which displays the header informations */
- $this->disp_header = $this->si_queue->header($entry);
+ $data = $this->si_queue->header($entry,$server);
+ $this->disp_header = $data;
+ if($this->si_queue->is_error()){
+ msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
+ }
}
/* Back is posted from the header display page */
$entries = array();
foreach($this->ServerList as $mac => $name){
if(!tests::is_mac($mac)) continue;
- $entries = array_merge($entries,$this->si_queue->query_mailqueue($mac,$this->OrderBy,$this->SortType,$this->range));
+ $entries = array_merge($entries,$this->si_queue->query_mailqueue($mac,$this->OrderBy,$this->SortType));
if($this->si_queue->is_error()){
- unset($this->ServerList[$mac]);
- msg_dialog::display(_("Error"),sprintf(_("The server '%s' was removed from the server list, due to communication problems with the GOsa daemon, the error was: %s"),$name,"<b>".msgPool::siError($this->si_queue->get_error()."</b>")),ERROR_DIALOG);
+ msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
}
}
}else{
- $entries = $this->si_queue->query_mailqueue($this->Server,$this->OrderBy,$this->SortType,$this->Limit);
+ $entries = $this->si_queue->query_mailqueue($this->Server,$this->OrderBy,$this->SortType);
if($this->si_queue->is_error()){
msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
}
}
-
+ $count = count($entries);
+ $entries = array_slice($entries,$this->Page,$this->range);
+
+ /* Add ServerName to results
+ */
+ foreach($entries as $key => $data){
+ $entries[$key]['ServerName'] = $this->ServerList[$data['Server']];
+ }
+
/******************
create html output
******************/
$smarty->assign("p_times" , $this->getTimes());
$smarty->assign("p_timeKeys" , array_flip($this->getTimes()));
$smarty->assign("search_for" , $this->Search);
- $smarty->assign("range_selector", range_selector(count($entries), $this->Page, $this->range,"EntriesPerPage"));
+ $smarty->assign("range_selector", range_selector($count, $this->Page, $this->range,"EntriesPerPage"));
$smarty->assign("OrderBy" , $this->OrderBy);
/* Display sort arrow */
diff --git a/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc
index 5f5721f38a09ea316a473b782efb298707c3e3e2..58443fbad0558559462d30aa495effad2c2e55b3 100644 (file)
/*! \brief Returns a list of all mail queue entries
@return Array s.a.
*/
- public function query_mailqueue($server,$sortby,$direction, $Limit)
+ public function query_mailqueue($server,$sortby,$direction)
{
$attrs = array("Size","Recipient","Sender","Arrival","MailID","Hold","Active","Error","Server");
$direction = "down";
}
- /* Check entry limit
- */
- if(!is_numeric($Limit) || $Limit < 1){
- trigger_error("Invalid entry limt '".$Limit."'.");
- $Limit = 20;
- }
-
/* Query mailqueue
*/
+ $ids = array();
$res = $this->send_data("gosa_mailqueue_query",$server,array(),TRUE);
$items = array();
if(isset($res['XML'][0])){
foreach($attrs as $source => $dest){
$val[$dest] = $entry[0][$source][0]['VALUE'];
}
+ $ids[] = $val['MailID'];
$attrs = array(
"MSG_HOLD" => "Hold",
"MSG_ACTIVE" => "Active",
$val['Server'] = $server;
$val['Arrival'] = strtotime($val['Arrival']);
- $items[$val[$sortby]] = $val;
+ $n = $val[$sortby]."-".microtime(1);
+ while(isset($items[$n])){
+ $n = $val[$sortby]."-".microtime(1);
+ }
+ $items[$n] = $val;
}
}
}
}else{
krsort($items);
}
-
return($items);
}
{
$data = array();
$data['msg_id'] = $msg_id;
- $res = $this->send_data("gosa_mailqueue_header",$this->target,$data,TRUE);
- print_a($res);
+ $res = $this->send_data("gosa_mailqueue_header",$server,$data,TRUE);
+
+ $attrs = array(
+ "RECIPIENT",
+ "SENDER",
+ "SUBJECT");
+
+ $data = array();
+ if(isset($res['XML'])){
+ foreach($attrs as $attr){
+ $data[$attr] = "";
+ if(isset($res['XML'][0][$attr])){
+ $data[$attr] = $res['XML'][0][$attr][0]['VALUE'];
+ }
+ }
+ }
+ return($data);
}
diff --git a/gosa-plugins/mail/addons/mailqueue/contents.tpl b/gosa-plugins/mail/addons/mailqueue/contents.tpl
index 5afe743cf51997b51a920e66ddf910b7ead8e4a2..81acb66711c78e102f30f5527e2e84b60f6f2eb5 100644 (file)
{$entries[$key].MailID}</td>
<td>
<!-- onclick="javascript: document.location.href='{$plug}&act=header&id={$entries[$key].MailID}&server={$entries[$key].Server}'"-->
- {$entries[$key].Server}</td>
+ {$entries[$key].ServerName}
+ </td>
<td>
{$entries[$key].Size}</td>
<td>
diff --git a/gosa-plugins/mail/addons/mailqueue/header.tpl b/gosa-plugins/mail/addons/mailqueue/header.tpl
index 7e90c1159ff8493da286538e9f8700a633fec458..fe88ee2d3fa363c3042644c842088736c5af2d2c 100644 (file)
-{$header}
+<table>
+ <tr>
+ <td>{t}Sender{/t} :</td>
+ <td>{$header.SENDER}</td>
+ </tr>
+ <tr>
+ <td>{t}Recipient{/t} :</td>
+ <td>{$header.RECIPIENT}</td>
+ </tr>
+ <tr>
+ <td>{t}Subject{/t} :</td>
+ <td><i>{$header.SUBJECT}</i></td>
+ </tr>
+</table>
<p class="seperator"> </p>
-<div style='text-align:right;'>
+<div style='text-align:right; padding:5px;'>
<input type="submit" name="back" value="{msgPool type=backButton}">
</div>