Annotation of /mambo/branches/4.6/administrator/components/com_checkin/admin.checkin.php
Parent Directory
|
Revision Log
Revision 948 - (view) (download)
| 1 : | alwarren | 715 | <?php |
| 2 : | /** | ||
| 3 : | * @package Mambo Open Source | ||
| 4 : | * @subpackage Checkin | ||
| 5 : | cauld | 948 | * @copyright Refer to copyright.php |
| 6 : | alwarren | 715 | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 : | * | ||
| 8 : | * Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure | ||
| 9 : | * that Mambo remained free Open Source software owned and managed by the community. | ||
| 10 : | * Mambo is Free Software | ||
| 11 : | */ | ||
| 12 : | |||
| 13 : | /** ensure this file is being included by a parent file */ | ||
| 14 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 15 : | |||
| 16 : | if (!$acl->acl_check( 'administration', 'config', 'users', $my->usertype )) { | ||
| 17 : | mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') ); | ||
| 18 : | } | ||
| 19 : | ?> | ||
| 20 : | <table class="adminheading"> | ||
| 21 : | <tr> | ||
| 22 : | <th class="checkin"><?php echo T_('Global Check-in') ?></th> | ||
| 23 : | </tr> | ||
| 24 : | </table> | ||
| 25 : | <table class="adminform"> | ||
| 26 : | <tr> | ||
| 27 : | <th class="title"><?php echo T_('Database Table') ?></th> | ||
| 28 : | <th class="title"><?php echo T_('# of Items') ?></th> | ||
| 29 : | <th class="title"><?php echo T_('Checked-In') ?></th> | ||
| 30 : | <th class="title"> </th> | ||
| 31 : | </tr> | ||
| 32 : | <?php | ||
| 33 : | $lt = mysql_list_tables($mosConfig_db); | ||
| 34 : | $k = 0; | ||
| 35 : | while (list($tn) = mysql_fetch_array( $lt )) { | ||
| 36 : | // make sure we get the right tables based on prefix | ||
| 37 : | if (!preg_match( "/^".$mosConfig_dbprefix."/i", $tn )) { | ||
| 38 : | continue; | ||
| 39 : | } | ||
| 40 : | $lf = mysql_list_fields($mosConfig_db, "$tn"); | ||
| 41 : | $nf = mysql_num_fields($lf); | ||
| 42 : | |||
| 43 : | $foundCO = false; | ||
| 44 : | $foundCOT = false; | ||
| 45 : | $foundE = false; | ||
| 46 : | for ($i = 0; $i < $nf; $i++) { | ||
| 47 : | $fname = mysql_field_name($lf, $i); | ||
| 48 : | if ( $fname == 'checked_out') { | ||
| 49 : | $foundCO = true; | ||
| 50 : | } else if ( $fname == 'checked_out_time') { | ||
| 51 : | $foundCOT = true; | ||
| 52 : | } else if ( $fname == 'editor') { | ||
| 53 : | $foundE = true; | ||
| 54 : | } | ||
| 55 : | } | ||
| 56 : | |||
| 57 : | if ($foundCO && $foundCOT) { | ||
| 58 : | if ($foundE) { | ||
| 59 : | $database->setQuery( "SELECT checked_out, editor FROM $tn WHERE checked_out > 0" ); | ||
| 60 : | } else { | ||
| 61 : | $database->setQuery( "SELECT checked_out FROM $tn WHERE checked_out > 0" ); | ||
| 62 : | } | ||
| 63 : | $res = $database->query(); | ||
| 64 : | $num = $database->getNumRows( $res ); | ||
| 65 : | |||
| 66 : | if ($foundE) { | ||
| 67 : | $database->setQuery( "UPDATE $tn SET checked_out=0, checked_out_time='00:00:00', editor=NULL WHERE checked_out > 0" ); | ||
| 68 : | } else { | ||
| 69 : | $database->setQuery( "UPDATE $tn SET checked_out=0, checked_out_time='0000-00-00 00:00:00' WHERE checked_out > 0" ); | ||
| 70 : | } | ||
| 71 : | $res = $database->query(); | ||
| 72 : | |||
| 73 : | if ($res == 1) { | ||
| 74 : | if ($num > 0) { | ||
| 75 : | echo "<tr class=\"row$k\">"; | ||
| 76 : | echo "\n <td width=\"350\">".T_('Checking table')." - $tn</td>"; | ||
| 77 : | echo "\n <td width=\"150\">".sprintf(Tn_('Checked in <strong>%d</strong> item','Checked in <strong>%d</strong> items', $num), $num)."</td>"; | ||
| 78 : | echo "\n <td width=\"100\" align=\"center\"><img src=\"images/tick.png\" border=\"0\" alt=\"tick\" /></td>"; | ||
| 79 : | echo "\n <td> </td>"; | ||
| 80 : | echo "\n</tr>"; | ||
| 81 : | } else { | ||
| 82 : | echo "<tr class=\"row$k\">"; | ||
| 83 : | echo "\n <td width=\"350\">".T_('Checking table')." - $tn</td>"; | ||
| 84 : | echo "\n <td width=\"150\">".sprintf(Tn_('Checked in <strong>%d</strong> item','Checked in <strong>%d</strong> items', $num), $num)."</td>"; | ||
| 85 : | echo "\n <td width=\"100\"> </td>"; | ||
| 86 : | echo "\n <td> </td>"; | ||
| 87 : | echo "\n</tr>"; | ||
| 88 : | } | ||
| 89 : | $k = 1 - $k; | ||
| 90 : | } | ||
| 91 : | } | ||
| 92 : | } | ||
| 93 : | ?> | ||
| 94 : | <tr> | ||
| 95 : | <td colspan="4"><b><?php echo T_('Checked out items have now been all checked in') ?></b></td> | ||
| 96 : | </tr> | ||
| 97 : | </table> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

