Merge remote-tracking branch 'origin/new/bug_7729'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / import_borrowers.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Import patrons [% IF ( uploadborrowers ) %]&rsaquo; Results[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <style type="text/css">
5     .yui-u fieldset.rows label.widelabel { width: 12em; }
6     .line_error { width: 100%; }
7     code { background-color: yellow; }
8 </style>
9 </head>
10 <body id="tools_import_borrowers" class="tools">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'patron-search.inc' %]
13
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/import_borrowers.pl">Import patrons</a>[% IF ( uploadborrowers ) %] &rsaquo; Results[% END %]</div>
15
16 <div id="doc3" class="yui-t2">
17  <div id="bd">
18   <div id="yui-main">
19    <div class="yui-b">
20     <div class="yui-g">
21      <div class="yui-u first">
22 <h1>Import patrons</h1>
23 [% IF ( uploadborrowers ) %]
24 <h5>Import results :</h5>
25 <ul>
26         <li>[% imported %] imported records [% IF ( lastimported ) %](last was [% lastimported %])[% END %]</li>
27         <li>[% overwritten %] overwritten [% IF ( lastoverwritten ) %](last was [% lastoverwritten %])[% END %]</li>
28         <li>[% alreadyindb %] not imported because already in borrowers table and overwrite disabled [% IF ( lastalreadyindb ) %](last was [% lastalreadyindb %])[% END %]</li>
29         <li>[% invalid %] not imported because they are not in the expected format [% IF ( lastinvalid ) %](last was [% lastinvalid %])[% END %]</li>
30         <li>[% total %] records parsed</li>
31         <li><a href="/cgi-bin/koha/tools/tools-home.pl">Back to Tools</a></li>
32 </ul>
33   [% IF ( FEEDBACK ) %]
34   <br /><br />
35     <div>
36     <h5>Feedback:</h5>
37     <ul class="feedback">
38     [% FOREACH FEEDBAC IN FEEDBACK %]
39     <li>
40         [% IF ( FEEDBAC.filename ) %]Parsing upload file <span class="filename">[% FEEDBAC.filename %]</span>
41         [% ELSIF ( FEEDBAC.backend ) %]Upload parsed using [% FEEDBAC.backend %]
42         [% ELSIF ( FEEDBAC.headerrow ) %]These fields found: [% FEEDBAC.value %]
43         [% ELSE %][% FEEDBAC.name %] : [% FEEDBAC.value %]
44         [% END %]
45     </li>
46     [% END %]
47     </ul>
48     </div>
49   [% END %]
50   [% IF ( ERRORS ) %]
51   <br /><br />
52     <div>
53     <h5>Error analysis:</h5>
54     <ul>
55     [% FOREACH ERROR IN ERRORS %]
56         [% IF ( ERROR.badheader ) %]<li>Header row could not be parsed</li>[% END %]
57         [% FOREACH missing_critical IN ERROR.missing_criticals %]
58         <li class="line_error">
59             Line <span class="linenumber">[% missing_critical.line %]</span>
60             [% IF ( missing_critical.badparse ) %]
61                 could not be parsed!
62             [% ELSIF ( missing_critical.bad_date ) %]
63                 has &quot;[% missing_critical.key %]&quot; in unrecognized format: &quot;[% missing_critical.value %]&quot;
64             [% ELSE %]
65                 Critical field &quot;[% missing_critical.key %]&quot;
66                 [% IF ( missing_critical.branch_map ) %]has unrecognized value &quot;[% missing_critical.value %]&quot;
67                 [% ELSIF ( missing_critical.category_map ) %]has unrecognized value &quot;[% missing_critical.value %]&quot;
68                 [% ELSE %]missing
69                 [% END %]
70                 (borrowernumber: [% missing_critical.borrowernumber %]; surname: [% missing_critical.surname %]).
71             [% END %]
72             <br /><code>[% missing_critical.lineraw %]</code>
73         </li>
74         [% END %]
75     [% END %]
76     </ul>
77     </div>
78   [% END %]
79 [% ELSE %]
80 <ul>
81         <li>Select a file to import into the borrowers table</li>
82         <li>If a cardnumber exists in the table, you can choose whether to ignore the new one or overwrite the old one.</li>
83 </ul>
84 <form method="post" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
85 <fieldset class="rows">
86 <legend>Import into the borrowers table</legend>
87 <ol>
88         <li>
89                 <label for="uploadborrowers">Select the file to import: </label>
90                 <input type="file" id="uploadborrowers" name="uploadborrowers" />
91         </li>
92 </ol></fieldset>
93     <fieldset class="rows">
94         <legend>Field to use for record matching</legend>
95         <ol>
96             <li class="radio">
97                 <select name="matchpoint" id="matchpoint">
98                     <option value="cardnumber">Cardnumber</option>
99                     [% FOREACH matchpoint IN matchpoints %]
100                         <option value="[% matchpoint.code %]">[% matchpoint.description %]</option>
101                     [% END %]
102                 </select>
103             </li>
104         </ol>
105     </fieldset>
106 <fieldset class="rows">
107 <legend>Default values</legend>
108 <ol>
109     [% FOREACH columnkey IN columnkeys %]
110         <li>
111                 <label class="widelabel" for="[% columnkey.key %]">[% columnkey.key %]</label>
112                 <input id="[% columnkey.key %]" name="[% columnkey.key %]" />
113         </li>
114     [% END %]
115 </ol></fieldset>
116         <fieldset class="rows">
117         <legend>If matching record is already in the borrowers table:</legend>
118     <ol><li class="radio">
119         <input type="radio" id="overwrite_cardnumberno" name="overwrite_cardnumber" value="0" checked="checked" /><label for="overwrite_cardnumberno">Ignore this one, keep the existing one</label>
120         </li>
121         <li class="radio">
122                 <input type="radio" id="overwrite_cardnumberyes" name="overwrite_cardnumber" value="1" /><label for="overwrite_cardnumberyes">Overwrite the existing one with this</label>
123         </li>
124     </ol>
125     </fieldset>
126     [% IF ( ExtendedPatronAttributes ) %]
127         <fieldset class="rows">
128         <legend>Patron Attributes</legend>
129     <ol><li class="radio">
130         <input type="radio" id="ext_preserve_0" name="ext_preserve" value="0" checked="checked" /><label for="ext_preserve_0">Replace all Patron Attributes</label>
131         </li>
132         <li class="radio">
133         <input type="radio" id="ext_preserve_1" name="ext_preserve" value="1" /><label for="ext_preserve_1">Replace only included Patron Attributes</label>
134         </li>
135     </ol>
136     </fieldset>
137     [% END %]
138         <fieldset class="action"><input type="submit" value="Import" /></fieldset>
139 </form>
140 [% END %]
141 </div>
142 <div class="yui-u">
143 <h2>Notes:</h2>
144 <ul>
145 <li>The first line in the file must be a header row defining which columns you are supplying in the import file.</li>
146 <li><b>Download a starter CSV file with all the columns <a href="?sample=1">here</a>.</b>  Values are comma-separated.</li>
147 <li>OR choose which fields you want to supply from the following list:<ul><li>
148     [% FOREACH columnkey IN columnkeys %]'[% columnkey.key %]', [% END %]
149 </li></ul></li>
150 [% IF ( ExtendedPatronAttributes ) %]
151 <li>If loading patron attributes, the 'patron_attributes' field should contain a comma-separated list of attribute types and values. The attribute type code and a colon should precede each value. For example: <b>INSTID:12345,LANG:fr</b> or <b>STARTDATE:January 1 2010,TRACK:Day</b>. If an input record has more than one attribute, the fields should either be entered as an unquoted string (previous examples), or with each field wrapped in separate double quotes and delimited by a comma: <b>&quot;STARTDATE:January 1, 2010&quot;,&quot;TRACK:Day&quot;</b>.  The second syntax would be required if the data might have a comma in it, like a date string.
152 </li>
153 [% END %]
154 <li>The fields 'branchcode' and 'categorycode' are <b>required</b> and <b>must match</b> valid entries in your database.</li>
155 <li>'password' should be stored in plaintext, and will be converted to a MD5 hash (if your passwords are already encrypted, talk to your system administrator about options).</li>
156 <li>Date formats should match your system preference, and <b>must</b> be zero-padded, e.g. '01/02/2008'.  Alternatively,
157 you can supply dates in ISO format (e.g., '2010-10-28').
158 </li>
159 </ul>
160
161      </div>
162     </div>
163    </div>
164   </div>
165   <div class="yui-b noprint">
166 [% INCLUDE 'tools-menu.inc' %]
167   </div>
168  </div>
169 [% INCLUDE 'intranet-bottom.inc' %]