mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
139 lines
3.6 KiB
PHP
139 lines
3.6 KiB
PHP
<?php
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2010 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
/**
|
|
*
|
|
* @package
|
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
* @link www.phraseanet.com
|
|
*/
|
|
require_once __DIR__ . "/../../lib/bootstrap.php";
|
|
$appbox = appbox::get_instance();
|
|
$session = $appbox->get_session();
|
|
$registry = $appbox->get_registry();
|
|
phrasea::headers();
|
|
|
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
|
|
|
$request = http_request::getInstance();
|
|
$parm = $request->get_parms(
|
|
"act"
|
|
, "lst"
|
|
, "mska"
|
|
, "msko"
|
|
, "chg_status_son"
|
|
, 'dlgW'
|
|
, 'dlgH'
|
|
);
|
|
?>
|
|
<html lang="<?php echo $session->get_I18n(); ?>">
|
|
<head>
|
|
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/prod/<?php echo $user->getPrefs('css') ?>/prodcolor.css" />
|
|
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
|
<script type="text/javascript">
|
|
|
|
function loaded()
|
|
{
|
|
parent.hideDwnl();
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="loaded();" style="overflow:hidden; padding:0px; margin:0px;">
|
|
<?php
|
|
if ($parm["act"] == "START" || $parm["act"] == "WORK")
|
|
{
|
|
$ACL = User_Adapter::getInstance($session->get_usr_id(), $appbox)->ACL();
|
|
|
|
if ($parm["act"] == "WORK")
|
|
{
|
|
if ($parm["chg_status_son"] == "1")
|
|
{
|
|
$lst = explode(";", $parm["lst"]);
|
|
foreach ($lst as $basrec)
|
|
{
|
|
$basrec = explode('_', $basrec);
|
|
$record = new record_adapter($barec[0], $basrec[1]);
|
|
|
|
if ($record->is_grouping())
|
|
{
|
|
foreach ($record->get_children() as $oneson)
|
|
{
|
|
if (!$ACL->has_right_on_base($oneson->get_base_id(), 'chgstatus'))
|
|
continue;
|
|
if ($parm["lst"] != "" && $parm["lst"] != null)
|
|
$parm["lst"].=",";
|
|
$parm["lst"] .= ';' . $oneson->get_sbas_id() . '_' . $oneson->get_record_id();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$mska = $msko = null;
|
|
|
|
$sbA = explode(';', $parm["mska"]);
|
|
$sbO = explode(';', $parm["msko"]);
|
|
|
|
foreach ($sbA as $sbAnd)
|
|
{
|
|
$sbAnd = explode('_', $sbAnd);
|
|
$mska[$sbAnd[0]] = $sbAnd[1];
|
|
}
|
|
foreach ($sbO as $sbOr)
|
|
{
|
|
$sbOr = explode('_', $sbOr);
|
|
$msko[$sbOr[0]] = $sbOr[1];
|
|
}
|
|
|
|
$lst = explode(";", $parm["lst"]);
|
|
$maj = 0;
|
|
foreach ($lst as $basrec)
|
|
{
|
|
$basrec = explode('_', $basrec);
|
|
if (count($basrec) !== 2)
|
|
continue;
|
|
|
|
try
|
|
{
|
|
$record = new record_adapter($basrec[0], $basrec[1]);
|
|
$base_id = $record->get_base_id();
|
|
if (isset($mska[$basrec[0]]) && isset($msko[$basrec[0]]))
|
|
{
|
|
$record = new record_adapter($basrec[0], $basrec[1]);
|
|
$status = $record->get_status();
|
|
$status = databox_status::operation_and($status, $mska[$basrec[0]]);
|
|
$status = databox_status::operation_or($status, $msko[$basrec[0]]);
|
|
$record->set_binary_status($status);
|
|
|
|
$session->get_logger($record->get_databox())
|
|
->log($record, Session_Logger::EVENT_STATUS, '', '');
|
|
|
|
$maj++;
|
|
unset($record);
|
|
}
|
|
}
|
|
catch (Exception $e)
|
|
{
|
|
|
|
}
|
|
}
|
|
?>
|
|
<div style="font-size:11px;text-align:center;">
|
|
<?php echo sprintf(_('prod::proprietes : %d documents modifies'), $maj) ?><br>
|
|
<a href="#" onclick="parent.hideDwnl();"><?php echo _('boutton::fermer') ?></a>
|
|
</div>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|