]> git.sur5r.net Git - contagged/blobdiff - templates/entry_edit.tpl
Merge pull request #15 from cweiske/master
[contagged] / templates / entry_edit.tpl
index de2283dddc973ec96f8309940565bced496807e1..9f9fe52b452397d2142937853a4c9973a4a19141 100644 (file)
+{include file="header.tpl"}
+
+<div id="edit">
+
 <h1>
   {if $entry.type != ''}
-  <img src="pix/{$entry.type}.png" border="0" width="22" height="22" align="middle" title="{$entry.type}">
+  <img src="pix/{$entry.type|h}.png" border="0" width="22" height="22" align="middle" title="{$entry.type|h}" alt="" />
   {/if}
-  {$entry.givenname} {$entry.name}
+  {$entry.givenname|h} {$entry.name|h}
 </h1>
 
-<form action="entry.php" method="post" enctype="multipart/form-data">
+<form action="entry.php" method="post" enctype="multipart/form-data" accept-charset="utf-8">
 <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
-<input type="hidden" name="dn" value="{$entry.dn|escape}" />
+<input type="hidden" name="dn" value="{$entry.dn|h}" />
 <input type="hidden" name="save" value="1" />
 
-{include file="ldaperror.tpl"}
-
 <table width="100%">
+<!--  -->
   <tr>
     <td valign="top" width="50%" align="center">
-      <table>
+      <table width="100%">
+{* always required ... if $fields.name *}
         <tr>
-          <td colspan="2"><b>{$lang.business}</b></td>
+          <th>{$lang.name}:</th>
+          <td><input type="text" class="input ac" name="entry[name]" value="{$entry.name|h}" id="firstfield" /></td>
         </tr>
+{* /if *}
+{if $fields.givenname}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.name}:</td>
-          <td><input type="text" class="input" name="entry[name]" value="{$entry.name|escape}"></td>
+          <th>{$lang.givenname}:</th>
+          <td><input type="text" class="input ac" name="entry[givenname]" value="{$entry.givenname|h}" /></td>
         </tr>
+{/if}
+{if $fields.title}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.givenname}:</td>
-          <td><input type="text" class="input" name="entry[givenname]" value="{$entry.givenname|escape}"></td>
+          <th>{$lang.title}:</th>
+          <td><input type="text" class="input ac" name="entry[title]" value="{$entry.title|h}" /></td>
         </tr>
+{/if}
+      </table>
+    </td>
+
+    <td valign="top" width="50%" align="center">
+    </td>
+  </tr>
+
+  <tr>
+    <td colspan="2">&nbsp;</td>
+  </tr>
+
+  <tr>
+    <td valign="top" width="50%" align="center">
+      <table width="100%">
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.title}:</td>
-          <td><input type="text" class="input" name="entry[title]" value="{$entry.title|escape}"></td>
+          <td colspan="2"><h3>{$lang.business}</h3></td>
         </tr>
+{if $fields.organization}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.organization}:</td>
+          <th>{$lang.organization}:</th>
           <td>
-            <input type="text" class="input" name="entry[organization]" value="{$entry.organization|escape}">
+            <input type="text" class="input ac" name="entry[organization]" value="{$entry.organization|h}" />
           </td>
         </tr>
+{/if}
+{if $fields.office}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap"></td>
-          <td>
-            <select onChange="document.forms[0].elements['entry[organization]'].value=this.options[this.selectedIndex].value" class="input">
-              <option value="">--- {$lang.select} ---</option>
-              {html_options values=$orgs output=$orgs}
-            </select>
-          </td>
+          <th>{$lang.office}:</th>
+          <td><input type="text" class="input ac" name="entry[office]" value="{$entry.office|h}" /></td>
+        </tr>
+{/if}
+{if $fields.street}
+        <tr>
+          <th>{$lang.street}:</th>
+          <td><input type="text" class="input ac" name="entry[street]" value="{$entry.street|h}" /></td>
         </tr>
+{/if}
+{if $fields.zip}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.office}:</td>
-          <td><input type="text" class="input" name="entry[office]" value="{$entry.office|escape}"></td>
+          <th>{$lang.zip}:</th>
+          <td><input type="text" class="input ac" name="entry[zip]" value="{$entry.zip|h}" /></td>
         </tr>
+{/if}
+{if $fields.location}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.street}:</td>
-          <td><input type="text" class="input" name="entry[street]" value="{$entry.street|escape}"></td>
+          <th>{$lang.location}:</th>
+          <td><input type="text" class="input ac" name="entry[location]" value="{$entry.location|h}" /></td>
         </tr>
+{/if}
+{if $fields.state}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.zip}:</td>
-          <td><input type="text" class="input" name="entry[zip]" value="{$entry.zip|escape}"></td>
+          <th>{$lang.state}:</th>
+          <td><input type="text" class="input ac" name="entry[state]" value="{$entry.state|h}" /></td>
         </tr>
+{/if}
+{if $fields.country}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.location}:</td>
-          <td><input type="text" class="input" name="entry[location]" value="{$entry.location|escape}"></td>
+          <td align="right" valign="top">{$lang.country}:</td>
+          <td>
+            <select class="input" name="entry[country]">
+                {html_options options=$iso3166 selected=$entry.country|default:$conf.country|upper}
+            </select>
+          </td>
         </tr>
+{/if}
+{if $fields.phone}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.phone}:</td>
-          <td><input type="text" class="input" name="entry[phone]" value="{$entry.phone|escape}"></td>
+          <th>{$lang.phone}:</th>
+          <td><input type="text" class="input" name="entry[phone]" value="{$entry.phone|h}" /></td>
         </tr>
+{/if}
+{if $fields.switchboard}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.fax}:</td>
-          <td><input type="text" class="input" name="entry[fax]" value="{$entry.fax|escape}"></td>
+          <th>{$lang.switchboard}:</th>
+          <td><input type="text" class="input" name="entry[switchboard]" value="{$entry.switchboard|h}" /></td>
         </tr>
+{/if}
+{if $fields.fax}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.pager}:</td>
-          <td><input type="text" class="input" name="entry[pager]" value="{$entry.pager|escape}"></td>
+          <th>{$lang.fax}:</th>
+          <td><input type="text" class="input" name="entry[fax]" value="{$entry.fax|h}" /></td>
         </tr>
+{/if}
+{if $fields.pager}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.manager}:</td>
+          <th>{$lang.pager}:</th>
+          <td><input type="text" class="input" name="entry[pager]" value="{$entry.pager|h}" /></td>
+        </tr>
+{/if}
+{if $fields.manager}
+        <tr>
+          <th>{$lang.manager}:</th>
           <td>
             <select name="entry[manager]" class="input">
               <option value="">--- {$lang.select} ---</option>
             </select>
           </td>
         </tr>
+{/if}
+{if $fields.position}
+        <tr>
+          <td align="right" valign="top">{$lang.position}:</td>
+          <td><input type="text" class="input ac" name="entry[position]" value="{$entry.position|h}" /></td>
+        </tr>
+{/if}
+{if $fields.department}
+        <tr>
+          <td align="right" valign="top">{$lang.department}:</td>
+          <td><input type="text" class="input ac" name="entry[department]" value="{$entry.department|h}" /></td>
+        </tr>
+{/if}
 
-      {if $conf.extended}
-        {include file="extended_edit.tpl"}
-      {/if}
       </table>
     </td>
-    
+
     <td valign="top" width="50%" align="center">
-      
-      
-      <table>
-        <tr>
-          <td colspan="2"><b>{$lang.private}</b></td>
-        </tr>
+
+      <table width="100%">
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.homestreet}:</td>
-          <td><textarea name="entry[homestreet]" class="input" rows="2" cols="30">{$entry.homestreet|escape}</textarea></td>
+          <td colspan="2"><h3>{$lang.private}</h3></td>
         </tr>
+{if $fields.homestreet}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.homephone}:</td>
-          <td><input type="text" class="input" name="entry[homephone]" value="{$entry.homephone|escape}"></td>
+          <th>{$lang.homestreet}:</th>
+          <td><textarea name="entry[homestreet]" class="input" rows="2" cols="30">{$entry.homestreet|h}</textarea></td>
         </tr>
+{/if}
+{if $fields.homephone}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.mobile}:</td>
-          <td><input type="text" class="input" name="entry[mobile]" value="{$entry.mobile|escape}"></td>
+          <th>{$lang.homephone}:</th>
+          <td><input type="text" class="input" name="entry[homephone]" value="{$entry.homephone|h}" /></td>
         </tr>
+{/if}
+{if $fields.mobile}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.url}:</td>
-          <td><input type="text" class="input" name="entry[url]" value="{$entry.url|escape}"></td>
+          <th>{$lang.mobile}:</th>
+          <td><input type="text" class="input" name="entry[mobile]" value="{$entry.mobile|h}" /></td>
         </tr>
-        
+{/if}
+{if $fields.photo}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{$lang.photo}:<br /><span class="hint">({$lang.msg_jpegonly})</span></td>
+          <th>{$lang.photo}:<br /><span class="hint">({$lang.msg_jpegonly})</span></th>
           <td>{if $entry.photo}
-                <input type="checkbox" class="radio" name="delphoto" id="delphoto" value="1">
+                <input type="checkbox" class="radio" name="delphoto" id="delphoto" value="1" />
                 <label for="delphoto">{$lang.delphoto}</label>
                 <br />
               {/if}
-            <input type="file" class="input" name="photoupload">
+            <input type="file" class="input" name="photoupload" />
           </td>
         </tr>
-        
-
+{/if}
+{if $jpegError}
+        <tr>
+          <th></th><td>{$jpegError}</td>
+        </tr>
+{/if}
+{if $fields.birthday}
         <tr>
-          <td colspan="2"><b>{$lang.mail}</b></td>
+          <td align="right" valign="top">{$lang.birthday}:<br /><span class="hint">({$lang.msg_dateformat})</span></td>
+          <td><input type="text" class="input" name="entry[birthday]" value="{$entry.birthday|h}" maxlength="10" /></td>
         </tr>
+{/if}
+{if $fields.anniversary}
+        <tr>
+          <th>{$lang.anniversary}:<br /><span class="hint">({$lang.msg_dateformat})</span></th>
+          <td><input type="text" class="input" name="entry[anniversary]" value="{$entry.anniversary|h}" maxlength="10" /></td>
+        </tr>
+{/if}
+{if $fields.spouse}
+        <tr>
+          <th>{$lang.spouse}:</th>
+          <td><input type="text" class="input" name="entry[spouse]" value="{$entry.spouse|h}" /></td>
+        </tr>
+{/if}
 
-        {foreach from=$entry.mail item=mail}      
-          <tr>
-            <td align="right" valign="top" nowrap="nowrap">{counter}:</td>
-            <td><input type="text" class="input" name="entry[mail][]" value="{$mail|escape}"></td>
-          </tr>
+        <tr>
+          <td colspan="2"><h3>{$lang.communication}</h3></td>
+        </tr>
+{if $fields._url}
+        {foreach from=$entry.url|smarty:nodefaults item=url}
+        <tr>
+          <th>{$lang.url} {counter}:</th>
+          <td><input type="text" class="input" name="entry[url][]" value="{$url|h}" /></td>
+        </tr>
         {/foreach}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{counter}:</td>
-          <td><input type="text" class="input" name="entry[mail][]" value=""></td>
+          <th>{$lang.url} {counter}:</th>
+          <td><input type="text" class="input" name="entry[url][]" value="" /></td>
         </tr>
+{/if}
+{if $fields._mail}
+        <!--{counter start=0}-->
+        {foreach from=$entry.mail|smarty:nodefaults item=mail}
         <tr>
-          <td align="right" valign="top" nowrap="nowrap">{counter}:</td>
-          <td><input type="text" class="input" name="entry[mail][]" value=""></td>
+          <th>{$lang.mail} {counter}:</th>
+          <td><input type="text" class="input" name="entry[mail][]" value="{$mail}" /></td>
         </tr>
-
+        {/foreach}
+        <tr>
+          <th>{$lang.mail} {counter}:</th>
+          <td><input type="text" class="input" name="entry[mail][]" value="" /></td>
+        </tr>
+        <tr>
+          <th>{$lang.mail} {counter}:</th>
+          <td><input type="text" class="input" name="entry[mail][]" value="" /></td>
+        </tr>
+{/if}
+{if $fields.instantmessenger}
+        <tr>
+          <td align="right" valign="top">{$lang.instantmessenger}:</td>
+          <td><input type="text" class="input" name="entry[instantmessenger]" value="{$entry.instantmessenger|h}" /></td>
+        </tr>
+{/if}
+{if $fields.ipphone}
         <tr>
-          <td colspan="2"><b>{$lang.note}</b></td>
+          <td align="right" valign="top">{$lang.ipphone}:</td>
+          <td><input type="text" class="input" name="entry[ipphone]" value="{$entry.ipphone|h}" /></td>
         </tr>
+{/if}
+
+      </table>
+    </td>
+  </tr>
+
+  <tr>
+    <td colspan="2">&nbsp;</td>
+  </tr>
+
+  <tr>
+    <td colspan="2"><h3>{$lang.extended}</h3></td>
+  </tr>
 
+  <tr>
+    <td width="50%" valign="top" align="center">
+      <table width="100%">
+{if $fields.note}
         <tr>
-          <td colspan="2" align="right"><textarea class="input" rows="6" cols="30" name="entry[note]" class="note">{$entry.note|escape}</textarea></td>
+          <td align="right" valign="top">{$lang.note}:</td>
+          <td align="right"><textarea rows="6" cols="30" name="entry[note]" class="input note">{$entry.note|h}</textarea></td>
         </tr>
+{/if}
 
       </table>
     </td>
+    <td width="50%" valign="top" align="center">
+      <table width="100%">
+{if $fields._marker}
+        <tr>
+          <th>{$lang.marker}:<br /><span class="hint">({$lang.msg_tagsep})</span></th>
+          <td>
+            <textarea class="input" name="entry[markers]" id="tageditlookup">{$entry.markers|h}</textarea>
+          </td>
+        </tr>
+{/if}
+{if $fields.certificate}
+        <tr>
+          <td align="right" valign="top">{$lang.certificate}:</td>
+          <td>
+            <textarea name="entry[certificate]" class="input" rows="6" cols="28" onClick="this.form.elements['entry[certificate]'].select();">{$entry.certificate|h}</textarea>
+            <br /><input type="button" name="clearCert" value="Clear" onclick="if (confirm('Are you sure?')) this.form.elements['entry[certificate]'].value='';" />
+          </td>
+        </tr>
+{/if}
+{if $fields.domain}
+        <tr>
+          <td align="right" valign="top">{$lang.domain}:</td>
+          <td><input type="text" class="input" name="entry[domain]" value="{$entry.domain|h}" /></td>
+        </tr>
+{/if}
+{if $fields.timezone}
+        <tr>
+          <td align="right" valign="top">{$lang.timezone}:</td>
+          <td>
+            <input type="text" class="inputbr" name="entry[timezone]" value="{$entry.timezone|h}" /><br />
+          </td>
+        </tr>
+{/if}
+      </table>
+    </td>
   </tr>
-  {if $entry.dn == ''}
+
+  {if $entry.dn == '' && $conf.privatebook}
   <tr>
     <td colspan="2" align="center">
-      {$lang.msg_addto}<br>
+      {$lang.msg_addto}<br />
       <table><tr><td>
-      <input type="radio" name="type" value="public" id="typepublic" class="radio" checked="checked">
-      <label for="typepublic"><img src="pix/public.png" border="0" width="22" height="22" align="middle">{$lang.publicbook}</label><br>
-      <input type="radio" name="type" value="private" id="typeprivate" class="radio">
-      <label for="typeprivate"><img src="pix/private.png" border="0" width="22" height="22" align="middle">{$lang.privatebook}</label>
+      <input type="radio" name="type" value="public" id="typepublic" class="radio" checked="checked" />
+      <label for="typepublic"><img src="pix/public.png" border="0" width="16" height="16" align="middle" />{$lang.publicbook}</label><br />
+      <input type="radio" name="type" value="private" id="typeprivate" class="radio" />
+      <label for="typeprivate"><img src="pix/private.png" border="0" width="16" height="16" align="middle" />{$lang.privatebook}</label>
       </td></tr></table>
     </td>
   </tr>
+  {else}
+      <input type="hidden" name="type" value="public" id="typepublic"/>
   {/if}
+
   <tr>
-    <td colspan="2" align="center"><br><input type="submit" class="input" value="{$lang.submit}"></td>
+    <td colspan="2" align="center"><br /><input type="submit" class="button" value="{$lang.submit}" /></td>
   </tr>
 </table>
 
 </form>
 
-<br>
+</div>
+
+{include file="footer.tpl"}