Example #1
0
 /**
  * Display only a search box for searching an action
  * @param $cn database connx
  */
 static function display_search($cn, $inner = false)
 {
     $a = isset($_GET['action_query']) ? $_GET['action_query'] : "";
     $qcode = isset($_GET['qcode']) ? $_GET['qcode'] : "";
     $supl_hidden = '';
     if (isset($_REQUEST['sc'])) {
         $supl_hidden .= HtmlInput::hidden('sc', $_REQUEST['sc']);
     }
     if (isset($_REQUEST['f_id'])) {
         $supl_hidden .= HtmlInput::hidden('f_id', $_REQUEST['f_id']);
         $f = new Fiche($cn, $_REQUEST['f_id']);
         $supl_hidden .= HtmlInput::hidden('qcode_dest', $f->get_quick_code());
     }
     if (isset($_REQUEST['sb'])) {
         $supl_hidden .= HtmlInput::hidden('sb', $_REQUEST['sb']);
     }
     $supl_hidden .= HtmlInput::hidden('ac', $_REQUEST['ac']);
     /**
      * Show the default button (add action, show search...)
      */
     if (!$inner) {
         require_once NOALYSS_INCLUDE . '/template/action_button.php';
     }
     $w = new ICard();
     $w->name = 'qcode';
     $w->id = $w->generate_id($w->name);
     $w->value = $qcode;
     $w->extra = "all";
     $w->typecard = 'all';
     $w->jrn = 0;
     $w->table = 0;
     $list = $cn->make_list("select fd_id from fiche_def where frd_id in (4,8,9,14,15,16,25)");
     $w->extra = $list;
     /* type of documents */
     $type_doc = new ISelect('tdoc');
     $aTDoc = $cn->make_array('select dt_id,dt_value from document_type order by dt_value');
     $aTDoc[] = array('value' => '-1', 'label' => _('Tous les types'));
     $type_doc->value = $aTDoc;
     $type_doc->selected = isset($_GET['tdoc']) ? $_GET['tdoc'] : -1;
     /* State of documents */
     $type_state = new ISelect('state');
     $aState = $cn->make_array('select s_id,s_value from document_state order by s_value');
     $aState[] = array('value' => '-1', 'label' => _('Tous les Etats'));
     $type_state->value = $aState;
     $type_state->selected = isset($_GET['state']) ? $_GET['state'] : -1;
     /* Except State of documents */
     $hsExcptype_state = new ISelect('hsstate');
     $aExcpState = $cn->make_array('select s_id,s_value from document_state order by s_value');
     $aExcpState[] = array('value' => '-1', 'label' => _('Aucun'));
     $hsExcptype_state->value = $aExcpState;
     $hsExcptype_state->selected = isset($_GET['hsstate']) ? $_GET['hsstate'] : -1;
     // date
     $start = new IDate('date_start');
     $start->value = isset($_GET['date_start']) ? $_GET['date_start'] : "";
     $end = new IDate('date_end');
     $end->value = isset($_GET['date_end']) ? $_GET['date_end'] : "";
     // Closed action
     $closed_action = new ICheckBox('closed_action');
     $closed_action->selected = isset($_GET['closed_action']) ? true : false;
     // Internal
     $only_internal = new ICheckBox('only_internal');
     $only_internal->selected = isset($_GET['only_internal']) ? true : false;
     // select profile
     $aAg_dest = $cn->make_array("select  p_id as value, " . "p_name as label " . " from profile order by 2");
     $aAg_dest[] = array('value' => '-2', 'label' => _('Tous les profiles'));
     $ag_dest = new ISelect();
     $ag_dest->name = "ag_dest_query";
     $ag_dest->value = $aAg_dest;
     $ag_dest->selected = isset($_GET["ag_dest_query"]) ? $_GET["ag_dest_query"] : -2;
     $str_ag_dest = $ag_dest->input();
     $osag_ref = new IText("sag_ref");
     $osag_ref->value = isset($_GET['sag_ref']) ? $_GET['sag_ref'] : "";
     $remind_date = new IDate('remind_date');
     $remind_date->value = isset($_GET['remind_date']) ? $_GET['remind_date'] : "";
     $remind_date_end = new IDate('remind_date_end');
     $remind_date_end->value = isset($_GET['remind_date_end']) ? $_GET['remind_date_end'] : "";
     $otag = new Tag($cn);
     // show the  action in
     require_once NOALYSS_INCLUDE . '/template/action_search.php';
 }