22if (!defined(
'ALLOWED'))
23 die(
'Appel direct ne sont pas permis');
37if (
$op==
'save_filter')
47 $new->setp(
"login",
$g_user->login);
48 $new->setp(
"nb_jrn",
$http->post(
"nb_jrn",
'number'));
49 $new->setp(
"date_start",
$http->post(
"date_start",
'string', NULL));
50 $new->setp(
"date_end",
$http->post(
"date_end",
'string', NULL));
51 $new->setp(
"description",
$http->post(
"desc",
'string', NULL));
52 $new->setp(
"amount_min",
$http->post(
"amount_min",
'number', NULL));
53 $new->setp(
"amount_max",
$http->post(
"amount_max",
'number', NULL));
54 $new->setp(
"qcode",
$http->post(
"qcode",
'string', NULL));
55 $new->setp(
"accounting",
$http->post(
"accounting",
'string', NULL));
56 $new->setp(
"uf_tag_option",
$http->post(
"tag_option",
"string",
null));
57 $new->setp(
"date_paid_start",
58 $http->post(
"date_paid_start",
'string', NULL));
59 $new->setp(
"date_paid_end",
$http->post(
"date_paid_end",
'string', NULL));
60 $new->setp(
"ledger_type",
$http->post(
"ledger_type",
'string'));
61 $new->setp(
"operation_filter",
$http->post(
"operation_filter",
'string', NULL));
62 $new->setp(
"filter_name",
h(
$http->post(
"filter_name",
'string')));
63 $new->setp(
"uf_currency_code",
h(
$http->post(
"p_currency_code",
'number',-1)));
64 $new->setp(
"tva_id_search",
h(
$http->post(
"tva_id_search",
'string',
null)));
68 $new->setp(
"uf_tag",join(
',',
$tag));
70 $new->setp(
"uf_tag",
null);
75 $aJrn[]=
$http->post(
"r_jrn".
$i,
"number");
77 $new->setp(
"r_jrn", join(
',', $aJrn));
78 if (strlen($new->getp(
"filter_name"))==0)
80 throw new Exception(_(
"Nom ne peut être vide"));
83 $rmAction=sprintf(
"delete_filter('%s','%s','%s')", trim(
$http->post(
'div')),
$dossier_id,
86 $answer[
'filter_name'].=sprintf(
"<a class=\"line\" style=\"display:inline;text-decoration:underline\" onclick=\"load_filter('%s','%s','%s')\">%s</a>",
88 $new->getp(
"filter_name"));
89 $answer[
'filter_name'].=
'<span id="'.uniqid().
'" onclick="'.$rmAction.
'" class="icon" style="display:inline;margin-left:2em"></span>';;
90 $answer[
'filter_id']=$new->getp(
"id");
98 header(
'Content-Type: application/json;charset=utf-8');
105if (
$op==
"load_filter")
107 $filter_id=
$http->get(
"filter_id",
"number");
118 header(
'Content-Type: application/json;charset=utf-8');
126if (
$op==
"display_search_filter")
128 $p_div=
$http->get(
"div");
138 select id, filter_name,ledger_type
146 printf(
'<ul class="select_table" id="manage%s">', $p_div);
150 echo $search_filter->build_name_filter();
154 echo
HtmlInput::anchor(_(
"Remise à zéro"),
"",
"style=\"text-decoration:underline\" onclick=\"reset_filter('$p_div');removeDiv('boxfilter{$p_div}')\"");
158 for (
$i=0;
$i<$nb_result;
$i++)
160 printf(
' <li id="manageli%s_%d">', $p_div,
$result[
$i][
"id"]);
161 $rmAction=sprintf(
"delete_filter('%s','%s','%s')", $p_div,
$dossier_id,
163 printf(
"<a href=\"javascript:void(0)\" style=\"display:inline;text-decoration:underline\" onclick=\"load_filter('%s','%s','%s');removeDiv('boxfilter%s')\">",
167 echo
'<span id="'.uniqid().
'" onclick="'.$rmAction.
'" class="icon" style="display:inline;margin-left:2em"></span>';
179if (
$op==
"delete_search_operation")
188 $p_div=
$http->post(
"div");
189 $filter_id=
$http->post(
"filter_id",
"number");
193 $cn->exec_sql(
"delete from user_filter where id=$1 and login=$2",[$filter_id,
$g_user->login]);
195 $answer[
'filter_id']=$filter_id;
198 catch (Exception
$ex)
202 header(
'Content-Type: application/json;charset=utf-8');
209if (
$op==
'display_filter_tag')
212 if ( trim(
$tag)==
"") {
return;}
217 $nb_tag=count(
$aTag);
218 for ($j=0; $j<$nb_tag; $j++)
229if (
$op==
'display_list_filter')
231 echo \HtmlInput::title_box(
"Recherches sauvées",
'display_list_filter_div');
234 $ledger_search->display_list_filter();
238 <ul
class=
"aligned-block">
h( $row[ 'oa_description'])
static build_array(User_Filter_SQL $user_filter_sql)
use a user_filter row and turns it into an array for javascript purpose
static id()
return the 'gDossier' value after a check
concerns the tags linked to an accountancy writing
ORM abstract of the table public.user_filter.