Skip to content

Commit 244173b

Browse files
committed
Fixed a small issue in a form
1 parent ca27020 commit 244173b

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

site/controllers/search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php/** * * Copyright (c) 2006-2024 LogicalDOC * WebSites: www.logicaldoc.com * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */defined('_JEXEC') or die;jimport('joomla.application.component.controller');use Joomla\CMS\Factory;use Joomla\CMS\MVC\Controller\BaseController;class LogicalDOCControllerSearch extends BaseController{ public function searchAdvanced() { Factory::getApplication()->input->set('view', 'search'); Factory::getApplication()->input->set('layout', 'result'); Factory::getApplication()->input->set('contenido', Factory::getApplication()->input->get('contenido','','string')); Factory::getApplication()->input->set('nombre', Factory::getApplication()->input->get('nombre')); Factory::getApplication()->input->set('palabraClave', Factory::getApplication()->input->get('palabraClave')); Factory::getApplication()->input->set('documento', Factory::getApplication()->input->get('documento')); Factory::getApplication()->input->set('carpeta', Factory::getApplication()->input->get('carpeta')); Factory::getApplication()->input->set('correoElectronico', Factory::getApplication()->input->get('correoElectronico')); Factory::getApplication()->input->set('tipoDocumento', Factory::getApplication()->input->get('tipoDocumento')); $this->display(); } public function display($cachable = false, $urlparams = false) { parent::display(); } public function returnDesktop() { Factory::getApplication()->input->set('view', 'explorer'); Factory::getApplication()->input->set('layout', 'view'); $entrar = 1; Factory::getApplication()->input->set('entrar', $entrar); $this->display(); } public function download() { //error_reporting(0); ob_end_clean(); require_once(JPATH_COMPONENT . '/download.php'); exit(); }}?>
1+
<?php/** * * Copyright (c) 2006-2024 LogicalDOC * WebSites: www.logicaldoc.com * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */defined('_JEXEC') or die;jimport('joomla.application.component.controller');use Joomla\CMS\Factory;use Joomla\CMS\MVC\Controller\BaseController;class LogicalDOCControllerSearch extends BaseController{ public function searchAdvanced() { Factory::getApplication()->input->set('view', 'search'); Factory::getApplication()->input->set('layout', 'result'); Factory::getApplication()->input->set('contenido', Factory::getApplication()->input->get('contenido','','string')); Factory::getApplication()->input->set('nombre', Factory::getApplication()->input->get('nombre')); Factory::getApplication()->input->set('palabraClave', Factory::getApplication()->input->get('palabraClave')); Factory::getApplication()->input->set('documento', Factory::getApplication()->input->get('documento')); Factory::getApplication()->input->set('carpeta', Factory::getApplication()->input->get('carpeta')); Factory::getApplication()->input->set('correoElectronico', Factory::getApplication()->input->get('correoElectronico')); Factory::getApplication()->input->set('tipoDocumento', Factory::getApplication()->input->get('tipoDocumento','','string')); $this->display(); } public function display($cachable = false, $urlparams = false) { parent::display(); } public function returnDesktop() { Factory::getApplication()->input->set('view', 'explorer'); Factory::getApplication()->input->set('layout', 'view'); $entrar = 1; Factory::getApplication()->input->set('entrar', $entrar); $this->display(); } public function download() { //error_reporting(0); ob_end_clean(); require_once(JPATH_COMPONENT . '/download.php'); exit(); }}?>

site/views/explorer/tmpl/form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php/** * Copyright (c) 2006-2024 LogicalDOC * WebSites: www.logicaldoc.com * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */defined( '_JEXEC' ) or die;use Joomla\CMS\Factory;use Joomla\CMS\Language\Text;?><script type="text/javascript"> $(document).ready(function(){ $("#searchAdvanced").button().click(function() { var contenido = $('#contenido').val(); var nombre = $('#nombre').val(); var palabraClave = $('#palabraClave').val(); if (contenido != '' || nombre != '' || palabraClave != ''){ document.formSearchAdvanced.task.value = 'searchAdvanced'; document.formSearchAdvanced.submit(); } else{ $('#nombre').validationEngine('showPrompt', '<?= Text::_('COM_LOGICALDOC_SOME_OF_THESE_FIELDS_ARE_REQUIRED')?>', 'error', true); return false; } }); $('*').keypress(function(e){ //funciona cuando se preciona la tecla enter if (e.keyCode == 13){ var contenido = $('#contenido').val(); var nombre = $('#nombre').val(); var palabraClave = $('#palabraClave').val(); if (contenido != '' || nombre != '' || palabraClave != ''){ document.formSearchAdvanced.task.value = 'searchAdvanced'; document.formSearchAdvanced.submit(); } else{ $('#nombre').validationEngine('showPrompt', '<?= Text::_('COM_LOGICALDOC_SOME_OF_THESE_FIELDS_ARE_REQUIRED')?>', 'error', true); return false; } } }); $("#searchReturn").button().click(function() { document.formSearch.task.value = 'returnDesktop'; document.formSearch.submit(); }); $("#tab").tabs(); $('#formSearchAdvanced').validationEngine(); });</script><form action= "" method="post" name="formSearchAdvanced" id="formSearchAdvanced"> <div id="tab"> <ul> <li><a href="#dato"><?= Text::_('COM_LOGICALDOC_ADVANCED_SEARCH') ?></a></li> </ul> <div id="dato"> <table id="datoTable" align="center"> <tr> <td style="text-align: right"><?= Text::_('COM_LOGICALDOC_CONTENT') ?>:</td> <td> <input type="text" name="contenido" id="contenido" value="" /> </td> </tr> <tr> <td style="text-align: right">Search Fields:</td> <?php $input = Factory::getApplication()->input; $val = $input->get('sfields', array(), 'array'); $contentChecked = in_array('content', $val) ? 'checked' : ''; $titleChecked = in_array('title', $val) ? 'checked' : ''; $tagsChecked = in_array('tags', $val) ? 'checked' : ''; ?> <td> <input type="checkbox" name="sfields[]" id="sfieldsc" value="content" <?= $contentChecked ?> />Content <input type="checkbox" name="sfields[]" id="sfieldst" value="title" <?= $titleChecked ?> />Name <input type="checkbox" name="sfields[]" id="sfieldsk" value="tags" <?= $tagsChecked ?> />Tags </td> </tr> <tr> <td><?= Text::_('COM_LOGICALDOC_DOCUMENT_TYPE') ?>:</td> <td> <select id="tipoDocumento" name="tipoDocumento"> <option value=""></option> <option value="pdf,doc,docx,odt,rtf" <?php if ($this->sessionSearch->get('tipoDocumento') == 'pdf,doc,docx,odt,rtf') echo "selected"; ?>>Document</option> <option value="xls,xlsx,ods" <?php if ($this->sessionSearch->get('tipoDocumento') == 'xls,xlsx,ods') echo "selected"; ?>>Spreadsheet</option> <option value="ppt,pptx,odp" <?php if ($this->sessionSearch->get('tipoDocumento') == 'ppt,pptx,odp') echo "selected"; ?>>Presentation</option> <option value="txt,html,htm,xml" <?php if ($this->sessionSearch->get('tipoDocumento') == 'txt,html,htm,xml') echo "selected"; ?>>Text</option> <option value="jpg,jpeg,png,gif,tif,tiff,psd,dwg,bmp,webp" <?php if ($this->sessionSearch->get('tipoDocumento') == 'jpg,jpeg,png,gif,tif,tiff,psd,dwg,bmp,webp') echo "selected"; ?>>Image</option> <option value="mp3,wav,m4a" <?php if ($this->sessionSearch->get('tipoDocumento') == 'mp3,wav,m4a') echo "selected"; ?>>Audio</option> <option value="avi,mkv,mp4,wmv" <?php if ($this->sessionSearch->get('tipoDocumento') == 'avi,mkv,mp4,wmv') echo "selected"; ?>>Video</option> <option value="eml,msg" <?php if ($this->sessionSearch->get('tipoDocumento') == 'eml,msg') echo "selected"; ?>>Email</option> </select> </td> </tr> </table> </div> <table width="100%" id="buttonTable"> <tr> <td align="right" colspan="2"> <button id="searchReturn"> <?= Text::_('COM_LOGICALDOC_GO_BACK') ?> </button> <button id="searchAdvanced"> <?= Text::_('COM_LOGICALDOC_SEARCH') ?> </button> </td> </tr> </table> <input type="hidden" name="option" value="com_logicaldoc" /> <input type="hidden" name="view" value="search"/> <input type="hidden" name="task" value="" /> <input type="hidden" name="id" value="<?= $this->rowConfiguration->idConfiguration ?>"/> <input type="hidden" name="documento" id="documento" value="1" /> </div><!--fin del tabs--></form>
1+
<?php/** * Copyright (c) 2006-2024 LogicalDOC * WebSites: www.logicaldoc.com * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */defined( '_JEXEC' ) or die;use Joomla\CMS\Factory;use Joomla\CMS\Language\Text;?><script type="text/javascript"> $(document).ready(function(){ $("#searchAdvanced").button().click(function() { var contenido = $('#contenido').val(); var nombre = $('#nombre').val(); var palabraClave = $('#palabraClave').val(); if (contenido != '' || nombre != '' || palabraClave != ''){ document.formSearchAdvanced.task.value = 'searchAdvanced'; document.formSearchAdvanced.submit(); } else{ $('#nombre').validationEngine('showPrompt', '<?= Text::_('COM_LOGICALDOC_SOME_OF_THESE_FIELDS_ARE_REQUIRED')?>', 'error', true); return false; } }); $('*').keypress(function(e){ //funciona cuando se preciona la tecla enter if (e.keyCode == 13){ var contenido = $('#contenido').val(); var nombre = $('#nombre').val(); var palabraClave = $('#palabraClave').val(); if (contenido != '' || nombre != '' || palabraClave != ''){ document.formSearchAdvanced.task.value = 'searchAdvanced'; document.formSearchAdvanced.submit(); } else{ $('#nombre').validationEngine('showPrompt', '<?= Text::_('COM_LOGICALDOC_SOME_OF_THESE_FIELDS_ARE_REQUIRED')?>', 'error', true); return false; } } }); $("#searchReturn").button().click(function() { document.formSearch.task.value = 'returnDesktop'; document.formSearch.submit(); }); $("#tab").tabs(); $('#formSearchAdvanced').validationEngine(); });</script><form action= "" method="post" name="formSearchAdvanced" id="formSearchAdvanced"> <div id="tab"> <ul> <li><a href="#dato"><?= Text::_('COM_LOGICALDOC_ADVANCED_SEARCH') ?></a></li> </ul> <div id="dato"> <table id="datoTable" align="center"> <tr> <td style="text-align: right"><?= Text::_('COM_LOGICALDOC_CONTENT') ?>:</td> <td> <input type="text" name="contenido" id="contenido" value="" /> </td> </tr> <tr> <td style="text-align: right">Search Fields:</td> <td> <input type="checkbox" name="sfields[]" id="sfieldsc" value="content" checked="checked" />Content <input type="checkbox" name="sfields[]" id="sfieldst" value="title" checked="checked" />Name <input type="checkbox" name="sfields[]" id="sfieldsk" value="tags" checked="checked" />Tags </td> </tr> <tr> <td><?= Text::_('COM_LOGICALDOC_DOCUMENT_TYPE') ?>:</td> <td> <select id="tipoDocumento" name="tipoDocumento"> <option value=""></option> <option value="pdf,doc,docx,odt,rtf" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'pdf,doc,docx,odt,rtf')) echo "selected"; ?>>Document</option> <option value="xls,xlsx,ods" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'xls,xlsx,ods')) echo "selected"; ?>>Spreadsheet</option> <option value="ppt,pptx,odp" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'ppt,pptx,odp')) echo "selected"; ?>>Presentation</option> <option value="txt,html,htm,xml" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'txt,html,htm,xml')) echo "selected"; ?>>Text</option> <option value="jpg,jpeg,png,gif,tif,tiff,psd,dwg,bmp,webp" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento')) == 'jpg,jpeg,png,gif,tif,tiff,psd,dwg,bmp,webp') echo "selected"; ?>>Image</option> <option value="mp3,wav,m4a" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'mp3,wav,m4a')) echo "selected"; ?>>Audio</option> <option value="avi,mkv,mp4,wmv" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'avi,mkv,mp4,wmv')) echo "selected"; ?>>Video</option> <option value="eml,msg" <?php if (!empty($this->sessionSearch) && ($this->sessionSearch->get('tipoDocumento') == 'eml,msg')) echo "selected"; ?>>Email</option> </select> </td> </tr> </table> </div> <table width="100%" id="buttonTable"> <tr> <td align="right" colspan="2"> <button id="searchReturn"> <?= Text::_('COM_LOGICALDOC_GO_BACK') ?> </button> <button id="searchAdvanced"> <?= Text::_('COM_LOGICALDOC_SEARCH') ?> </button> </td> </tr> </table> <input type="hidden" name="option" value="com_logicaldoc" /> <input type="hidden" name="view" value="search"/> <input type="hidden" name="task" value="" /> <input type="hidden" name="id" value="<?= $this->rowConfiguration->idConfiguration ?>"/> <input type="hidden" name="documento" id="documento" value="1" /> </div><!--fin del tabs--></form>

0 commit comments

Comments
 (0)