+
+';
echo dossier::hidden();
echo HtmlInput::hidden('ac', $ac);
require_once NOALYSS_TEMPLATE.'/impress_cat_card.php';
echo HtmlInput::submit('cat_display', _('Recherche'));
echo '';
-$search_card=new IText('card_search');
-$search_card_js=sprintf('onclick="boxsearch_card(\'%d\')"',dossier::id());
-?>
-
- :input()?>
-
-
-';
$str = "if (g('histo').value==3 || g('histo').value== -1 ) {
g('trstart').style.display='none';g('trend').style.display='none';g('allcard').style.display='none';}
diff --git a/include/profile.inc.php b/include/profile.inc.php
index 41d0bc8b2..b68d67c52 100644
--- a/include/profile.inc.php
+++ b/include/profile.inc.php
@@ -107,31 +107,35 @@ if (isset($_POST['change_stock']))
if (isset($_POST['save_name']))
{
-
- extract($_POST, EXTR_SKIP);
+ $http=new HttpInput();
+ $p_name=$http->post("p_name");
+ $p_id=$http->post("p_id");
+ $with_calc=$http->post("with_calc","string",'f');
+ $with_direct_form=$http->post("with_direct_form","string",'f');
+ $with_search_card=$http->post("with_search_card","string",0);
+ $p_desc=$http->post('p_desc');
try
{
if (strlen(trim($p_name))==0)
throw new Exception("Nom ne peut être vide");
if (isNumber($p_id)==0)
throw new Exception("profile Invalide");
- $wc=(isset($with_calc))?1:0;
- $wd=(isset($with_direct_form))?1:0;
$p_desc=(strlen(trim($p_desc))==0)?null:trim($p_desc);
if ($p_id!=-1)
{
$cn->exec_sql("update profile set p_name=$1,p_desc=$2,
- with_calc=$3, with_direct_form=$4 where p_id=$5",
+ with_calc=$3, with_direct_form=$4 ,with_search_card=$6
+ where p_id=$5",
array($p_name,
- $p_desc, $wc, $wd, $p_id));
+ $p_desc, $with_calc, $with_direct_form, $p_id,$with_search_card));
}
else
{
$p_id=$cn->get_value("insert into profile (p_name,
- p_desc,with_calc,with_direct_form) values
- ($1,$2,$3,$4) returning p_id",
+ p_desc,with_calc,with_direct_form,with_search_card) values
+ ($1,$2,$3,$4,$5) returning p_id",
array(
- $p_name, $p_desc, $wc, $wd
+ $p_name, $p_desc, $with_calc, $with_direct_form,$with_search_card
));
}
}
@@ -150,9 +154,9 @@ if (isset($_POST['clone']))
$p_id = $http->post("p_id","number", 0);
$cn->start();
$new_id=$cn->get_value("insert into profile(p_name,p_desc,with_calc,
- with_direct_form)
+ with_direct_form,with_search_card)
select 'copie de '||p_name,p_desc,with_calc,
- with_direct_form from profile where p_id=$1 returning p_id", array($p_id));
+ with_direct_form , with_search_card from profile where p_id=$1 returning p_id", array($p_id));
$cn->exec_sql("
insert into profile_menu (p_id,me_code,me_code_dep,p_order,p_type_display,pm_default)
select $1,me_code,me_code_dep,p_order,p_type_display,pm_default from profile_menu
@@ -406,7 +410,7 @@ $profile_mobile->create_js_script();
// Show details of the selected profile
//*******************************************************
echo '
';
-if (isset($_POST['p_id']))
+if (isset($_POST['p_id']) && $_POST['p_id'] != -1 )
{
require_once NOALYSS_INCLUDE.'/ajax/ajax_get_profile.php';
?>
diff --git a/include/sql/patch/upgrade167.sql b/include/sql/patch/upgrade167.sql
new file mode 100644
index 000000000..d79e3353d
--- /dev/null
+++ b/include/sql/patch/upgrade167.sql
@@ -0,0 +1,7 @@
+begin;
+alter table profile add column with_search_card integer;
+comment on column profile.with_search_card is 'Display a icon for searching card : 1 display, 0 not displaid';
+
+update profile set with_search_card =1;
+insert into version (val,v_description) values (168,'Button search card');
+commit ;
diff --git a/include/template/module.php b/include/template/module.php
index d25416d9f..264bb074d 100644
--- a/include/template/module.php
+++ b/include/template/module.php
@@ -18,6 +18,36 @@ if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
echo '
';
endif;
+// show search card
+if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
+ where user_name=$1 and with_search_card=1",array($_SESSION[SESSION_KEY.'g_user'])) ==1):
+ $search_card=new IText('card_search');
+ $search_card_js=sprintf('onclick="boxsearch_card(\'%d\')"',dossier::id());
+ echo Icon_Action::button_magnifier(uniqid(), "$('box_search_card').show()");
+ echo '
';
+ echo HtmlInput::title_box(_("recherche"), "box_search_card","hide");
+ echo _('Recherche de fiche');
+ echo '
';
+ echo _("Donnez une partie du nom, prénom, de la description, du poste comptable, du n° de TVA,quick code ... "
+ . " de la fiche" ) ;
+ echo '
';
+ echo '
';
+ echo $search_card->input();
+ echo '
';
+ echo '
';
+
+ echo '- '.
+ HtmlInput::button_anchor(_("Chercher"),"javascript:void(0)","",$search_card_js,'button').
+ '
';
+
+ echo '- '.
+ HtmlInput::button_hide("box_search_card").
+ '
';
+ echo '
';
+ echo '
';
+endif;
+
+
if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
where user_name=$1 and with_direct_form=true",array($_SESSION[SESSION_KEY.'g_user'])) ==1):
?>
diff --git a/include/template/profile.php b/include/template/profile.php
index 39a78ffb5..5d6529555 100644
--- a/include/template/profile.php
+++ b/include/template/profile.php
@@ -45,4 +45,8 @@
|
input()?> |
+
+ |
+ input()?> |
+
\ No newline at end of file