</varlistentry>
<varlistentry>
+ <term>pz:pqf_strftime</term>
+ <listitem>
+ <para>
+ Allows you to extend a query with dates and operators.
+ The provided string allows certain substitutions and serves as a
+ format string.
+ The special two character sequence '%%' gets converted to the
+ original query. Other characters leading with the percent sign are
+ conversions supported by strftime.
+ All other characters are copied verbatim. For example, the string
+ <literal>@and @attr 1=30 @attr 2=3 %Y %%</literal>
+ would search for current year combined with the original PQF (%%).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>pz:sort</term>
<listitem>
<para>
CCL_bibset ccl_map = prepare_cclmap(cl);
const char *sru = session_setting_oneval(sdb, PZ_SRU);
const char *pqf_prefix = session_setting_oneval(sdb, PZ_PQF_PREFIX);
+ const char *pqf_strftime = session_setting_oneval(sdb, PZ_PQF_STRFTIME);
if (!ccl_map)
return -1;
wrbuf_puts(se->wrbuf, pqf_prefix);
wrbuf_puts(se->wrbuf, " ");
}
- ccl_pquery(se->wrbuf, cn);
+ if (!pqf_strftime || !*pqf_strftime)
+ ccl_pquery(se->wrbuf, cn);
+ else
+ {
+ time_t cur_time = time(0);
+ struct tm *tm = localtime(&cur_time);
+ char tmp_str[300];
+ const char *cp = tmp_str;
+
+ /* see man strftime(3) for things .. In particular %% gets converted
+ to %.. And That's our original query .. */
+ strftime(tmp_str, sizeof(tmp_str)-1, pqf_strftime, tm);
+ for (; *cp; cp++)
+ {
+ if (cp[0] == '%')
+ ccl_pquery(se->wrbuf, cn);
+ else
+ wrbuf_putc(se->wrbuf, cp[0]);
+ }
+ }
xfree(cl->pquery);
cl->pquery = xstrdup(wrbuf_cstr(se->wrbuf));
<set name="pz:xslt" value="auto"/>
<set name="pz:apdulog" value="1"/>
+ <set name="pz:pqf_strftime" value="@or %% %Y"/>
<!-- Examples of application-specific setting -->
<!-- Available in output record and/or normalization stylesheet -->