Merge branch 'stable'

This commit is contained in:
following
2013-01-30 16:42:26 +01:00
3 changed files with 35 additions and 10 deletions

View File

@@ -27,7 +27,7 @@
$ownerid = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid']+0 : 0;
$adminid = sql_value("SELECT `adminid` FROM `cache_reports` WHERE `id`=&1", 0, $rid);
if (isset($_REQUEST['assign']) && $rid > 0 && $adminid == 0)
if (isset($_REQUEST['assign']) && $rid > 0) // && $adminid == 0)
{
sql("UPDATE `cache_reports` SET `status`=2, `adminid`=&2 WHERE `id`=&1", $rid, $login->userid);
$tpl->redirect('adminreports.php?id='.$rid);
@@ -115,14 +115,19 @@
`c`.`name`,
`u2`.`username` AS `ownernick`,
`u`.`username`,
`cr`.`lastmodified`
IF(LENGTH(`u3`.`username`)>10, CONCAT(LEFT(`u3`.`username`,9),'.'),`u3`.`username`) AS `adminname`,
`cr`.`lastmodified`,
`cr`.`adminid` IS NOT NULL AND `cr`.`adminid`!=&1 AS otheradmin
FROM `cache_reports` `cr`
INNER JOIN `caches` `c` ON `c`.`cache_id` = `cr`.`cacheid`
INNER JOIN `user` `u` ON `u`.`user_id` = `cr`.`userid`
INNER JOIN `user` AS `u2` ON `u2`.`user_id`=`c`.`user_id`
WHERE `cr`.`status` < 3
AND (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1)
ORDER BY `cr`.`status` ASC, `cr`.`lastmodified` ASC",
LEFT JOIN `user` AS `u3` ON `u3`.`user_id`=`cr`.`adminid`
WHERE `cr`.`status` < 3 " .
// AND (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1)
"ORDER BY (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1) DESC,
`cr`.`status` ASC,
`cr`.`lastmodified` ASC",
$login->userid);
$tpl->assign_rs('reportedcaches', $rs);
@@ -168,6 +173,8 @@
sql_free_result($rs);
$tpl->assign('list', false);
$tpl->assign('otheradmin',$record['adminid']>0 && $record['adminid'] != $login->userid);
$tpl->assign('ownreport',$record['adminid'] == $login->userid);
}
$tpl->assign('error', $error);

View File

@@ -2227,6 +2227,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1798', 'Operato
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1799', 'Only available during specified seasons', '2012-10-29 14:28:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1800', 'This cache can be done at certain seasons only - see the cache description for more details. For example, the cache may be placed in a corn labyrinth, which only exists from bloom to harvest season.', '2012-10-29 14:28:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1801', 'Help', '2012-11-09 19:28:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1802', 'Warning: This report is already assigned to another admin. Consult him first before you assume the report!', '2013-01-30 16:26:00');
-- Table sys_trans_ref
SET NAMES 'utf8';
@@ -4327,6 +4328,7 @@ INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('1798'
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('1799', 'table:cache_attrib;field=html_desc', '0');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('1800', 'table:cache_attrib;field=html_desc', '0');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('1801', './lang/de/ocstyle/lib/menu.php', '199');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('1802', './lang/de/ocstyle/adminreports.tpl', '83');
-- Table sys_trans_text
SET NAMES 'utf8';
@@ -5716,6 +5718,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 ('1799', 'DE', 'Nur zu bestimmten Zeiten im Jahr', '2012-10-29 14:28:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1800', 'DE', 'Dieser Cache l\&auml;sst sich nur zu bestimmten Zeite im Jahr absolvieren. N\&auml;here Angaben sind in der Beschreibung des Caches zu finden. Der Cache kann beispielsweise in einem Maislabyrinth versteckt sein, das nur zwischen Bl\&uuml;te- und Erntezeit existiert.', '2012-10-29 14:28:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1801', 'DE', 'Hilfe', '2012-11-09 19:32:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1802', 'DE', 'Warnung: Diese Cachemeldung wird bereits von einem anderen Admin bearbeitet. Bitte sprich dich mit ihm ab, bevor du sie &uuml;bernimmst!', '2013-01-30 16:28:00');
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');

View File

@@ -26,27 +26,37 @@
{/if}
{if $list == true}
<table class="table">
<tr><th>{t}ID{/t}</th><th>{t}Name{/t}</th><th>{t}Owner{/t}</th><th>{t}Reporter{/t}</th><th>{t}Date{/t}</th></tr>
{assign var="otheradmins" value=0}
{foreach from=$reportedcaches item=rc}
<tr>
{if $rc.otheradmin > $otheradmins}
<td colspan=5"><p style="line-height: 1.6em;">{t}(*) New reports{/t}</p>
</td></tr>
<tr><th>{t}ID{/t}</th><th>{t}Name{/t}</th><th>{t}Owner{/t}</th><th>{t}Reporter{/t}</th><th>{t}Admin{/t}</th><th>{t}Date{/t}</th></tr>
{assign var="otheradmins" value=$rc.otheradmin}
{/if}
<td><a href="adminreports.php?id={$rc.id}">{$rc.id}</td>
<td><a href="adminreports.php?id={$rc.id}">{$rc.new|escape}{$rc.name|escape}</a></td>
<td>{$rc.ownernick|escape}</td>
<td>{$rc.username|escape}</td>
<td style="white-space: nowrap;">{$rc.lastmodified|date_format:$opt.format.datelong}</td></tr>
{if $otheradmins}
<td>{$rc.adminname|escape}</td>
{/if}
<td style="white-space: nowrap;">{$rc.lastmodified|date_format:$opt.format.date}</td></tr>
{foreachelse}
<tr><td colspan=5>{t}No reported caches{/t}</td></tr>
{/foreach}
</table>
{if $reportedcaches != NULL}
{if $reportedcaches != NULL and $otheradmins==0}
<p style="line-height: 1.6em;">{t}(*) New reports{/t}</p>
{/if}
{else}
<p style="line-height: 1.6em;">{t}Details for report of {/t} <a href="viewcache.php?cacheid={$cacheid}" target="_blank">{$cachename|escape}</a> {t} by {/t} <a href="viewprofile.php?userid={$userid}" target="_blank">{$usernick|escape}</a></p>
<p style="line-height: 1.6em;"><b>{t}Last modified:{/t}</b>&nbsp;{$lastmodified|date_format:$opt.format.datelong}</p>
<p style="line-height: 1.6em;"><b>{t}State:{/t}</b>&nbsp;{$status}&nbsp;<b>Admin:</b>&nbsp;{if $adminnick==''}{t}not assigned{/t}{else}{$adminnick|escape}{/if}</p>
<p style="line-height: 1.6em;"><b>{t}State:{/t}</b>&nbsp;{$status}&nbsp;&nbsp;<b>Admin:</b>&nbsp;{if $adminnick==''}{t}not assigned{/t}{else}{if $otheradmin}<font color="red"><b>{/if}{$adminnick|escape}{if $otheradmin}</b></font>{/if}{/if}</p>
<p style="line-height: 1.6em;"><b>{t}Reason:{/t}</b>&nbsp;{$reason|escape|nl2br}</p>
<p style="line-height: 1.6em;"><b>{t}Comment:{/t}</b>&nbsp;{$note|escape|nl2br}</p>
@@ -57,7 +67,9 @@
</p>
</div>
<p style="line-height: 1.6em;"><input type="submit" name="assign" value="{t}Assign to me{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="contact" value="{t}Contact owner{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="done" value="{t}Mark as finished{/t}" class="formbuttons" /></p>
<p style="line-height: 1.6em;"><input type="submit" name="assign" value="{t}Assign to me{/t}" class="formbuttons" />
{if $ownreport}
&nbsp;<input type="submit" name="contact" value="{t}Contact owner{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="done" value="{t}Mark as finished{/t}" class="formbuttons" /></p>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
@@ -67,6 +79,9 @@
</div>
<p style="line-height: 1.6em;"><input type="submit" name="statusActive" value="{t}Ready for search{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="statusTNA" value="{t}Temporary not available{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="statusArchived" value="{t}Archived{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="statusLockedVisible" value="{t}Locked, visible{/t}" class="formbuttons" />&nbsp;&nbsp;<input type="submit" name="statusLockedInvisible" value="{t}Locked, invisible{/t}" class="formbuttons" /></p>
{elseif $otheradmin}
<br />{t}Warning: This report is already assigned to another admin. Consult him first before you assume the report!{/t}
{/if}
{/if}
</form>