- md5
- 0419a4bf0de1e84c07a42cd90f3fba2f
- sha1
- 2d774aebd5db2193e105db72570cf6b25b2f8dcf
- sha256
- df18e4a7c9990ea0867addabd55b68af02dcf5f7f5f415d9e3a3c304b6f0a673
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
<?php
/**
* @version $Id: admin.checkin.php 10002 2008-02-08 10:56:57Z willebil $
* @package Joomla
* @subpackage Checkin
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
if (!$acl->acl_check( 'administration', 'config', 'users', $my->usertype )) {
mosRedirect( 'index2.php?', _NOT_AUTH );
}
$nullDate = $database->getNullDate();
?>
<table class="adminheading">
<tr>
<th class="checkin">
Global Check-in
</th>
</tr>
</table>
<table class="adminform">
<tr>
<th class="title">
Database Table
</th>
<th class="title">
# of Items
</th>
<th class="title">
Checked-In
</th>
<th class="title">
</th>
</tr>
<?php
$tables = $database->getTableList();
$k = 0;
foreach ($tables as $tn) {
// make sure we get the right tables based on prefix
if (!preg_match( "/^".$mosConfig_dbprefix."/i", $tn )) {
continue;
}
$fields = $database->getTableFields( array( $tn ) );
$foundCO = false;
$foundCOT = false;
$foundE = false;
$foundCO = isset( $fields[$tn]['checked_out'] );
$foundCOT = isset( $fields[$tn]['checked_out_time'] );
$foundE = isset( $fields[$tn]['editor'] );
if ($foundCO && $foundCOT) {
if ($foundE) {
$query = "SELECT checked_out, editor"
. "\n FROM $tn"
. "\n WHERE checked_out > 0"
;
} else {
$query = "SELECT checked_out"
. "\n FROM $tn"
. "\n WHERE checked_out > 0"
;
}
$database->setQuery( $query );
$res = $database->query();
$num = $database->getNumRows( $res );
if ($foundE) {
$query = "UPDATE $tn"
. "\n SET checked_out = 0, checked_out_time = " . $database->Quote( $nullDate ) . ", editor = NULL"
. "\n WHERE checked_out > 0"
;
} else {
$query = "UPDATE $tn"
. "\n SET checked_out = 0, checked_out_time = " . $database->Quote( $nullDate )
. "\n WHERE checked_out > 0"
;
}
$database->setQuery( $query );
$res = $database->query();
if ($res == 1) {
if ($num > 0) {
echo "<tr class=\"row$k\">";
echo "\n <td width=\"350\">Checking table - $tn</td>";
echo "\n <td width=\"150\">Checked in <b>$num</b> items</td>";
echo "\n <td width=\"100\" align=\"center\"><img src=\"images/tick.png\" border=\"0\" alt=\"tick\" /></td>";
echo "\n <td> </td>";
echo "\n</tr>";
} else {
echo "<tr class=\"row$k\">";
echo "\n <td width=\"350\">Checking table - $tn</td>";
echo "\n <td width=\"150\">Checked in <b>$num</b> items</td>";
echo "\n <td width=\"100\"> </td>";
echo "\n <td> </td>";
echo "\n</tr>";
}
$k = 1 - $k;
}
}
}
?>
<tr>
<td colspan="4">
<strong>Checked out items have now been all checked in</strong>
</td>
</tr>
</table>
The same content is in 2 releases, Joomla 1.0.14 to 1.0.15. See them all, or every version of this file.