Coding standards

This commit is contained in:
Romain Neutron
2012-01-31 18:35:27 +01:00
parent dcb4933438
commit 99a344774f
110 changed files with 668 additions and 536 deletions

View File

@@ -14,12 +14,10 @@
*
*/
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
require_once __DIR__ . '/lib/bootstrap.php';
use Symfony\Component\Finder\Finder;
\Alchemy\Phrasea\Core::initAutoloads();
$fix = isset($argv[1]) && 'fix' == $argv[1];
$finder = new Finder();

View File

@@ -121,6 +121,7 @@ class ACL implements cache_cacheableInterface
$key = $record->get_serialize_key();
if (array_key_exists($key, $this->_rights_records_document))
return true;
return false;
@@ -188,6 +189,7 @@ class ACL implements cache_cacheableInterface
$key = $record->get_serialize_key();
if (array_key_exists($key, $this->_rights_records_preview))
return true;
return false;
@@ -241,6 +243,7 @@ class ACL implements cache_cacheableInterface
public function apply_model(User_Interface $template_user, Array $base_ids)
{
if (count($base_ids) == 0)
return $this;
$sbas_ids = array();
@@ -382,6 +385,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
if ($this->is_limited($base_id))
@@ -469,6 +473,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
return $this->_rights_bas[$base_id]['restrict_dwnld'];
@@ -485,6 +490,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
return (int) $this->_rights_bas[$base_id]['remain_dwnld'];
@@ -502,6 +508,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
$this->_rights_bas[$base_id]['remain_dwnld'] =
@@ -541,12 +548,14 @@ class ACL implements cache_cacheableInterface
$this->load_rights_sbas();
if (!isset($this->_rights_sbas[$sbas_id]))
return false;
if (!isset($this->_rights_sbas[$sbas_id][$right]))
throw new Exception('This right does not exists');
if ($this->_rights_sbas[$sbas_id][$right] === true)
return true;
return false;
@@ -562,6 +571,7 @@ class ACL implements cache_cacheableInterface
{
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
return $this->_rights_bas[$base_id]['mask_and'];
@@ -577,6 +587,7 @@ class ACL implements cache_cacheableInterface
{
$this->load_rights_bas();
if (!$this->has_access_to_base($base_id))
return false;
return $this->_rights_bas[$base_id]['mask_xor'];
@@ -620,21 +631,21 @@ class ACL implements cache_cacheableInterface
{
$this->load_rights_bas();
$ret = array();
foreach($this->appbox->get_databoxes() as $databox)
{
if ($sbas_ids && !in_array($databox->get_sbas_id(), $sbas_ids))
{
continue;
}
foreach ($databox->get_collections() as $collection)
{
$continue = false;
if(!array_key_exists($collection->get_base_id(), $this->_rights_bas))
continue;
$base_id = $collection->get_base_id();
$datas = $this->_rights_bas[$base_id];
@@ -702,7 +713,7 @@ class ACL implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}
@@ -718,6 +729,7 @@ class ACL implements cache_cacheableInterface
{
if ($this->_rights_records_preview)
return $this;
try
@@ -730,7 +742,7 @@ class ACL implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT sbas_id, record_id, preview, document
FROM records_rights WHERE usr_id = :usr_id';
@@ -771,6 +783,7 @@ class ACL implements cache_cacheableInterface
{
if ($this->_rights_sbas && $this->_global_rights)
return $this;
try
@@ -782,7 +795,7 @@ class ACL implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT sbasusr.* FROM sbasusr, sbas
@@ -832,6 +845,7 @@ class ACL implements cache_cacheableInterface
protected function load_rights_bas()
{
if ($this->_rights_bas && $this->_global_rights && is_array($this->_limited))
return $this;
try
@@ -844,7 +858,7 @@ class ACL implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT u.* FROM basusr u, bas b, sbas s
@@ -1335,6 +1349,7 @@ class ACL implements cache_cacheableInterface
$stmt->closeCursor();
if (!$row)
return $this;
$this->give_access_to_base(array($base_id_dest));
@@ -1501,6 +1516,7 @@ class ACL implements cache_cacheableInterface
{
$this->load_rights_bas();
if (!isset($this->_limited[$base_id]))
return null;
return ($this->_limited[$base_id]);
}
@@ -1509,18 +1525,18 @@ class ACL implements cache_cacheableInterface
{
if ($limit)
{
$sql = 'UPDATE basusr
$sql = 'UPDATE basusr
SET time_limited = 1
, limited_from = :limited_from
, limited_to = :limited_to
, limited_from = :limited_from
, limited_to = :limited_to
WHERE base_id = :base_id AND usr_id = :usr_id';
}
else
{
$sql = 'UPDATE basusr
$sql = 'UPDATE basusr
SET time_limited = 0
, limited_from = :limited_from
, limited_to = :limited_to
, limited_from = :limited_from
, limited_to = :limited_to
WHERE base_id = :base_id AND usr_id = :usr_id';
}

View File

@@ -551,7 +551,7 @@ class API_OAuth2_Adapter extends OAuth2
return $account;
}
/**
*
* @param int $usr_id

View File

@@ -71,7 +71,7 @@ class API_V1_Log
/**
*
* @var API_OAuth2_Account
* @var API_OAuth2_Account
*/
protected $account;
@@ -85,7 +85,7 @@ class API_V1_Log
*
* @param appbox $appbox
* @param Request $request
* @param API_OAuth2_Account $account
* @param API_OAuth2_Account $account
*/
public function __construct(appbox &$appbox, $log_id)
{
@@ -93,16 +93,16 @@ class API_V1_Log
$this->id = (int) $log_id;
$sql = '
SELECT
SELECT
api_log_id,
api_account_id,
api_log_route,
api_log_date,
api_log_status_code,
api_log_format,
api_log_ressource,
api_log_general,
api_log_aspect,
api_log_date,
api_log_status_code,
api_log_format,
api_log_ressource,
api_log_general,
api_log_aspect,
api_log_action
FROM
api_logs
@@ -172,7 +172,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -184,7 +184,7 @@ class API_V1_Log
public function set_status_code($status_code)
{
$this->status_code = (int) $status_code;
$sql = 'UPDATE api_log
SET api_log_status_code = :code
WHERE api_log_id = :log_id';
@@ -197,7 +197,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -208,12 +208,12 @@ class API_V1_Log
public function set_format($format)
{
if (!in_array($format, array('json', 'jsonp', 'yaml', 'unknow')))
throw new Exception_InvalidArgument();
$this->format = $format;
$sql = 'UPDATE api_log
SET api_log_format = :format
WHERE api_log_id = :log_id';
@@ -226,7 +226,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -239,9 +239,9 @@ class API_V1_Log
{
if (!in_array($format, array(self::DATABOXES_RESSOURCE,self::BASKETS_RESSOURCE, self::FEEDS_RESSOURCE, self::RECORDS_RESSOURCE)))
throw new Exception_InvalidArgument();
$this->ressource = $ressource;
$sql = 'UPDATE api_log
SET api_log_ressource = :ressource
WHERE api_log_id = :log_id';
@@ -254,7 +254,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -266,7 +266,7 @@ class API_V1_Log
public function set_general($general)
{
$this->general = $general;
$sql = 'UPDATE api_log
SET api_log_general = :general
WHERE api_log_id = :log_id';
@@ -279,7 +279,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -291,7 +291,7 @@ class API_V1_Log
public function set_aspect($aspect)
{
$this->aspect = $aspect;
$sql = 'UPDATE api_log
SET api_log_aspect = :aspect
WHERE api_log_id = :log_id';
@@ -304,7 +304,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -316,7 +316,7 @@ class API_V1_Log
public function set_action($action)
{
$this->action = $action;
$sql = 'UPDATE api_log
SET api_log_action = :action
WHERE api_log_id = :log_id';
@@ -329,7 +329,7 @@ class API_V1_Log
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
return $this;
}
@@ -338,8 +338,8 @@ class API_V1_Log
return $this->account;
}
public static function create(appbox &$appbox, API_OAuth2_Account $account, $route, $status_code, $format, $ressource, $general = null, $aspect = null, $action = null)
public static function create(appbox &$appbox, API_OAuth2_Account $account, $route, $status_code, $format, $ressource, $general = null, $aspect = null, $action = null)
{
$sql = '
INSERT INTO
@@ -347,38 +347,38 @@ class API_V1_Log
api_log_id,
api_account_id,
api_log_route,
api_log_date,
api_log_status_code,
api_log_format,
api_log_ressource,
api_log_general,
api_log_aspect,
api_log_date,
api_log_status_code,
api_log_format,
api_log_ressource,
api_log_general,
api_log_aspect,
api_log_action
)
VALUES (
null,
:account_id,
:route,
NOW(),
:status_code,
:format,
:ressource,
:general,
:aspect,
NOW(),
:status_code,
:format,
:ressource,
:general,
:aspect,
:action
)';
$params = array(
':account_id' => $account->get_id(),
':route' => $route,
':status_code' => $status_code,
':format' => $format,
':ressource' => $ressource,
':general' => $general,
':aspect' => $aspect,
':action' => $action
':status_code' => $status_code,
':format' => $format,
':ressource' => $ressource,
':general' => $general,
':aspect' => $aspect,
':action' => $action
);
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();

View File

@@ -18,4 +18,4 @@
class Bridge_Exception extends Exception
{
}
}

View File

@@ -68,4 +68,4 @@ class Controller_Admin_Fields implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -54,7 +54,7 @@ class Controller_Admin_Publications implements ControllerProviderInterface
$request = $app['request'];
$feed = Feed_Adapter::create($appbox, $user, $request->get('title'), $request->get('subtitle'));
if($request->get('public') == '1')
$feed->set_public (true);
elseif ($request->get('base_id'))
@@ -93,6 +93,7 @@ class Controller_Admin_Publications implements ControllerProviderInterface
$user = User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user))
return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it'));
$request = $app['request'];
@@ -121,23 +122,29 @@ class Controller_Admin_Publications implements ControllerProviderInterface
$user = User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user))
return new Response('ERROR:you are not allowed');
if ($_FILES['Filedata']['error'] !== 0)
return new Response('ERROR:error while upload');
$file = new system_file($_FILES['Filedata']['tmp_name']);
if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif')))
return new Response('ERROR:bad filetype');
if ($file->getSize() > 200000)
return new Response('ERROR:file too large');
$datas = $file->get_technical_datas();
if (!isset($datas[system_file::TC_DATAS_WIDTH]) || !isset($datas[system_file::TC_DATAS_HEIGHT]))
return new Response('ERROR:file is not square');
if ($datas[system_file::TC_DATAS_WIDTH] != $datas[system_file::TC_DATAS_HEIGHT])
return new Response('ERROR:file is not square');
$feed->set_icon($file);

View File

@@ -260,7 +260,7 @@ class Controller_Admin_Users implements ControllerProviderInterface
$response = new Response($CSVDatas, 200, array('Content-Type' => 'text/plain'));
$response->headers->set('Content-Disposition', 'attachment; filename=export.txt');
return $response;
}
);

View File

@@ -54,7 +54,7 @@ class Controller_Prod_Records_Edit implements ControllerProviderInterface
return $twig->render($template, array('edit' => $editing, 'message' => ''));
}
);
return $controllers;
}

View File

@@ -57,4 +57,4 @@ class Controller_Prod_Records_MoveCollection implements ControllerProviderInterf
return $controllers;
}
}
}

View File

@@ -174,4 +174,4 @@ class Controller_Prod_Records_Tooltip implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -44,17 +44,17 @@ class Controller_RSSFeeds implements ControllerProviderInterface
{
$content = new Feed_XML_RSS();
}
if ($format == Feed_Adapter::FORMAT_ATOM)
{
$content = new Feed_XML_Atom();
}
if($format == Feed_Adapter::FORMAT_COOLIRIS)
{
$content = new Feed_XML_Cooliris();
}
if ($user instanceof User_Adapter)
$link = $feed->get_user_link($registry, $user, $format, $page);
else
@@ -82,7 +82,7 @@ class Controller_RSSFeeds implements ControllerProviderInterface
}
foreach ($entries->get_entries() as $entry)
$content->set_item($entry);
$render = $content->render();
$response = new Response($render, 200, array('Content-Type' => $content->get_mimetype()));
$response->setCharset('UTF-8');
@@ -176,8 +176,8 @@ class Controller_RSSFeeds implements ControllerProviderInterface
return $display_feed($feed, Feed_Adapter::FORMAT_COOLIRIS , $page);
});
return $controllers;
}
}
}

View File

@@ -51,8 +51,8 @@ class Controller_Setup_Installer implements ControllerProviderInterface
$request = $app['request'];
$servername = $request->getScheme() . '://' . $request->getHttpHost() . '/';
setup::write_config($servername);
$php_constraint = setup::check_php_version();
$writability_constraints = setup::check_writability(new Setup_Registry());
$extension_constraints = setup::check_php_extension();
@@ -89,11 +89,11 @@ class Controller_Setup_Installer implements ControllerProviderInterface
return $app->redirect('/setup/installer/step2/');
}
$ld_path = array(dirname(__FILE__) . '/../../../../templates/web');
$loader = new Twig_Loader_Filesystem($ld_path);
$twig = new Twig_Environment($loader);
$html = $twig->render(
'/setup/index.twig'
, array_merge($constraints_coll, array(
@@ -111,12 +111,12 @@ class Controller_Setup_Installer implements ControllerProviderInterface
$controllers->get('/step2/', function() use ($app)
{
phrasea::use_i18n(Session_Handler::get_locale());
$ld_path = array(dirname(__FILE__) . '/../../../../templates/web');
$loader = new Twig_Loader_Filesystem($ld_path);
$twig = new Twig_Environment($loader);
$twig->addExtension(new Twig_Extensions_Extension_I18n());
$request = $app['request'];
@@ -303,4 +303,4 @@ class Controller_Setup_Installer implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -86,4 +86,4 @@ class Controller_Setup_Upgrader implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -50,7 +50,7 @@ class Controller_Utils_ConnectionTest implements ControllerProviderInterface
}
catch (Exception $e)
{
}
if ($dbname && $connection_ok === true)
@@ -83,7 +83,7 @@ class Controller_Utils_ConnectionTest implements ControllerProviderInterface
}
catch (Exception $e)
{
}
}

View File

@@ -57,4 +57,4 @@ class Controller_Utils_PathFileTest implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -14,8 +14,8 @@ require_once __DIR__ . '/../vendor/dailymotion-sdk-php/Dailymotion.php';
class DailymotionWithoutOauth2 extends Dailymotion
{
/**
* Call a remote method.
*
@@ -37,7 +37,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
'call' => $method,
'args' => $args,
));
$status_code = null;
try
{
@@ -45,7 +45,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
}
catch (DailymotionAuthException $e)
{
if ($e->error === 'invalid_token')
{
throw new Bridge_Exception_ActionAuthNeedReconnect();
@@ -84,8 +84,8 @@ class DailymotionWithoutOauth2 extends Dailymotion
return $result['result'];
}
/**
* Upload a file on the Dailymotion servers and generate an URL to be used with API methods.
*
@@ -100,6 +100,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
$this->timeout = null;
$result = json_decode($this->httpRequest($result['upload_url'], array('file' => '@' . $filePath)), true);
$this->timeout = $timeout;
return $result['url'];
}
}

View File

@@ -10,12 +10,12 @@
*/
/**
*
*
* @package Exception
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class Exception_Setup_FixBadEmailAddresses extends Exception
{
}
}

View File

@@ -26,7 +26,7 @@ abstract class Feed_Abstract
*/
const FORMAT_ATOM = 'atom';
/**
*
*
*/
const FORMAT_COOLIRIS = 'cooliris';

View File

@@ -57,7 +57,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
const CACHE_ENTRY_NUMBER = 'entrynumber';
const CACHE_USER_TOKEN = 'usr_token';
const MAX_ENTRIES = 20;
/**

View File

@@ -357,11 +357,11 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
return $this->publisher;
}
/**
*
* @param User_adapter $user
* @return boolean
* @return boolean
*/
public function is_publisher(User_adapter $user)
{

View File

@@ -370,9 +370,11 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
$medium = strtolower($content->get_record()->get_type());
if (!in_array($medium, array('image', 'audio', 'video')))
return $this;
if (!$preview_permalink || !$thumbnail_permalink)
return $this;
//add item node to channel node

View File

@@ -324,7 +324,7 @@ class Session_Handler
{
if (!$this->phrasea_session instanceof Session_Phrasea)
throw new \Exception('No phrasea session available');
$this->phrasea_session->open();
return $this;
@@ -597,7 +597,7 @@ class Session_Handler
'ssel_id' => $row['ssel_id'],
'from' => $row['owner'],
'validate_id' => $row['validate_id'],
'url' => $registry->get('GV_ServerName')
'url' => $registry->get('GV_ServerName')
. 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value']
);

View File

@@ -55,14 +55,14 @@ class Setup_Upgrade
{
throw new Exception_Setup_UpgradeAlreadyStarted('The upgrade is already started');
}
$this->appbox = $appbox;
if(count(User_Adapter::get_wrong_email_users($appbox)) > 0)
{
throw new Exception_Setup_FixBadEmailAddresses('Please fix the database before starting');
}
$this->write_lock();
return $this;

View File

@@ -907,6 +907,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public static function get_usr_id_from_email($email)
{
if (is_null($email))
return false;
$conn = connection::getPDOConnection();
@@ -1255,7 +1256,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public function get_applied_template()
{
return $this->applied_template;
}
@@ -1277,10 +1278,11 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
protected function load_preferences()
{
if ($this->_prefs)
return $this;
$registry = \registry::get_instance();
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute(array(':id' => $this->id));
@@ -1300,7 +1302,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
{
$v = $registry->get('GV_defaultQuery');
}
$this->_prefs[$k] = $v;
$this->update_pref($k, $v);
}
@@ -1378,7 +1380,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
return $this;
@@ -1573,6 +1575,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
{
$this->load_preferences();
if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value)
return $value;
$ok = true;
@@ -1610,6 +1613,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$appbox = appbox::get_instance();
$session = $appbox->get_session();
if (!$session->is_authenticated())
return;
$ses_id = $session->get_ses_id();
@@ -1668,7 +1672,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
}
}
@@ -1732,7 +1736,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
return false;
@@ -1818,7 +1822,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
return $locale;
@@ -1884,6 +1888,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public function get_nonce()
{
if ($this->nonce)
return $this->nonce;
$nonce = false;

View File

@@ -269,7 +269,7 @@ class User_Query implements User_QueryInterface
$extra = $this->include_phantoms ? ' OR sbas_id IS NULL ' : '';
$not_sbas_id = array_diff($this->active_sbas, $this->sbas_ids);
if (count($not_sbas_id) > 0 && count($not_sbas_id) < count($this->sbas_ids))
{
$sql .= sprintf(' AND ((sbas_id != %s ) ' . $extra . ')'
@@ -489,6 +489,7 @@ class User_Query implements User_QueryInterface
public function get_total()
{
if ($this->total)
return $this->total;
$conn = $this->appbox->get_connection();
@@ -637,6 +638,7 @@ class User_Query implements User_QueryInterface
public function on_base_ids(Array $base_ids = null)
{
if (!$base_ids)
return $this;
$this->bases_restrictions = true;
@@ -661,6 +663,7 @@ class User_Query implements User_QueryInterface
public function on_sbas_ids(Array $sbas_ids = null)
{
if (!$sbas_ids)
return $this;
$this->sbas_restrictions = true;

View File

@@ -215,7 +215,7 @@ class appbox extends base
$stmt = $this->get_connection()->prepare($sqlupd);
$stmt->execute(array(':ordre' => $ordre, ':base_id' => $collection->get_base_id()));
$stmt->closeCursor();
$collection->get_databox()->delete_data_from_cache(\databox::CACHE_COLLECTIONS);
return $this;

View File

@@ -327,6 +327,7 @@ class basket_adapter implements cache_cacheableInterface
public function get_first_element()
{
foreach ($this->get_elements() as $basket_element)
return $basket_element;
return null;
}
@@ -338,6 +339,7 @@ class basket_adapter implements cache_cacheableInterface
public function get_validation_end_date()
{
if (!$this->valid || !$this->validation_end_date)
return null;
return $this->validation_end_date;
}
@@ -349,6 +351,7 @@ class basket_adapter implements cache_cacheableInterface
public function is_validation_finished()
{
if (!$this->valid || !$this->validation_end_date)
return null;
$now = new DateTime();
@@ -362,6 +365,7 @@ class basket_adapter implements cache_cacheableInterface
public function is_confirmed()
{
if (!$this->valid)
return null;
return $this->validation_is_confirmed;
@@ -370,14 +374,17 @@ class basket_adapter implements cache_cacheableInterface
public function is_releasable()
{
if (!$this->valid)
return false;
if ($this->is_confirmed())
return false;
foreach ($this->get_elements() as $element)
{
if ($element->get_my_agreement() == '0')
return false;
}
@@ -477,7 +484,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT s.pushFrom, n.id as noview, s.usr_id as owner, s.rid
@@ -542,7 +549,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}
@@ -585,6 +592,7 @@ class basket_adapter implements cache_cacheableInterface
public function sort($order)
{
if (!$this->valid || !in_array($order, array('asc', 'desc')))
return;
$this->load_elements();
@@ -630,7 +638,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception_Record_AdapterNotFound $e)
{
}
catch (Exception $e)
{
@@ -745,7 +753,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}
@@ -900,7 +908,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}
}
@@ -1016,6 +1024,7 @@ class basket_adapter implements cache_cacheableInterface
public function set_read()
{
if (!$this->noview)
return true;
$session = $this->appbox->get_session();
@@ -1075,7 +1084,7 @@ class basket_adapter implements cache_cacheableInterface
foreach ($this->get_elements() as $basket_element)
{
$basket_element->validate($me, $user, $insert_id, $can_hd);
if ($can_hd && $me->ACL()->has_hd_grant($basket_element->get_record()))
$user->ACL()->grant_hd_on($basket_element->get_record(), $me, 'validate');
else
@@ -1131,15 +1140,19 @@ class basket_adapter implements cache_cacheableInterface
if ($this->is_mine)
{
if ($this->is_validation_finished())
return sprintf(_('Vous aviez envoye cette demande a %d utilisateurs'), (count($this->validating_users) - 1));
else
return sprintf(_('Vous avez envoye cette demande a %d utilisateurs'), (count($this->validating_users) - 1));
}
else
{
if ($this->validation_see_others)
return sprintf(_('Processus de validation recu de %s et concernant %d utilisateurs'), User_Adapter::getInstance($this->usr_id, $this->appbox)->get_display_name(), (count($this->validating_users) - 1));
else
return sprintf(_('Processus de validation recu de %s'), User_Adapter::getInstance($this->usr_id, $this->appbox)->get_display_name());
}
}
@@ -1248,6 +1261,7 @@ class basket_adapter implements cache_cacheableInterface
protected function load_elements()
{
if (!is_null($this->elements))
return;
$this->elements = array();
@@ -1274,7 +1288,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}
@@ -1372,7 +1386,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
return array('error' => true, 'status' => 0);
@@ -1412,7 +1426,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$ret = array('error' => false, 'status' => 0);
@@ -1525,11 +1539,14 @@ class basket_adapter implements cache_cacheableInterface
public function remove_from_ssel($sselcont_id)
{
if (!$this->is_mine)
return array('error' => 'error', 'status' => 0);
if ($this->is_grouping)
return $this->remove_grouping_elements($sselcont_id);
else
return $this->remove_basket_elements($sselcont_id);
}
@@ -1869,7 +1886,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
return $appbox->delete_data_from_cache($ssel_ids);
@@ -1897,7 +1914,7 @@ class basket_adapter implements cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT id, usr_id, confirmed, can_agree, can_see_others

View File

@@ -548,20 +548,20 @@ class basket_element_adapter implements cache_cacheableInterface
}
$this->delete_data_from_cache();
$sql = 'SELECT distinct v.usr_id FROM ssel s, validate v
WHERE v.ssel_id = s.ssel_id AND s.ssel_id = :ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute(array(':ssel_id' => $this->get_ssel_id()));
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach($rs as $row)
{
$appbox->delete_data_from_cache('basket_element_' . $row['usr_id'] . '_' . $this->sselcont_id);
}
try
{
$basket = basket_adapter::getInstance($appbox, $this->ssel_id, $usr_id);
@@ -654,23 +654,23 @@ class basket_element_adapter implements cache_cacheableInterface
$stmt->closeCursor();
$this->delete_data_from_cache();
$sql = 'SELECT distinct v.usr_id FROM ssel s, validate v
WHERE v.ssel_id = s.ssel_id AND s.ssel_id = :ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute(array(':ssel_id' => $this->get_ssel_id()));
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach($rs as $row)
{
$appbox->delete_data_from_cache('basket_element_' . $row['usr_id'] . '_' . $this->sselcont_id);
}
$basket = basket_adapter::getInstance($appbox, $this->ssel_id, $usr_id);
$basket->delete_cache();
return $this;
}

View File

@@ -151,7 +151,7 @@ class basketCollection
$appbox = appbox::get_instance();
$conn = $appbox->get_connection();
$session = $appbox->get_session();
$sql = 'SELECT n.ssel_id FROM sselnew n
$sql = 'SELECT n.ssel_id FROM sselnew n
WHERE n.usr_id = :usr_id ';
$stmt = $conn->prepare($sql);
$stmt->execute(array(':usr_id' => $session->get_usr_id()));
@@ -164,12 +164,12 @@ class basketCollection
try
{
$basket = basket_adapter::getInstance($appbox, $row['ssel_id'], $session->get_usr_id());
if ($basket->is_valid() && !$basket->is_my_valid() && $basket->is_validation_finished())
throw new Exception('Finished');
$baskets[] = $basket;
}
catch(Exception $e)
{

View File

@@ -154,7 +154,7 @@ class bootstrap
Twig_Autoloader::register();
Twig_Extensions_Autoloader::register();
/**
* Load symfony components needed
*/

View File

@@ -43,7 +43,7 @@ class cache_databox
}
catch (\Exception $e)
{
}
if ($last_update)

View File

@@ -208,7 +208,7 @@ class caption_field implements cache_cacheableInterface
{
if(strlen($separator) > 1)
$separator = $separator[0];
if (trim($separator) === '')
$separator = ' ';
else

View File

@@ -60,6 +60,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
protected function retrieve_fields()
{
if (is_array($this->fields))
return $this->fields;
$fields = array();
@@ -96,7 +97,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
}
$this->fields = $rec_fields;
@@ -133,6 +134,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
{
$fields = $this->retrieve_fields();
if (isset($this->dces_elements[$label]))
return $fields[$this->dces_elements[$label]];
return null;
}

View File

@@ -200,9 +200,9 @@ class collection implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute(array(':pub_wm' => $publi, ':coll_id' => $this->get_coll_id()));
$stmt->closeCursor();
$this->pub_wm = $publi;
$this->delete_data_from_cache();
}
@@ -223,9 +223,9 @@ class collection implements cache_cacheableInterface
$stmt->closeCursor();
$this->name = $name;
$this->delete_data_from_cache();
phrasea::reset_baseDatas();
return $this;
@@ -404,7 +404,7 @@ class collection implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute(array(':prefs' => $this->prefs, ':coll_id' => $this->get_coll_id()));
$stmt->closeCursor();
$this->delete_data_from_cache();
return $this->prefs;

View File

@@ -175,6 +175,7 @@ class connection
self::$_PDO_instance[$name] = null;
unset(self::$_PDO_instance[$name]);
}
return;
}

View File

@@ -142,7 +142,7 @@ class databox extends base
}
catch (Exception $e)
{
}
}
@@ -157,7 +157,7 @@ class databox extends base
}
catch (Exception $e)
{
}
$conn = connection::getPDOConnection();
@@ -451,6 +451,7 @@ class databox extends base
$stmt->closeCursor();
if ($row)
return self::get_instance((int) $row['sbas_id']);
try
@@ -463,7 +464,7 @@ class databox extends base
}
catch (Exception $e)
{
}
$sql = 'USE `' . $dbname . '`';
@@ -575,6 +576,7 @@ class databox extends base
public function get_meta_structure()
{
if ($this->meta_struct)
return $this->meta_struct;
try
@@ -697,6 +699,7 @@ class databox extends base
}
}
if ($n > $limit)
return true;
return false;
@@ -986,7 +989,7 @@ class databox extends base
}
catch (Exception $e)
{
}
if (isset($field['regname']))
@@ -1220,6 +1223,7 @@ class databox extends base
public function get_structure()
{
if ($this->structure)
return $this->structure;
$this->structure = $this->retrieve_structure();
@@ -1234,7 +1238,7 @@ class databox extends base
}
catch (Exception $e)
{
}
$structure = null;
@@ -1260,6 +1264,7 @@ class databox extends base
public function get_cterms()
{
if ($this->cterms)
return $this->cterms;
$sql = "SELECT value FROM pref WHERE prop='cterms'";
@@ -1426,6 +1431,7 @@ class databox extends base
public function get_cgus()
{
if ($this->cgus)
return $this->cgus;
$this->load_cgus();
@@ -1443,7 +1449,7 @@ class databox extends base
}
catch (Exception $e)
{
}
$sql = 'SELECT value, locale, updated_on FROM pref WHERE prop ="ToU"';

View File

@@ -94,12 +94,12 @@ class databox_cgu
$terms = array();
$appbox = appbox::get_instance();
$session = $appbox->get_session();
if(!$home)
{
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
}
foreach ($appbox->get_databoxes() as $databox)
{
try

View File

@@ -554,7 +554,7 @@ class databox_field implements cache_cacheableInterface
{
if (strpos($separator, ';') === false)
$separator .= ';';
$this->separator = $separator;
return $this;

View File

@@ -159,13 +159,13 @@ class databox_status
$statuses = array();
$sbas_ids = $user->ACL()->get_granted_sbas();
$see_all = array();
foreach ($sbas_ids as $databox)
{
$see_all[$databox->get_sbas_id()] = false;
foreach($databox->get_collections() as $collection)
{
if($user->ACL()->has_right_on_base($collection->get_base_id(), 'chgstatus'))
@@ -193,7 +193,7 @@ class databox_status
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_modify_struct'))
$see_this = true;
foreach ($status as $bit => $props)
{
@@ -491,7 +491,7 @@ class databox_status
$conn = connection::getPDOConnection();
$status = '0';
if(substr($stat1, 0, 2) === '0x')
{
$stat1 = self::hex2bin(substr($stat1, 2));
@@ -530,7 +530,7 @@ class databox_status
{
$stat2 = self::hex2bin(substr($stat2, 2));
}
$sql = 'select bin(0b' . trim($stat1) . ' & ~0b' . trim($stat2) . ') as result';
$stmt = $conn->prepare($sql);
@@ -560,7 +560,7 @@ class databox_status
{
$stat2 = self::hex2bin(substr($stat2, 2));
}
$sql = 'select bin(0b' . trim($stat1) . ' | 0b' . trim($stat2) . ') as result';
$stmt = $conn->prepare($sql);
@@ -579,12 +579,12 @@ class databox_status
public static function dec2bin($status)
{
$status = (string) $status;
if(!ctype_digit($status))
{
throw new \Exception('Non-decimal value');
}
$conn = connection::getPDOConnection();
$sql = 'select bin(' . $status . ') as result';
@@ -595,7 +595,7 @@ class databox_status
$stmt->closeCursor();
$status = '0';
if ($row)
{
$status = $row['result'];
@@ -611,12 +611,12 @@ class databox_status
{
$status = substr($status, 2);
}
if(!ctype_xdigit($status))
{
throw new \Exception('Non-hexadecimal value');
}
$conn = connection::getPDOConnection();
$sql = 'select BIN( CAST( 0x'.trim($status).' AS UNSIGNED ) ) as result';
@@ -627,7 +627,7 @@ class databox_status
$stmt->closeCursor();
$status = '0';
if ($row)
{
$status = $row['result'];

View File

@@ -76,6 +76,7 @@ class gatekeeper
$session = $appbox->get_session();
if (http_request::is_command_line())
return;
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
@@ -104,7 +105,7 @@ class gatekeeper
}
catch (Exception $e)
{
}
}
@@ -121,6 +122,7 @@ class gatekeeper
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
return;
phrasea::redirect('/login/?redirect=/thesaurus2');
break;
@@ -129,6 +131,7 @@ class gatekeeper
break;
case 'admin':
if ($this->_script_name === 'runscheduler.php')
return;
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
break;
@@ -148,6 +151,7 @@ class gatekeeper
return;
case 'setup':
if ($appbox->upgradeavailable())
return;
else
phrasea::redirect('/login/');
@@ -264,6 +268,7 @@ class gatekeeper
$parm = $request->get_parms('LOG');
if (is_null($parm["LOG"]))
return $this;
try
@@ -281,11 +286,12 @@ class gatekeeper
try
{
$datas = random::helloToken($parm['LOG']);
return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/");
}
catch (Exception_NotFound $e)
{
}
return $this;

View File

@@ -33,7 +33,7 @@ class geonames
{
return '';
}
$registry = registry::get_instance();
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
. 'get_name.php?geonameid='
@@ -94,6 +94,7 @@ class geonames
$cityName = self::clean_input($cityName);
if (strlen($cityName) === 0)
return $output;
$registry = registry::get_instance();
@@ -134,6 +135,7 @@ class geonames
public function find_geoname_from_ip($ip)
{
if (array_key_exists($ip, $this->cache_ips))
return $this->cache_ips[$ip];
$output = array(

View File

@@ -93,7 +93,7 @@ class http_request
return true;
return false;
}
public function is_secure()
{
return (

View File

@@ -138,7 +138,7 @@ class lazaretFile
$record = new record_adapter($sbas_id, $record_id);
$record->substitute_subdef('document', new system_file($pathfile));
$this->delete();
return $this;

View File

@@ -34,4 +34,4 @@ return call_user_func(
});
return $app;
});
});

View File

@@ -58,6 +58,7 @@ return call_user_func(
{
$browser = Browser::getInstance();
if (!$browser->isMobile())
return new Response('');
$twig = new supertwig();

View File

@@ -70,10 +70,11 @@ return call_user_func(function()
return new response($twig->render('/prod/actions/Bridge/deactivated.twig', $params), 200);
}
return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200);
}
});
return $app;
});
});

View File

@@ -34,10 +34,13 @@ return call_user_func(function()
{
$browser = Browser::getInstance();
if ($browser->isMobile())
return $app->redirect("/login/?redirect=/lightbox");
elseif ($browser->isNewGeneration())
return $app->redirect("/login/?redirect=/prod");
else
return $app->redirect("/login/?redirect=/client");
});
@@ -70,6 +73,7 @@ return call_user_func(function()
/**
* Mount all aps
*/
return $app;
}
);
);

View File

@@ -49,8 +49,10 @@ return call_user_func(function()
$app->get('/', function() use ($app)
{
if ($app['install'] === true)
return $app->redirect('/setup/installer/');
if ($app['upgrade'] === true)
return $app->redirect('/setup/upgrader/');
});
@@ -63,6 +65,7 @@ return call_user_func(function()
$app->error(function($e) use ($app)
{
if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled)
return $app->redirect('/login');
return new Response(
@@ -77,4 +80,4 @@ return call_user_func(function()
});
return $app;
});
});

View File

@@ -77,6 +77,7 @@ class module_admin
);
$twig = new supertwig();
return $twig->render('admin/tree.html.twig', $params);
}

View File

@@ -42,7 +42,7 @@ class module_admin_route_users
return $this;
}
public function export(Symfony\Component\HttpFoundation\Request $request)
{
$appbox = appbox::get_instance();
@@ -143,8 +143,8 @@ class module_admin_route_users
if (is_null($v))
$this->query_parms[$k] = false;
}
$query = new User_Query($appbox);
$templates = $query
->only_templates(true)

View File

@@ -183,7 +183,7 @@ class module_admin_route_users_edit
$templates = $query
->only_templates(true)
->execute()->get_results();
$this->users_datas = $rs;
$out = array(
'datas' => $this->users_datas,
@@ -543,7 +543,7 @@ class module_admin_route_users_edit
}
$users = $this->users;
$user = User_adapter::getInstance(array_pop($users), appbox::get_instance());
if ($user->is_template() || $user->is_special())
@@ -594,29 +594,29 @@ class module_admin_route_users_edit
{
$appbox = appbox::get_instance();
$session = $appbox->get_session();
$template = \User_adapter::getInstance($this->request->get('template'), $appbox);
if ($template->get_template_owner()->get_id() != $session->get_usr_id())
{
throw new \Exception_Forbidden('You are not the owner of the template');
}
$current_user = \User_adapter::getInstance($session->get_usr_id(), $appbox);
$base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin')));
foreach ($this->users as $usr_id)
{
$user = \User_adapter::getInstance($usr_id, $appbox);
if($user->is_template())
{
continue;
}
$user->ACL()->apply_model($template, $base_ids);
}
return $this;
}

View File

@@ -338,7 +338,7 @@ return call_user_func(function()
}
catch (Exception $e)
{
}
return new Response(json_encode($result), 200, array("content-type" => "application/json"));
@@ -367,7 +367,7 @@ return call_user_func(function()
}
catch (Exception $e)
{
}
return new response(json_encode($result), 200, array("content-type" => "application/json"));
@@ -387,7 +387,7 @@ return call_user_func(function()
}
catch (Exception $e)
{
}
return new Response(json_encode($result), 200, array("content-type" => "application/json"));
@@ -405,7 +405,7 @@ return call_user_func(function()
}
catch (Exception $e)
{
}
return new Response(json_encode($result), 200, array("content-type" => "application/json"));
@@ -430,4 +430,4 @@ return call_user_func(function()
return $app;
});
});

View File

@@ -29,7 +29,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception;
return call_user_func(function(){
$app = new Silex\Application();
@@ -42,7 +42,7 @@ $app["appbox"] = appbox::get_instance();
$app['p4user'] = null;
/**
* @var API_OAuth2_Token
* @var API_OAuth2_Token
*/
$app['token'] = null;
@@ -121,6 +121,7 @@ $parseRoute = function ($route, Response $response)
}
}
}
return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action);
};
@@ -139,6 +140,7 @@ $app->before(function($request) use ($app)
$app['token'] = API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken());
if ($session->is_authenticated())
return;
if ($oauth2_adapter->has_ses_id())
{
@@ -150,7 +152,7 @@ $app->before(function($request) use ($app)
}
catch (\Exception $e)
{
}
}
$auth = new Session_Authentication_None($app['p4user']);
@@ -171,7 +173,7 @@ $app->after(function (Request $request, Response $response) use ($app, $parseRou
$route = $parseRoute($pathInfo, $response);
$log = API_V1_Log::create(
$app["appbox"],
$account,
$account,
$request->getMethod() . " " . $pathInfo,
$response->getStatusCode(),
$response->headers->get('content-type'),
@@ -659,7 +661,7 @@ $app->get('/feeds/{wrong_feed_id}/content/', $bad_request_exception);
*/
$app->error(function (\Exception $e) use ($app)
{
if ($e instanceof API_V1_exception_methodnotallowed)
$code = API_V1_result::ERROR_METHODNOTALLOWED;
elseif ($e instanceof Exception\MethodNotAllowedHttpException)
@@ -745,4 +747,4 @@ $app->error(function (\Exception $e) use ($app)
//// public function add_user(\Symfony\Component\HttpFoundation\Request $app['request']);
return $app;
});
});

View File

@@ -46,14 +46,14 @@ class module_console_systemUpgrade extends Command
$output->writeln('This version of Phraseanet requires a config/config.inc');
$output->writeln('Would you like it to be created based on your settings ?');
$dialog = $this->getHelperSet()->get('dialog');
do
{
$continue = mb_strtolower($dialog->ask($output, '<question>' . _('Create automatically') . ' (Y/n)</question>', 'y'));
}
while (!in_array($continue, array('y', 'n')));
if ($continue == 'y')
{
require __DIR__ . "/../../../../config/_GV.php";
@@ -64,16 +64,16 @@ class module_console_systemUpgrade extends Command
.'$debug=false;'."\n"
.'$debug=true;'."\n"
.'';
file_put_contents(__DIR__ . "/../../../../config/config.inc", $datas);
}
else
{
{
throw new RuntimeException('Phraseanet is not set up');
}
}
}
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';

View File

@@ -75,7 +75,7 @@ class module_prod
else
$dates[$name] = array('sbas' => array($sbas_id), 'fieldname' => $name);
}
if (isset($fields[$name]))
{
$fields[$name]['sbas'][] = $sbas_id;

View File

@@ -244,7 +244,7 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
}
catch (Exception $e)
{
}
$_lst[$indice]['type'] = $record->get_type();
}
@@ -450,11 +450,12 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
}
catch (Exception $e)
{
}
}
if (!is_array($request->get('mds')))
return $this;
$sbas_id = (int) $request->get('sbid');

View File

@@ -500,6 +500,7 @@ class module_report
public function getOrder($k = false)
{
if ($k === false)
return $this->tab_order;
return $this->tab_order[$k];
}
@@ -819,6 +820,7 @@ class module_report
public function buildReport($tab = false, $groupby = false, $on = false)
{
if (sizeof($this->report) > 0)
return $this->report;
$conn = connection::getPDOConnection($this->sbas_id);

View File

@@ -935,7 +935,7 @@ class module_report_activity extends module_report
AND (" . $collfilter['sql'] . ")
GROUP by ddate
ORDER BY ddate ASC";
$stmt = $conn->prepare($sql);
$stmt->execute($params);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -951,7 +951,7 @@ class module_report_activity extends module_report
{
$res[$key] = number_format($act, 2, '.', '');
}
return $res;
}
@@ -1102,7 +1102,7 @@ class module_report_activity extends module_report
AND (" . $collfilter['sql'] . ")
GROUP BY ddate
ORDER BY activity ASC ";
$stmt = $conn->prepare($sql);
$stmt->execute($params);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -1112,6 +1112,7 @@ class module_report_activity extends module_report
$date = new DateTime($row['ddate']);
$result[$date->format(DATE_ATOM)] = $row['activity'];
}
return $result;
}

View File

@@ -157,8 +157,10 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
public function isValid()
{
if (isset($this->dashboard) && sizeof($this->dashboard) > 0)
return true;
else
return false;
}
@@ -348,11 +350,11 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
}
catch (Exception $e)
{
}
$i++;
}
return;
}

View File

@@ -75,9 +75,9 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
}
catch (Exception $e)
{
}
$tmp = new self($sbasid, $sbas_coll, $dmin, $dmax);
$appbox->set_data_to_cache($tmp, $cache_id);
@@ -131,7 +131,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
* @return <void>
*/
public function process()
{
{
try
{
//Get number of DLs
@@ -250,8 +250,9 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
}
catch(PDOException $e)
{
}
return;
}

View File

@@ -149,8 +149,10 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
public function isValid()
{
if (isset($this->arraySorted) && sizeof($this->arraySorted) > 0)
return true;
else
return false;
}
@@ -162,10 +164,11 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
public function getTop($nbtop)
{
if (!is_int($nbtop))
return array();
$tmp = array();
if ($this->isValid())
{
foreach ($this->arraySorted as $k => $v)
@@ -182,6 +185,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
}
}
}
return $tmp;
}

View File

@@ -38,7 +38,7 @@ class module_report_download extends module_report
'mime' => 'subdef.mime',
'file' => 'subdef.file'
);
/**
* constructor
*

View File

@@ -603,10 +603,10 @@ class module_report_nav extends module_report
, 'titre' => $record->get_title()
, 'taille' => $document->get_size()
);
$this->setDisplayNav();
$this->setReport();
return $this->report;
}

View File

@@ -55,7 +55,7 @@ class patch_320f implements patchInterface
function apply(base &$appbox)
{
$feeds = array();
try
{
$sql = 'ALTER TABLE `ssel` ADD `migrated` INT NOT NULL DEFAULT "0"';
@@ -65,9 +65,9 @@ class patch_320f implements patchInterface
}
catch(Exception $e)
{
}
$sql = 'SELECT ssel_id, usr_id, name, descript, pub_date
, updater, pub_restrict, homelink
FROM ssel WHERE (public = "1" or homelink="1") and migrated = 0';
@@ -123,7 +123,7 @@ class patch_320f implements patchInterface
}
}
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
WHERE ssel_id = :ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute(array(':ssel_id' => $row['ssel_id']));

View File

@@ -202,8 +202,8 @@ class random
self::cleanTokens();
$conn = connection::getPDOConnection();
$sql = 'SELECT * FROM tokens
WHERE value = :token
$sql = 'SELECT * FROM tokens
WHERE value = :token
AND (expire_on > NOW() OR expire_on IS NULL)';
$stmt = $conn->prepare($sql);
$stmt->execute(array(':token' => $token));

View File

@@ -180,7 +180,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$connbas = $this->databox->get_connection();
@@ -530,7 +530,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
return null;
@@ -580,7 +580,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$sql = 'SELECT BIN(status) as status FROM record
WHERE record_id = :record_id';
@@ -617,6 +617,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
throw new Exception_Media_SubdefNotFound ();
if (isset($this->subdefs[$name]))
return $this->subdefs[$name];
if (!$this->subdefs)
@@ -657,7 +658,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$connbas = $this->get_databox()->get_connection();
@@ -756,8 +757,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
if ($data)
{
if (isset($this->technical_datas[$data]))
return $this->technical_datas[$data];
else
return false;
}
@@ -860,7 +863,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
);
}
$sql = 'UPDATE record
$sql = 'UPDATE record
SET originalname = :originalname WHERE record_id = :record_id';
$params = array(
@@ -1114,7 +1117,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
@@ -1340,7 +1343,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$this->delete_data_from_cache(self::CACHE_STATUS);
@@ -1355,6 +1358,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function get_reg_name()
{
if (!$this->is_grouping())
return false;
$balisename = '';
@@ -1551,6 +1555,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{
$hd = $this->get_subdef('document');
if ($hd->is_physically_present())
return new system_file(p4string::addEndSlash($hd->get_path()) . $hd->get_file());
return null;
}
@@ -1773,7 +1778,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
}
@@ -1803,16 +1808,16 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function get_data_from_cache($option = null)
{
\cache_databox::refresh($this->get_sbas_id());
$databox = $this->get_databox();
return $databox->get_data_from_cache($this->get_cache_key($option));
}
public function set_data_to_cache($value, $option = null, $duration = 0)
{
$databox = $this->get_databox();
return $databox->set_data_to_cache($value, $this->get_cache_key($option), $duration);
}
@@ -1830,7 +1835,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
break;
}
$databox = $this->get_databox();
\cache_databox::update($this->get_sbas_id(), 'record', $this->get_record_id());
return $databox->delete_data_from_cache($this->get_cache_key($option));
@@ -1871,7 +1876,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
}
@@ -1891,6 +1896,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function get_container_baskets()
{
if ($this->container_basket)
return $this->container_basket;
$appbox = appbox::get_instance();

View File

@@ -205,6 +205,7 @@ class record_preview extends record_adapter
public function get_train($pos = 0, $query='', searchEngine_adapter $search_engine=null)
{
if ($this->train)
return $this->train;
switch ($this->env)
@@ -267,10 +268,11 @@ class record_preview extends record_adapter
public function get_title($highlight = '', searchEngine_adapter $search_engine=null)
{
if ($this->title)
return $this->title;
$this->title = collection::getLogo($this->get_base_id()) . ' ';
switch ($this->env)
{
@@ -323,6 +325,7 @@ class record_preview extends record_adapter
public function get_short_history()
{
if (!is_null($this->short_history))
return $this->short_history;
$tab = array();
@@ -376,14 +379,14 @@ class record_preview extends record_adapter
if (!isset($tab[$hour][$site][$action][$row['usr_id']]))
{
$user = null;
try
{
$user = \User_Adapter::getInstance($row['usr_id'], $appbox);
}
catch (Exception $e)
{
}
$tab[$hour][$site][$action][$row['usr_id']] =
@@ -415,6 +418,7 @@ class record_preview extends record_adapter
public function get_view_popularity()
{
if (!is_null($this->view_popularity))
return $this->view_popularity;
$appbox = appbox::get_instance();
$session = $appbox->get_session();
@@ -512,6 +516,7 @@ class record_preview extends record_adapter
public function get_refferer_popularity()
{
if (!is_null($this->refferer_popularity))
return $this->refferer_popularity;
$appbox = appbox::get_instance();
$session = $appbox->get_session();
@@ -598,6 +603,7 @@ class record_preview extends record_adapter
{
if (!is_null($this->download_popularity))
return $this->download_popularity;
$appbox = appbox::get_instance();
$session = $appbox->get_session();

View File

@@ -131,8 +131,10 @@ class registry implements registryInterface
$this->load();
if(!$this->cache->is_set($key) && !is_null($defaultvalue))
return $defaultvalue;
else
return $this->cache->get($key);
}

View File

@@ -143,7 +143,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
public function set_options(searchEngine_options $options)
{
$this->options = $options;
$this->opt_search_type = (int) $options->get_search_type();
$this->opt_bases = $options->get_bases();
$this->opt_fields = $options->get_fields();
@@ -397,7 +397,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
$total_time = 0;
$sort = '';
if($this->options->get_sortby())
{
switch($this->options->get_sortord())
@@ -412,7 +412,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
}
$sort .= '0' . $this->options->get_sortby();
}
foreach ($this->queries as $sbas_id => $qry)
{
$this->results[$sbas_id] = phrasea_query2(
@@ -651,7 +651,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
{
$val = $field['value'];
}
$ret[] = $val;
}

View File

@@ -752,9 +752,9 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
'before_match' => "<em>",
'after_match' => "</em>"
);
$fields_to_send = array();
foreach($fields as $k=>$f)
{
$fields_to_send[$k] = $f['value'];

View File

@@ -454,13 +454,13 @@ class searchEngine_options implements Serializable
{
$tmpvalue = (array) $value;
$value = array();
foreach($tmpvalue as $k=>$data)
{
$k = ctype_digit($k) ? (int) $k : $k;
$value[$k] = $data;
}
}
$this->$key = $value;

View File

@@ -475,7 +475,7 @@ class set_export extends set_abstract
$sd = $download_element->get_subdefs();
foreach ($download_element->get_downloadable() as $name => $properties)
{
{
if ($properties === false || !in_array($name, $subdefs))
{
continue;
@@ -758,6 +758,7 @@ class set_export extends set_abstract
return false;
}
if (isset($list['complete']) && $list['complete'] === true)
return;
@@ -989,13 +990,13 @@ class set_export extends set_abstract
else
{
/**
*
*
* Header "Pragma: public" SHOULD be present.
* In case it is not present, download on IE 8 and previous over HTTPS
* will fail.
*
*
* @todo : merge this shitty fix with Response object.
*
*
*/
if (!headers_sent())
{
@@ -1007,6 +1008,7 @@ class set_export extends set_abstract
$response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";");
$response->headers->set('Content-Length', filesize($file));
$response->setContent(file_get_contents($file));
return $response;
}
}
@@ -1057,7 +1059,7 @@ class set_export extends set_abstract
$user = false;
if ($anonymous)
{
}
else
{

View File

@@ -53,7 +53,7 @@ class task_Scheduler
{
self::$connection = new connection_pdo ('appbox', $hostname, $port, $user, $password, $dbname);
}
return self::$connection;
}

View File

@@ -112,7 +112,7 @@ class task_manager
return $row;
}
public static function getAvailableTasks()
{
$registry = registry::get_instance();
@@ -150,6 +150,7 @@ class task_manager
closedir($hdir);
}
}
return $tasks;
}
}

View File

@@ -459,7 +459,7 @@ class task_period_ftp extends task_appboxAbstract
if (in_array(trim($basefolder), array('.', './', '')))
$basefolder = '/';
foreach ($ftp_export['files'] as $fileid => $file)
{
$base_id = $file["base_id"];
@@ -567,7 +567,7 @@ class task_period_ftp extends task_appboxAbstract
{
if($this->debug)
echo "\nlogfile \n";
$date = new DateTime();
$remote_file = $date->format('U');
@@ -575,12 +575,12 @@ class task_period_ftp extends task_appboxAbstract
FROM ftp_export_elements
WHERE ftp_export_id = :ftp_export_id
AND error = "0" AND done="1"';
$stmt = $conn->prepare($sql);
$stmt->execute(array(':ftp_export_id'=>$id));
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
$buffer = '#transfert finished '.$date->format(DATE_ATOM)."\n\n";
foreach ($rs as $row)
@@ -602,7 +602,7 @@ class task_period_ftp extends task_appboxAbstract
$ftp_client->chdir($ftp_export["destfolder"]);
$ftp_client->put($remotefile, $tmpfile);
unlink($tmpfile);
}
@@ -766,7 +766,7 @@ class task_period_ftp extends task_appboxAbstract
_('task::ftp:Status about your FTP transfert from %1$s to %2$s')
, $registry->get('GV_homeTitle'), $ftp_server
);
mail::ftp_sent($sendermail, $subject, $sender_message);
mail::ftp_receive($mail, $receiver_message);

View File

@@ -162,6 +162,7 @@ class task_period_outofdate extends task_abstract
parent.calcSQL();
</script>
<?php
return("");
}
else // ... so we NEVER come here
@@ -218,11 +219,12 @@ class task_period_outofdate extends task_abstract
jQuery.map($(this).serializeArray(), function(n, i){
json[n['name']] = n['value'];
});
return json;
};
})( jQuery );
function chgxmltxt(textinput, fieldname)
{
var limits = { 'period':{min:1, 'max':1440} , 'delay':{min:0} } ;
@@ -274,7 +276,7 @@ class task_period_outofdate extends task_abstract
}
$("#cmd").html(s);
}
});
});
}
function chgsbas(sbaspopup)
@@ -289,7 +291,7 @@ class task_period_outofdate extends task_abstract
, async:false
, success:function(data)
{
// console.log(data);
// console.log(data);
var html = "<option value=\"\">...</option>";
for(i in data.date_fields)
html += "\n<option class=\"jsFilled\" value=\"" + data.date_fields[i] + "\">" + data.date_fields[i] + "</option>";
@@ -308,12 +310,13 @@ class task_period_outofdate extends task_abstract
for(fld=0; fld<=2; fld++)
$("#status"+fld).html(html);
}
});
});
return;
}
<?php
/*
@@ -682,12 +685,13 @@ class task_period_outofdate extends task_abstract
}
$ret = ($nchanged > 0 ? $nchanged : 'NORECSTODO');
return($ret);
}
/*
function doRecords()
{
@@ -911,9 +915,9 @@ class task_period_outofdate extends task_abstract
private function calcSQL($sxTaskSettings)
{
$ret = array();
$this->sxTaskSettings = $sxTaskSettings;
$date1 = $date2 = NULL;
$field1 = $field2 = '';
@@ -1007,7 +1011,7 @@ class task_period_outofdate extends task_abstract
SET " . $sqlset[0] .
" WHERE " . $w;
// printf("%d : %s \n%s", __LINE__, $sql, var_export($params, true));
$ret[] = array('sql'=>$sql, 'params'=>$params);
// $stmt = $this->connbas->prepare($sql);
@@ -1274,7 +1278,7 @@ class task_period_outofdate extends task_abstract
}
catch(Exception $e)
{
}
}
break;

View File

@@ -68,6 +68,7 @@ class task_period_upgradetov32 extends task_abstract
{
printf("sbas_id '" . $this->sbas_id . "' invalide\n");
$this->return_value = self::RETURNSTATUS_STOPPED;
return;
}
@@ -241,7 +242,7 @@ class task_period_upgradetov32 extends task_abstract
}
catch (Exception $e)
{
}
}
@@ -369,11 +370,13 @@ class task_period_upgradetov32 extends task_abstract
if ($n_done >= 5000)
{
$this->return_value = task_abstract::RETURNSTATUS_TORESTART;
return;
}
}
if ($memory > 100)
{
$this->return_value = task_abstract::RETURNSTATUS_TORESTART;
return;
}
}
@@ -408,9 +411,9 @@ class task_period_upgradetov32 extends task_abstract
$stmt->closeCursor();
$this->setProgress(0, 0);
$this->return_value = self::RETURNSTATUS_TODELETE;
flush();
return;

View File

@@ -307,7 +307,7 @@ class task_period_writemeta extends task_databoxAbstract
$fields = $record->get_caption()->get_fields();
$subCMD = '';
if ($record->get_uuid())
{
$subCMD .= '-XMP-exif:ImageUniqueID=';
@@ -315,7 +315,7 @@ class task_period_writemeta extends task_databoxAbstract
$subCMD .= '-IPTC:UniqueDocumentID=';
$subCMD .= escapeshellarg($record->get_uuid());
}
foreach ($fields as $field)
{
$meta = $field->get_databox_field();
@@ -326,23 +326,23 @@ class task_period_writemeta extends task_databoxAbstract
$multi = $meta->is_multi();
$type = $meta->get_type();
$datas = $field->get_value();
if ($multi)
{
$datas = $field->get_value();
foreach ($datas as $value)
{
$value = $this->format_value($type, $value);
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
$subCMD .= escapeshellarg($value).' ';
}
}
else
{
$datas = $this->format_value($type, $datas);
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
$subCMD .= escapeshellarg($datas).' ';
}
}
@@ -355,17 +355,18 @@ class task_period_writemeta extends task_databoxAbstract
$cmd .= ( $registry->get('GV_exiftool') . ' -m -overwrite_original ');
if ($name != 'document' || $this->clear_doc)
$cmd .= '-all:all= ';
$cmd .= ' -codedcharacterset=utf8 ';
$cmd .= $subCMD.' '.escapeshellarg($file);
$this->log(sprintf(('writing meta for sbas_id=%1$d - record_id=%2$d (%3$s)'), $this->sbas_id, $record_id, $name));
$s = trim(shell_exec($cmd));
$this->log("\t" . $s);
}
return $this;
}

View File

@@ -655,48 +655,48 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testis_limited()
{
$appbox = appbox::get_instance();
$found = false;
foreach ($appbox->get_databoxes() as $databox)
{
foreach ($databox->get_collections() as $collection)
{
$base_id = $collection->get_base_id();
if(!self::$user->ACL()->has_access_to_base($base_id))
continue;
$this->assertFalse(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, true, new DateTime('-1 day'), new DateTime('+1 day'));
$this->assertFalse(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, false, new DateTime('-1 day'), new DateTime('+1 day'));
$this->assertFalse(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, true, new DateTime('+1 day'), new DateTime('+2 day'));
$this->assertTrue(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, true, new DateTime('-2 day'), new DateTime('-1 day'));
$this->assertTrue(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, true, new DateTime('-2 day'), new DateTime('+2 day'));
$this->assertFalse(self::$user->ACL()->is_limited($base_id));
self::$user->ACL()->set_limits($base_id, false, new DateTime('-2 day'), new DateTime('+2 day'));
$this->assertFalse(self::$user->ACL()->is_limited($base_id));
$found = true;
}
}
if(!$found)
$this->fail ('Unable to test');
}
@@ -704,50 +704,50 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testget_limits()
{
$appbox = appbox::get_instance();
$found = false;
foreach ($appbox->get_databoxes() as $databox)
{
foreach ($databox->get_collections() as $collection)
{
$base_id = $collection->get_base_id();
if(!self::$user->ACL()->has_access_to_base($base_id))
continue;
$minusone = new DateTime('-1 day');
$plusone = new DateTime('+1 day');
self::$user->ACL()->set_limits($base_id, true, $minusone, $plusone);
$limits = self::$user->ACL()->get_limits($base_id);
$this->assertEquals($limits['dmin'], $minusone);
$this->assertEquals($limits['dmax'], $plusone);
$minustwo = new DateTime('-2 day');
$plustwo = new DateTime('-2 day');
self::$user->ACL()->set_limits($base_id, true, $minustwo, $plustwo);
$limits = self::$user->ACL()->get_limits($base_id);
$this->assertEquals($limits['dmin'], $minustwo);
$this->assertEquals($limits['dmax'], $plustwo);
self::$user->ACL()->set_limits($base_id, false);
$this->assertNull(self::$user->ACL()->get_limits($base_id));
$found = true;
}
}
if(!$found)
$this->fail ('Unable to test');
}

View File

@@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../bootstrap.php';
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -25,17 +25,17 @@ class Bridge_Api_Apitest_Containers implements Bridge_Api_ContainerInterface
public function __construct()
{
}
public function get_created_on()
{
}
public function get_description()
{
}
public function get_id()
@@ -45,12 +45,12 @@ class Bridge_Api_Apitest_Containers implements Bridge_Api_ContainerInterface
public function get_thumbnail($width = 120, $height = 90)
{
}
public function get_title()
{
}
public function get_type()
@@ -60,12 +60,12 @@ class Bridge_Api_Apitest_Containers implements Bridge_Api_ContainerInterface
public function get_updated_on()
{
}
public function get_url()
{
}
}
@@ -78,27 +78,27 @@ class Bridge_Api_Apitest_Element implements Bridge_Api_ElementInterface
public function __construct()
{
}
public function get_category()
{
}
public function get_created_on()
{
}
public function get_description()
{
}
public function get_duration()
{
}
public function get_id()
@@ -108,17 +108,17 @@ class Bridge_Api_Apitest_Element implements Bridge_Api_ElementInterface
public function get_rating()
{
}
public function get_thumbnail()
{
}
public function get_title()
{
}
public function get_type()
@@ -128,22 +128,22 @@ class Bridge_Api_Apitest_Element implements Bridge_Api_ElementInterface
public function get_updated_on()
{
}
public function get_url()
{
}
public function get_view_count()
{
}
public function is_private()
{
}
}
@@ -159,17 +159,17 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
protected function initialize_transport()
{
}
protected function set_auth_params()
{
}
protected function set_transport_authentication_params()
{
}
public function get_terms_url()
@@ -178,7 +178,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
}
/**
*
*
* @return Array
*/
public function connect()
@@ -188,7 +188,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
/**
*
* @return Bridge_Api_Interface
* @return Bridge_Api_Interface
*/
public function reconnect()
{
@@ -197,7 +197,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
/**
*
* @return Bridge_Api_Interface
* @return Bridge_Api_Interface
*/
public function disconnect()
{
@@ -206,7 +206,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
/**
*
* @return boolean
* @return boolean
*/
public function is_connected()
{
@@ -214,16 +214,16 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
}
/**
*
* @return Bridge_Api_Interface
*
* @return Bridge_Api_Interface
*/
public function set_locale($locale)
{
}
/**
*
*
* @return string
*/
public function get_name()
@@ -232,39 +232,39 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
}
/**
*
*
* @return string
*/
public function get_icon_url()
{
}
/**
*
*
* @return string
*/
public function get_image_url()
{
}
/**
*
*
* @return string
*/
public function get_url()
{
}
/**
*
*
* @return string
*/
public function get_infos()
{
}
public function get_object_class_from_type($type)
@@ -292,12 +292,12 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
public function get_element_types()
{
}
public function get_container_types()
{
}
public function get_element_from_id($element_id, $object)
@@ -305,6 +305,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
$element = new Bridge_Api_Apitest_Element();
$element->id = $element_id;
$element->type = $object;
return $element;
}
@@ -313,12 +314,13 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
$container = new Bridge_Api_Apitest_Containers();
$container->id = $element_id;
$container->type = $object;
return $container;
}
public function get_category_list()
{
}
public function get_user_name()
@@ -340,6 +342,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
$element_collection->add_element(new Bridge_Api_Apitest_Element());
$i++;
}
return $element_collection;
}
@@ -352,61 +355,62 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
$container_collection->add_element(new Bridge_Api_Apitest_Containers());
$i++;
}
return $container_collection;
}
public function update_element($object, $object_id, Array $datas)
{
}
public function create_container($container_type, Request $request)
{
}
public function add_element_to_container($element_type, $element_id, $destination, $container_id)
{
}
public function delete_object($object, $object_id)
{
}
/**
*
*
* @return Closure
*/
public function acceptable_records()
{
}
public function get_element_status(Bridge_Element $element)
{
}
public function map_connector_to_element_status($status)
{
}
public function get_error_message_from_status($connector_status)
{
}
public function upload(record_adapter &$record, array $options = array())
{
}
public function is_valid_object_id($object_id)
{
}
public function is_configured()
@@ -416,27 +420,27 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
public function check_upload_constraints(array $datas, record_adapter $record)
{
}
public function get_upload_datas(Request $request, record_adapter $record)
{
}
public function is_multiple_upload()
{
}
public function check_update_constraints(Array $datas)
{
}
public function get_update_datas(Request $request)
{
}
}
@@ -446,12 +450,12 @@ class Bridge_Api_Auth_None extends Bridge_Api_Auth_Abstract implements Bridge_Ap
public function connect($param)
{
}
public function parse_request_token()
{
}
public function reconnect()
@@ -476,12 +480,12 @@ class Bridge_Api_Auth_None extends Bridge_Api_Auth_Abstract implements Bridge_Ap
public function get_auth_signatures()
{
}
public function set_parameters(Array $parameters)
{
}
}
}

View File

@@ -1,8 +1,8 @@
<?php
/**
* @example
*
* @example
*
try
{
$validator = new W3CFeedRawValidator($xml);
@@ -22,7 +22,7 @@
{
print "\n" . $e->getMessage();
}
*
*
*/
/**
@@ -30,7 +30,7 @@
*/
class W3CFeedValidatorException extends Exception
{
}
/**
@@ -55,7 +55,7 @@ class W3CFeedUrlValidator extends W3CFeedValidator
/**
* The URL of the document to validate
* @var string
* @var string
*/
private $url;
@@ -88,12 +88,13 @@ class W3CFeedUrlValidator extends W3CFeedValidator
{
throw new W3CFeedValidatorException("Unable to request W3C API");
}
return new W3CFeedValidatorResponse($response);
}
/**
* Check if an url is valid
* @param string $url
* @param string $url
* @return boolean
*/
private function isValidUrl($url)
@@ -112,14 +113,14 @@ class W3CFeedRawValidator extends W3CFeedValidator
/**
* The source of the document to validate
* @var string
* @var string
*/
private $rawData;
/**
* Constructor
* Init instance which the specified data to validate
* @param string $rawData
* @param string $rawData
*/
public function __construct($rawData)
{
@@ -151,6 +152,7 @@ class W3CFeedRawValidator extends W3CFeedValidator
{
throw new W3CFeedValidatorException("Unable to request W3C API");
}
return new W3CFeedValidatorResponse($response);
}
@@ -209,36 +211,40 @@ class W3CFeedValidatorResponse
$string .= $name . "=>" . $detail . "\n";
}
}
return $string;
}
/**
* Check if the XML is valid
* @return boolean
* Check if the XML is valid
* @return boolean
*/
public function isValid()
{
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:validity";
return $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== "false";
}
/**
* Check for errors
* @return boolean
* @return boolean
*/
public function hasError()
{
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:errors/m:errorcount";
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
}
/**
* check fro warnings
* @return boolean
* @return boolean
*/
public function hasWarning()
{
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:warnings/m:warningcount";
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
}
@@ -271,8 +277,8 @@ class W3CFeedValidatorResponse
* 1 => etc ..
* }
* }
*
* @return array
*
* @return array
*/
public function getWarnings()
{
@@ -286,12 +292,13 @@ class W3CFeedValidatorResponse
$warnings[] = $this->domNodeToArray($warning);
}
}
return $warnings;
}
/**
* Get an array with all errors as follow
* @return array
* @return array
*/
public function getErrors()
{
@@ -305,14 +312,15 @@ class W3CFeedValidatorResponse
$errors[] = $this->domNodeToArray($error);
}
}
return $errors;
}
/**
* @source http://www.ermshaus.org/2010/12/php-transform-domnode-to-array
*
*
* Transforms the contents of a DOMNode to an associative array
*
*
* XML node names become array keys, attributes will be discarded. If $node
* doesn't contain child nodes, a string will be returned.
*

View File

@@ -10,7 +10,7 @@
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -29,7 +29,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
const USER_AGENT_IPHONE = 'Mozilla/5.0 (iPod; U; CPU iPhone OS 2_1 like Mac OS X; fr-fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F137 Safari/525.20';
/**
*
* @var Symfony\Component\HttpKernel\Client
* @var Symfony\Component\HttpKernel\Client
*/
protected $client;
@@ -330,7 +330,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
/**
*
* @var collection
* @var collection
*/
protected static $collection;
protected static $time_start;
@@ -340,7 +340,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
{
if (!self::$time_start)
self::$time_start = microtime(true);
if(!setup::is_installed())
exit("Phraseanet is not set up\n");
@@ -431,12 +431,12 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
$basket_coll = new basketCollection($appbox, self::$user->get_id());
$baskets = $basket_coll->get_baskets();
foreach($baskets['baskets'] as $basket)
{
$basket->delete();
}
basket_adapter::create($appbox, 'TEST', self::$user);
$appbox->get_session()->authenticate(new Session_Authentication_None(self::$user));
@@ -919,11 +919,11 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
{
return $this->assertRegExp('/\d{4}[-]\d{2}[-]\d{2}[T]\d{2}[:]\d{2}[:]\d{2}[+]\d{2}[:]\d{2}/', $date);
}
protected function set_user_agent($user_agent)
{
$browser = Browser::getInstance();
$browser->setUserAgent($user_agent);
}
}
}

View File

@@ -10,7 +10,7 @@
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -40,7 +40,7 @@ abstract class PhraseanetPHPUnitAuthenticatedAbstract extends PhraseanetPHPUnitA
$session->logout();
parent::tearDown();
}
// public static function setUpBeforeClass()
// {
// parent::setUpBeforeClass();
@@ -55,4 +55,4 @@ abstract class PhraseanetPHPUnitAuthenticatedAbstract extends PhraseanetPHPUnitA
// parent::tearDownAfterClass();
// }
}
}

View File

@@ -10,7 +10,7 @@
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -34,4 +34,4 @@ abstract class PhraseanetWebTestCaseAbstract extends PhraseanetPHPUnitAbstract
$this->app = $this->createApplication();
}
}
}

View File

@@ -10,7 +10,7 @@
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -35,4 +35,4 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
$this->app = $this->createApplication();
}
}
}

View File

@@ -153,13 +153,13 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
public function testDec2bin()
{
$this->assertEquals('1010', databox_status::dec2bin('10'));
try
{
}
catch(Exception $e)
{
}
}
@@ -167,7 +167,7 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
{
$this->assertEquals('10100001', databox_status::hex2bin('0x0A1'));
$this->assertEquals('10100001', databox_status::hex2bin('0A1'));
try
{
databox_status::hex2bin('G1');
@@ -175,7 +175,7 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
}
catch(Exception $e)
{
}
}

View File

@@ -117,7 +117,7 @@ class Feed_overviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
$crawler = $this->client->request('GET', $url);
$response = $this->client->getResponse();
if (self::$record_1->get_preview()->get_baseurl() !== '')
{
$this->assertEquals(302, $response->getStatusCode());

View File

@@ -64,6 +64,7 @@ class Module_Prod_Route_RecordFeedApp extends PhraseanetWebTestCaseAuthenticated
public function createApplication()
{
$app = require __DIR__ . '/../../../../../classes/module/Prod.php';
return $app;
}
@@ -211,7 +212,7 @@ class Module_Prod_Route_RecordFeedApp extends PhraseanetWebTestCaseAuthenticated
// }
// catch (Exception $e)
// {
//
//
// }
// }
//

View File

@@ -163,9 +163,9 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
/**
* XML is not verified due to Validator Service bug
*/
return;
try
{
$validator = new W3CFeedRawValidator($xml);
@@ -253,7 +253,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
$offset_start = ($offset_start++) * $n_entries;
$collection = $feed->get_entries($offset_start, $n_entries);
$entries = $collection->get_entries();
if (sizeof($entries) == 0) //no more
if (sizeof($entries) == 0) //no more
break;
}
$feed_entry = array_shift($entries);
@@ -331,6 +331,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
{
$current_attributes[$attribute->name] = $attribute->value;
}
return $current_attributes;
}
@@ -470,7 +471,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
)
);
foreach ($fields as $key_field => $field)
{
if ($field["media_field"]["name"] == $node->nodeName)
@@ -516,6 +517,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
unset($item_entries[$key]); //remove
}
};
return $remove;
}
@@ -562,7 +564,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
$offset_start = ($offset_start++) * $n_entries;
$collection = $feed->get_entries($offset_start, $n_entries);
$entries = $collection->get_entries();
if (sizeof($entries) == 0) //no more
if (sizeof($entries) == 0) //no more
break;
}
$feed_entry = array_shift($entries);
@@ -642,4 +644,4 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
}
}
}
}

View File

@@ -100,7 +100,7 @@ class dashboardTest extends PhraseanetPHPUnitAbstract
{
if ($key == 'activity_added')
{
}
$this->assertLessThanOrEqual($nbDay, count($dash));
}
@@ -119,7 +119,7 @@ class dashboardTest extends PhraseanetPHPUnitAbstract
}
catch (Exception $e)
{
}
}

View File

@@ -29,7 +29,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract
*/
public function tearDown()
{
}
/**

View File

@@ -23,8 +23,8 @@ require_once dirname(__FILE__) . '/PhraseanetPHPUnitAbstract.class.inc';
class userTest extends PhraseanetPHPUnitAbstract
{
public function testMail()
{
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
@@ -32,10 +32,10 @@ class userTest extends PhraseanetPHPUnitAbstract
{
$appbox = appbox::get_instance();
self::$user->set_email(null);
self::$user->set_email(null);
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
self::$user->set_email('');
self::$user->set_email('');
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
self::$user->set_email('noone@example.com');
$this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noone@example.com'));
@@ -46,14 +46,14 @@ class userTest extends PhraseanetPHPUnitAbstract
}
try
{
self::$user->set_email('noonealt1@example.com');
$this->fail('A user already got this address');
}
catch(Exception $e)
{
}
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
}
}
}

View File

@@ -124,7 +124,7 @@
<tr>
<td>
{% if main_user is not empty %}
{% if main_user.is_special is not empty %}
{% if main_user.get_login() == 'invite' %}
{% trans 'Reglages:: reglages d acces guest' %}
@@ -199,7 +199,7 @@
<td></td>
</tr>
{% endif %}
<tr>
<td style="width:122px;overflow:hidden;white-space:nowrap;">
{{rights['sbas_id']|sbas_name}}
@@ -556,7 +556,7 @@
{% endif %}
</div>
<div class="PNB10" style="top:auto;height:20px;">
<button class="users_rights_valid">{% trans 'boutton::valider' %}</button>
<button class="users_rights_valid">{% trans 'boutton::valider' %}</button>
<a href="/admin/users/search/" class="users_rights_cancel">{% trans 'boutton::retour' %}</a>
</div>
</div>

View File

@@ -21,13 +21,13 @@
</tr>
<tr>
<td colspan="2">
{% trans 'De' %}
{% trans 'De' %}
<input type="text" class="dmin datepicker" name="dmin" {% if datas.time_limited == 0 %}readonly="readonly"{% endif %} value="{{datas.limited_from}}" />
</td>
</tr>
<tr>
<td colspan="2">
{% trans 'A' %}
{% trans 'A' %}
<input type="text" class="dmax datepicker" name="dmax" {% if datas.time_limited == 0 %}readonly="readonly"{% endif %} value="{{datas.limited_to}}" />
</td>
</tr>

View File

@@ -94,7 +94,7 @@
}
})
};
function activeTree(click)
{
$('#FNDR').treeview({
@@ -142,7 +142,7 @@
activeTree(true);
}
);
function refreshBaskets()
{
return;

View File

@@ -32,7 +32,7 @@
{% endif %}
<li class="{% if feature == 'connected' %}selected{% endif %}">
<a target="right" href="sessionwhois.php" class="ajax zone_online_users">
<a target="right" href="sessionwhois.php" class="ajax zone_online_users">
<img src="/skins/admin/Connected.png" />
{% trans 'admin::utilisateurs: utilisateurs connectes' %}
</a>
@@ -40,13 +40,13 @@
{% if user.ACL().has_right('manageusers') %}
<li class="{% if feature == 'users' %}selected{% endif %}">
<a target="right" href="/admin/users/search/" class="ajax zone_editusers">
<a target="right" href="/admin/users/search/" class="ajax zone_editusers">
<img src="/skins/admin/Users.png" />
{% trans 'admin::utilisateurs: utilisateurs' %}
</a>
</li>
<li class="{% if feature == 'registrations' %}selected{% endif %}">
<a target="right" href="demand.php?act=LISTUSERS">
<a target="right" href="demand.php?act=LISTUSERS">
<img src="/skins/admin/Demandes.png" />
{% trans 'admin::utilisateurs: demandes en cours' %}
</a>
@@ -64,7 +64,7 @@
{% if user.ACL().has_right('taskmanager') %}
<li class="{% if feature == 'taskmanager' %}selected{% endif %}">
<a target="right" href="taskmanager.php">
<a target="right" href="taskmanager.php">
<img src="/skins/admin/TaskManager.png" />
{% trans 'admin::utilisateurs: gestionnaire de taches' %}
</a>
@@ -73,7 +73,7 @@
<li class="open">
<div class="{% if feature == 'bases' %}selected{% endif %}" style="padding:0 0 2px 0;">
<a id="TREE_DATABASES" target="right" href="databases.php">
<a id="TREE_DATABASES" target="right" href="databases.php">
<img src="/skins/admin/DatabasesAvailable.png" />
{% trans 'admin::utilisateurs: bases de donnees' %}
</a>
@@ -98,46 +98,46 @@
<li class="{% if this_is_open %}open{% endif %}">
<div style="padding:0 0 2px 0;" class="{% if this_is_selected %}selected{% endif %}">
<a target="right" href="database.php?p0={{ sbas_id }}">
<img src="/skins/admin/Database.png"/>
<a target="right" href="database.php?p0={{ sbas_id }}">
<img src="/skins/admin/Database.png"/>
{{ databox.get_viewname() }}
</a>
</div>
<ul>
{% if user.ACL().has_right_on_sbas( sbas_id , 'bas_modify_struct') %}
<li>
<a target="right" href="structure.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
<li>
<a target="right" href="structure.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'admin::structure: reglage de la structure' %}
</a>
</li>
<li>
<a target="right" href="description.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
<li>
<a target="right" href="description.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'CHAMPS' %}
</a>
</li>
<li>
<a target="right" href="subdefs.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
<li>
<a target="right" href="subdefs.php?act=STRUCTURE&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust01.gif"/>
{% trans 'SUBDEFS' %}
</a>
</li>
<li>
<a target="right" href="statbits.php?act=STATBITS&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust02.gif"/>
<li>
<a target="right" href="statbits.php?act=STATBITS&p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust02.gif"/>
{% trans 'admin::status: reglage des status' %}
</a>
</li>
<li>
<a target="right" href="cgus.php?p0={{ sbas_id }}">
<li>
<a target="right" href="cgus.php?p0={{ sbas_id }}">
{% trans 'admin:: CGUs' %}
</a>
</li>
<li>
<a target="right" href="collorder.php?p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust03.gif"/>
<li>
<a target="right" href="collorder.php?p0={{ sbas_id }}">
<img src="/skins/icons/miniadjust03.gif"/>
{% trans 'admin::collection: ordre des collections' %}
</a>
</li>
@@ -153,7 +153,7 @@
{% if seeUsrGene %}
<li>
<a target="right" href="/admin/users/search/?sbas_id[]={{ sbas_id }}" class="ajax">
<a target="right" href="/admin/users/search/?sbas_id[]={{ sbas_id }}" class="ajax">
<img src="/skins/admin/Users.png"/>
{% trans 'admin::utilisateurs: utilisateurs' %}
</a>
@@ -175,20 +175,20 @@
{% if (user.ACL.has_right_on_base(collection.get_base_id(), 'modify_struct')) %}
<li>
<a target="right" href="sugval.php?p0={{ sbas_id }}&p1={{ collection.get_base_id() }}">
<img src="/skins/icons/foldph20open_0.gif"/>
<a target="right" href="sugval.php?p0={{ sbas_id }}&p1={{ collection.get_base_id() }}">
<img src="/skins/icons/foldph20open_0.gif"/>
{% trans 'admin::base: preferences de collection' %}
</a>
</li>
{% endif %}
{% if (user.ACL.has_right_on_base( collection.get_base_id(), 'canadmin')) %}
{% if (user.ACL.has_right_on_base( collection.get_base_id(), 'canmodifrecord')
{% if (user.ACL.has_right_on_base( collection.get_base_id(), 'canmodifrecord')
and user.ACL.has_right_on_base( collection.get_base_id(), 'manage')
and user.ACL.has_right_on_sbas( sbas_id, 'bas_manage') ) %}
<li>
<a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax">
<img src="/skins/admin/Users.png"/>
<a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax">
<img src="/skins/admin/Users.png"/>
{% trans 'admin::utilisateurs: utilisateurs' %}
</a>
</li>
@@ -214,4 +214,4 @@
' . $row["dbname"] . '(' . $row["host"] . ':' . $row["port"] . ')
</li>
{% endfor %}
</ul>
</ul>

View File

@@ -32,7 +32,7 @@
{% endif %}
{% endif %}
</li>
{% if browser.isNewGeneration and registry.get('GV_thesaurus') == true and user.ACL.has_access_to_module('thesaurus') %}
<li>
<a target="_blank" href="/thesaurus2/">
@@ -42,8 +42,8 @@
</a>
</li>
{% endif %}
{# MODULE #}
{% if user.ACL.has_access_to_module('admin') %}
<li>
@@ -104,20 +104,20 @@
</a>
</li>
{% endif %}
{% endif %}
</ol>
</div>
<div class="PNB" style="left:auto;overflow:hidden;">
<ol>
{% if module == "client" or module == "prod" %}
<li id="notification_trigger">
<a href="#" style="font-weight:bold;text-decoration:none;">
<span>
{% trans 'Notifications' %}
<span class="counter" style="visibility:{% if events.get_unread_notifications_number > 0 %}visible{% else %}hidden{% endif %};">
<div style="padding:1px 3px 0;">
{% if events.get_unread_notifications_number > 0 %}
@@ -191,4 +191,4 @@
<div style="display:none;z-index:30000;" id="notification_box">
{% set notifications = events.get_notifications %}
{% include 'prod/notifications.twig' %}
</div>
</div>

View File

@@ -122,7 +122,7 @@
setTimeout("$('form#create_admin').submit();",500);
};
}
if($current.hasClass('appbox_settings'))
{
test_connection_appbox(callback);
@@ -195,7 +195,7 @@
var password_input = $('input[name="ab_password"]', appbox_scope);
var dbname_input = $('input[name="db_name"]', databox_scope);
var user = user_input.val();
var password = password_input.val();
var dbname = dbname_input.val();

View File

@@ -83,7 +83,7 @@ $TOU = $databox->get_cgus();
</head>
<body>
<h1><?php echo _('Terms Of Use'); ?></h1>
<form target="_self" method="post" action="cgus.php">
<div style="text-align:center;margin:10px 0;">
<input type="submit" value="<?php echo _('Mettre a jour'); ?>" id="valid"/><input type="checkbox" value="1" name="valid"/><label for="valid"><?php echo _('admin::CGU Les utilisateurs doivent imperativement revalider ces conditions'); ?></label>

Some files were not shown because too many files have changed in this diff Show More