mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Merge branch 4.0 into master
This commit is contained in:
@@ -147,6 +147,18 @@ class ACL implements cache_cacheableInterface
|
||||
return self::$bas_rights;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of available rights by databox for the current user
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_sbas_rights()
|
||||
{
|
||||
$this->load_rights_sbas();
|
||||
|
||||
return $this->_rights_sbas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a hd grant has been received for a record
|
||||
*
|
||||
@@ -580,10 +592,11 @@ class ACL implements cache_cacheableInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has the right, at least on one collection
|
||||
* Check if the user has the right, on at least one collection
|
||||
*
|
||||
* @param string $right
|
||||
* @return boolean
|
||||
* @param string $right
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function has_right($right)
|
||||
{
|
||||
@@ -598,9 +611,10 @@ class ACL implements cache_cacheableInterface
|
||||
/**
|
||||
* Check if the user has the required right on a database
|
||||
*
|
||||
* @param <type> $sbas_id
|
||||
* @param <type> $right
|
||||
* @return <type>
|
||||
* @param int $sbas_id
|
||||
* @param string $right
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function has_right_on_sbas($sbas_id, $right)
|
||||
{
|
||||
@@ -623,8 +637,8 @@ class ACL implements cache_cacheableInterface
|
||||
/**
|
||||
* Retrieve mask AND for user on specified base_id
|
||||
*
|
||||
* @param int $base_id
|
||||
* @return string
|
||||
* @param int $base_id
|
||||
* @return int
|
||||
*/
|
||||
public function get_mask_and($base_id)
|
||||
{
|
||||
@@ -639,8 +653,8 @@ class ACL implements cache_cacheableInterface
|
||||
/**
|
||||
* Retrieve mask XOR for user on specified base_id
|
||||
*
|
||||
* @param int $base_id
|
||||
* @return string
|
||||
* @param int $base_id
|
||||
* @return int
|
||||
*/
|
||||
public function get_mask_xor($base_id)
|
||||
{
|
||||
|
@@ -118,7 +118,7 @@ class media_Permalink_Adapter implements cache_cacheableInterface
|
||||
'record_id' => $this->media_subdef->get_record_id(),
|
||||
'subdef' => $this->media_subdef->get_name(),
|
||||
/** @Ignore */
|
||||
'label' => $label,
|
||||
'label' => str_replace('/', '_', $label),
|
||||
'token' => $this->get_token(),
|
||||
]));
|
||||
}
|
||||
|
64
lib/classes/patch/400alpha7a.php
Normal file
64
lib/classes/patch/400alpha7a.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2016 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
|
||||
class patch_400alpha7a implements patchInterface
|
||||
{
|
||||
/** @var string */
|
||||
private $release = '4.0.0-alpha.7';
|
||||
|
||||
/** @var array */
|
||||
private $concern = [base::APPLICATION_BOX];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_release()
|
||||
{
|
||||
return $this->release;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDoctrineMigrations()
|
||||
{
|
||||
return [
|
||||
'20160511160640'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function require_all_upgrades()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function concern()
|
||||
{
|
||||
return $this->concern;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(base $databox, Application $app)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
64
lib/classes/patch/400alpha8a.php
Normal file
64
lib/classes/patch/400alpha8a.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2016 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
|
||||
class patch_400alpha8a implements patchInterface
|
||||
{
|
||||
/** @var string */
|
||||
private $release = '4.0.0-alpha.8';
|
||||
|
||||
/** @var array */
|
||||
private $concern = [base::APPLICATION_BOX];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_release()
|
||||
{
|
||||
return $this->release;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDoctrineMigrations()
|
||||
{
|
||||
return [
|
||||
'20160520165600'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function require_all_upgrades()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function concern()
|
||||
{
|
||||
return $this->concern;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(base $databox, Application $app)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -68,8 +68,6 @@ class record_exportElement extends record_adapter
|
||||
parent::__construct($app, $sbas_id, $record_id);
|
||||
|
||||
$this->get_actions($remain_hd);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,8 +268,7 @@ class record_exportElement extends record_adapter
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Array
|
||||
* @return array
|
||||
*/
|
||||
public function get_orderable()
|
||||
{
|
||||
@@ -279,8 +276,7 @@ class record_exportElement extends record_adapter
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Array
|
||||
* @return array
|
||||
*/
|
||||
public function get_downloadable()
|
||||
{
|
||||
|
@@ -99,19 +99,20 @@ class set_export extends set_abstract
|
||||
} else {
|
||||
$this->exportName = "Export_" . date("Y-n-d") . '_' . mt_rand(100, 999);
|
||||
|
||||
$tmp_lst = explode(';', $lst);
|
||||
$n = 1;
|
||||
foreach ($tmp_lst as $basrec) {
|
||||
$basrec = explode('_', $basrec);
|
||||
if (count($basrec) != 2)
|
||||
continue;
|
||||
|
||||
$records = new \Alchemy\Phrasea\Record\RecordReferenceCollection();
|
||||
|
||||
foreach (explode(';', $lst) as $basrec) {
|
||||
try {
|
||||
$record = new record_adapter($this->app, $basrec[0], $basrec[1]);
|
||||
} catch (\Exception_Record_AdapterNotFound $e) {
|
||||
$records[] = \Alchemy\Phrasea\Record\RecordReference::createFromRecordReference($basrec);
|
||||
} catch (Exception $exception) {
|
||||
// Ignore invalid record references
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($records->toRecords($app->getApplicationBox()) as $record) {
|
||||
if ($record->isStory()) {
|
||||
foreach ($record->getChildren() as $child_basrec) {
|
||||
$base_id = $child_basrec->getBaseId();
|
||||
|
Reference in New Issue
Block a user