Code

Basix addressbook update
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Mar 2010 16:19:26 +0000 (16:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Mar 2010 16:19:26 +0000 (16:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17300 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc
gosa-plugins/addressbook/addons/addressbook/contents.tpl
gosa-plugins/addressbook/addons/addressbook/main.inc

index f9f0aa5fea8e3955f0a7f0fc15fb568fc4c7f3c9..c466c255c94b37e617f3fefc60776bf9f9798634 100644 (file)
@@ -454,7 +454,7 @@ class addressbook extends plugin
   
           $this->telephone_list[$attrs['sn'][0].$attrs['dn']]=
 
-            "<td class=\"phonelist\" title=\"".$attrs['sn'][0].", ".$attrs['givenName'][0].
+            "<td class=\"list1\" title=\"".$attrs['sn'][0].", ".$attrs['givenName'][0].
               "\"onClick='location.href=\"main.php?plug=".validate($_GET['plug']).
                           "&amp;start=".validate($_GET['start']).
                           "&amp;show=".urlencode(base64_encode($attrs['dn']))."\"'>
@@ -464,22 +464,22 @@ class addressbook extends plugin
                $attrs['sn'][0].", ".$attrs['givenName'][0].
             "</a>
             &nbsp;</td>
-            <td class=\"phonelist\" title=\""._("Dial")." ".$attrs['telephoneNumber'][0]."\">
+            <td class=\"list1\" title=\""._("Dial")." ".$attrs['telephoneNumber'][0]."\">
             <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&amp;dial=telephoneNumber&amp;start=".validate($_GET['start'])."&amp;target=".base64_encode($attrs['dn'])."\">".$attrs['telephoneNumber'][0]."
             </a>
             &nbsp;</td>
-            <td class=\"phonelist\" title=\"".$attrs['facsimileTelephoneNumber'][0]."\">
+            <td class=\"list1\" title=\"".$attrs['facsimileTelephoneNumber'][0]."\">
             ".$attrs['facsimileTelephoneNumber'][0]."
             &nbsp;</td>
-            <td class=\"phonelist\" title=\""._("Dial")." ".$attrs['mobile'][0]."\">
+            <td class=\"list1\" title=\""._("Dial")." ".$attrs['mobile'][0]."\">
             <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&amp;dial=mobile&amp;start=".validate($_GET['start'])."&amp;target=".base64_encode($attrs['dn'])."\">".$attrs['mobile'][0]."
             </a>
             &nbsp;</td>
-            <td class=\"phonelist\" title=\""._("Dial")." ".$attrs['homePhone'][0]."\">
+            <td class=\"list1\" title=\""._("Dial")." ".$attrs['homePhone'][0]."\">
             <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&amp;dial=homePhone&amp;start=".validate($_GET['start'])."&amp;target=".base64_encode($attrs['dn'])."\">".$attrs['homePhone'][0]."
             </a>
             &nbsp;</td>
-            <td>
+            <td class=\"list1\">
             <a href=\"plugins/addressbook/getvcard.php?dn=".base64_encode($attrs['dn'])."\">
             <img align=\"top\" border=0 src=\"images/save.png\" alt=\"vcf\" title=\"".sprintf(_("Save contact for %s as vcard"), $attrs['givenName'][0]." ".$attrs['sn'][0])."\">
             </a>";
@@ -511,7 +511,7 @@ class addressbook extends plugin
     /* Create list of readable departments */
     $deps = array();
     foreach($this->config->idepartments as $dn => $name){
-      if( $this->acl_is_readable($dn) || $dn == $this->config->current['BASE']){
+      if(preg_match("/r/",$this->ui->get_permissions($dn,'users/user')) || $dn == $this->config->current['BASE']){
         $deps[$dn] = $name;
       }
     }
@@ -643,12 +643,8 @@ class addressbook extends plugin
         $mod++;
         break;
       }
-      if ( ($mod++) & 1){
-        $col= "style=\"background-color: #FFFFFF;\"";
-      } else {
-        $col= "style=\"background-color: #F5F5F5;\"";
-      }
-      $output.= "<tr $col>\n$val</tr>\n";
+        $mod++;
+      $output.= "<tr>\n$val</tr>\n";
     }
 
     $smarty->assign("search_result", $output);
index 9ff4648f8c2cc65aa4804e39f263244288b58cd6..4aef36f69a5fc1ccc1fd5198dd7d48b4df6dee3e 100644 (file)
-<table style='table-layout:fixed; width:100%; table-layout:auto;' summary="{t}Entry info{/t}">
 
-<tr>
 <td>
-
-   <table style='width:100%;' summary="{t}Entry info{/t}">
-
-
-    <colgroup>
-        <col width="32%">
-        <col width="14%">
-        <col width="14%">
-        <col width="14%">
-        <col width="14%">
-        <col width="8%">
-    </colgroup>
-    <tr style="background-color: #E8E8E8; height:26px;font-weight:bold;">
-     <td class="tbhead">{t}Name{/t}</td><td class="tbhead">{t}Phone{/t}</td><td class="tbhead">{t}Fax{/t}</td>
-     <td class="tbhead">{t}Mobile{/t}</td><td class="tbhead">{t}Private{/t}</td><td class="tbrhead">{t}Contact{/t}</td>
+<div id="mainlist">
<div class="mainlist-header">
+  <p>{t}System logs{/t}
+  </p>
+  <div class="mainlist-nav">
+   <table summary="{t}Filter{/t}" style="width: 100%;"      id="t_scrolltable" cellpadding="0" cellspacing="0">
+    <tr>
+     <td>{t}Search{/t}
+      <select id="object_type" style='width:220px' name="object_type" onChange="mainform.submit()" title="{t}Choose the object that will be searched in{/t}" size=1>
+       {html_options options=$objlist selected=$object_type}<option disabled>&nbsp;</option>
+      </select>
+      <input id="search_for" type='text' name='search_for' maxlength='20' value='{$search_for}' title='{t}Search string{/t}' onChange="mainform.submit()">
+      <button name="apply" type='submit'>{t}Filter anwenden{/t}</button>
+     </td>
+     <td class='left-border'>
+      <input type="checkbox" name="organizational" value="1" {$organizational} onClick="mainform.submit()" title="{t}Select to see regular users{/t}">{t}Show organizational entries{/t}
+     </td>
     </tr>
-    {$search_result}
-   </table>
-
-   <table style='text-align:center; width:100%;' summary="{t}Entry info{/t}">
-
     <tr>
-     <td>{$range_selector}</td>
+     <td>{t}Display results for department{/t}
+      <select name="search_base" style='width:220px' onChange="mainform.submit()"             title="{t}Choose the department the search will be based on{/t}" size=1>
+       {html_options options=$deplist selected=$depselect}<option disabled>&nbsp;</option>
+      </select>
+     </td>
+     <td class='left-border'>
+      <input type="checkbox" name="global" value="1" {$global} onClick="mainform.submit()" title="{t}Select to see users in addressbook{/t}">{t}Show addressbook entries{/t}
+     </td>
     </tr>
    </table>
-
-   {if $show_info eq 1}
-    {include file=$address_info}
+  </div>
+ </div>
+ <div class="mainlist-header">
+  <p>{t}Actions{/t}
+  </p>
+  <div class="mainlist-nav" style='padding: 3px;'>
+   
+   {if $internal_createable}
+    {image path='images/lists/element.png[new]'}
+    <a href="main.php{$plug}&amp;global=add" style="text-align:center;vertical-align:middle;">{t}Add entry{/t}</a>
+    
    {/if}
-
-  </td>
-  <td style='width:270px;'>
-
-   <div class="contentboxh" style="border-bottom:1px solid #B0B0B0;">
-    <p class="contentboxh">{image path="{$infoimage}" align="right"}{t}Information{/t}
-</p>
-   </div>
-   <div class="contentboxb">
-    <p class="contentboxb">
-     {t}The telephone list plugin provides list and search facilities for the people in your site. You may want to specify the asterisk [*] like in 'Go*us' to find 'Gonicus'. Use the filters below to narrow down your search.{/t}
-    </p>
-   </div>
-   <br>
-   <div class="contentboxh">
-    <p class="contentboxh" style="vertical-align:middle;">{image path="{$actionimage}" align="right"}{t}Actions{/t}
-</p>
-   </div>
-   <div class="contentboxb">
-    <p class="contentboxb" style="vertical-align:middle;">
-{if $internal_createable}
-     {image path="{$add_image}"}&nbsp;
-
-     <a href="main.php{$plug}&amp;global=add" style="text-align:center;vertical-align:middle;">{t}Add entry{/t}</a><br>
-{/if}
-
-{if $internal eq 0}
- {if $internal_editable}
-     {image path="{$edit_image}"}&nbsp;
-
-     <a href="main.php{$plug}&amp;global=edit">{t}Edit entry{/t}</a><br>
- {/if}
- {if $internal_removeable}
-            {image path="{$delete_image}"}&nbsp;
-
-            <a href="main.php{$plug}&amp;global=remove" style="vertical-align:middle;">{t}Remove entry{/t}</a><br>
- {/if}
-{/if}
-    </p>
-   </div>
-   <br>
-   <div class="contentboxh">
-    <p class="contentboxh">{image path="{$launchimage}" align="right"}{t}Filters{/t}
-</p>
-   </div>
-   <div class="contentboxb">
-    <table style='width:100%;' summary="{t}Entry info{/t}">
-
-     {$alphabet}
-    </table>
+   
+   {if $internal eq 0}
     
-<table style='width:100%;' summary="{t}Entry info{/t}">
-
-       <tr>
-               <td>
-<input type="checkbox" name="organizational" value="1" {$organizational} onClick="mainform.submit()" title="{t}Select to see regular users{/t}">{t}Show organizational entries{/t}<br>
-    <input type="checkbox" name="global" value="1" {$global} onClick="mainform.submit()" title="{t}Select to see users in addressbook{/t}">{t}Show addressbook entries{/t}<br>
-               </td>
-       </tr>
-</table>
-
-<table style='width:100%;' summary="{t}Entry info{/t}">
-
-       <tr>
-               <td>
-                       <label for="search_base">{image path="{$tree_image}" title="{t}Display results for department{/t}"}
-</label>
-               </td>
-       <td>
-                       <select name="search_base" style='width:220px' onChange="mainform.submit()" title="{t}Choose the department the search will be based on{/t}" size=1>
-                       {html_options options=$deplist selected=$depselect}
-                               <option disabled>&nbsp;</option>
-               </select>
-               </td>
-       </tr>
-</table>
-<table style='width:100%;' summary="{t}Entry info{/t}">
-
-       <tr>
-               <td>
-                       <label for="object_type">{image path="{$obj_image}" title="{t}Match object{/t}"}
-</label>
-               </td>
-           <td>
-                       <select id="object_type" style='width:220px' name="object_type" onChange="mainform.submit()" title="{t}Choose the object that will be searched in{/t}" size=1>
-                       {html_options options=$objlist selected=$object_type}
-                               <option disabled>&nbsp;</option>
-               </select>
-           </td>
-       </tr>
-</table>
-<table style='width:100%;' summary="{t}Entry info{/t}">
-
-       <tr>
-               <td><label for="search_for">{image path="{$search_image}" title="{t}Search for{/t}"}
-</label>
-               </td>
-           <td>
-                       <input id="search_for" style='width:99%' type='text' name='search_for' maxlength='20' value='{$search_for}' title='{t}Search string{/t}' onChange="mainform.submit()">
-               </td>
-       </tr>
-</table>
-   {$apply}
-   </div>
-  </td>
-</tr>
-</table>
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       focus_field('search_for');
-  -->
-</script>
+    {if $internal_editable}
+     {image path='images/lists/edit.png'}
+     <a href="main.php{$plug}&amp;global=edit">{t}Edit entry{/t}</a>
+     
+    {/if}
+    
+    {if $internal_removeable}
+     {image path='images/lists/trash.png'}
+     <a href="main.php{$plug}&amp;global=remove" style="vertical-align:middle;">{t}Remove entry{/t}</a>
+     
+    {/if}
+    
+   {/if}
+  </div>
+ </div>
+ <div class="listContainer">
+
+  <table width='100%' summary="{t}Entry list{/t}" cellpadding="0" cellspacing="0">
+   <thead class="fixedListHeader listHeaderFormat">
+   <tr>
+    <td class="listheader">{t}Name{/t}
+    </td>
+    <td class="listheader">{t}Phone{/t}
+    </td>
+    <td class="listheader">{t}Fax{/t}
+    </td>
+    <td class="listheader">{t}Mobile{/t}
+    </td>
+    <td class="listheader">{t}Private{/t}
+    </td>
+    <td class="listheader">{t}Contact{/t}
+    </td>
+   </tr>
+  </thead>
+   <tbody {if $show_info eq 1} style='height:50px;' {else} style='height:250px; width:100%;' {/if}
+      class="listScrollContent listBodyFormat">
+    {$search_result}
+   </tbody>
+  </table>
+ </div>
+ <div class="nlistFooter"  style='width:100%; text-align: center;'>
+  {$range_selector}
+ </div>
+ {if $show_info eq 1}
+  {include file=$address_info}
+ {/if}
+</div>
+<br>
+<script language="JavaScript" type="text/javascript"><!-- // First input field on page   focus_field('search_for');  --></script>
index 8807c001820a7d09b7125085f3a3f65925239e62..0c795afc0dd3743e34fba03c54da8a95417c477a 100644 (file)
@@ -39,9 +39,6 @@ if ( $cleanup ){
        $display= $addressbook->execute ();
        $display.= "<input type=\"hidden\" name=\"ignore\">\n";
 
-       /* Page header*/
-       $display= print_header(get_template_path('plugins/addressbook/images/plugin.png'), _("Addressbook")).$display;
-
        /* Store changes  in session */
        session::set('addressbook',$addressbook);
 }