public function dsp_button() { $this->id = $this->id == "" ? $this->name : $this->id; $javascript = 'search_poste(this)'; $button = HtmlInput::button_image($javascript, $this->id . "_bt", 'alt="' . _('Recherche') . '" class="image_search"', "image/magnifier13.png"); /* add the property */ $sc = $this->get_js_attr(); return $button . $sc; }
/** *@brief return a string containing the button for displaying * a search form. When clicking on the result, update the input text file * the common used attribute as * - jrn the ledger * - label the field to update * - name name of the input text * - price amount * - tvaid * - typecard (deb, cred, filter or list of value) * will be set * if ICard is in readOnly, the button disappears, so the return string is empty \code // search ipopup $search_card=new IPopup('ipop_card'); $search_card->title=_('Recherche de fiche'); $search_card->value=''; echo $search_card->input(); $a=new ICard('test'); $a->search(); \endcode *\see ajax_card.php *\note the ipopup id is hard coded : ipop_card *@return HTML string with the button */ function search() { if ($this->readOnly == true) { return ''; } if (!isset($this->id)) { $this->id = $this->name; } $a = ""; foreach (array('typecard', 'jrn', 'label', 'price', 'tvaid') as $att) { if (isset($this->{$att})) { $a .= "this." . $att . "='" . $this->{$att} . "';"; } } if (isset($this->id) && $this->id != "") { $a .= "this.inp='" . $this->id . "';"; } else { $a .= "this.inp='" . $this->name . "';"; } $a .= "this.popup='ipop_card';"; $javascript = $a . ' search_card(this);return false;'; $button = HtmlInput::button_image($javascript, $this->name . "_bt", 'alt="' . _('Recherche') . '" class="image_search"', "image/magnifier13.png"); return $button; }