%doctype;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <!-- $Id: templm/upddag.txt v7.0 2016/01/26 10:48:00 $ -->
  <title>[*modify::tree]</title>
  <meta name="robots" content="none"%/>
  <meta name="format-detection" content="telephone=no"%/>
  <meta http-equiv="Content-Type" content="text/html; charset=%charset;"%/>
  <meta http-equiv="Content-Style-Type" content="text/css"%/>
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png"%/>
  %include;css
  %include;templm/js_upd
</head>
<body%body_prop; id="dag">
%include;hed
%message_to_wizard;
%include;templm/updind_updfam

%let;lt4;title="%ak6;%ak3;%ak7;"%in;

%define;one_i_line(z1)
    <tr id="srz1">
      <td class="b1"><a tabindex="10000" href="javascript:addPvar(z1,0);">+</a></td>
      <td><input id="rpz1_occ" name="ocz1" class="occ3" autocomplete="off" size="5" maxlength="8" value="%p_of_index.z1.occ;"
           onkeypress="javascript:return oKP2(event,'p','z1','_occ','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:delS('p','z1','_occ',1,0,'');">x</a></td>
      <td><input id="rpz1_fn" name="pz1" class="ar" size="30" maxlength="200" value="%p_of_index.z1.first_name;" onblur="tUC1(this)"%/></td>
      <td><input id="rpz1_sn" name="nz1" size="30" maxlength="200" value="%p_of_index.z1.surname;" onblur="tUC(this);jq1('pz1','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',0,1,'');">&uarr;</a></td>
      <td class="b1"><span id="pz1_jq1">
          %if;p_of_index.z1.has_birth_date; %p_of_index.z1.slash_birth_date;
          %elseif;p_of_index.z1.has_baptism_date; %p_of_index.z1.slash_baptism_date;
          %end;
           - %nn;
          %if;p_of_index.z1.has_death_date;%p_of_index.z1.slash_death_date;
          %elseif;p_of_index.z1.has_burial_date;%p_of_index.z1.slash_burial_date;
          %elseif;p_of_index.z1.has_cremation_date;%p_of_index.z1.slash_cremation_date;
          %end;
        </span></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',1,1,'');">&darr;</a></td>
      <td><input id="sz1_t" name="tz1" size="30" maxlength="200" value="sosa_ref_z1"%/></td>
    </tr>
%end;

%define;one_s_line(z1)
    <tr id="sz1">
      <td class="b1"><a tabindex="10000" href="javascript:addPvar(z1,0);">+</a></td>
      <td><input id="spz1_occ" name="socz1" class="occ3" autocomplete="off" size="5" maxlength="8" value="%svar.z1.occ;"
           onkeypress="javascript:return oKP2(event,'p','z1','_occ','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:delS('p','z1','_occ',1,0,'');">x</a></td>
      <td><input id="spz1_fn" name="spz1" class="ar" size="30" maxlength="200" value="%svar.z1.first_name;" onblur="tUC1(this)"%/></td>
      <td><input id="sz1_sn" name="snz1" size="30" maxlength="200" value="%svar.z1.surname;" onblur="tUC(this);jq1('pz1','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',0,1,'');">&uarr;</a></td>
      <td class="b1"><span id="pz1_jq1">
          %if;p_of_index.z1.has_birth_date; %p_of_index.z1.slash_birth_date;
          %elseif;p_of_index.z1.has_baptism_date; %p_of_index.z1.slash_baptism_date;
          %end;
           - %nn;
          %if;p_of_index.z1.has_death_date;%p_of_index.z1.slash_death_date;
          %elseif;p_of_index.z1.has_burial_date;%p_of_index.z1.slash_burial_date;
          %elseif;p_of_index.z1.has_cremation_date;%p_of_index.z1.slash_cremation_date;
          %end;
        </span></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',1,1,'');">&darr;</a></td>
      <td><input id="pz1_t" name="sz1" size="30" maxlength="200" value="%evar.sz1;"%/></td>
    </tr>

%end;

%define;one_svar(z1) %( s1=;s2=;... list of sosa_nb relative to some index_i %)
  %if;((evar.pz1 != "" and evar.nz1!="") or evar.iz1!="")
    %apply;one_i_line(z1)
    %apply;one_s_line(z1)
    %apply;one_svar(z1+1)
  %elseif;(evar.sz1!="")
    %apply;one_s_line(z1)
    %apply;one_svar(z1+1)
  %end;
%end;


%define;one_pvar(z1) %( i1=;i2=; ... contiguous list of indexes %)
  %if;(evar_iz1 != "")
    <tr id="pz1">
      <td class="b1"><a tabindex="10000" href="javascript:addPvar(z1,0);">+</a></td>
      <td><input id="pz1_occ" name="ocz1" class="occ3 form-control" autocomplete="off" size="5" maxlength="8" value="%p_of_index.z1.occ;"
           onkeypress="javascript:return oKP2(event,'p','z1','_occ','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:delS('p','z1','_occ',1,0,'');">x</a></td>
      <td><input id="pz1_fn" name="pz1" class="ar form-control" size="30" maxlength="200" value="%p_of_index.z1.first_name;" onblur="tUC1(this)"%/></td>
      <td><input id="pz1_sn" name="nz1" class="form-control" size="30" maxlength="200" value="%p_of_index.z1.surname;" onblur="tUC(this);jq1('pz1','')"%/></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',0,1,'');">&uarr;</a></td>
      <td class="b1"><span id="pz1_jq1">
          %if;p_of_index.z1.has_birth_date; %p_of_index.z1.slash_birth_date;
          %elseif;p_of_index.z1.has_baptism_date; %p_of_index.z1.slash_baptism_date;
          %end;
           - %nn;
          %if;p_of_index.z1.has_death_date;%p_of_index.z1.slash_death_date;
          %elseif;p_of_index.z1.has_burial_date;%p_of_index.z1.slash_burial_date;
          %elseif;p_of_index.z1.has_cremation_date;%p_of_index.z1.slash_cremation_date;
          %end;
        </span></td>
      <td class="b1"><a tabindex="10000" href="javascript:invertS('p','z1','_occ',1,1,'');">&darr;</a></td>
      <td><input id="pz1_t" name="tz1" class="form-control" size="30" maxlength="200" value="%evar.tz1;"
          %/><input type="hidden" id="pz1_i" name="iz1" size="5" value="%p_of_index.z1.index;" %/></td>
    </tr>
    %apply;one_pvar(z1+1)
  %end;
%end;

<form id="upd" name="upd" method="get" action="%action;" onsubmit="oS1()">
  <div id="jq" style="display:none"> </div>
  <p style="display:none;">
    %hidden;
    <input type="hidden" name="m" value='%if;(evar.mode="DAG")DAG%else;RLM%end;' %/>
    <input type="hidden" name="spouse" value="%evar.spouse;" %/>
    <input type="hidden" name="image" value="%evar.image;" %/>
    <input type="hidden" name="bd" value="%evar.bd;" %/>
    <input type="hidden" name="color" value="%evar.color;" %/>
    <input type="hidden" name="invert" value="%evar.invert;" %/>
    <input type="hidden" name="lim" value="%evar.lim;" %/>
    <input type="hidden" name="new" value="%evar.new;" %/>
  </p>
  <fieldset>
    <div class="d-flex justify-content-between">
      <h2 class="mt-2 mb-4">[*edit tree]</h2>
      <div class="form-inline">
        <input type="submit" class="btn btn-primary" value="OK" %/>
      </div>
    </div>
    <table class="table table-sm" id="upddag" summary="pvar" cellspacing=0 cellpadding=0>
      <tr style="font-weight:bold;text-align:center">
        <td class="b1"><abbr title="[add::]">+</abbr></td>
        <td class="bg7"><abbr %lt4;>#</abbr></td>
        <td class="b1"><abbr title="[delete::]">x</abbr></td>
        <td class="bg7">[first name/first names]0</td>
        <td class="bg7">[surname/surnames]0</td>
        <td class="b1"><abbr title="[invert::] 3..2">&uarr;</abbr></td>
        <td class="bg7">[birth] - [death]</td>
        <td class="b1"><abbr title="[invert::] 2..3">&darr;</abbr></td>
        <td class="bg7">[text]</td>
      </tr>
      %if;(evar.mode="DAG")
        %apply;one_svar(1)
      %else;
        %if;(evar.i0!="")
          %apply;one_pvar(0)
        %else;
          %apply;one_pvar(1)
        %end;
      %end;
      <tr id="new_pvar"></tr>
      <tr><td class="b1"><a id="add_pvar" style="display:block" href="javascript:addPvar(1,1)">+</a></td>
          <td colspan="8" class="b1"> </td>
      </tr>
    </table>
  </fieldset>
</form>

%define;sosa_dag(z1)
  %if;(evar.iz1 != "")
    %if;(p_of_index.z1.has_sosa)
      %apply;add_in_sorted_list(p_of_index.z1.sosa.v)
    %end;
    %apply;sosa_dag(z1+1)
  %end;
%end;

%if;(browsing_with_sosa_ref)
  <div class="menu"><span><a href="%prefix;m=DAG;i1=%sosa_ref.index;%nn;
  %empty_sorted_list;
  %apply;sosa_dag(1)
  %reset_count;
  %foreach;sorted_list_item;
    %incr_count;
    ;s%count;=%item.1;%nn;
  %end;
  ;bd=%evar.bd;;color=%evar.color;;image=%evar.image;;spouse=%evar.spouse;">[*tree] (Sosa)</a></span></div>
%end;

<div style="height:300px;clear:both;"> </div>
  %base_trailer;
  %include;copyr
</body>
</html>
