fixed nano handling for saved queries; layout improvements

This commit is contained in:
following 2013-02-23 19:10:38 +01:00
parent cc2792ddb3
commit 8b6aea4e09
6 changed files with 75 additions and 31 deletions

View File

@ -1474,8 +1474,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('628', 'With the
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('629', 'Store query', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('630', 'Store options as new search', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('631', 'Name of the search', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('632', 'You have to enter a name for this search', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('633', 'There already exists a search with this name', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('632', 'You have to enter a name for this search.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('633', 'There already exists a search with this name.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('634', 'Store', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('635', 'Overwrite old search options', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('636', '-- Select search to overwrite --', '2010-08-28 11:48:04');
@ -2275,6 +2275,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1832', 'Rights'
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1833', 'Admin rights can be granted and revoked by a system administrator with database access.', '2013-02-19 05:40:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1834', 'declined data license', '2013-02-19 05:40:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1835', 'The user account has been disabled, because the user declined the <a href=\"articles.php?page=impressum#datalicense\">data license</a>. Cache descriptions, log texts and pictures have been deleted.', '2013-02-19 05:40:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1839', 'You must select a search to overwrite.', '2013-02-23 19:00:04');
-- Table sys_trans_ref
SET NAMES 'utf8';
@ -5021,8 +5022,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('629', 'DE', 'Suche speichern', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('630', 'DE', 'Suchoptionen als neue Suche abspeichern', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('631', 'DE', 'Name der Suche', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'DE', 'Es muss ein Name der Suche angegeben werden', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'DE', 'Es existiert bereits eine Suche unter diesem Namen', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'DE', 'Es muss ein Name der Suche angegeben werden.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'DE', 'Es existiert bereits eine Suche unter diesem Namen.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('634', 'DE', 'Speichern', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('635', 'DE', 'Alte Suchoptionen überschreiben', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('636', 'DE', '-- Bitte zu überschreibende Suche auswählen --', '2010-08-28 11:48:06');
@ -5820,6 +5821,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1833', 'DE', 'Adminrechte können von einem Systemadministrator mit Datenbankzugriff vergeben oder entzogen werden.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1834', 'DE', 'Datenlizenz abgelehnt', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1835', 'DE', 'Das Benutzerprofil wurde deaktiviert, weil der Benutzer die <a href=\"articles.php?page=impressum#datalicense\">Datenlizenz</a> abgelehnt hat. Cachebeschreibungen, Logtexte und Bilder des Benutzers wurden entfernt.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1839', 'DE', 'Es muss eine zu überschreibende Suche gewählt werden.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs \r', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing please do not login', '2010-08-28 11:48:07');
@ -6438,8 +6440,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('629', 'EN', 'Store query', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('630', 'EN', 'Store options as a new search', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('631', 'EN', 'Name of the search', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'EN', 'You have to enter a name for this search', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'EN', 'A search with this name already exists', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'EN', 'You have to enter a name for this search.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'EN', 'A search with this name already exists.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('634', 'EN', 'Store', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('635', 'EN', 'Overwrite old search options', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('636', 'EN', '-- Select search to overwrite --', '2010-08-28 11:48:07');
@ -7239,6 +7241,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1833', 'EN', 'Admin rights can be granted and revoked by a system administrator with database access.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1834', 'EN', 'declined data license', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1835', 'EN', 'The user account has been disabled, because the user declined the <a href=\"articles.php?page=impressum#datalicense\">data license</a>. Cache descriptions, log texts and pictures have been deleted.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1839', 'EN', 'You must select a search to overwrite.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'ES', 'Reordenar ID', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'ES', 'La base de datos no se pudo conectar.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'ES', 'En pruebas - por favor, no entre.', '2010-12-09 00:17:55');
@ -7857,8 +7860,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('629', 'ES', 'Guardar búsqueda', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('630', 'ES', 'Opciones de búsqueda guardar como una nueva búsqueda', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('631', 'ES', 'Nombre de la búsqueda', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'ES', 'Usted tiene que introducir un nombre para esta búsqueda', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'ES', 'Existe una búsqueda con el mismo nombre', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'ES', 'Usted tiene que introducir un nombre para esta búsqueda.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'ES', 'Existe una búsqueda con el mismo nombre.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('634', 'ES', 'Guardar', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('635', 'ES', 'Opción de sobreescribir búsquedas antiguas', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('636', 'ES', '-- Seleccione la búsqueda para sobrescribir --', '2010-12-09 00:17:57');
@ -9356,8 +9359,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('629', 'IT', 'Salva ricerca', '2010-09-01 23:49:03');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('630', 'IT', 'Salva le opzioni di ricerca in una nuova ricerca', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('631', 'IT', 'Nome della ricerca', '2010-09-01 23:49:03');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'IT', 'Devi inserire un nome per questa ricerca', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'IT', 'Esiste già una ricerca con questo nome', '2010-09-01 23:49:03');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'IT', 'Devi inserire un nome per questa ricerca.', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'IT', 'Esiste già una ricerca con questo nome.', '2010-09-01 23:49:03');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('634', 'IT', 'Salva', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('635', 'IT', 'Sovrascrivi le vecchie opzioni di ricerca', '2010-09-01 23:49:03');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('636', 'IT', '-- Seleziona una ricerca da sovrascrivere --', '2010-08-31 20:06:23');
@ -10769,8 +10772,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('629', 'NL', 'Zoekopdracht opslaan', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('630', 'NL', 'Bewaar zoekopties voor zoekopdracht', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('631', 'NL', 'Naam van zoekopdracht', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'NL', 'Er moet een naam voor de zoekopdracht opgegeven worden', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'NL', 'Er bestaat al een zoekopdracht met deze naam', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('632', 'NL', 'Er moet een naam voor de zoekopdracht opgegeven worden.', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('633', 'NL', 'Er bestaat al een zoekopdracht met deze naam.', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('634', 'NL', 'Opslaan', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('635', 'NL', 'Oude zoekopties overschrijven', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('636', 'NL', 'Het over te schrijven zoekopdracht kiezen', '2011-02-04 19:50:07');

View File

@ -344,7 +344,7 @@ function switchAttributeCat2()
<td>
<table class="table">
<tr>
<td><input type="checkbox" id="cachesize8" name="cachesize8" value="8" onclick="javascript:sync_options(this)" class="checkbox" {cachesize2checked} /> <label for="cachesize2">{t}nano{/t}</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><input type="checkbox" id="cachesize8" name="cachesize8" value="8" onclick="javascript:sync_options(this)" class="checkbox" {cachesize8checked} /> <label for="cachesize2">{t}nano{/t}</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><input type="checkbox" id="cachesize2" name="cachesize2" value="2" onclick="javascript:sync_options(this)" class="checkbox" {cachesize2checked} /> <label for="cachesize2">{t}micro{/t}</label></td>
<td><input type="checkbox" id="cachesize3" name="cachesize3" value="3" onclick="javascript:sync_options(this)" class="checkbox" {cachesize3checked} /> <label for="cachesize3">{t}small{/t}</label></td>
<td><input type="checkbox" id="cachesize4" name="cachesize4" value="4" onclick="javascript:sync_options(this)" class="checkbox" {cachesize4checked} /> <label for="cachesize4">{t}normal{/t}</label></td>

View File

@ -101,13 +101,15 @@ function savequery($queryid, $queryname, $saveas, $submit, $saveas_queryid)
else
{
if (sql_value("SELECT COUNT(*) FROM `queries` WHERE `id`='&1' AND `user_id`='&2'", 0, $saveas_queryid, $login->userid) == 0)
$tpl->error(ERROR_UNKNOWN);
$tpl->assign('errorMustSelectQuery',true);
else
{
// save as
$oOptions = sql_value("SELECT `options` FROM `queries` WHERE `id`='&1'", array(), $queryid);
sql("UPDATE `queries` SET `options`='&1' WHERE `id`='&2'", $oOptions, $saveas_queryid);
// save as
$oOptions = sql_value("SELECT `options` FROM `queries` WHERE `id`='&1'", array(), $queryid);
sql("UPDATE `queries` SET `options`='&1' WHERE `id`='&2'", $oOptions, $saveas_queryid);
$tpl->redirect('query.php?action=view');
$tpl->redirect('query.php?action=view');
}
}
}

View File

@ -562,6 +562,7 @@ input { border:1px solid black; background-color:white; padding:1px; font-size:1
*.input120 {width:120px;} /* emailadress */
*.input200 {width:200px;}
*.input300 {width:300px;}
*.input350 {width:350px;} /* overwrite saved query */
*.input400 {width:400px;} /* short cachedescription */
input.checkbox {width:12px; height:12px; font-size:12px; border:0;}

View File

@ -57,20 +57,20 @@
{t}Store query{/t}
</div>
<table class="content">
<table class="table">
<tr>
<td class="header-small" colspan="2">{t}Store options as new search{/t}</td>
</tr>
<tr>
<td>{t}Name of the search{/t}</td>
<td>{t}Name of the search{/t}:</td>
<td>
<input type="text" name="queryname" class="input200" maxlength="60" value="{$queryname}" />
<input type="text" name="queryname" class="input300" maxlength="60" value="{$queryname}" />
</td>
</tr>
{if $errorEmptyName==true}
<tr><td colspan="2"><span class="errormsg">{t}You have to enter a name for this search{/t}</span></td></tr>
<tr><td colspan="2"><span class="errormsg">{t}You have to enter a name for this search.{/t}</span></td></tr>
{elseif $errorNameExists==true}
<tr><td colspan="2" class="errormsg">{t}There already exists a search with this name{/t}</td></tr>
<tr><td colspan="2" class="errormsg">{t}There already exists a search with this name.{/t}</td></tr>
{/if}
<tr>
<td>&nbsp;</td>
@ -81,22 +81,20 @@
</table>
</form>
<p>&nbsp;</p>
<form action="query.php" method="post">
<input type="hidden" name="action" value="saveas" />
<input type="hidden" name="queryid" value="{$queryid}" />
<input type="hidden" name="submit" value="1" />
<table class="content">
<colgroup>
<col width="150">
<col>
</colgroup>
<table class="table">
<tr>
<td class="header-small" colspan="2">{t}Overwrite old search options{/t}</td>
</tr>
<tr>
<td>{t}Name of the search{/t}</td>
<td>{t}Name of the search{/t}:</td>
<td>
<select name="oldqueryid" class="input300">
<select name="oldqueryid" class="input350">
{foreach from=$queries item=queriesItem name="queries"}
{if $smarty.foreach.queries.first}
<option value="0" selected="selected">{t}-- Select search to overwrite --{/t}</option>
@ -108,6 +106,9 @@
</select>
</td>
</tr>
{if $errorMustSelectQuery==true}
<tr><td colspan="2" class="errormsg">{t}You must select a search to overwrite.{/t}</td></tr>
{/if}
<tr>
<td>&nbsp;</td>
<td>

View File

@ -0,0 +1,37 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* This script was used for adding nano queries when nano size was implemented.
* It may be adopted for future additions of cache sizes or types.
*
* Unicode Reminder ??
***************************************************************************/
$opt['rootpath'] = '../../';
require($opt['rootpath'] . 'lib2/web.inc.php');
$rs = sql("SELECT * FROM queries");
while ($r = sql_fetch_array($rs))
{
$query = unserialize($r['options']);
if (isset($query['cachesize']))
{
$cachesize = $query['cachesize'];
// add nano size to all queries that include micro or other
if (preg_match('/[;][12][;]/', ';'.$cachesize.';') &&
!preg_match('/[;][8][;]/', ';'.$cachesize.';'))
{
// echo $r['name'] . ": " . $cachesize . " -> " . $query['cachesize'] .= ";8\n";
$query['cachesize'] .= ";8";
$saveopt = serialize($query);
// sql("UPDATE queries SET `options`='&1' WHERE `id`='&2'", $saveopt, $r['id']);
// ^^ run this line only if you are absolutely sure what you are doing
echo "added nano to query " . $r['id'] . "(" . $cachesize . ") of user " . $r['user_id'] . "\n";
}
}
}
sql_free_result($rs);
?>