mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Refactor client
Terminate baskets.php Update Refactor Fix grid layout Fix page navigation issue when no results Fix mainMenu position for ie6 Fix IE6 javascript errors Fix some client bugs Fix indent cleanup Add Client tests Fix typo FIx indent Use new search engine API Remove useless comments Remove old client Add cover annotations CS fixer
This commit is contained in:
@@ -44,6 +44,9 @@ rewrite ^/user/notifications/.*$ /index.php last;
|
||||
rewrite ^/download/.*$ /index.php last;
|
||||
rewrite ^/session/.*$ /index.php last;
|
||||
|
||||
rewrite ^/client/.*$ /index.php last;
|
||||
rewrite ^/client/baskets.*$ /index.php last;
|
||||
|
||||
rewrite ^/api/v1/.*$ /api/v1/index.php last;
|
||||
rewrite ^/api/oauthv2/.*$ /api/oauthv2/index.php last;
|
||||
rewrite ^/api/.*$ /api/index.php last;
|
||||
|
@@ -342,7 +342,7 @@ class Application extends SilexApplication
|
||||
$twig->addExtension(new \Twig_Extension_Core());
|
||||
$twig->addExtension(new \Twig_Extension_Optimizer());
|
||||
$twig->addExtension(new \Twig_Extension_Escaper());
|
||||
$twig->addExtension(new \Twig_Extensions_Extension_Debug());
|
||||
|
||||
// add filter trans
|
||||
$twig->addExtension(new \Twig_Extensions_Extension_I18n());
|
||||
// add filter localizeddate
|
||||
@@ -357,6 +357,7 @@ class Application extends SilexApplication
|
||||
$twig->addFilter('stripdoublequotes', new \Twig_Filter_Function('stripdoublequotes'));
|
||||
$twig->addFilter('get_collection_logo', new \Twig_Filter_Function('collection::getLogo'));
|
||||
$twig->addFilter('floor', new \Twig_Filter_Function('floor'));
|
||||
$twig->addFilter('min', new \Twig_Filter_Function('min'));
|
||||
$twig->addFilter('bas_names', new \Twig_Filter_Function('phrasea::bas_names'));
|
||||
$twig->addFilter('sbas_names', new \Twig_Filter_Function('phrasea::sbas_names'));
|
||||
$twig->addFilter('sbas_from_bas', new \Twig_Filter_Function('phrasea::sbasFromBas'));
|
||||
|
@@ -28,6 +28,8 @@ use Alchemy\Phrasea\Controller\Admin\SearchEngine;
|
||||
use Alchemy\Phrasea\Controller\Admin\Subdefs;
|
||||
use Alchemy\Phrasea\Controller\Admin\TaskManager;
|
||||
use Alchemy\Phrasea\Controller\Admin\Users;
|
||||
use Alchemy\Phrasea\Controller\Client\Root as ClientRoot;
|
||||
use Alchemy\Phrasea\Controller\Client\Baskets as ClientBasket;
|
||||
use Alchemy\Phrasea\Controller\Prod\Basket;
|
||||
use Alchemy\Phrasea\Controller\Prod\Bridge;
|
||||
use Alchemy\Phrasea\Controller\Prod\Download;
|
||||
@@ -166,6 +168,9 @@ return call_user_func(function($environment = null) {
|
||||
$app->mount('/download/', new DoDownload());
|
||||
$app->mount('/session/', new Session());
|
||||
|
||||
$app->mount('/client/', new ClientRoot());
|
||||
$app->mount('/client/baskets', new ClientBasket());
|
||||
|
||||
$app->error(function(\Exception $e) use ($app) {
|
||||
$request = $app['request'];
|
||||
|
||||
|
314
lib/Alchemy/Phrasea/Controller/Client/Baskets.php
Normal file
314
lib/Alchemy/Phrasea/Controller/Client/Baskets.php
Normal file
@@ -0,0 +1,314 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Controller\Client;
|
||||
|
||||
use Entities\Basket;
|
||||
use Entities\BasketElement;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Silex\Application;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Baskets implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
/**
|
||||
* Gets client baskets
|
||||
*
|
||||
* name : get_client_baskets
|
||||
*
|
||||
* description : fetch current user baskets
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->match('/', $this->call('getBaskets'))
|
||||
->method('POST|GET')
|
||||
->bind('get_client_baskets');
|
||||
|
||||
/**
|
||||
* Creates a new basket
|
||||
*
|
||||
* name : client_new_basket
|
||||
*
|
||||
* description : Create a new basket
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : REDIRECT Response
|
||||
*/
|
||||
$controllers->post('/new/', $this->call('createBasket'))
|
||||
->bind('client_new_basket');
|
||||
|
||||
/**
|
||||
* Deletes a basket
|
||||
*
|
||||
* name : client_delete_basket
|
||||
*
|
||||
* description : Delete a basket
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : REDIRECT Response
|
||||
*/
|
||||
$controllers->post('/delete/', $this->call('deleteBasket'))
|
||||
->bind('client_delete_basket');
|
||||
|
||||
/**
|
||||
* Checks if client basket should be updated
|
||||
*
|
||||
* name : client_basket_check
|
||||
*
|
||||
* description : Update basket client
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : JSON Response
|
||||
*/
|
||||
$controllers->post('/check/', $this->call('checkBaskets'))
|
||||
->bind('client_basket_check');
|
||||
|
||||
/**
|
||||
* Adds an element to a basket
|
||||
*
|
||||
* name : client_basket_add_element
|
||||
*
|
||||
* description : Add an element to a basket
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : REDIRECT Response
|
||||
*/
|
||||
$controllers->post('/add-element/', $this->call('addElementToBasket'))
|
||||
->bind('client_basket_add_element');
|
||||
|
||||
/**
|
||||
* Deletes an element from a basket
|
||||
*
|
||||
* name : client_basket_delete_element
|
||||
*
|
||||
* description : Delete an element from a basket
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : REDIRECT Response
|
||||
*/
|
||||
$controllers->post('/delete-element/', $this->call('deleteBasketElement'))
|
||||
->bind('client_basket_delete_element');
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a basket element
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function deleteBasketElement(Application $app, Request $request)
|
||||
{
|
||||
try {
|
||||
$repository = $app['EM']->getRepository('\Entities\BasketElement');
|
||||
$basketElement = $repository->findUserElement($request->request->get('p0'), $app['phraseanet.user']);
|
||||
$app['EM']->remove($basketElement);
|
||||
$app['EM']->flush();
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
return $app->redirect($app['url_generator']->generate('get_client_baskets', array(
|
||||
'courChuId' => $request->request->get('courChuId', '')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a basket
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function deleteBasket(Application $app, Request $request)
|
||||
{
|
||||
try {
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket($app, $request->request->get('courChuId'), $app['phraseanet.user'], true);
|
||||
|
||||
$app['EM']->remove($basket);
|
||||
$app['EM']->flush();
|
||||
unset($basket);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
return $app->redirect($app['url_generator']->generate('get_client_baskets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new basket
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function createBasket(Application $app, Request $request)
|
||||
{
|
||||
$basket = null;
|
||||
|
||||
try {
|
||||
$basket = new Basket();
|
||||
$basket->setName($request->request->get('p0'));
|
||||
$basket->setOwner($app['phraseanet.user']);
|
||||
|
||||
$app['EM']->persist($basket);
|
||||
$app['EM']->flush();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
return $app->redirect($app['url_generator']->generate('get_client_baskets', array(
|
||||
'courChuId' => null !== $basket ? $basket->getId() : ''
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an element to a basket
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function addElementToBasket(Application $app, Request $request)
|
||||
{
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket($app, $request->request->get('courChuId'), $app['phraseanet.user'], true);
|
||||
|
||||
if ($basket) {
|
||||
try {
|
||||
$record = new \record_adapter($app, $request->request->get('sbas'), $request->request->get('p0'));
|
||||
|
||||
$basketElement = new BasketElement();
|
||||
$basketElement->setRecord($record);
|
||||
$basketElement->setBasket($basket);
|
||||
$basket->addBasketElement($basketElement);
|
||||
|
||||
$app['EM']->persist($basket);
|
||||
|
||||
$app['EM']->flush();
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $app->redirect($app['url_generator']->generate('get_client_baskets', array(
|
||||
'courChuId' => $basket ? $basket->getId() : ''
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetchs current user baskets
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function getBaskets(Application $app, Request $request)
|
||||
{
|
||||
$selectedBasketId = trim($request->get('courChuId', ''));
|
||||
$baskets = new ArrayCollection($app['EM']->getRepository('\Entities\Basket')->findActiveByUser($app['phraseanet.user']));
|
||||
$selectedBasket = null;
|
||||
|
||||
if ('' === $selectedBasketId && $baskets->count() > 0) {
|
||||
$selectedBasketId = $baskets->first()->getId();
|
||||
}
|
||||
|
||||
if ('' !== $selectedBasketId) {
|
||||
$selectedBasket = $app['EM']->getRepository('\Entities\Basket')->findUserBasket($app, $selectedBasketId, $app['phraseanet.user'], true);
|
||||
}
|
||||
|
||||
$basketCollections = $baskets->partition(function($key, $basket) {
|
||||
return (Boolean) $basket->getPusherId();
|
||||
});
|
||||
|
||||
return $app['twig']->render('client/baskets.html.twig', array(
|
||||
'total_baskets' => $baskets->count(),
|
||||
'user_baskets' => $basketCollections[1],
|
||||
'recept_user_basket' => $basketCollections[0],
|
||||
'selected_basket' => $selectedBasket,
|
||||
'selected_basket_elements' => $selectedBasket ? $selectedBasket->getElements() : new ArrayCollection()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks Update basket client
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function checkBaskets(Application $app, Request $request)
|
||||
{
|
||||
$noview = 0;
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$baskets = $repository->findActiveByUser($app['phraseanet.user']);
|
||||
|
||||
foreach ($baskets as $basket) {
|
||||
if (!$basket->getIsRead()) {
|
||||
$noview++;
|
||||
}
|
||||
}
|
||||
|
||||
return $app->json(array(
|
||||
'success' => true,
|
||||
'message' => '',
|
||||
'no_view' => $noview
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix the method to call with the controller class name
|
||||
*
|
||||
* @param string $method The method to call
|
||||
* @return string
|
||||
*/
|
||||
private function call($method)
|
||||
{
|
||||
return sprintf('%s::%s', __CLASS__, $method);
|
||||
}
|
||||
}
|
548
lib/Alchemy/Phrasea/Controller/Client/Root.php
Normal file
548
lib/Alchemy/Phrasea/Controller/Client/Root.php
Normal file
@@ -0,0 +1,548 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Controller\Client;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
||||
use Silex\Application;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
||||
class Root implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
/**
|
||||
* Get client main page
|
||||
*
|
||||
* name : get_client
|
||||
*
|
||||
* description : Get client homepage
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->get('/', $this->call('getClient'))
|
||||
->bind('get_client');
|
||||
|
||||
/**
|
||||
* Get client language
|
||||
*
|
||||
* name : get_client_language
|
||||
*
|
||||
* description : Get client language
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : JSON Response
|
||||
*/
|
||||
$controllers->get('/language/', $this->call('getClientLanguage'))
|
||||
->bind('get_client_language');
|
||||
|
||||
/**
|
||||
* Get client publication page
|
||||
*
|
||||
* name : client_publications_start_page
|
||||
*
|
||||
* description : Get client language
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : JSON Response
|
||||
*/
|
||||
$controllers->get('/publications/', $this->call('getClientPublications'))
|
||||
->bind('client_publications_start_page');
|
||||
|
||||
/**
|
||||
* Get client help page
|
||||
*
|
||||
* name : client_help_start_page
|
||||
*
|
||||
* description : Get client help
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->get('/help/', $this->call('getClientHelp'))
|
||||
->bind('client_help_start_page');
|
||||
|
||||
/**
|
||||
* Query client for documents
|
||||
*
|
||||
* name : client_query
|
||||
*
|
||||
* description : Query client for documents
|
||||
*
|
||||
* method : POST
|
||||
*
|
||||
* parameters : none
|
||||
*
|
||||
* return : JSON Response
|
||||
*/
|
||||
$controllers->post('/query/', $this->call('query'))
|
||||
->bind('client_query');
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries database to fetch documents
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function query(Application $app, Request $request)
|
||||
{
|
||||
$query = $this->buildQueryFromRequest($request);
|
||||
$displayMode = explode('X', $request->request->get('mod', '3X6'));
|
||||
|
||||
if (count($displayMode) === 1) {
|
||||
$modRow = (int) ($displayMode[0]);
|
||||
$modCol = 1;
|
||||
} else {
|
||||
$modRow = (int) ($displayMode[0]);
|
||||
$modCol = (int) ($displayMode[1]);
|
||||
}
|
||||
|
||||
$perPage = $modCol * $modRow;
|
||||
|
||||
$options = SearchEngineOptions::fromRequest($app, $request);
|
||||
$app['phraseanet.SE']->setOptions($options);
|
||||
|
||||
$currentPage = (int) $request->request->get('pag', 0);
|
||||
|
||||
if ($currentPage < 1) {
|
||||
$app['phraseanet.SE']->resetCache();
|
||||
$currentPage = 1;
|
||||
}
|
||||
|
||||
$result = $app['phraseanet.SE']->query($query, $currentPage, $perPage);
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
$colls = array_map(function(\collection $collection) {
|
||||
return $collection->get_coll_id();
|
||||
}, array_filter($options->getCollections(), function(\collection $collection) use ($databox) {
|
||||
return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
|
||||
}));
|
||||
|
||||
$app['phraseanet.SE.logger']->log($databox, $result->getQuery(), $result->getTotal(), $colls);
|
||||
}
|
||||
|
||||
$searchData = $result->getResults();
|
||||
|
||||
if (count($searchData) === 0 ) {
|
||||
return new Response($app['twig']->render("client/help.html.twig"));
|
||||
}
|
||||
|
||||
$resultData = array();
|
||||
|
||||
foreach ($searchData as $record) {
|
||||
try {
|
||||
$record->get_subdef('document');
|
||||
$lightInfo = $app['twig']->render('common/technical_datas.html.twig', array('record' => $record));
|
||||
} catch (\Exception $e) {
|
||||
$lightInfo = '';
|
||||
}
|
||||
|
||||
$caption = $app['twig']->render('common/caption.html.twig', array('view' => 'answer', 'record' => $record));
|
||||
|
||||
$docType = $record->get_type();
|
||||
$isVideo = ($docType == 'video');
|
||||
$isAudio = ($docType == 'audio');
|
||||
$isImage = ($docType == 'image');
|
||||
$isDocument = ($docType == 'document');
|
||||
|
||||
if (!$isVideo && !$isAudio) {
|
||||
$isImage = true;
|
||||
}
|
||||
|
||||
$canDownload = $app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'candwnldpreview') ||
|
||||
$app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'candwnldhd') ||
|
||||
$app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'cancmd');
|
||||
|
||||
try {
|
||||
$previewExists = $record->get_preview()->is_physically_present();
|
||||
} catch (\Exception $e) {
|
||||
$previewExists = false;
|
||||
}
|
||||
|
||||
$resultData[] = array(
|
||||
'record' => $record,
|
||||
'mini_logo' => \collection::getLogo($record->get_base_id(), $app),
|
||||
'preview_exists' => $previewExists,
|
||||
'light_info' => $lightInfo,
|
||||
'caption' => $caption,
|
||||
'is_video' => $isVideo,
|
||||
'is_audio' => $isAudio,
|
||||
'is_image' => $isImage,
|
||||
'is_document' => $isDocument,
|
||||
'can_download' => $canDownload,
|
||||
'can_add_to_basket' => $app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'canputinalbum')
|
||||
);
|
||||
}
|
||||
|
||||
return new Response($app['twig']->render("client/answers.html.twig", array(
|
||||
'mod_col' => $modCol,
|
||||
'mod_row' => $modRow,
|
||||
'result_data' => $resultData,
|
||||
'per_page' => $perPage,
|
||||
'search_engine' => $app['phraseanet.SE'],
|
||||
'search_engine_option' => $options->serialize(),
|
||||
'history' => \queries::history($app['phraseanet.appbox'], $app['phraseanet.user']->get_id()),
|
||||
'result' => $result,
|
||||
'proposals' => $currentPage === 1 ? $result->getProposals() : null,
|
||||
'help' => count($resultData) === 0 ? $this->getHelpStartPage($app) : '',
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets help start page
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function getClientHelp(Application $app, Request $request)
|
||||
{
|
||||
return new Response($this->getHelpStartPage($app));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets client publication start page
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function getClientPublications(Application $app, Request $request)
|
||||
{
|
||||
return new Response($this->getPublicationStartPage($app));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets client language
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function getClientLanguage(Application $app, Request $request)
|
||||
{
|
||||
$out = array();
|
||||
$out['createWinInvite'] = _('paniers:: Quel nom souhaitez vous donner a votre panier ?');
|
||||
$out['chuNameEmpty'] = _('paniers:: Quel nom souhaitez vous donner a votre panier ?');
|
||||
$out['noDLok'] = _('export:: aucun document n\'est disponible au telechargement');
|
||||
$out['confirmRedirectAuth'] = _('invite:: Redirection vers la zone d\'authentification, cliquez sur OK pour continuer ou annulez');
|
||||
$out['serverName'] = $app['phraseanet.registry']->get('GV_ServerName');
|
||||
$out['serverError'] = _('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
|
||||
$out['serverTimeout'] = _('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
|
||||
$out['serverDisconnected'] = _('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
|
||||
$out['confirmDelBasket'] = _('paniers::Vous etes sur le point de supprimer ce panier. Cette action est irreversible. Souhaitez-vous continuer ?');
|
||||
$out['annuler'] = _('boutton::annuler');
|
||||
$out['fermer'] = _('boutton::fermer');
|
||||
$out['renewRss'] = _('boutton::renouveller');
|
||||
$out['print'] = _('Print');
|
||||
$out['no_basket'] = _('Please create a basket before adding an element');
|
||||
|
||||
return $app->json($out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets client main page
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function getClient(Application $app, Request $request)
|
||||
{
|
||||
\User_Adapter::updateClientInfos($app, 2);
|
||||
$renderTopics = '';
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_client_render_topics') == 'popups') {
|
||||
$renderTopics = \queries::dropdown_topics($app['locale.I18n']);
|
||||
} elseif ($app['phraseanet.registry']->get('GV_client_render_topics') == 'tree') {
|
||||
$renderTopics = \queries::tree_topics($app['locale.I18n']);
|
||||
}
|
||||
|
||||
return new Response($app['twig']->render('client/index.html.twig', array(
|
||||
'last_action' => !$app['phraseanet.user']->is_guest() && false !== $request->cookies->has('last_act') ? $request->cookies->has('last_act') : null,
|
||||
'phrasea_home' => $this->getDefaultClientStartPage($app),
|
||||
'render_topics' => $renderTopics,
|
||||
'grid_properties' => $this->getGridProperty(),
|
||||
'search_order' => SearchEngineOptions::SORT_MODE_DESC,
|
||||
'storage_access' => $this->getDocumentStorageAccess($app),
|
||||
'tabs_setup' => $this->getTabSetup($app),
|
||||
'menubar' => $app['twig']->render('common/menubar.html.twig', array('module' => 'client')),
|
||||
'css_file' => $this->getCssFile($app),
|
||||
'basket_status' => null !== $app['phraseanet.user']->getPrefs('client_basket_status') ? $app['phraseanet.user']->getPrefs('client_basket_status') : "1",
|
||||
'mod_pres' => null !== $app['phraseanet.user']->getPrefs('client_view') ? $app['phraseanet.user']->getPrefs('client_view') : '',
|
||||
'start_page' => $app['phraseanet.user']->getPrefs('start_page'),
|
||||
'start_page_query' => null !== $app['phraseanet.user']->getPrefs('start_page_query') ? $app['phraseanet.user']->getPrefs('start_page_query') : ''
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets display grid property
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getGridProperty()
|
||||
{
|
||||
return array(
|
||||
array('w' => '3', 'h' => '2', 'name' => '3*2', 'selected' => '0'),
|
||||
array('w' => '5', 'h' => '4', 'name' => '5*4', 'selected' => '0'),
|
||||
array('w' => '4', 'h' => '10', 'name' => '4*10', 'selected' => '0'),
|
||||
array('w' => '6', 'h' => '3', 'name' => '6*3', 'selected' => '1'),
|
||||
array('w' => '8', 'h' => '4', 'name' => '8*4', 'selected' => '0'),
|
||||
array('w' => '1', 'h' => '10', 'name' => 'list*10', 'selected' => '0'),
|
||||
array('w' => '1', 'h' => '100', 'name' => 'list*100', 'selected' => '0')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets databoxes and collections the current user can access
|
||||
*
|
||||
* @param Application $app
|
||||
* @return array
|
||||
*/
|
||||
private function getDocumentStorageAccess(Application $app)
|
||||
{
|
||||
$allDataboxes = $allCollections = array();
|
||||
|
||||
foreach ($app['phraseanet.user']->ACL()->get_granted_sbas() as $databox) {
|
||||
if (count($app['phraseanet.appbox']->get_databoxes()) > 0) {
|
||||
$allDataboxes[$databox->get_sbas_id()] = array('databox' => $databox, 'collections' => array());
|
||||
}
|
||||
|
||||
if (count($databox->get_collections()) > 0) {
|
||||
foreach ($app['phraseanet.user']->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) {
|
||||
$allDataboxes[$databox->get_sbas_id()]['collections'][$coll->get_base_id()] = $coll;
|
||||
$allCollections[$coll->get_base_id()] = $coll;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array('databoxes' => $allDataboxes, 'collections' => $allCollections);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Client Tab Setup
|
||||
*
|
||||
* @param Application $app
|
||||
* @return array
|
||||
*/
|
||||
private function getTabSetup(Application $app)
|
||||
{
|
||||
$tong = array(
|
||||
$app['phraseanet.registry']->get('GV_ong_search') => 1,
|
||||
$app['phraseanet.registry']->get('GV_ong_advsearch') => 2,
|
||||
$app['phraseanet.registry']->get('GV_ong_topics') => 3
|
||||
);
|
||||
|
||||
unset($tong[0]);
|
||||
|
||||
if (count($tong) == 0) {
|
||||
$tong = array(1 => 1);
|
||||
}
|
||||
|
||||
ksort($tong);
|
||||
|
||||
return $tong;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CSS file used by end user
|
||||
*
|
||||
* @param Application $app
|
||||
* @return string
|
||||
*/
|
||||
private function getCssFile(Application $app)
|
||||
{
|
||||
$cssPath = __DIR__ . '/../../../../../www/skins/client/';
|
||||
|
||||
$css = array();
|
||||
$cssFile = $app['phraseanet.user']->getPrefs('client_css');
|
||||
|
||||
$finder = new Finder();
|
||||
|
||||
$iterator = $finder
|
||||
->directories()
|
||||
->depth(0)
|
||||
->filter(function(\SplFileInfo $fileinfo) {
|
||||
return ctype_xdigit($fileinfo->getBasename());
|
||||
})
|
||||
->in($cssPath);
|
||||
|
||||
foreach ($iterator as $dir) {
|
||||
$baseName = $dir->getBaseName();
|
||||
$css[$baseName] = $baseName;
|
||||
}
|
||||
|
||||
if ((!$cssFile || !isset($css[$cssFile])) && isset($css['000000'])) {
|
||||
$cssFile = '000000';
|
||||
}
|
||||
|
||||
return sprintf('skins/client/%s/clientcolor.css', $cssFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forges query from request parameters
|
||||
*
|
||||
* @param Request $request
|
||||
* @return string
|
||||
*/
|
||||
private function buildQueryFromRequest(Request $request)
|
||||
{
|
||||
$query = '';
|
||||
|
||||
if ('' !== $clientQuery = trim($request->request->get('qry', ''))) {
|
||||
$query .= $clientQuery;
|
||||
}
|
||||
|
||||
$opAdv = $request->request->get('opAdv', array());
|
||||
$queryAdv = $request->request->get('qryAdv', array());
|
||||
|
||||
if (count($opAdv) > 0 && count($opAdv) == count($queryAdv)) {
|
||||
foreach ($opAdv as $opId => $op) {
|
||||
if (isset($queryAdv[$opId]) && ($advancedQuery = trim($queryAdv[$opId]) !== '')) {
|
||||
if ($query === $clientQuery) {
|
||||
$query = '(' . $clientQuery . ')';
|
||||
}
|
||||
|
||||
$query .= ' ' . $op . ' (' . $advancedQuery . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($query)) {
|
||||
$query = 'all';
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets default start home page for client
|
||||
*
|
||||
* @param Application $app
|
||||
* @return string
|
||||
*/
|
||||
private function getDefaultClientStartPage(Application $app)
|
||||
{
|
||||
$startPage = strtoupper($app['phraseanet.user']->getPrefs('start_page'));
|
||||
|
||||
if ($startPage === 'PUBLI') {
|
||||
return $this->getPublicationStartPage($app);
|
||||
}
|
||||
|
||||
if (in_array($startPage, array('QUERY', 'LAST_QUERY'))) {
|
||||
return $this->getQueryStartPage($app);
|
||||
}
|
||||
|
||||
return $this->getHelpStartPage($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets query start home page for client
|
||||
*
|
||||
* @param Application $app
|
||||
* @return string
|
||||
*/
|
||||
private function getQueryStartPage(Application $app)
|
||||
{
|
||||
$collections = $queryParameters = array();
|
||||
|
||||
$searchSet = json_decode($app['phraseanet.user']->getPrefs('search'));
|
||||
|
||||
if ($searchSet && isset($searchSet->bases)) {
|
||||
foreach ($searchSet->bases as $bases) {
|
||||
$collections = array_merge($collections, $bases);
|
||||
}
|
||||
} else {
|
||||
$collections = array_keys($app['phraseanet.user']->ACL()->get_granted_base());
|
||||
}
|
||||
|
||||
$queryParameters["mod"] = $app['phraseanet.user']->getPrefs('client_view') ?: '3X6';
|
||||
$queryParameters["bas"] = $collections;
|
||||
$queryParameters["qry"] = $app['phraseanet.user']->getPrefs('start_page_query') ?: 'all';
|
||||
$queryParameters["pag"] = 0;
|
||||
$queryParameters["search_type"] = SearchEngineOptions::RECORD_RECORD;
|
||||
$queryParameters["qryAdv"] = '';
|
||||
$queryParameters["opAdv"] = array();
|
||||
$queryParameters["status"] = array();
|
||||
$queryParameters["recordtype"] = SearchEngineOptions::TYPE_ALL;
|
||||
$queryParameters["sort"] = $app['phraseanet.registry']->get('GV_phrasea_sort', '');
|
||||
$queryParameters["infield"] = array();
|
||||
$queryParameters["ord"] = SearchEngineOptions::SORT_MODE_DESC;
|
||||
|
||||
$subRequest = Request::create('/client/query/', 'POST', $queryParameters);
|
||||
|
||||
return $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST)->getContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets publications start home page for client
|
||||
*
|
||||
* @param Application $app
|
||||
* @return string
|
||||
*/
|
||||
private function getPublicationStartPage(Application $app)
|
||||
{
|
||||
return $app['twig']->render('client/home_inter_pub_basket.html.twig', array(
|
||||
'feeds' => \Feed_Collection::load_all($app, $app['phraseanet.user']),
|
||||
'image_size' => (int) $app['phraseanet.user']->getPrefs('images_size')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get help start home page for client
|
||||
*
|
||||
* @param Application $app
|
||||
* @return string
|
||||
*/
|
||||
private function getHelpStartPage(Application $app)
|
||||
{
|
||||
return $app['twig']->render('client/help.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix the method to call with the controller class name
|
||||
*
|
||||
* @param string $method The method to call
|
||||
* @return string
|
||||
*/
|
||||
private function call($method)
|
||||
{
|
||||
return sprintf('%s::%s', __CLASS__, $method);
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class module_client
|
||||
{
|
||||
|
||||
public function getLanguage(Application $app, $lng)
|
||||
{
|
||||
$out = array();
|
||||
$out['createWinInvite'] = _('paniers:: Quel nom souhaitez vous donner a votre panier ?');
|
||||
$out['chuNameEmpty'] = _('paniers:: Quel nom souhaitez vous donner a votre panier ?');
|
||||
$out['noDLok'] = _('export:: aucun document n\'est disponible au telechargement');
|
||||
$out['confirmRedirectAuth'] = _('invite:: Redirection vers la zone d\'authentification, cliquez sur OK pour continuer ou annulez');
|
||||
$out['serverName'] = $app['phraseanet.registry']->get('GV_ServerName');
|
||||
$out['serverError'] = _('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
|
||||
$out['serverTimeout'] = _('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
|
||||
$out['serverDisconnected'] = _('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
|
||||
$out['confirmDelBasket'] = _('paniers::Vous etes sur le point de supprimer ce panier. Cette action est irreversible. Souhaitez-vous continuer ?');
|
||||
$out['annuler'] = _('boutton::annuler');
|
||||
$out['fermer'] = _('boutton::fermer');
|
||||
$out['renewRss'] = _('boutton::renouveller');
|
||||
|
||||
return p4string::jsonencode($out);
|
||||
}
|
||||
}
|
||||
|
@@ -48,83 +48,29 @@ class phrasea
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public function getHome(Application $app, $type = 'PUBLI', $context = 'prod')
|
||||
public static function start(Configuration $configuration)
|
||||
{
|
||||
if ($type == 'HELP') {
|
||||
if (file_exists($app['phraseanet.registry']->get('GV_RootPath') . "config/help_" . $app['locale.I18n'] . ".php")) {
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . "config/help_" . $app['locale.I18n'] . ".php");
|
||||
} elseif (file_exists($app['phraseanet.registry']->get('GV_RootPath') . 'config/help.php')) {// on verifie si il y a une home personnalisee sans langage
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . 'config/help.php');
|
||||
} else {
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . 'www/client/help.php');
|
||||
}
|
||||
$choosenConnexion = $configuration->getPhraseanet()->get('database');
|
||||
|
||||
$connexion = $configuration->getConnexion($choosenConnexion);
|
||||
|
||||
$hostname = $connexion->get('host');
|
||||
$port = (int) $connexion->get('port');
|
||||
$user = $connexion->get('user');
|
||||
$password = $connexion->get('password');
|
||||
$dbname = $connexion->get('dbname');
|
||||
|
||||
if (!extension_loaded('phrasea2')) {
|
||||
throw new RuntimeException('Phrasea extension is required');
|
||||
}
|
||||
|
||||
if ($type == 'PUBLI') {
|
||||
if ($context == 'prod')
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . "www/prod/homeinterpubbask.php");
|
||||
else
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . "www/client/homeinterpubbask.php");
|
||||
if (!function_exists('phrasea_conn')) {
|
||||
throw new RuntimeException('Phrasea extension requires upgrade');
|
||||
}
|
||||
|
||||
if (in_array($type, array('QUERY', 'LAST_QUERY'))) {
|
||||
$context = in_array($context, array('client', 'prod')) ? $context : 'prod';
|
||||
$parm = array();
|
||||
|
||||
$bas = array();
|
||||
|
||||
$searchSet = json_decode($app['phraseanet.user']->getPrefs('search'));
|
||||
|
||||
if ($searchSet && isset($searchSet->bases)) {
|
||||
foreach ($searchSet->bases as $bases)
|
||||
$bas = array_merge($bas, $bases);
|
||||
} else {
|
||||
$bas = array_keys($app['phraseanet.user']->ACL()->get_granted_base());
|
||||
if (phrasea_conn($hostname, $port, $user, $password, $dbname) !== true) {
|
||||
throw new RuntimeException('Unable to initialize Phrasea connection');
|
||||
}
|
||||
|
||||
$start_page_query = $app['phraseanet.user']->getPrefs('start_page_query');
|
||||
|
||||
if ($context == "prod") {
|
||||
$parm["bas"] = $bas;
|
||||
$parm["qry"] = $start_page_query;
|
||||
$parm["pag"] = 0;
|
||||
$parm["sel"] = '';
|
||||
$parm["ord"] = null;
|
||||
$parm["search_type"] = 0;
|
||||
$parm["record_type"] = '';
|
||||
$parm["status"] = array();
|
||||
$parm["fields"] = array();
|
||||
$parm["date_min"] = '';
|
||||
$parm["date_max"] = '';
|
||||
$parm["date_field"] = '';
|
||||
}
|
||||
if ($context == "client") {
|
||||
$parm["mod"] = $app['phraseanet.user']->getPrefs('client_view');
|
||||
$parm["bas"] = $bas;
|
||||
$parm["qry"] = $start_page_query;
|
||||
$parm["pag"] = '';
|
||||
$parm["search_type"] = 0;
|
||||
$parm["qryAdv"] = '';
|
||||
$parm["opAdv"] = array();
|
||||
$parm["status"] = '';
|
||||
$parm["nba"] = '';
|
||||
$parm["date_min"] = '';
|
||||
$parm["date_max"] = '';
|
||||
$parm["record_type"] = '';
|
||||
$parm["date_field"] = '';
|
||||
$parm["sort"] = $app['phraseanet.registry']->get('GV_phrasea_sort');
|
||||
$parm["stemme"] = '';
|
||||
$parm["dateminfield"] = array();
|
||||
$parm["datemaxfield"] = array();
|
||||
$parm["infield"] = '';
|
||||
$parm["regroup"] = null;
|
||||
$parm["ord"] = 0;
|
||||
}
|
||||
|
||||
require($app['phraseanet.registry']->get('GV_RootPath') . 'www/' . $context . "/answer.php");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public static function clear_sbas_params(Application $app)
|
||||
|
225
templates/web/client/answers.html.twig
Normal file
225
templates/web/client/answers.html.twig
Normal file
@@ -0,0 +1,225 @@
|
||||
{% set available_results = result.getTotal() %}
|
||||
{% set query_string = result.getQuery() %}
|
||||
{% set current_page = result.getCurrentPage(per_page) %}
|
||||
{% set total_page = result.getTotalPages(per_page) %}
|
||||
{% set pagination_html = '' %}
|
||||
{% set pagination_offset = 3 %}
|
||||
{% set max = 2 * pagination_offset + 3 %}
|
||||
|
||||
|
||||
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
|
||||
<script type="text/javascript" language="javascript">
|
||||
$('#proposals').empty().append("<div style='height:0px; overflow:hidden'>{{ query_string|e('js') }}</div>{{ proposals is not none ? proposals|e('js') : ''}}");
|
||||
|
||||
{% if app['phraseanet.registry'].get('GV_clientAutoShowProposals') %}
|
||||
|
||||
{% if proposals is not none %}
|
||||
chgOng(4);
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
$("#history").empty().append("{{ history|e('js') }}")
|
||||
</script>
|
||||
|
||||
{% set tooltip_html %}
|
||||
<div>{% trans "client::answers: rapport de questions par bases" %}</div>
|
||||
{% endset %}
|
||||
|
||||
{% set txt %}
|
||||
<b>
|
||||
{{ query_string[0:36] }}{% if query_string|length > 36 %}...{% endif %}
|
||||
</b>
|
||||
{% trans %}
|
||||
client::answers: {{ available_results }} reponses
|
||||
{% endtrans %}
|
||||
|
||||
<a style="float:none;display:inline-block;padding:2px 3px" class="infoTips" title="{{ tooltip_html }}"> </a>
|
||||
{% endset %}
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function(){
|
||||
p4.tot = {{ available_results > 0 ? available_results : 0 }};
|
||||
$("#nb_answers").append("{{ txt|e('js') }}");
|
||||
});
|
||||
</script>
|
||||
|
||||
{% if total_page > 0 %}
|
||||
{% if total_page > max %}
|
||||
{% for p in 1..total_page %}
|
||||
{% if p == current_page %}
|
||||
{% set pagination_html = pagination_html ~ '<span class="naviButton sel">' ~ p ~ '</span>' %}
|
||||
{% elseif (p >= (current_page - pagination_offset)) and ((p - 1) <= (current_page + pagination_offset)) %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">' ~ p ~ '</span>' %}
|
||||
{% elseif (current_page < (pagination_offset + 2)) and (p < (max - pagination_offset + 2)) %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">' ~ p ~ '</span>' %}
|
||||
{% elseif (current_page >= (total_page - pagination_offset - 2)) and (p >= (total_page - (2 * pagination_offset))) %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">' ~ p ~ '</span>' %}
|
||||
{% elseif p == (total_page - 1) %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">...' ~ p ~ '</span>' %}
|
||||
{% elseif p == 1 %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">' ~ p ~ '...</span>' %}
|
||||
{% endif %}
|
||||
|
||||
{% if p != (total_page - 1) %}
|
||||
{% set pagination_html = pagination_html ~ '<span class="naviButton" style="cursor:default;"> - </span>' %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for p in 1..total_page %}
|
||||
{% if p == current_page %}
|
||||
{% set pagination_html = pagination_html ~ '<span class="naviButton sel">' ~ p ~ '</span>' %}
|
||||
{% else %}
|
||||
{% set pagination_html = pagination_html ~ '<span onclick="gotopage(' ~ p ~ ');" class="naviButton">' ~ p ~ '</span>' %}
|
||||
{% endif %}
|
||||
|
||||
{% if p < total_page %}
|
||||
{% set pagination_html = pagination_html ~ '<span class="naviButton" style="cursor:default;"> - </span>' %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% set pagination_html = pagination_html ~ '<div class="navigButtons"><div id="PREV_PAGE" class="PREV_PAGE"></div><div id="NEXT_PAGE" class="NEXT_PAGE"></div></div>' %}
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function(){
|
||||
$("#navigation").empty().append("{{ pagination_html|e('js') }}");
|
||||
|
||||
{% if current_page != 0 and available_results > 0 %}
|
||||
$("#PREV_PAGE").bind('click',function(){gotopage({{ current_page - 1 }})});
|
||||
{% else %}
|
||||
$("#PREV_PAGE").unbind('click');
|
||||
{% endif %}
|
||||
|
||||
{% if current_page != (total_page - 1) and available_results > 0 %}
|
||||
$("#NEXT_PAGE").bind('click',function(){gotopage({{ current_page + 1 }})});
|
||||
{% else %}
|
||||
$("#NEXT_PAGE").unbind('click');
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% if result_data|length > 0 %}
|
||||
<div>
|
||||
<table id="grid" cellpadding="0" cellspacing="0" border="0" style="xwidth:95%;">
|
||||
{% if mod_col == 1 %}
|
||||
<tr style="visibility:hidden">
|
||||
<td class="w160px"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr style="visibility:hidden">
|
||||
{% for i in 1..mod_col %}
|
||||
<td class="w160px"></td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% for data in result_data %}
|
||||
{% set record = data['record'] %}
|
||||
{% set thumbnail = record.get_thumbnail() %}
|
||||
|
||||
{% if loop.first %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
|
||||
{% if (loop.index0 % mod_col) == 0 and not loop.first %}
|
||||
</tr>
|
||||
<tr>
|
||||
{% endif %}
|
||||
|
||||
{% if mod_col == 1 and not loop.first %}
|
||||
</tr>
|
||||
<tr style="height:20px;">
|
||||
<td colspan="2" class="td_mod_lst_img"><hr /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% endif %}
|
||||
|
||||
{% if mod_col == 1 %}
|
||||
<td valign="top" class="td_mod_lst_desc">
|
||||
{% else %}
|
||||
<td class="w160px">
|
||||
{% endif %}
|
||||
<div class="diapo w160px" style="margin-bottom:0;border-bottom:none;">
|
||||
<div class="title">{{ record.get_title() }}</div>
|
||||
<div class="status">{{ record.get_status_icons()|raw }}</div>
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0pt auto;">
|
||||
<tr class="h160px">
|
||||
<td class="image w160px h160px">
|
||||
{% if data['is_video'] or data['is_audio'] %}
|
||||
{% if record.get_formated_duration() is not empty %}
|
||||
<div class="dmco_text duration">{{ record.get_formated_duration() }}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if record.is_grouping %}
|
||||
{% set on_click_html = "openPreview('REG',0, '" ~ record.get_serialize_key() ~ "');" %}
|
||||
{% else %}
|
||||
{% set on_click_html = "openPreview('RESULT','" ~ record.get_number() ~ "');" %}
|
||||
{% endif %}
|
||||
|
||||
{% if mod_col == 1 %}
|
||||
{% set pic_roll = "/prod/tooltip/preview/" ~ record.get_sbas_id() ~ "/" ~ record.get_record_id() ~ "/" %}
|
||||
{% else %}
|
||||
{% set pic_roll = "/prod/tooltip/caption/" ~ record.get_sbas_id() ~ "/" ~ record.get_record_id() ~ "/answer/" %}
|
||||
{% endif %}
|
||||
|
||||
<img
|
||||
onclick="{{ on_click_html }}"
|
||||
class="captionTips {{ thumbnail.get_width() > thumbnail.get_height() ? 'hthbimg' : 'vthbimg' }}"
|
||||
id="IMG{{ record.get_serialize_key() }}"
|
||||
src="{{ thumbnail.get_url() }}"
|
||||
tooltipsrc="{{ pic_roll }}"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="diapo w160px" style="border-top:none;">
|
||||
<div class="buttons">
|
||||
<div class="minilogos">{{ data['mini_logo']|raw }}</div>
|
||||
{% if data['can_download'] %}
|
||||
<div class="downloader" title="{% trans 'action : exporter' %}" onclick="evt_dwnl('{{ record.get_serialize_key() }}');"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="printer" title="{% trans 'action : print' %}" onClick="evt_print('{{ record.get_serialize_key() }}');"></div>
|
||||
|
||||
{% if data['can_add_to_basket'] %}
|
||||
<div class="baskAdder" title="{% trans 'action : ajouter au panier' %}" onClick="evt_add_in_chutier({{ record.get_sbas_id() }}, {{ record.get_record_id() }});"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if mod_col != 1 %}
|
||||
<div style="margin-right:3px;" class="infoTips" id="INFO{{ record.get_serialize_key() }}" tooltipsrc="/prod/tooltip/tc_datas/{{ record.get_sbas_id() }}/{{ record.get_record_id() }}/"></div>
|
||||
{% if data['preview_exists'] %}
|
||||
<div class="previewTips" tooltipsrc="/prod/tooltip/preview/{{ record.get_sbas_id() }}/{{ record.get_record_id() }}/" id="ZOOM{{ record.get_serialize_key() }}"> </div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{% if mod_col == 1 %}
|
||||
<td valign="top">
|
||||
<div class="desc1">
|
||||
<div class="caption" class="desc2">
|
||||
{{ data['caption'] }}
|
||||
<hr />
|
||||
{{ data['light_info'] }}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
p4.tot = {{ available_results }};
|
||||
p4.tot_options = '{{ search_engine_option|raw }}';
|
||||
p4.tot_query = "{{ query_string }}";
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{% endif %}
|
153
templates/web/client/baskets.html.twig
Normal file
153
templates/web/client/baskets.html.twig
Normal file
@@ -0,0 +1,153 @@
|
||||
{% set nb_basket_elements = selected_basket_elements.count() %}
|
||||
<div id="blocBask" class="bodyLeft" style="height:314px;bottom:0px;">
|
||||
<div class="baskTitle">
|
||||
<div id="flechenochu" class="flechenochu"></div>
|
||||
<div class="baskName">
|
||||
{% if selected_basket is not none %}
|
||||
{{ selected_basket.getName() }}
|
||||
:
|
||||
{% trans %}
|
||||
paniers:: {{ nb_basket_elements }} documents dans le panier
|
||||
{% endtrans %}
|
||||
{% if app['phraseanet.registry'].get('GV_viewSizeBaket') %}
|
||||
({{ selected_basket.getSize(app) }} Mo)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table style='width:99%' class='baskIndicator' id='baskMainTable'>
|
||||
<tr>
|
||||
<td>
|
||||
{% if total_baskets > 0 %}
|
||||
<select id="chutier_name" name="chutier_name" onChange="chg_chu();" style="width:120px;">
|
||||
<optgroup label="{% trans 'paniers::categories: mes paniers' %}">
|
||||
{% for basket in user_baskets %}
|
||||
<option class="chut_choice" {% if basket.getId() == selected_basket.getId() %}selected{% endif %} value="{{ basket.getId() }}">
|
||||
{{ basket.getName() }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
<optgroup label="{% trans 'paniers::categories: paniers recus' %}">
|
||||
{% for basket in recept_user_basket %}
|
||||
<option class="chut_choice" {% if basket.getId() == selected_basket.getId() %}selected{% endif %} value="{{ basket.getId() }}">
|
||||
{{ basket.getName() }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
</select>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="width:40%">
|
||||
{% if total_baskets > 0 %}
|
||||
<div class="baskDel" title="{% trans 'action : supprimer' %}" onclick="evt_chutier('DELSSEL');"/></div>
|
||||
{% endif %}
|
||||
<div class="baskCreate" title="{% trans 'action:: nouveau panier' %}" onclick="newBasket();"></div>
|
||||
<div style="float:right;position:relative;width:3px;height:16px;"></div>
|
||||
|
||||
{% if total_baskets > 0 and (app['phraseanet.user'].ACL().has_right("candwnldhd") or app['phraseanet.user'].ACL().has_right("candwnldpreview") or app['phraseanet.user'].ACL().has_right("cancmd") > 0) %}
|
||||
<div class="baskDownload" title="{% trans 'action : exporter' %}" onclick="evt_dwnl();"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if total_baskets > 0%}
|
||||
<div class="baskPrint" title="{% trans 'action : print' %}" onclick="evt_print();"></div>
|
||||
{% endif %}
|
||||
|
||||
{% if total_baskets > 0 %}
|
||||
<div class="baskComparator" onclick="openCompare({{ selected_basket.getId() }})" title="{% trans 'action : ouvrir dans le comparateur' %}"></div>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="divexterne" style="height:270px;overflow-x:hidden;overflow-y:auto;position:relative">
|
||||
{% if selected_basket is not none and selected_basket.getPusher(app) is not none %}
|
||||
{% set pusher_name = selected_basket.getPusher(app).get_display_name() %}
|
||||
<div class="txtPushClient">
|
||||
{% trans %}
|
||||
paniers:: panier emis par {{ pusher_name }}
|
||||
{% endtrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for element in selected_basket_elements %}
|
||||
{% set record = element.getRecord(app) %}
|
||||
{% set thumbnail = record.get_thumbnail() %}
|
||||
|
||||
{% if thumbnail.get_width() > thumbnail.get_height() %} {# paysage #}
|
||||
{% if thumbnail.get_width() > 67 %}
|
||||
{% set width = 67 %}
|
||||
{% set top = ((67 - (67 * thumbnail.get_height() / thumbnail.get_width())) / 2)|round(0, constant('PHP_ROUND_HALF_UP')) %}
|
||||
{% else %}
|
||||
{% set width = thumbnail.get_width() %}
|
||||
{% set top = ((67 - thumbnail.get_height()) / 2)|round(0, constant('PHP_ROUND_HALF_UP')) %}
|
||||
{% endif %}
|
||||
|
||||
{% set dim = "width:" ~ width ~ "px" %}
|
||||
{% else %} {# portrait #}
|
||||
{% if thumbnail.get_height() > 55 %}
|
||||
{% set height = 55 %}
|
||||
{% set top = ((67 - 55) / 2)|round(0, constant('PHP_ROUND_HALF_UP')) %}
|
||||
{% else %}
|
||||
{% set height = thumbnail.get_height() %}
|
||||
{% set top = ((67 - thumbnail.get_height()) / 2)|round(0, constant('PHP_ROUND_HALF_UP')) %}
|
||||
{% endif %}
|
||||
|
||||
{% set dim = "height:" ~ height ~ "px" %}
|
||||
{% endif %}
|
||||
|
||||
{% set tooltip = '' %}
|
||||
{% if app['phraseanet.registry'].get('GV_rollover_chu') %}
|
||||
{% set tooltip = 'tooltipsrc="/prod/tooltip/caption/' ~ record.get_sbas_id() ~ '/' ~ record.get_record_id() ~ '/basket/"' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="diapochu">
|
||||
<div class="image">
|
||||
<img
|
||||
onclick="openPreview('BASK',{{ record.get_number() }}, {{ selected_basket.getId() }}); return(false);"
|
||||
{{ tooltip }}
|
||||
style="position:relative; top:{{ top }}px; {{ dim }}"
|
||||
class="{{ thumbnail.get_height() > 42 ? 'hThumbnail' : 'vThumbnail' }} baskTips"
|
||||
src="{{ thumbnail.get_url() }}"
|
||||
/>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<div
|
||||
class="baskOneDel"
|
||||
onclick="evt_del_in_chutier({{ element.getId() }});"
|
||||
title="{% trans 'action : supprimer' %}">
|
||||
</div>
|
||||
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldhd')
|
||||
or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldpreview')
|
||||
or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'cancmd')
|
||||
or app['phraseanet.user'].ACL().has_preview_grant(record) %}
|
||||
<div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{% trans 'action : exporter' %}"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="blocNoBask" class="bodyLeft" style="height: 22px;display:none;bottom:0px;">
|
||||
<div class="baskTitle">
|
||||
<div id="flechechu" class="flechenochu"></div>
|
||||
<div id="viewtext" class="baskName">
|
||||
{% if selected_basket is not none %}
|
||||
{{ selected_basket.getName() }}
|
||||
:
|
||||
{% trans %}
|
||||
paniers:: {{ nb_basket_elements }} documents dans le panier
|
||||
{% endtrans %}
|
||||
{% endif %}
|
||||
<span style="width:16px;height:16px;position: absolute; right: 10px;background-position:center center;" class='baskIndicator'></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oldNoview = p4.nbNoview;
|
||||
p4.nbNoview = 0;
|
||||
|
||||
if(p4.nbNoview > oldNoview) {
|
||||
alert('{% trans 'paniers:: vous avez de nouveaux paniers non consultes' %}');
|
||||
}
|
||||
</script>
|
@@ -1,24 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
{% if app['locale.I18n'] not in ['fr', 'en', 'us'] %}
|
||||
{% set lng = 'fr' %}
|
||||
{% else %}
|
||||
{% set lng = app['locale.I18n'] %}
|
||||
{% endif %}
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
$help_lng = $app['locale.I18n'];
|
||||
if ( ! in_array($app['locale.I18n'], array('fr', 'en', 'us')))
|
||||
$help_lng = 'fr';
|
||||
|
||||
if ($help_lng == 'fr') {
|
||||
?>
|
||||
{% if lng == 'fr' %}
|
||||
<div class="client_help">
|
||||
<h5>La recherche s'effectue grâce à la boîte de dialogue qui se trouve en haut à gauche de l'écran. Sachez que vous pouvez utiliser les opérateurs ou caractères spéciaux suivants :</h5>
|
||||
<h5 style="border:#CCCCCC 2px solid">* , ? , ET , OU , SAUF , DANS , DERNIERS , TOUT (ou AND , OR , EXCEPT , LAST , ALL)</h5>
|
||||
@@ -79,10 +65,7 @@ if ($help_lng == 'fr') {
|
||||
, ...
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ($help_lng == 'en' || $help_lng == 'us') {
|
||||
?>
|
||||
{% elseif lng == 'en' or lng == 'us' %}
|
||||
<div class="client_help">
|
||||
<h5>The search can be made through a dialogue box which can be found up left of your screen. Please note that you can use the following specific characters or boolean operators :</h5>
|
||||
<h5 style="border:#CCCCCC 2px solid">* , ? , AND , OR , EXCEPT , IN, LAST , ALL</h5>
|
||||
@@ -143,5 +126,4 @@ if ($help_lng == 'en' || $help_lng == 'us') {
|
||||
, ...
|
||||
</center>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
{% endif %}
|
112
templates/web/client/home_inter_pub_basket.html.twig
Normal file
112
templates/web/client/home_inter_pub_basket.html.twig
Normal file
@@ -0,0 +1,112 @@
|
||||
<div style="height:50px;" class="homePubTitleBox">
|
||||
<div style="float:left;width:350px;"><h1 style="font-size:20px;margin-top:15px;">
|
||||
<h1>{% trans "publications:: dernieres publications" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{% for entry in feeds.get_aggregate().get_entries(0, 5).get_entries() %}
|
||||
<div class="boxPubli">
|
||||
<div class="titlePubli">
|
||||
<h2 class="htitlePubli">
|
||||
<a class="homePubTitle" onclick="openCompare('{{ entry.get_id() }}');">
|
||||
{{ entry.get_title() }}
|
||||
</a>
|
||||
</h2>
|
||||
<span class="publiInfos">
|
||||
{{ app['date-formatter'].getPrettyString(entry.get_created_on()) }}
|
||||
{% if entry.get_author_email() %}
|
||||
<a class="homePubLink" href="mailto:{{ entry.get_author_email() }}">
|
||||
{{ entry.get_author_name() }}
|
||||
</a>
|
||||
{% if entry.get_updated_on() > entry.get_created_on() %}
|
||||
<br/>
|
||||
<span style="font-style:italic;">
|
||||
{% trans "publications:: derniere mise a jour" %} {{ app['date-formatter'].getPrettyString(entry.get_updated_on()) }}
|
||||
</span>
|
||||
<br />
|
||||
<br />
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<div class="descPubli">
|
||||
<div style="margin:10px 0 10px 20px;width:80%;">
|
||||
{% if entry.get_subtitle()|trim is not empty %}
|
||||
{{ entry.get_subtitle()|nl2br }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:100%;position:relative;float:left;" id="PUBLICONT{{ entry.get_id() }}">
|
||||
{% for item in entry.get_content() %}
|
||||
{% set record = item.get_record() %}
|
||||
{% set thumbnail = record.get_thumbnail() %}
|
||||
{% set docType = record.get_type() %}
|
||||
{% set duration = "" %}
|
||||
{% set ratio = thumbnail.get_width() / thumbnail.get_height() %}
|
||||
{% set wrapper_size = image_size + 30 %}
|
||||
|
||||
{% set types = {
|
||||
"isVideo" : (docType == "video" ? true : false),
|
||||
"isAudio" : (docType == "audio" ? true : false),
|
||||
"isImage" : (docType == "image" or (docType != "video" and docType != "audio") ? true : false)
|
||||
} %}
|
||||
|
||||
{% if types["isVideo"] or types["isAudio"] %}
|
||||
{% set duration = record.get_formated_duration() %}
|
||||
{% endif %}
|
||||
|
||||
{% if ratio > 1 %}
|
||||
{% set cw = [(image_size - 30), (thumbnail.get_width())]|min %}
|
||||
{% set ch = cw / ratio %}
|
||||
{% set pv = ((image_size - ch) / 2)|floor %}
|
||||
{% set ph = ((image_size - cw) / 2)|floor %}
|
||||
|
||||
{% set image_style %}
|
||||
width:{{ cw }}px;xpadding:{{ pv }}px {{ ph }}px;
|
||||
{% endset %}
|
||||
{% else %}
|
||||
{% set ch = [(image_size - 30), (thumbnail.get_height())]|min %}
|
||||
{% set cw = cw * ratio %}
|
||||
{% set pv = ((image_size - ch) / 2)|floor %}
|
||||
{% set ph = ((image_size - cw) / 2)|floor %}
|
||||
|
||||
{% set image_style %}
|
||||
height:{{ ch }}px;xpadding:{{ pv }}px {{ ph }}px;
|
||||
{% endset %}
|
||||
{% endif %}
|
||||
|
||||
<div style="width:{{ wrapper_size }}px;" sbas="{{ record.get_sbas_id() }}" id="{{"IMGT_" ~ record.get_serialize_key() ~ "_PUB_" ~ entry.get_id() }}" class="IMGT diapo" onclick="openPreview('FEED','{{ item.get_ord() }}','{{ entry.get_id() }}');">
|
||||
<div>
|
||||
<div class="title" style="height:40px;">
|
||||
{{ record.get_title() }}
|
||||
</div>
|
||||
</div>
|
||||
<table class="thumb w160px h160px" style="xheight:{{ image_size }}px;" cellpadding="0" valign="middle">
|
||||
<tr>
|
||||
<td>
|
||||
{% if duration is not empty %}
|
||||
<div class="duration">
|
||||
{{ duration }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<img title="{% embed "common/caption.html.twig" with {'view': 'publi', 'record': record} %}{% endembed %}" class="captionTips" src="{{ thumbnail.get_url() }}" style="{{ image_style }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="height: 25px;position:relative;">
|
||||
<table class="bottom">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style='text-align:right;' valign='bottom' nowrap>
|
||||
<div tooltipsrc="/prod/tooltip/preview/{{ record.get_sbas_id() }}/{{ record.get_record_id() }}/" class="previewTips"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
509
templates/web/client/index.html.twig
Normal file
509
templates/web/client/index.html.twig
Normal file
@@ -0,0 +1,509 @@
|
||||
<html lang="{{ app['locale.I18n'] }}">
|
||||
<head>
|
||||
<title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} Client</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||
<style ID="MYS" type="text/css">
|
||||
IMG.hthbimg {
|
||||
WIDTH: 108px;
|
||||
}
|
||||
|
||||
IMG.vthbimg {
|
||||
HEIGHT: 108px;
|
||||
}
|
||||
|
||||
.w160px {
|
||||
WIDTH: 128px;
|
||||
}
|
||||
|
||||
.h160px {
|
||||
HEIGHT: 128px;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="/include/jslibs/jquery-ui-1.8.17/css/dark-hive/jquery-ui-1.8.17.custom.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/jquery.contextmenu.css,skins/common/main.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/client/clientcolor.css" />
|
||||
{% if css_file %}
|
||||
<link id="skinCss" type="text/css" rel="stylesheet" href="/include/minify/f={{ css_file }}" />
|
||||
{% endif %}
|
||||
<style>
|
||||
#PREVIEWCURRENTCONT {
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
</style>
|
||||
<!--[if IE 6]>
|
||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/client/ie6.css" >
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
|
||||
<script type="text/javascript" src="/include/minify/f=include/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
|
||||
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/include/minify/g=client"></script>
|
||||
<script type="text/javascript" src="/include/jslibs/flowplayer/flowplayer-3.2.11.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="PNB" style="overflow:hidden;width:100%;height:100%;">
|
||||
<div id="container" style="position:absolute;top:0;left:0;overflow:hidden;width:100%;height:100%;">
|
||||
{{ menubar|raw }}
|
||||
<div style="top:30px;position:relative;float:left;">
|
||||
<div id="left" style="height:100%;width:265px;position:relative;float:left;">
|
||||
<div style="overflow:hidden;border:none;padding:0;margin:0;position:relative;top:0px;height:0px;width:265px;" id="search">
|
||||
<div class="bodyLeft" style="top:3px;">
|
||||
<div id="bigTabsBckg">
|
||||
<table align="center" border="0" style="table-layout:fixed; top:1px; left:2px;height:22px; width:253px;" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
{% set active_tab = '' %}
|
||||
{% for key_tab, tab in tabs_setup %}
|
||||
{% if key_tab != 0 %}
|
||||
{% set tab_active = key_tab == app['phraseanet.registry'].get('GV_ong_actif') ? 'actif' : 'inactif' %}
|
||||
{% if tab == 1 %}
|
||||
{% if tab_active == 'actif' %}
|
||||
{% set active_tab = 'ongSearch' %}
|
||||
{% endif %}
|
||||
|
||||
<td class="bigTabs {{ tab_active }}" id="ongSearch" onclick="chgOngSearch('ongSearch');">{% trans 'client:: recherche' %}</td>
|
||||
{% elseif tab == 2 %}
|
||||
{% if tab_active == 'actif' %}
|
||||
{% set active_tab = 'ongAdvSearch' %}
|
||||
{% endif %}
|
||||
|
||||
<td class="bigTabs {{ tab_active }}" id="ongAdvSearch" onclick="chgOngSearch('ongAdvSearch');return(false);">{% trans 'client:: recherche avancee' %}</td>
|
||||
{% elseif tab == 3 %}
|
||||
{% if tab_active == 'actif' %}
|
||||
{% set active_tab = 'ongTopic' %}
|
||||
{% endif %}
|
||||
|
||||
<td class="bigTabs {{ tab_active }}" id="ongTopic" onclick="chgOngSearch('ongTopic');return(false);"><{% trans 'client:: topics' %}</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<form style="margin:0px; padding:0px;" name="search" id="searchForm" action="{{ path('client_query') }}" onkeypress="if(event.keyCode==13){ doSearch();return false;}" method="post">
|
||||
<div id="idongSearch">
|
||||
<div id="mainSearch" style="overflow:hidden;">
|
||||
<div>
|
||||
<div>
|
||||
<input type="text" name="qry" value="{{ start_page_query }}" id="qry" style="width:245px;">
|
||||
</div>
|
||||
<div id="idongAdvSearch" style="display:none;">
|
||||
<div>
|
||||
<select name="opAdv[]" style="width:54px">
|
||||
<option value="{% trans "phraseanet::technique:: et" %}">{% trans "phraseanet::technique:: et" %}</option>
|
||||
<option value="{% trans "phraseanet::technique:: or" %}">{% trans "phraseanet::technique:: or" %}</option>
|
||||
<option value="{% trans "phraseanet::technique:: except" %}">{% trans "phraseanet::technique:: except" %}</option>
|
||||
</select>
|
||||
<input type="text" name="qryAdv[]" id="qryAdv1" style="width:185px">
|
||||
</div>
|
||||
<div>
|
||||
<select name="opAdv[]" style="width:54px">
|
||||
<option value="{% trans "phraseanet::technique:: et" %}">{% trans "phraseanet::technique:: et" %}</option>
|
||||
<option value="{% trans "phraseanet::technique:: or" %}">{% trans "phraseanet::technique:: or" %}</option>
|
||||
<option value="{% trans "phraseanet::technique:: except" %}">{% trans "phraseanet::technique:: except" %}</option>
|
||||
</select>
|
||||
<input type="text" name="qryAdv[]" id="qryAdv2" style="width:185px">
|
||||
</div>
|
||||
</div>
|
||||
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'popup' %}
|
||||
<div>
|
||||
{% trans "client::recherche: rechercher dans les bases :" %}
|
||||
{% if app['phraseanet.appbox'].get_databoxes()|length > 0 %}
|
||||
<select id="basSelector" onchange="beforeAnswer();" style="width:245px;">
|
||||
<option value="{{ storage_access['collections']|keys|join(';') }}">{% trans "client::recherche: rechercher dans toutes les bases" %}</option>
|
||||
{% for sbasId, databoxWrapper in storage_access['databoxes'] %}
|
||||
{% set databox = databoxWrapper['databoxes'] %}
|
||||
{% set collections = databoxWrapper['collections'] %}
|
||||
{% if collections|length > 0 %}
|
||||
<optgroup label="{{ databox.get_viewname() }}">
|
||||
<option value="{{ collection|keys|join(';') }}">{{ databox.get_viewname() }}</option>
|
||||
{% for collId, collection in collections %}
|
||||
<option value="{{ collId }}" checked="checked">{{ collection.get_name() }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<select title="{% trans "phraseanet:: presentation des resultats" %}" name="mod" id="mod" onChange="changeModCol();" >
|
||||
{% for property in grid_properties %}
|
||||
{% set selected = '' %}
|
||||
{% if mod_pres is empty %}
|
||||
{% if property['selected'] == '1' %}
|
||||
{% set selected = 'selected' %}
|
||||
{% endif %}
|
||||
{% elseif mod_pres == property['h'] ~ 'X' ~ property['w'] %}
|
||||
{% set selected = 'selected' %}
|
||||
{% endif %}
|
||||
|
||||
<option {{ selected }} value="{{ property['h'] ~ 'X' ~ property['w'] }}"> {{ property['name'] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="radio" value="0" class="checkbox" {% if app['phraseanet.registry'].get('GV_defaultQuery_type') == 0 %}checked="checked"{% endif %} id="search_type_docs" name="search_type" /><label for="search_type_docs">{% trans "phraseanet::type:: documents" %}</label>
|
||||
<input type="radio" value="1" class="checkbox" {% if app['phraseanet.registry'].get('GV_defaultQuery_type') != 0 %}checked="checked"{% endif %} id="search_type_group" name="search_type" /><label for="search_type_group">{% trans "phraseanet::type:: reportages" %}</label>
|
||||
<input type="hidden" name="sort" value="{{ app['phraseanet.registry'].get('GV_phrasea_sort') }}"/>
|
||||
<input type="hidden" name="ord" id="searchOrd" value="{{ search_order }}" />
|
||||
</div>
|
||||
<div>
|
||||
<div style="text-align:center;"><input class="pointer" type="button" onclick="doSearch();" value="{% trans "boutton::rechercher" %}" /></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="pag" id="formAnswerPage" value="">
|
||||
<input type="hidden" name="nba" value="">
|
||||
|
||||
<div class="onglets" style="white-space: nowrap; margin-left: 5px; width: 227px;">
|
||||
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}
|
||||
<span id="idOnglet1" class="actif actives" onclick="chgOng(1);">
|
||||
{% trans "phraseanet:: collections" %} <img onclick="removeFilters();" id="filter_danger" src="/skins/icons/alert.png" title="{% trans "client::recherche: cliquez ici pour desactiver tous les filtres de toutes base" %}" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
|
||||
<span id="idOnglet4" class="{{ app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' ? "inactif" : "actif" }} actives" onclick="chgOng(4);">
|
||||
{% trans "phraseanet:: propositions" %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span id="idOnglet5" class="{{ not app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' and not app['phraseanet.registry'].get('GV_thesaurus') ? 'actif' : 'inactif' }} actives" onclick="chgOng(5);">
|
||||
{% trans "phraseanet:: historique" %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchMiddle" style="">
|
||||
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}
|
||||
<div id="onglet1" style="display:block;height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div>
|
||||
<div style="text-align:center;margin:5px;">
|
||||
<input id="bases_all" class="actives" type="button" value="{% trans 'boutton:: selectionner toutes les bases' %}" onclick="checkBases(true);"/>
|
||||
<input id="bases_none" class="actives" type="button" value="{% trans 'boutton:: selectionner aucune base' %}" onclick="checkBases(false);"/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="basesContainer">
|
||||
{% for sbasId, databoxWrapper in storage_access['databoxes'] %}
|
||||
{% set databox = databoxWrapper['databox'] %}
|
||||
{% if app['phraseanet.registry'].get('GV_view_bas_and_coll') %}
|
||||
<div class="basContainer">
|
||||
<div class="basContTitle">
|
||||
<div class="basTitle">
|
||||
<input class="basChecker checkbox" id="basChecker{{ sbasId }}" type="checkbox" onclick="chkSbas({{ sbasId }},this)" />
|
||||
<label for="basChecker{{ sbasId }}">{{ databox.get_viewname() }}</label>
|
||||
<img onclick="removeFilters({{ sbasId }});" id="filter_danger{{ sbasId }}" class="filter_danger" src="/skins/icons/alert.png" title="{% trans "client::recherche: cliquez ici pour desactiver tous les filtres de cette base" %}" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
|
||||
</div>
|
||||
{% set status_bit_filters = '' %}
|
||||
{% for bit, data in databox.get_statusbits() if data['searchable'] %}
|
||||
{% set html_status_bit %}
|
||||
<div style="text-align:center;overflow:hidden;">' .
|
||||
<table style="table-layout:fixed;width:90%;text-align:left;" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="width:50%" nowrap>
|
||||
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_off{{ sbasId }}" value="{{ sbasId }}_of{{ sbasId }}"/>
|
||||
<label title="{{ data['labeloff'] }}" for="statusfil_{{ sbasId }}_off{{ bit }}">{% if data['img_off'] %}<img src="'{{ datas['img_off'] }}" title="{{ datas['labeloff'] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labeloff'] }}</label>
|
||||
</td>
|
||||
<td style="width:50%" nowrap>
|
||||
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_on{{ sbasId }}" value="{{ sbasId }}_on{{ sbasId }}"/>
|
||||
<label title="{{ data['labelon'] }}" for="statusfil_{{ sbasId }}_on{{ bit }}">{% if data['img_on']%}<img src="{{ datas['img_on'] }}" title="{{ datas['labelon'] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labelon'] }}</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endset %}
|
||||
{% set status_bit_filters = status_bit_filters ~ '' ~ html_status_bit %}
|
||||
{% endfor %}
|
||||
|
||||
{% set xml_structure = databox.get_sxml_structure() %}
|
||||
|
||||
{% if xml_structure %}
|
||||
{% set date_filters = '' %}
|
||||
{% set fields_filters = '' %}
|
||||
{% if xml_structure.description %}
|
||||
{% for f, field in xml_structure.description.children() %}
|
||||
{% set field_type = '' %}
|
||||
{% set field_searchclient = '' %}
|
||||
|
||||
{% for name, value in field.attributes() %}
|
||||
{% if name == "type" %}
|
||||
{% set field_type = value %}
|
||||
{% endif %}
|
||||
|
||||
{% if name == "searchclient" %}
|
||||
{% set field_searchclient = value %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if field_type == 'date' and field_searchclient == '1' %}
|
||||
{% set date_filter_html %}
|
||||
<div>
|
||||
<table style="width:98%;text-align:left;" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{{ f }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%;">
|
||||
{% trans "phraseanet::time:: de" %}
|
||||
</td>
|
||||
<td style="width:50%;">
|
||||
{% trans "phraseanet::time:: a" %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%;">
|
||||
<input type="hidden" name="dateminfield[]" value="{{ sbasId }}_{{ f }}">
|
||||
<input db="{{ sbasId }}" onchange="checkFilters();" class="datepicker" type="text" name="datemin[]">
|
||||
</td>
|
||||
<td style="width:50%;">
|
||||
<input type="hidden" name="datemaxfield[]" value="{{ sbasId }}_{{ f }}">
|
||||
<input db="{{ sbasId }}" onchange="checkFilters();" class="datepicker" type="text" name="datemax[]">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endset %}
|
||||
{% set date_filters = date_filters ~ '' ~ date_filter_html %}
|
||||
{% elseif field_type != 'date' %}
|
||||
{% set field_filter_html %}
|
||||
<option value="{{ sbasId }}_{{ f }}">{{ f }}</option>
|
||||
{% endset %}
|
||||
{% set fields_filters = fields_filters ~ '' ~ field_filter_html %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if status_bit_filters is not empty or fields_filters is not empty or date_filters is not empty %}
|
||||
<div class="filter">
|
||||
<span class="actives" onclick="toggleFilter('Filters{{sbasId}}',this);">
|
||||
{% trans "client::recherche: filter sur" %}
|
||||
</span>
|
||||
</div>
|
||||
<div id="Filters{{ sbasId }}" class="base_filter" style="display:none;">
|
||||
{% if date_filters is not empty %}
|
||||
<div class="filterTitle">{% trans "client::recherche: filtrer par dates" %}</div>
|
||||
{{ date_filters|raw }}
|
||||
{% endif %}
|
||||
{% if status_bit_filters is not empty %}
|
||||
<div class="filterTitle">{% trans "client::recherche: filtrer par status" %}</div>
|
||||
{{ status_bit_filters|raw }}
|
||||
{% endif %}
|
||||
{% if fields_filters is not empty %}
|
||||
<div class="filterTitle">{% trans "client::recherche: filtrer par champs" %}</div>
|
||||
<div>
|
||||
<select db="{{sbasId}}" onchange="checkFilters();" name="infield[]" style="width:165px;">
|
||||
<option value="" selected="selected">{% trans 'client::recherche: filtrer par champs : tous les champs' %}</option>
|
||||
{{ fields_filters|raw }}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="height:4px;"> </div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %} {# decalage ici a verifier l 421 fichier original #}
|
||||
<div class="basGrp">
|
||||
{% for collId, collection in storage_access['collections'] %}
|
||||
<div>
|
||||
<input type="checkbox" class="checkbox basItem basItem{{ sbasId }}" checked name="bas[]" id="basChk{{ collId}}" value="{{ collId }}">
|
||||
<label for="basChk{{ collId }}">{{ collection.get_name() }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
|
||||
<div id="onglet4" style="{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}display:none;{% endif %}height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div>
|
||||
<div id="proposals" style="width:235px; overflow:hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="onglet5" style="{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' or app['phraseanet.registry'].get('GV_thesaurus') %}display:none;{% endif %}height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div id="history"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="idongTopic" style="overflow-x:hidden;overflow-y:auto;">
|
||||
{{ render_topics|raw }}
|
||||
</div>
|
||||
<div class="bodySearchBottom">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="baskets" class="loading" style="overflow:hidden;border:none;padding:0;margin:0;position:relative;bottom:0;width:265px;height:320px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="right" style="position:relative;top:0;height:100%;float:right;">
|
||||
<div id="nb_answersEXT">
|
||||
<div id="nb_answers"></div>
|
||||
</div>
|
||||
<div id="answers" style="overflow-x:auto;overflow-y:auto;border:none;padding:0;margin:0;position:relative;left:0;top:0;margin:10px 0;">
|
||||
{{ phrasea_home|raw }}
|
||||
</div>
|
||||
<div class="divNavig" id="navigation"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="OVERLAY" style="display:none;"></div>
|
||||
<div id="PREVIEWBOX" style="overflow:hidden;">
|
||||
<div id="PREVIEWTITLE" style="height:50px;">
|
||||
<div style="margin:0 20px 8px;height:34px;">
|
||||
<span id="SPANTITLE" style="font-size:16px;font-weight:bold;"> </span>
|
||||
<div style="position:absolute;right:0;top:0;">
|
||||
<div onclick="closePreview();" style="cursor:pointer;color:#CCCCCC;font-size:12px;font-weight:bold;text-align:right;text-decoration:underline;">
|
||||
{% trans 'boutton::fermer' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWLEFT" class="preview_col" style="width:49%;position:relative;float:left;overflow:hidden;">
|
||||
<div id="PREVIEWCURRENT" class="debug preview_col_film" style="margin-left:20px;">
|
||||
<div id="PREVIEWCURRENTGLOB" style="position:relative;float:left;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWIMGCONT" class="preview_col_cont" style="overflow-x:hidden;overflow-y:hidden;text-align:left;"></div>
|
||||
</div>
|
||||
<div id="PREVIEWRIGHT" class="preview_col" style="width:49%;position:relative;float:right;overflow:hidden;">
|
||||
<div style="margin-right:10px;">
|
||||
<div id="PREVIEWIMGDESC" class="preview_col_cont" style="overflow-x:hidden;overflow-y:auto;">
|
||||
<ul style="height:30px;overflow:hidden;">
|
||||
<li><a href="#PREVIEWIMGDESCINNER-BOX">{% trans 'preview:: Description' %}</a></li>
|
||||
<li><a href="#HISTORICOPS-BOX">{% trans 'preview:: Historique' %}</a></li>
|
||||
<li><a href="#popularity-BOX">{% trans 'preview:: Popularite' %}</a></li>
|
||||
</ul>
|
||||
<div id="PREVIEWIMGDESCINNER-BOX" class="descBoxes">
|
||||
<div id="PREVIEWIMGDESCINNER" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="HISTORICOPS-BOX" class="descBoxes">
|
||||
<div id="HISTORICOPS" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="popularity-BOX" class="descBoxes">
|
||||
<div id="popularity" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWOTHERS" class="preview_col_film" style="overflow-x:hidden;overflow-y:auto;">
|
||||
<div id="PREVIEWOTHERSINNER" style="margin:0 0 0 20px;position:relative;float:left;width:100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWHD"></div>
|
||||
<div id="DIALOG"></div>
|
||||
<div id="MESSAGE"></div>
|
||||
</div>
|
||||
<iframe id="MODALDL" class="modalbox" src="" name="download" frameborder="0"></iframe>
|
||||
<div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;z-index:12000;">
|
||||
</div>
|
||||
<form name="formChu" id="formChu" action="/client/baskets/" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="sbas" id="formChubas" value="">
|
||||
{#<input type="hidden" name="act" id="formChuact" value="">#}
|
||||
<input type="hidden" name="p0" id="formChup0" value="">
|
||||
<input type="hidden" name="ssel_id" value="">
|
||||
<input type="hidden" name="courChuId" id="formChuBaskId" value="">
|
||||
</form>
|
||||
<form name="validatorEject" target="wVal" id="validatorEject" action="/lightbox/" method="get" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="ssel_id" id="ssel2val" value="">
|
||||
<input type="hidden" name="mode" value="0">
|
||||
</form>
|
||||
<form name="logout" target="_self" id="logout" action="/login/logout/" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="app" value="client">
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function reModCol()
|
||||
{
|
||||
var mod_col = $('#mod')[0].options[$('#mod')[0].selectedIndex].value.split('X');
|
||||
if(mod_col[0])
|
||||
mod_col = mod_col[1]
|
||||
var w = Math.round((bodyW - 16) / (mod_col==1?4:mod_col)) - 12;
|
||||
|
||||
if(w < 128)
|
||||
w = 128;
|
||||
var propname = document.styleSheets[0].cssRules ? "cssRules":"rules"; // firefox=cssRules ; safari,ie=rules
|
||||
document.styleSheets[0][propname][0].style.width = (w-20)+"px"; // IMG.hthbimg
|
||||
document.styleSheets[0][propname][1].style.height = (w-20)+"px"; // IMG.vthbimg
|
||||
document.styleSheets[0][propname][2].style.width = (w)+"px"; // .w160px
|
||||
document.styleSheets[0][propname][3].style.height = (w)+"px"; // .h160px
|
||||
}
|
||||
|
||||
function sessionactive(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/session/update/",
|
||||
dataType: 'json',
|
||||
data: {
|
||||
app : 2,
|
||||
usr : {{ app['phraseanet.user'].get_id() }}
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
},
|
||||
timeout: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
},
|
||||
success: function(data){
|
||||
if(data)
|
||||
manageSession(data);
|
||||
var t = 120000;
|
||||
if(data.apps && parseInt(data.apps)>1)
|
||||
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
||||
window.setTimeout("sessionactive();", t);
|
||||
|
||||
return;
|
||||
}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" language="javascript">
|
||||
var lastAct = null;
|
||||
var baskDisplay = true;
|
||||
|
||||
$(document).ready(function(){
|
||||
chgOngSearch('{{ active_tab }}');
|
||||
checkBases(true);
|
||||
|
||||
{% if last_action is not none %}
|
||||
lastAct = $.parseJSON('{{ last_action }}');
|
||||
execLastAct(lastAct);
|
||||
{% endif %}
|
||||
|
||||
{% if basket_status == '0' %}
|
||||
baskDisplay = false;
|
||||
{% else %}
|
||||
baskDisplay = true;
|
||||
{% endif %}
|
||||
|
||||
setBaskStatus();
|
||||
});
|
||||
</script>
|
||||
|
||||
{% if app['phraseanet.registry'].get('GV_googleAnalytics') is not empty %}
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("{{ app['phraseanet.registry'].get('GV_googleAnalytics') }}");
|
||||
pageTracker._setDomainName("none");
|
||||
pageTracker._setAllowLinker(true);
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
@@ -780,7 +780,7 @@
|
||||
if (!check_TOU($('#sendmail'))) {
|
||||
return false;
|
||||
}
|
||||
dialog.Close()
|
||||
dialog.Close();
|
||||
$('#sendmail form').submit();
|
||||
});
|
||||
|
||||
|
100
tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php
Normal file
100
tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Controller\Client;
|
||||
|
||||
class BasketsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::connect
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::call
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::getBaskets
|
||||
*/
|
||||
public function testGetClientBaskets()
|
||||
{
|
||||
self::$DI['client']->request("GET", "/client/baskets/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::getBaskets
|
||||
*/
|
||||
public function testPostClientBaskets()
|
||||
{
|
||||
self::$DI['client']->request("POST", "/client/baskets/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::createBasket
|
||||
*/
|
||||
public function testCreateBasket()
|
||||
{
|
||||
$nbBasketsBefore = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Entities\Basket b')->getSingleScalarResult();
|
||||
self::$DI['client']->request("POST", "/client/baskets/new/", array('p0' => 'hello'));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||
$nbBasketsAfter = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Entities\Basket b')->getSingleScalarResult();
|
||||
$this->assertGreaterThan($nbBasketsBefore,$nbBasketsAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::addElementToBasket
|
||||
*/
|
||||
public function testAddElementToBasket()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
self::$DI['client']->request("POST", "/client/baskets/add-element/", array(
|
||||
'courChuId' => $basket->getId(),
|
||||
'sbas' => self::$DI['record_1']->get_sbas_id(),
|
||||
'p0' => self::$DI['record_1']->get_record_id()
|
||||
));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||
$basket = self::$DI['app']['EM']->getRepository('Entities\Basket')->find($basket->getId());
|
||||
$this->assertGreaterThan(0, $basket->getElements()->count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::deleteBasket
|
||||
*/
|
||||
public function testDeleteBasket()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
self::$DI['client']->request("POST", "/client/baskets/delete/", array(
|
||||
'courChuId' => $basket->getId()
|
||||
));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||
try {
|
||||
$basket = self::$DI['app']['EM']->getRepository('Entities\Basket')->find($basket->getId());
|
||||
$this->fail('Basket is not deleted');
|
||||
} catch (\exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Baskets::deleteBasketElement
|
||||
*/
|
||||
public function testDeleteBasketElement()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
$record = self::$DI['record_1'];
|
||||
|
||||
$basketElement = new \Entities\BasketElement();
|
||||
$basketElement->setBasket($basket);
|
||||
$basketElement->setRecord($record);
|
||||
$basketElement->setLastInBasket();
|
||||
|
||||
$basket->addBasketElement($basketElement);
|
||||
|
||||
self::$DI['app']['EM']->persist($basket);
|
||||
self::$DI['app']['EM']->flush();
|
||||
|
||||
self::$DI['client']->request("POST", "/client/baskets/delete-element/", array(
|
||||
'p0' => $basketElement->getId()
|
||||
));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||
$this->assertEquals(0, $basket->getElements()->count());
|
||||
}
|
||||
}
|
83
tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php
Normal file
83
tests/Alchemy/Tests/Phrasea/Controller/Client/RootTest.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Controller\Client;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
||||
|
||||
class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::connect
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::call
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClient
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getDefaultClientStartPage
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getQueryStartPage
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getHelpStartPage
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getPublicationStartPage
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getGridProperty
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getDocumentStorageAccess
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getTabSetup
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getCssFile
|
||||
*/
|
||||
public function testGetClient()
|
||||
{
|
||||
\phrasea::start(self::$DI['app']['phraseanet.configuration']);
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['client']->request("GET", "/client/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientLanguage
|
||||
*/
|
||||
public function testGetLanguage()
|
||||
{
|
||||
self::$DI['client']->request("GET", "/client/language/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientPublications
|
||||
*/
|
||||
public function testGetPublications()
|
||||
{
|
||||
self::$DI['client']->request("GET", "/client/publications/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientHelp
|
||||
*/
|
||||
public function testGetClientHelp()
|
||||
{
|
||||
self::$DI['client']->request("GET", "/client/help/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::query
|
||||
* @covers Alchemy\Phrasea\Controller\Client\Root::buildQueryFromRequest
|
||||
*/
|
||||
public function testExecuteQuery()
|
||||
{
|
||||
$queryParameters = array();
|
||||
$queryParameters["mod"] = self::$DI['user']->getPrefs('client_view') ? : '3X6';
|
||||
$queryParameters["bas"] = array_keys(self::$DI['user']->ACL()->get_granted_base());
|
||||
$queryParameters["qry"] = self::$DI['user']->getPrefs('start_page_query') ? : 'all';
|
||||
$queryParameters["pag"] = 0;
|
||||
$queryParameters["search_type"] = SearchEngineOptions::RECORD_RECORD;
|
||||
$queryParameters["qryAdv"] = '';
|
||||
$queryParameters["opAdv"] = array();
|
||||
$queryParameters["status"] = array();
|
||||
$queryParameters["recordtype"] = SearchEngineOptions::TYPE_ALL;
|
||||
$queryParameters["sort"] = self::$DI['app']['phraseanet.registry']->get('GV_phrasea_sort', '');
|
||||
$queryParameters["infield"] = array();
|
||||
$queryParameters["ord"] = SearchEngineOptions::SORT_MODE_DESC;
|
||||
|
||||
self::$DI['client']->request("POST", "/client/query/", $queryParameters);
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
}
|
@@ -45,6 +45,9 @@
|
||||
RewriteRule ^download/.*$ /index.php [L]
|
||||
RewriteRule ^session/.*$ /index.php [L]
|
||||
|
||||
RewriteRule ^client/.*$ /index.php [L]
|
||||
RewriteRule ^client/baskets.*$ /index.php [L]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^api/v1/.*$ /api/v1/index.php [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
|
@@ -1,404 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 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\SearchEngine\SearchEngineOptions;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||
|
||||
$app = new Application();
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
if (!isset($parm)) {
|
||||
|
||||
$http_request = http_request::getInstance();
|
||||
$parm = $http_request->get_parms("mod", "bases"
|
||||
, "pag"
|
||||
, "qry", "search_type", "record_type"
|
||||
, "qryAdv", 'opAdv', 'status', 'date_min', 'date_max'
|
||||
, 'dateminfield', 'datemaxfield'
|
||||
, 'date_field'
|
||||
, 'sort'
|
||||
, 'stemme'
|
||||
, 'infield'
|
||||
, "nba"
|
||||
, "regroup" // si rech par doc, regroup ,ou pizza
|
||||
, "ord"
|
||||
);
|
||||
}
|
||||
$qry = '';
|
||||
|
||||
if (trim($parm['qry']) != '') {
|
||||
$qry .= trim($parm['qry']);
|
||||
}
|
||||
if (count($parm['opAdv']) > 0 && count($parm['opAdv']) == count($parm['qryAdv'])) {
|
||||
foreach ($parm['opAdv'] as $opId => $op) {
|
||||
if (trim($parm['qryAdv'][$opId]) != '') {
|
||||
if ($qry == trim($parm['qry']))
|
||||
$qry = '(' . trim($parm['qry']) . ')';
|
||||
$qry .= ' ' . $op . ' (' . trim($parm['qryAdv'][$opId]) . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($qry == '')
|
||||
$qry = 'all';
|
||||
|
||||
$parm['qry'] = $qry;
|
||||
|
||||
$qrySbas = array();
|
||||
if (is_null($parm['bases'])) {
|
||||
echo 'vous devez selectionner des collections dans lesquelles chercher';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$parm["mod"])
|
||||
$parm["mod"] = "3X6";
|
||||
|
||||
|
||||
$mod = explode("X", $parm["mod"]);
|
||||
if (count($mod) == 1) {
|
||||
$mod_row = (int) ($mod[0]);
|
||||
$mod_col = 1;
|
||||
} else {
|
||||
$mod_row = (int) ($mod[0]);
|
||||
$mod_col = (int) ($mod[1]);
|
||||
}
|
||||
$mod_xy = $mod_col * $mod_row;
|
||||
|
||||
$tbases = array();
|
||||
|
||||
$options = SearchEngineOptions::fromRequest($app, $request);
|
||||
|
||||
$form = $options->serialize();
|
||||
|
||||
$perPage = $mod_xy;
|
||||
|
||||
$app['phraseanet.SE']->setOptions($options);
|
||||
|
||||
$firstPage = $parm['pag'] < 1;
|
||||
if ($parm['pag'] < 1) {
|
||||
$app['phraseanet.SE']->resetCache();
|
||||
$parm['pag'] = 1;
|
||||
}
|
||||
|
||||
$result = $app['phraseanet.SE']->query($parm['qry'], (((int) $parm["pag"] - 1) * $perPage), $perPage);
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
$colls = array_map(function(\collection $collection) {
|
||||
return $collection->get_coll_id();
|
||||
}, array_filter($options->getCollections(), function(\collection $collection) use ($databox) {
|
||||
return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
|
||||
}));
|
||||
|
||||
$app['phraseanet.SE.logger']->log($databox, $result->getQuery(), $result->getTotal(), $colls);
|
||||
}
|
||||
|
||||
$proposals = $firstPage ? $result->propositions() : false;
|
||||
|
||||
$npages = $result->getTotal();
|
||||
|
||||
|
||||
$page = $result->getCurrentPage($perPage);
|
||||
|
||||
$ACL = $app['phraseanet.user']->ACL();
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_thesaurus')) {
|
||||
?>
|
||||
<script language="javascript">
|
||||
document.getElementById('proposals').innerHTML = "<div style='height:0px; overflow:hidden'>\n<?php echo p4string::MakeString($parm['qry'], "JS") ?>\n</div>\n<?php echo p4string::MakeString($proposals, "JS") ?>";
|
||||
<?php
|
||||
if ($app['phraseanet.registry']->get('GV_clientAutoShowProposals')) {
|
||||
?>
|
||||
if("<?php echo p4string::MakeString($proposals, "JS") ?>" != "<div class=\"proposals\"></div>")
|
||||
chgOng(4);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
$history = queries::history($app['phraseanet.appbox'], $app['phraseanet.user']->get_id());
|
||||
|
||||
echo '<script language="javascript" type="text/javascript">$("#history").empty().append("' . str_replace('"', '\"', $history) . '")</script>';
|
||||
|
||||
$nbanswers = $result->getAvailable();
|
||||
$longueur = strlen($parm['qry']);
|
||||
|
||||
$qrys = '<div>' . _('client::answers: rapport de questions par bases') . '</div>';
|
||||
|
||||
foreach ($qrySbas as $sbas => $qryBas)
|
||||
$qrys .= '<div style="font-weight:bold;">' . phrasea::sbas_names($sbas, $app) . '</div><div>' . $qryBas . '</div>';
|
||||
|
||||
$txt = "<b>" . substr($parm['qry'], 0, 36) . ($longueur > 36 ? "..." : "") . "</b>" . sprintf(_('client::answers: %d reponses'), (int) $nbanswers) . " <a style=\"float:none;display:inline-block;padding:2px 3px\" class=\"infoTips\" title=\"" . str_replace('"', "'", $qrys) . "\"> </a>";
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
p4.tot = <?php echo ($nbanswers > 0) ? $nbanswers : '0' ?>;
|
||||
document.getElementById("nb_answers").innerHTML = "<?php echo p4string::JSstring($txt) ?>";
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$npages = $result->getTotalPages($perPage);
|
||||
$pages = '';
|
||||
$ecart = 3;
|
||||
$max = (2 * $ecart) + 3;
|
||||
|
||||
if ($npages > $max) {
|
||||
for ($p = 1; $p <= $npages; $p++) {
|
||||
if ($p == $page)
|
||||
$pages .= '<span class="naviButton sel">' . ($p) . '</span>';
|
||||
elseif (( $p >= ($page - $ecart) ) && ( ($p - 1) <= ($page + $ecart) ))
|
||||
$pages .= '<span onclick="gotopage(' . ($p ) . ');" class="naviButton">' . ($p) . '</span>';
|
||||
elseif (($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) )) // si je suis dans les premieres pages ...
|
||||
$pages .= '<span onclick="gotopage(' . ($p ) . ');" class="naviButton">' . ($p) . '</span>';
|
||||
elseif (($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) )) // si je suis dans les dernieres pages ...
|
||||
$pages .= '<span onclick="gotopage(' . ($p ) . ');" class="naviButton">' . ($p) . '</span>';
|
||||
elseif ($p == ($npages - 1)) // c"est la derniere
|
||||
$pages .= '<span onclick="gotopage(' . ($p ) . ');" class="naviButton">...' . ($p) . '</span>';
|
||||
elseif ($p == 0) // c"est la premiere
|
||||
$pages .= '<span onclick="gotopage(' . ($p ) . ');" class="naviButton">' . ($p) . '...</span>';
|
||||
|
||||
if (($p == $page)
|
||||
|| ( ( $p >= ($page - $ecart) ) && ( $p <= ($page + $ecart) ))
|
||||
|| ( ($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) ) )
|
||||
|| ( ($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) ) )
|
||||
|| ( $p == 0)
|
||||
)
|
||||
$pages .= '<span class="naviButton" style="cursor:default;"> - </span>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ($p = 1; $p <= $npages; $p++) {
|
||||
if ($p == $page)
|
||||
$pages .= '<span class="naviButton sel">' . ($p) . '</span>';
|
||||
else
|
||||
$pages .= '<span onclick="gotopage(' . ($p) . ');" class="naviButton">' . ($p) . '</span>';
|
||||
if ($p < $npages)
|
||||
$pages .= '<span class="naviButton" style="cursor:default;"> - </span>';
|
||||
}
|
||||
}
|
||||
|
||||
$string2 = $pages . '<div class="navigButtons">';
|
||||
$string2.= '<div id="PREV_PAGE" class="PREV_PAGE"></div>';
|
||||
$string2.= '<div id="NEXT_PAGE" class="NEXT_PAGE"></div>';
|
||||
$string2.= '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#navigation").empty().append("<?php echo p4string::JSstring($string2) ?>");
|
||||
|
||||
<?php
|
||||
if ($page != 0 && $nbanswers) {
|
||||
?>
|
||||
$("#PREV_PAGE").bind('click',function(){gotopage(<?php echo ($page - 1) ?>)});
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
$("#PREV_PAGE").unbind('click');
|
||||
<?php
|
||||
}
|
||||
if ($page != $npages - 1 && $nbanswers) {
|
||||
?>
|
||||
$("#NEXT_PAGE").bind('click',function(){gotopage(<?php echo ($page + 1) ?>)});
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
$("#NEXT_PAGE").unbind('click');
|
||||
<?php } ?>
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$layoutmode = "grid";
|
||||
if ($mod_col == 1)
|
||||
$layoutmode = "list";
|
||||
else
|
||||
$layoutmode = "grid";
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (count($result->getResults()) > 0) {
|
||||
?><div><table id="grid" cellpadding="0" cellspacing="0" border="0" style="xwidth:95%;"><?php
|
||||
if ($mod_col == 1) { // MODE LISTE
|
||||
?><tr style="visibility:hidden"><td class="w160px" /><td /></tr><?php
|
||||
} else { // MODE GRILLE
|
||||
?><tr style="visibility:hidden"><?php
|
||||
for ($ii = 0; $ii < $mod_col; $ii++) {
|
||||
?><td class="w160px"></td><?php
|
||||
}
|
||||
?></tr><?php
|
||||
}
|
||||
|
||||
foreach ($result->getResults() as $record) {
|
||||
/* @var $record record_adapter */
|
||||
$base_id = $record->get_base_id();
|
||||
$sbas_id = $record->get_sbas_id();
|
||||
|
||||
$thumbnail = $record->get_thumbnail();
|
||||
|
||||
$docType = $record->get_type();
|
||||
|
||||
$title = $record->get_title();
|
||||
|
||||
try {
|
||||
$record->get_subdef('document');
|
||||
$light_info = $app['twig']->render('common/technical_datas.html.twig', array('record' => $record));
|
||||
} catch (\Exception $e) {
|
||||
$light_info = '';
|
||||
}
|
||||
$caption = $app['twig']->render('common/caption.html.twig', array('view' => 'answer', 'record' => $record));
|
||||
|
||||
|
||||
if ($i == 0) {
|
||||
?><tr><?php
|
||||
}
|
||||
if (($i % $mod_col == 0 && $i != 0)) {
|
||||
?></tr><tr><?php
|
||||
}
|
||||
if ($mod_col == 1 && $i != 0) {
|
||||
?></tr><tr style="height:20px;">
|
||||
<td colspan="2" class="td_mod_lst_img"><hr></td>
|
||||
</tr><tr><?php
|
||||
}
|
||||
|
||||
if ($mod_col == 1) {
|
||||
?><td valign="top" class="td_mod_lst_desc"><?php
|
||||
} else {
|
||||
?><td class="w160px"><?php
|
||||
}
|
||||
?><div class="diapo w160px" style="margin-bottom:0;border-bottom:none;">
|
||||
<div class="title"><?php echo $title ?></div><?php
|
||||
$status = '';
|
||||
$status .= '<div class="status">';
|
||||
$status .= $record->get_status_icons();
|
||||
$status .= '</div>';
|
||||
|
||||
echo $status;
|
||||
|
||||
$isVideo = ($docType == 'video');
|
||||
$isAudio = ($docType == 'audio');
|
||||
$isImage = ($docType == 'image');
|
||||
$isDocument = ($docType == 'document');
|
||||
|
||||
|
||||
$sd = $record->get_subdefs();
|
||||
|
||||
$isImage = false;
|
||||
$isDocument = false;
|
||||
if (!$isVideo && !$isAudio) {
|
||||
$isImage = true;
|
||||
}
|
||||
?><table cellpadding="0" cellspacing="0" style="margin: 0pt auto;"><?php
|
||||
?><tr class="h160px"><?php
|
||||
?><td class="image w160px h160px"><?php
|
||||
if ($isVideo) {
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
echo '<div class="dmco_text duration">' . $duration . '</div>';
|
||||
}
|
||||
if ($isAudio) {
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
echo '<div class="dmco_text duration">' . $duration . '</div>';
|
||||
}
|
||||
|
||||
$onclick = "";
|
||||
|
||||
if ($record->is_grouping()) {
|
||||
$onclick = 'openPreview(\'REG\',0,\'' . $sbas_id . '_' . $record->get_record_id() . '\');';
|
||||
} else {
|
||||
$onclick = 'openPreview(\'RESULT\',' . $record->get_number() . ');';
|
||||
}
|
||||
|
||||
if ($mod_col == '1')
|
||||
$pic_roll = '/prod/tooltip/preview/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/';
|
||||
else
|
||||
$pic_roll = '/prod/tooltip/caption/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/answer/';
|
||||
|
||||
$pic_roll = str_replace(array('&', '"'), array('&', '"'), $pic_roll);
|
||||
?><img onclick="<?php echo $onclick ?>" class="<?php echo ($thumbnail->get_width() > $thumbnail->get_height()) ? 'hthbimg' : 'vthbimg' ?> captionTips" id="IMG<?php echo $record->get_base_id() ?>_<?php echo $record->get_record_id() ?>" src="<?php echo $thumbnail->get_url() ?>" tooltipsrc="<?php echo ($pic_roll) ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="diapo w160px" style="border-top:none;"><?php ?><div class="buttons"><?php
|
||||
$minilogos = "";
|
||||
|
||||
$minilogos .= '<div class="minilogos">' . collection::getLogo($record->get_base_id(), $app);
|
||||
$minilogos .= '</div>';
|
||||
$sbas_id = $record->get_sbas_id();
|
||||
echo $minilogos;
|
||||
|
||||
if (
|
||||
$ACL->has_right_on_base($record->get_base_id(), 'candwnldpreview') ||
|
||||
$ACL->has_right_on_base($record->get_base_id(), 'candwnldhd') ||
|
||||
$ACL->has_right_on_base($record->get_base_id(), 'cancmd')
|
||||
) {
|
||||
?><div class="downloader" title="<?php echo _('action : exporter') ?>" onclick="evt_dwnl('<?php echo $sbas_id ?>_<?php echo $record->get_record_id() ?>');"></div><?php
|
||||
}
|
||||
?>
|
||||
<div class="printer" title="<?php echo _('action : print') ?>" onClick="evt_print('<?php echo $sbas_id ?>_<?php echo $record->get_record_id() ?>');"></div>
|
||||
<?php
|
||||
if ($ACL->has_right_on_base($record->get_base_id(), "canputinalbum")) {
|
||||
?><div class="baskAdder" title="<?php echo _('action : ajouter au panier') ?>" onClick="evt_add_in_chutier('<?php echo $record->get_sbas_id() ?>', '<?php echo $record->get_record_id() ?>');"></div><?php
|
||||
}
|
||||
if ($mod_col != '1') {
|
||||
?>
|
||||
<div style="margin-right:3px;" class="infoTips" id="INFO<?php echo $record->get_base_id() ?>_<?php echo $record->get_record_id() ?>" tooltipsrc="/prod/tooltip/tc_datas/<?php echo $record->get_sbas_id() ?>/<?php echo $record->get_record_id() ?>/"></div>
|
||||
<?php
|
||||
try {
|
||||
if ($record->get_preview()->is_physically_present()) {
|
||||
?>
|
||||
<div class="previewTips" tooltipsrc="/prod/tooltip/preview/<?php echo $record->get_sbas_id(); ?>/<?php echo $record->get_record_id(); ?>/" id="ZOOM<?php echo $record->get_base_id() ?>_<?php echo $record->get_record_id() ?>"> </div>
|
||||
<?php
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
?></div><?php
|
||||
?></div><?php
|
||||
?></td><?php
|
||||
if ($mod_col == 1) { // 1X10 ou 1X100
|
||||
?><td valign="top"><?php
|
||||
?><div class="desc1"><?php
|
||||
?><div class="caption" class="desc2"><?php echo ($caption . '<hr/>' . $light_info) ?></div><?php
|
||||
?></div><?php
|
||||
?></td><?php
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
?></tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
p4.tot = <?php echo $result->getAvailable(); ?>;
|
||||
p4.tot_options = '<?php echo $options->serialize() ?>';
|
||||
p4.tot_query = '<?php echo $parm['qry'] ?>';
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</div><?php
|
||||
} else {
|
||||
?><div><?php echo _('reponses:: Votre recherche ne retourne aucun resultat'); ?></div><?php
|
||||
phrasea::getHome($app, 'HELP', 'client');
|
||||
}
|
@@ -1,232 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
|
||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||
|
||||
$app = new Application();
|
||||
|
||||
$Request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
|
||||
|
||||
$nbNoview = 0;
|
||||
|
||||
$ACL = $app['phraseanet.user']->ACL();
|
||||
|
||||
$out = null;
|
||||
|
||||
if ($Request->get("act") == "DELIMG" && $Request->get("p0") != "") {
|
||||
$repository = $app['EM']->getRepository('\Entities\BasketElement');
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$basket_element = $repository->findUserElement($Request->get('p0'), $app['phraseanet.user']);
|
||||
$app['EM']->remove($basket_element);
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
if ($Request->get('act') == "ADDIMG" && ($Request->get("p0") != "" && $Request->get("p0") != null)) {
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket($app, $Request->get('courChuId'), $app['phraseanet.user'], true);
|
||||
|
||||
$sbas_id = $Request->get('sbas');
|
||||
$record = new record_adapter($app, $sbas_id, $Request->get('p0'));
|
||||
|
||||
$BasketElement = new \Entities\BasketElement();
|
||||
$BasketElement->setRecord($record);
|
||||
$BasketElement->setBasket($basket);
|
||||
$basket->addBasketElement($BasketElement);
|
||||
|
||||
$app['EM']->persist($BasketElement);
|
||||
$app['EM']->merge($basket);
|
||||
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
if ($Request->get('act') == "DELCHU" && ($Request->get("p0") != "" && $Request->get("p0") != null)) {
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket($app, $Request->get('courChuId'), $app['phraseanet.user'], true);
|
||||
|
||||
$app['EM']->remove($basket);
|
||||
$app['EM']->flush();
|
||||
unset($basket);
|
||||
}
|
||||
|
||||
|
||||
$courChuId = $Request->get('courChuId');
|
||||
|
||||
if ($Request->get('act') == "NEWCHU" && ($Request->get("p0") != "" && $Request->get("p0") != null)) {
|
||||
$basket = new \Entities\Basket();
|
||||
$basket->setName($Request->get('p0'));
|
||||
$basket->setOwner($app['phraseanet.user']);
|
||||
|
||||
$app['EM']->persist($basket);
|
||||
$app['EM']->flush();
|
||||
|
||||
$courChuId = $basket->getId();
|
||||
}
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$baskets = $repository->findActiveByUser($app['phraseanet.user']);
|
||||
|
||||
$out = "<table style='width:99%' class='baskIndicator' id='baskMainTable'><tr><td>";
|
||||
$out .= '<select id="chutier_name" name="chutier_name" onChange="chg_chu();" style="width:120px;">';
|
||||
|
||||
$baskets_opt = $recepts_opt = '';
|
||||
|
||||
foreach ($baskets as $typeBask => $basket) {
|
||||
if ( ! $basket->getPusherId()) {
|
||||
$baskId = $basket->getId();
|
||||
$sltd = '';
|
||||
if (trim($courChuId) == '')
|
||||
$courChuId = $baskId;
|
||||
if ($courChuId == $baskId)
|
||||
$sltd = 'selected';
|
||||
$baskets_opt .= '<option class="chut_choice" ' . $sltd . ' value="' . $baskId . '">'
|
||||
. $basket->getName() . '</option>';
|
||||
}
|
||||
|
||||
if ($basket->getPusherId()) {
|
||||
$baskId = $basket->getId();
|
||||
$sltd = '';
|
||||
if (trim($courChuId) == '')
|
||||
$courChuId = $baskId;
|
||||
if ($courChuId == $baskId)
|
||||
$sltd = 'selected';
|
||||
$recepts_opt .= '<option class="chut_choice" ' . $sltd . ' value="' . $baskId . '">'
|
||||
. $basket->getName() . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($baskets_opt) {
|
||||
$out .= '<optgroup label="' . _('paniers::categories: mes paniers') . '">'
|
||||
. $baskets_opt
|
||||
. '</optgroup>';
|
||||
}
|
||||
if ($recepts_opt) {
|
||||
$out .= '<optgroup label="' . _('paniers::categories: paniers recus') . '">'
|
||||
. $recepts_opt
|
||||
. '</optgroup>';
|
||||
}
|
||||
|
||||
|
||||
$out.='</optgroup>';
|
||||
$out .= "</select>";
|
||||
$out .= '</td><td style="width:40%">';
|
||||
|
||||
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket($app, $courChuId, $app['phraseanet.user'], true);
|
||||
|
||||
$jscriptnochu = $basket->getName() . " : " . sprintf(_('paniers:: %d documents dans le panier'), $basket->getElements()->count());
|
||||
|
||||
$nbElems = $basket->getElements()->count();
|
||||
?><div id="blocBask" class="bodyLeft" style="height:314px;bottom:0px;"><?php ?><div class="baskTitle"><?php ?><div id="flechenochu" class="flechenochu"></div><?php
|
||||
$totSizeMega = $basket->getSize($app);
|
||||
echo '<div class="baskName">' . sprintf(_('paniers:: paniers:: %d documents dans le panier'), $nbElems) .
|
||||
($app['phraseanet.registry']->get('GV_viewSizeBaket') ? ' (' . $totSizeMega . ' Mo)' : '') . '</div>';
|
||||
?></div><?php ?><div><?php
|
||||
echo $out;
|
||||
?><div class="baskDel" title="<?php echo _('action : supprimer') ?>" onclick="evt_chutier('DELSSEL');"/></div><?php ?><div class="baskCreate" title="<?php echo _('action:: nouveau panier') ?>" onclick="newBasket();"></div><?php ?><div style="float:right;position:relative;width:3px;height:16px;"></div><?php
|
||||
if ($nbElems > 0 && ($ACL->has_right("candwnldhd") || $ACL->has_right("candwnldpreview") || $ACL->has_right("cancmd") > 0 )) {
|
||||
?><div class="baskDownload" title="<?php echo _('action : exporter') ?>" onclick="evt_dwnl();"></div><?php
|
||||
}
|
||||
if ($nbElems > 0) {
|
||||
?><div class="baskPrint" title="<?php echo _('action : print') ?>" onclick="evt_print();"></div><?php
|
||||
}
|
||||
$jsclick = '';
|
||||
if (trim($courChuId) != '') {
|
||||
$jsclick = ' onclick=openCompare(\'' . $courChuId . '\') ';
|
||||
}
|
||||
?><div class="baskComparator" <?php echo $jsclick ?> title="<?php echo _('action : ouvrir dans le comparateur') ?>"></div><?php
|
||||
?></td><?php
|
||||
?></tr><?php
|
||||
?></table><?php
|
||||
?></div><?php
|
||||
?><div class="divexterne" style="height:270px;overflow-x:hidden;overflow-y:auto;position:relative"><?php
|
||||
if ($basket->getPusher($app) instanceof user) {
|
||||
?><div class="txtPushClient"><?php
|
||||
echo sprintf(_('paniers:: panier emis par %s'), $basket->getPusher($app)->get_display_name())
|
||||
?></div><?php
|
||||
}
|
||||
|
||||
foreach ($basket->getElements() as $basket_element) {
|
||||
$dim = $dim1 = $top = 0;
|
||||
|
||||
$thumbnail = $basket_element->getRecord($app)->get_thumbnail();
|
||||
|
||||
if ($thumbnail->get_width() > $thumbnail->get_height()) { // cas d'un format paysage
|
||||
if ($thumbnail->get_width() > 67) {
|
||||
$dim1 = 67;
|
||||
$top = ceil((67 - 67 * $thumbnail->get_height() / $thumbnail->get_width()) / 2);
|
||||
} else { // miniature
|
||||
$dim1 = $thumbnail->get_width();
|
||||
$top = ceil((67 - $thumbnail->get_height()) / 2);
|
||||
}
|
||||
$dim = "width:" . $dim1 . "px";
|
||||
} else { // cas d'un format portrait
|
||||
if ($thumbnail->get_height() > 55) {
|
||||
$dim1 = 55;
|
||||
$top = ceil((67 - 55) / 2);
|
||||
} else { // miniature
|
||||
$dim1 = $thumbnail->get_height();
|
||||
$top = ceil((67 - $thumbnail->get_height()) / 2);
|
||||
}
|
||||
$dim = "height:" . $dim1 . "px";
|
||||
}
|
||||
|
||||
if ($thumbnail->get_height() > 42)
|
||||
$classSize = "hThumbnail";
|
||||
else
|
||||
$classSize = "vThumbnail";
|
||||
|
||||
$tooltip = "";
|
||||
|
||||
$record = $basket_element->getRecord($app);
|
||||
if ($app['phraseanet.registry']->get('GV_rollover_chu')) {
|
||||
$tooltip = 'tooltipsrc="/prod/tooltip/caption/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/basket/"';
|
||||
}
|
||||
?><div class="diapochu"><?php
|
||||
?><div class="image"><?php
|
||||
?><img onclick="openPreview('BASK',<?php echo $basket_element->getRecord($app)->get_number() ?>,<?php echo $courChuId ?>); return(false);"
|
||||
<?php echo $tooltip ?> style="position:relative; top:<?php echo $top ?>px; <?php echo $dim ?>"
|
||||
class="<?php echo $classSize ?> baskTips" src="<?php echo $thumbnail->get_url() ?>"><?php
|
||||
?></div><?php ?><div class="tools"><?php ?><div class="baskOneDel" onclick="evt_del_in_chutier('<?php echo $basket_element->getId() ?>');"
|
||||
title="<?php echo _('action : supprimer') ?>"></div><?php
|
||||
if ($app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'candwnldhd') ||
|
||||
$app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'candwnldpreview') ||
|
||||
$app['phraseanet.user']->ACL()->has_right_on_base($record->get_base_id(), 'cancmd') ||
|
||||
$app['phraseanet.user']->ACL()->has_preview_grant($record)) {
|
||||
?><div class="baskOneDownload" onclick="evt_dwnl('<?php echo $record->get_sbas_id() ?>_<?php echo $record->get_record_id() ?>');" title="<?php echo _('action : exporter') ?>"></div><?php
|
||||
}
|
||||
?></div><?php
|
||||
?></div><?php
|
||||
}
|
||||
?></div></div><div id="blocNoBask" class="bodyLeft" style="height: 22px;display:none;bottom:0px;"><?php
|
||||
?><div class="baskTitle"><?php
|
||||
?><div id="flechechu" class="flechenochu"></div><?php
|
||||
?><div id="viewtext" class="baskName"><?php echo $jscriptnochu ?><span style="width:16px;height:16px;position: absolute; right: 10px;background-position:center center;" class='baskIndicator'></span></div><?php ?></div><?php ?></div>
|
||||
<?php
|
||||
?>
|
||||
<script>
|
||||
var oldNoview = p4.nbNoview;
|
||||
p4.nbNoview = parseInt(<?php echo $nbNoview ?>);
|
||||
if(p4.nbNoview>oldNoview)
|
||||
alert('<?php echo _('paniers:: vous avez de nouveaux paniers non consultes'); ?>');
|
||||
</script>
|
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 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\SearchEngine\SearchEngineOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
|
||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||
|
||||
$app = new Application();
|
||||
|
||||
$lng = $app['locale'];
|
||||
|
||||
$output = '';
|
||||
|
||||
$request = http_request::getInstance();
|
||||
$parm = $request->get_parms('action', 'env', 'pos', 'cont', 'roll', 'mode', 'color', 'options_serial', 'query');
|
||||
|
||||
switch ($parm['action']) {
|
||||
case 'LANGUAGE':
|
||||
$output = module_client::getLanguage($app, $lng);
|
||||
break;
|
||||
case 'HOME':
|
||||
$output = phrasea::getHome($app, 'PUBLI', 'client');
|
||||
break;
|
||||
case 'CSS':
|
||||
$output = $app['phraseanet.user']->setPrefs('css', $parm['color']);
|
||||
break;
|
||||
case 'BASK_STATUS':
|
||||
$output = $app['phraseanet.user']->setPrefs('client_basket_status', $parm['mode']);
|
||||
break;
|
||||
case 'BASKUPDATE':
|
||||
$noview = 0;
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$baskets = $repository->findActiveByUser($app['phraseanet.user']);
|
||||
|
||||
foreach ($baskets as $basket) {
|
||||
if ( ! $basket->getIsRead())
|
||||
$noview ++;
|
||||
if ( ! $basket->getIsRead())
|
||||
$noview ++;
|
||||
}
|
||||
$output = $noview;
|
||||
break;
|
||||
}
|
||||
echo $output;
|
||||
|
@@ -1,177 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
$app = new Application();
|
||||
|
||||
$feeds = \Feed_Collection::load_all($app, $app['phraseanet.user']);
|
||||
|
||||
$th_size = $app['phraseanet.user']->getPrefs('images_size');
|
||||
|
||||
?>
|
||||
<div style="height:50px;" class="homePubTitleBox">
|
||||
<div style="float:left;width:350px;"><h1 style="font-size:20px;margin-top:15px;">
|
||||
<h1><?php echo _('publications:: dernieres publications'); ?></h1>
|
||||
</div>
|
||||
<!-- <div style="float:right;width:160px;text-align:right;cursor:pointer;" class="subscribe_my_rss">
|
||||
<h1 style="font-size:17px;margin-top:19px;">
|
||||
<?php echo _('publications:: s\'abonner aux publications'); ?>
|
||||
<img style="border:none;" src="/skins/icons/rss16.png" />
|
||||
</h1>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$feed = '';
|
||||
|
||||
foreach ($feeds->get_aggregate()->get_entries(0, 5)->get_entries() as $entry) {
|
||||
/* @var $entry \Feed_Entry_Adapter */
|
||||
|
||||
$feed .= '<div class="boxPubli">' .
|
||||
'<div class="titlePubli">' .
|
||||
'<h2 class="htitlePubli">' .
|
||||
'<a class="homePubTitle" onclick="openCompare(\'' . $entry->get_id() . '\');">'
|
||||
. $entry->get_title() .
|
||||
'</a> </h2>' .
|
||||
'<span class="publiInfos">' .
|
||||
' ' . $app['date-formatter']->getPrettyString($entry->get_created_on()) .
|
||||
' ';
|
||||
|
||||
if ($entry->get_author_email())
|
||||
$feed .= '<a class="homePubLink" href="mailto:' . $entry->get_author_email() . '">';
|
||||
|
||||
$feed .= $entry->get_author_name();
|
||||
|
||||
if ($entry->get_author_email())
|
||||
$feed .= '</a>';
|
||||
|
||||
if ($entry->get_updated_on() > $entry->get_created_on())
|
||||
$feed .= '<br/><span style="font-style:italic;">' . _('publications:: derniere mise a jour')
|
||||
. ' ' . $app['date-formatter']->getPrettyString($entry->get_updated_on()) . '</span><br/><br/>';
|
||||
|
||||
$feed .= '</span></div><div class="descPubli"><div style="margin:10px 0 10px 20px;width:80%;">';
|
||||
|
||||
|
||||
if (trim($entry->get_subtitle()) != '') {
|
||||
$feed .= '' . nl2br($entry->get_subtitle());
|
||||
}
|
||||
$feed .= '</div>';
|
||||
|
||||
$feed .= '<div style="width:100%;position:relative;float:left;" id="PUBLICONT' . $entry->get_id() . '">';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
foreach ($entry->get_content() as $Feed_item) {
|
||||
/* @var $Feed_item \Feed_Entry_Item */
|
||||
$record = $Feed_item->get_record();
|
||||
|
||||
$thumbnail = $record->get_thumbnail();
|
||||
|
||||
$title = $record->get_title();
|
||||
$caption = $app['twig']->render(
|
||||
'common/caption.html.twig', array('view' => 'internal_publi', 'record' => $record)
|
||||
);
|
||||
|
||||
$preview = "<div tooltipsrc='/prod/tooltip/preview/" . $record->get_sbas_id() . "/" . $record->get_record_id() . "/' class=\"previewTips\"></div> ";
|
||||
|
||||
$docType = $record->get_type();
|
||||
$isVideo = ($docType == 'video');
|
||||
$isAudio = ($docType == 'audio');
|
||||
$isImage = ($docType == 'image');
|
||||
|
||||
$duration = '';
|
||||
|
||||
if ( ! $isVideo && ! $isAudio)
|
||||
$isImage = true;
|
||||
|
||||
if ($isVideo) {
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
$duration = '<div class="duration">' . $duration . '</div>';
|
||||
}
|
||||
if ($isAudio) {
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
$duration = '<div class="duration">' . $duration . '</div>';
|
||||
}
|
||||
|
||||
|
||||
$ratio = $thumbnail->get_width() / $thumbnail->get_height();
|
||||
|
||||
if ($ratio > 1) {
|
||||
$cw = min(((int) $th_size - 30), $thumbnail->get_width());
|
||||
$ch = $cw / $ratio;
|
||||
$pv = floor(($th_size - $ch) / 2);
|
||||
$ph = floor(($th_size - $cw) / 2);
|
||||
$imgStyle = 'width:' . $cw . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
} else {
|
||||
$ch = min(((int) $th_size - 30), $thumbnail->get_height());
|
||||
$cw = $ch * $ratio;
|
||||
|
||||
$pv = floor(($th_size - $ch) / 2);
|
||||
$ph = floor(($th_size - $cw) / 2);
|
||||
|
||||
$imgStyle = 'height:' . $ch . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
}
|
||||
|
||||
$feed .= "<div style='width:" . ($th_size + 30) . "px;' sbas=\"" . $record->get_sbas_id() . "\"
|
||||
id='IMGT_" . $record->get_serialize_key() . "_PUB_" . $entry->get_id()
|
||||
. "' class='IMGT diapo'
|
||||
onclick=\"openPreview('FEED','" . $Feed_item->get_ord() . "','" . $entry->get_id() . "');\">";
|
||||
|
||||
$feed .= '<div>';
|
||||
$feed .= "<div class=\"title\" style=\"height:40px;\">";
|
||||
|
||||
$feed .= $title;
|
||||
|
||||
$feed .= "</div>\n";
|
||||
|
||||
$feed .= '</div>';
|
||||
|
||||
$feed .= "<table class=\"thumb w160px h160px\" style=\"xheight:" . (int) $th_size . "px;\" cellspacing='0' cellpadding='0' valign='middle'>\n<tr><td>";
|
||||
|
||||
$feed .= $duration . "<img title=\"" . str_replace('"', '"', $caption) . "\" class=\" captionTips\" src=\"" . $thumbnail->get_url() . "\" style=\"" . $imgStyle . "\" />";
|
||||
|
||||
$feed .= "</td></tr></table>";
|
||||
|
||||
$feed .= '<div style="height: 25px;position:relative;">';
|
||||
$feed .= '<table class="bottom">';
|
||||
$feed .= '<tr>';
|
||||
$feed .= '<td>';
|
||||
|
||||
$feed .= "</td>\n";
|
||||
|
||||
$feed .= "<td style='text-align:right;' valign='bottom' nowrap>\n";
|
||||
|
||||
$feed .= $preview;
|
||||
|
||||
$feed .= "</td>";
|
||||
$feed .= "</tr>";
|
||||
$feed .= "</table>";
|
||||
$feed .= "</div>";
|
||||
|
||||
|
||||
$feed .= "</div>";
|
||||
}
|
||||
$feed .= '</div>' .
|
||||
'</div></div>';
|
||||
}
|
||||
|
||||
echo '<div>' . $feed . '</div>';
|
||||
|
@@ -1,670 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||
$app = new Application();
|
||||
|
||||
$usr_id = $app['phraseanet.user']->get_id();
|
||||
|
||||
phrasea::headers();
|
||||
|
||||
User_Adapter::updateClientInfos($app, 2);
|
||||
$user = User_Adapter::getInstance($usr_id, $app);
|
||||
?>
|
||||
<html lang="<?php echo $app['locale.I18n']; ?>">
|
||||
<head>
|
||||
<title><?php echo $app['phraseanet.registry']->get('GV_homeTitle') ?> Client</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||
<style ID="MYS" type="text/css">
|
||||
IMG.hthbimg
|
||||
{
|
||||
WIDTH: 108px;
|
||||
}
|
||||
IMG.vthbimg
|
||||
{
|
||||
HEIGHT: 108px;
|
||||
}
|
||||
.w160px
|
||||
{
|
||||
WIDTH: 128px;
|
||||
}
|
||||
.h160px
|
||||
{
|
||||
HEIGHT: 128px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/include/minify/f=include/jslibs/jquery-1.7.1.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/include/jslibs/jquery-ui-1.8.17/css/dark-hive/jquery-ui-1.8.17.custom.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/jquery.contextmenu.css,skins/common/main.css" />
|
||||
<?php
|
||||
//listage des css
|
||||
$css = array();
|
||||
$cssPath = $app['phraseanet.registry']->get('GV_RootPath') . 'www/skins/client/';
|
||||
|
||||
if ($hdir = opendir($cssPath)) {
|
||||
while (false !== ($file = readdir($hdir))) {
|
||||
|
||||
if (substr($file, 0, 1) == "." || mb_strtolower($file) == "cvs")
|
||||
continue;
|
||||
if (is_dir($cssPath . $file)) {
|
||||
$css[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir($hdir);
|
||||
}
|
||||
|
||||
$cssfile = false;
|
||||
$baskStatus = '1';
|
||||
$mode_pres = '';
|
||||
|
||||
$cssfile = $user->getPrefs('client_css');
|
||||
$baskStatus = $user->getPrefs('client_basket_status');
|
||||
$mode_pres = $user->getPrefs('client_view');
|
||||
$start_page = $user->getPrefs('start_page');
|
||||
$start_page_query = $user->getPrefs('start_page_query');
|
||||
|
||||
if ( ! $cssfile && isset($css['000000']))
|
||||
$cssfile = '000000';
|
||||
|
||||
$cssfile = 'skins/client/000000/clientcolor.css';
|
||||
?>
|
||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=skins/client/clientcolor.css" />
|
||||
<?php
|
||||
if ($cssfile) {
|
||||
?>
|
||||
<link id="skinCss" type="text/css" rel="stylesheet" href="/include/minify/f=<?php echo $cssfile ?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
#PREVIEWCURRENTCONT{
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="PNB" style="width:100%;height:100%;overflow:hidden;">
|
||||
<div id="container" style="position:absolute;top:0;left:0;overflow:hidden;width:100%;height:100%;">
|
||||
|
||||
<?php
|
||||
echo $app['twig']->render('common/menubar.twig', array('module' => 'client'));
|
||||
?>
|
||||
<div style="top:30px;position:relative;float:left;">
|
||||
<div id="left" style="height:100%;width:265px;position:relative;float:left;">
|
||||
<div style="overflow:hidden;border:none;padding:0;margin:0;position:relative;top:0px;height:0px;width:265px;" id="search">
|
||||
<?php
|
||||
$i = 1;
|
||||
|
||||
|
||||
$tong = array(
|
||||
$app['phraseanet.registry']->get('GV_ong_search') => 1,
|
||||
$app['phraseanet.registry']->get('GV_ong_advsearch') => 2,
|
||||
$app['phraseanet.registry']->get('GV_ong_topics') => 3
|
||||
);
|
||||
unset($tong[0]);
|
||||
if (count($tong) == 0)
|
||||
$tong = array(1 => 1);
|
||||
|
||||
ksort($tong);
|
||||
?>
|
||||
|
||||
|
||||
<div class="bodyLeft" style="top:3px;">
|
||||
<div id="bigTabsBckg">
|
||||
<table align="center" border="0" style="table-layout:fixed; top:1px; left:2px;height:22px; width:253px;" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<?php
|
||||
$activeTab = '';
|
||||
foreach ($tong as $kong => $ong) {
|
||||
if ($kong == 0)
|
||||
continue;
|
||||
$k = $kong == $app['phraseanet.registry']->get('GV_ong_actif') ? 'actif' : 'inactif';
|
||||
switch ($ong) {
|
||||
case 1:
|
||||
if ($k == 'actif')
|
||||
$activeTab = 'ongSearch';
|
||||
?>
|
||||
<td class="bigTabs <?php echo $k ?>" id="ongSearch" onclick="chgOngSearch('ongSearch');"><?php echo _('client:: recherche') ?></td>
|
||||
<?php
|
||||
break;
|
||||
case 2:
|
||||
if ($k == 'actif')
|
||||
$activeTab = 'ongAdvSearch';
|
||||
?>
|
||||
<td class="bigTabs <?php echo $k ?>" id="ongAdvSearch" onclick="chgOngSearch('ongAdvSearch');return(false);"><?php echo _('client:: recherche avancee') ?></td>
|
||||
<?php
|
||||
break;
|
||||
case 3:
|
||||
if ($k == 'actif')
|
||||
$activeTab = 'ongTopic';
|
||||
?>
|
||||
<td class="bigTabs <?php echo $k ?>" id="ongTopic" onclick="chgOngSearch('ongTopic');return(false);"><?php echo _('client:: topics') ?></td>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<form style="margin:0px; padding:0px;" name="search" id="searchForm" action="answer.php" onkeypress="if(event.keyCode==13){ doSearch();return false;}" method="post">
|
||||
|
||||
<div id="idongSearch">
|
||||
|
||||
<div id="mainSearch" style="overflow:hidden;">
|
||||
<div>
|
||||
<div>
|
||||
<input type="text" name="qry" value="<?php echo p4string::MakeString($start_page_query, "form") ?>" id="qry" style="width:245px;">
|
||||
</div>
|
||||
<div id="idongAdvSearch" style="display:none;">
|
||||
|
||||
<div>
|
||||
<select name="opAdv[]" style="width:54px">
|
||||
<option value="<?php echo _('phraseanet::technique:: et') ?>"><?php echo _('phraseanet::technique:: et') ?></option>
|
||||
<option value="<?php echo _('phraseanet::technique:: or') ?>"><?php echo _('phraseanet::technique:: or') ?></option>
|
||||
<option value="<?php echo _('phraseanet::technique:: except') ?>"><?php echo _('phraseanet::technique:: except') ?></option>
|
||||
</select>
|
||||
<input type="text" name="qryAdv[]" id="qryAdv1" style="width:185px">
|
||||
</div>
|
||||
<div>
|
||||
<select name="opAdv[]" style="width:54px">
|
||||
<option value="<?php echo _('phraseanet::technique:: et') ?>"><?php echo _('phraseanet::technique:: et') ?></option>
|
||||
<option value="<?php echo _('phraseanet::technique:: or') ?>"><?php echo _('phraseanet::technique:: or') ?></option>
|
||||
<option value="<?php echo _('phraseanet::technique:: except') ?>"><?php echo _('phraseanet::technique:: except') ?></option>
|
||||
</select>
|
||||
<input type="text" name="qryAdv[]" id="qryAdv2" style="width:185px">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
if ($app['phraseanet.registry']->get('GV_client_coll_ckbox') === 'popup') {
|
||||
// liste des collections : popup
|
||||
?>
|
||||
<div>
|
||||
<?php echo _('client::recherche: rechercher dans les bases :') ?>
|
||||
|
||||
|
||||
<?php
|
||||
$allbases = array();
|
||||
$showbases = (count($app['phraseanet.appbox']->get_databoxes()) > 0);
|
||||
$options = '';
|
||||
|
||||
|
||||
|
||||
foreach ($user->ACL()->get_granted_sbas() as $databox) {
|
||||
if ($showbases) {
|
||||
$options .= '<optgroup label="' . $databox->get_viewname() . '">';
|
||||
$allbcol = array();
|
||||
$n_allbcol = 0;
|
||||
if (count($databox->get_collections()) > 0) {
|
||||
$options .= '<option value="' . implode(';', $allbcol) . '">`' . $databox->get_viewname() . '`' . '</option>';
|
||||
}
|
||||
foreach ($user->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) {
|
||||
$allbcol[] = $coll->get_base_id();
|
||||
$n_allbcol ++;
|
||||
|
||||
echo '<input style="display:none;" checked="checked" type="checkbox" class="basItem checkbox basItem' . $databox->get_sbas_id() . '" name="bases[]" value="' . $coll->get_base_id() . '" id="basChk' . $coll->get_base_id() . '" />';
|
||||
|
||||
$options .= '<option value="' . $coll->get_base_id() . '" checked="checked" >' . $coll->get_name() . '</option>';
|
||||
|
||||
$allbases[] = $coll->get_base_id();
|
||||
}
|
||||
if ($n_allbcol > 1) {
|
||||
$options .= '<option value="' . implode(';', $allbcol) . '">`' . $databox->get_viewname() . '`' . '</option>';
|
||||
}
|
||||
}
|
||||
if ($showbases) {
|
||||
$options .= "</optgroup>\n";
|
||||
}
|
||||
}
|
||||
echo '<select id="basSelector" onchange="beforeAnswer();" style="width:245px;"><option value="' . implode(';', $allbases) . '">' . _('client::recherche: rechercher dans toutes les bases') . '</option>' . $options . '</select>';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div>
|
||||
<select title="<?php echo _('phraseanet:: presentation des resultats') ?>" name="mod" id="mod" onChange="changeModCol();" >
|
||||
<?php
|
||||
$vmf = array(
|
||||
array('w' => '3', 'h' => '2', 'name' => '3*2', 'selected' => '0'),
|
||||
array('w' => '5', 'h' => '4', 'name' => '5*4', 'selected' => '0'),
|
||||
array('w' => '4', 'h' => '10', 'name' => '4*10', 'selected' => '0'),
|
||||
array('w' => '6', 'h' => '3', 'name' => '6*3', 'selected' => '1'),
|
||||
array('w' => '8', 'h' => '4', 'name' => '8*4', 'selected' => '0'),
|
||||
array('w' => '1', 'h' => '10', 'name' => 'list*10', 'selected' => '0'),
|
||||
array('w' => '1', 'h' => '100', 'name' => 'list*100', 'selected' => '0')
|
||||
);
|
||||
foreach ($vmf as $vm) {
|
||||
$w = $vm["w"];
|
||||
$h = $vm["h"];
|
||||
|
||||
$sel = '';
|
||||
if ($mode_pres == '') {
|
||||
if ($vm['selected'] == '1')
|
||||
$sel = 'selected';
|
||||
}
|
||||
else
|
||||
if ($mode_pres == $h . 'X' . $w)
|
||||
$sel = "selected";
|
||||
|
||||
echo '<option ' . $sel . ' value="' . $h . 'X' . $w . '">' . (string) $vm['name'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$sel1 = "";
|
||||
$sel2 = "";
|
||||
($app['phraseanet.registry']->get('GV_defaultQuery_type') == 0 ? $sel1 = " checked='checked'" : $sel2 = " checked='checked'")
|
||||
?>
|
||||
|
||||
<input type="radio" value="0" class="checkbox" <?php echo $sel1 ?> id="search_type_docs" name="search_type" /><label for="search_type_docs"><?php echo _('phraseanet::type:: documents') ?></label>
|
||||
<input type="radio" value="1" class="checkbox" <?php echo $sel2 ?> id="search_type_group" name="search_type" /><label for="search_type_group"><?php echo _('phraseanet::type:: reportages') ?></label>
|
||||
|
||||
<input type="hidden" name="sort" value="<?php echo $app['phraseanet.registry']->get('GV_phrasea_sort'); ?>"/>
|
||||
|
||||
<input type="hidden" name="ord" id="searchOrd" value="<?php echo \searchEngine_options::SORT_MODE_DESC ?>" />
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div style="text-align:center;"><input class="pointer" type="button" onclick="doSearch();" value="<?php echo _('boutton::rechercher') ?>" /></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="pag" id="formAnswerPage" value="">
|
||||
<input type="hidden" name="nba" value="">
|
||||
|
||||
|
||||
|
||||
<div class="onglets" style="white-space: nowrap; margin-left: 5px; width: 227px;">
|
||||
<?php
|
||||
if ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') {
|
||||
?>
|
||||
<span id="idOnglet1" class="actif actives" onclick="chgOng(1);">
|
||||
<?php echo _('phraseanet:: collections') ?> <img onclick="removeFilters();" id="filter_danger" src="/skins/icons/alert.png" title="<?php echo _('client::recherche: cliquez ici pour desactiver tous les filtres de toutes base') ?>" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
if ($app['phraseanet.registry']->get('GV_thesaurus')) {
|
||||
?>
|
||||
<span id="idOnglet4" class="<?php echo ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') ? "inactif" : "actif" ?> actives" onclick="chgOng(4);">
|
||||
<?php echo _('phraseanet:: propositions') ?>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span id="idOnglet5" class="<?php echo ( ! ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') && ! $app['phraseanet.registry']->get('GV_thesaurus')) ? 'actif' : 'inactif' ?> actives" onclick="chgOng(5);">
|
||||
<?php echo _('phraseanet:: historique') ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchMiddle" style="">
|
||||
<?php
|
||||
if ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') {
|
||||
?>
|
||||
<div id="onglet1" style="display:block;height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div>
|
||||
<div style="text-align:center;margin:5px;">
|
||||
<input id="bases_all" class="actives" type="button" value="<?php echo _('boutton:: selectionner toutes les bases') ?>" onclick="checkBases(true);"/>
|
||||
<input id="bases_none" class="actives" type="button" value="<?php echo _('boutton:: selectionner aucune base') ?>" onclick="checkBases(false);"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="basesContainer">
|
||||
<?php
|
||||
foreach ($user->ACL()->get_granted_sbas() as $databox) {
|
||||
if ($app['phraseanet.registry']->get('GV_view_bas_and_coll')) {
|
||||
?>
|
||||
<div class="basContainer">
|
||||
<div class="basContTitle">
|
||||
<div class="basTitle">
|
||||
<input class="basChecker checkbox" id="basChecker<?php echo $databox->get_sbas_id() ?>" type="checkbox" onclick="chkSbas(<?php echo $databox->get_sbas_id() ?>,this)" />
|
||||
<label for="basChecker<?php echo $databox->get_sbas_id() ?>"><?php echo $databox->get_viewname() ?></label>
|
||||
<img onclick="removeFilters(<?php echo $databox->get_sbas_id() ?>);" id="filter_danger<?php echo $databox->get_sbas_id() ?>" class="filter_danger" src="/skins/icons/alert.png" title="<?php echo _('client::recherche: cliquez ici pour desactiver tous les filtres de cette base') ?>" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
|
||||
</div>
|
||||
<?php
|
||||
$status = $databox->get_statusbits();
|
||||
|
||||
$sbFilters = '';
|
||||
$dateFilters = $fieldsFilters = '';
|
||||
foreach ($status as $bit => $datas) {
|
||||
$imgoff = '';
|
||||
$imgon = '';
|
||||
if ( ! $datas['searchable'])
|
||||
continue;
|
||||
if ($datas['img_off'])
|
||||
$imgoff = '<img src="' . $datas['img_off'] . '" title="' . $datas['labeloff'] . '" style="width:16px;height:16px;vertical-align:bottom" />';
|
||||
|
||||
if ($datas['img_on'])
|
||||
$imgoff = '<img src="' . $datas['img_on'] . '" title="' . $datas['labelon'] . '" style="width:16px;height:16px;vertical-align:bottom" />';
|
||||
|
||||
$labeloff = $datas['labeloff'];
|
||||
$labelon = $datas['labelon'];
|
||||
|
||||
$sbFilters .= '<div style="text-align:center;overflow:hidden;">' .
|
||||
'<table style="table-layout:fixed;width:90%;text-align:left;" cellspacing="0" cellpadding="0">' .
|
||||
'<tr>' .
|
||||
'<td style="width:50%" nowrap>' .
|
||||
'<input class="checkbox" db="' . $databox->get_sbas_id() . '" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_' . $databox->get_sbas_id() . '_off' . $bit . '" value="' . $databox->get_sbas_id() . '_of' . $bit . '"/>' .
|
||||
'<label title="' . $labeloff . '" for="statusfil_' . $databox->get_sbas_id() . '_off' . $bit . '">' . $imgoff . $labeloff . '</label>' .
|
||||
'</td>' .
|
||||
'<td style="width:50%" nowrap>' .
|
||||
'<input class="checkbox" db="' . $databox->get_sbas_id() . '" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_' . $databox->get_sbas_id() . '_on' . $bit . '" value="' . $databox->get_sbas_id() . '_on' . $bit . '"/>' .
|
||||
'<label title="' . $labelon . '" for="statusfil_' . $databox->get_sbas_id() . '_on' . $bit . '">' . $imgon . $labelon . '</label>' .
|
||||
'</td>' .
|
||||
'</tr>' .
|
||||
'</table>' .
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$sxe = $databox->get_sxml_structure();
|
||||
if ($sxe) {
|
||||
$dateFilters = $fieldsFilters = '';
|
||||
if ($sxe->description) {
|
||||
foreach ($sxe->description->children() as $f => $field) {
|
||||
if ($field['type'] == 'date' && $field['searchclient'] == '1') {
|
||||
$dateFilters .= '<div><table style="width:98%;text-align:left;" cellspacing="0" cellpadding="0"><tr><td colspan="2">' .
|
||||
$f . '</td></tr>' .
|
||||
'<tr><td style="width:50%;">' . _('phraseanet::time:: de') .
|
||||
'</td><td style="width:50%;">' .
|
||||
_('phraseanet::time:: a') .
|
||||
'</td></tr>' .
|
||||
'<tr><td style="width:50%;">' .
|
||||
'<input type="hidden" name="dateminfield[]" value="' . $databox->get_sbas_id() . '_' . $f . '">' .
|
||||
' <input db="' . $databox->get_sbas_id() . '" onchange="checkFilters();" class="datepicker" type="text" name="date_min[]"></td><td style="width:50%;">' .
|
||||
'<input type="hidden" name="datemaxfield[]" value="' . $databox->get_sbas_id() . '_' . $f . '">' .
|
||||
' <input db="' . $databox->get_sbas_id() . '" onchange="checkFilters();" class="datepicker" type="text" name="date_max[]"></td></tr>' .
|
||||
'</table>' .
|
||||
'</div>';
|
||||
} elseif ($field['type'] != 'date') {
|
||||
$fieldsFilters .= '<option value="' . $databox->get_sbas_id() . '_' . $f . '">' . $f . '</option>';
|
||||
}
|
||||
}
|
||||
if ($dateFilters != '' || $sbFilters != '' || $fieldsFilters != '') {
|
||||
echo '<div class="filter"><span class="actives" onclick="toggleFilter(\'Filters' . $databox->get_sbas_id() . '\',this);">' . _('client::recherche: filter sur') . '</span></div>' .
|
||||
'<div id="Filters' . $databox->get_sbas_id() . '" class="base_filter" style="display:none;">';
|
||||
if ($dateFilters != '')
|
||||
echo '<div class="filterTitle">- ' . _('client::recherche: filtrer par dates') . '</div>' . $dateFilters;
|
||||
if ($sbFilters != '')
|
||||
echo '<div class="filterTitle">- ' . _('client::recherche: filtrer par status') . '</div>' . $sbFilters;
|
||||
if ($fieldsFilters != '')
|
||||
echo '<div class="filterTitle">- ' . _('client::recherche: filtrer par champs') . '</div><div><select db="' . $databox->get_sbas_id() . '" onchange="checkFilters();" name="infield[]" style="width:165px;"><option value="" selected="selected">' . _('client::recherche: filtrer par champs : tous les champs') . '</option>' . $fieldsFilters . '</select></div>';
|
||||
echo '</div><div style="height:4px;"> </div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?><div class="basGrp"><?php
|
||||
foreach ($user->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) {
|
||||
$s = "checked";
|
||||
echo '<div><input type="checkbox" class="checkbox basItem basItem' . $databox->get_sbas_id() . '" ' . $s . ' name="bases[]" id="basChk' . $coll->get_base_id() . '" value="' . $coll->get_base_id() . '"><label for="basChk' . $coll->get_base_id() . '">' . $coll->get_name() . '</label></div>';
|
||||
}
|
||||
?></div><?php
|
||||
if ($app['phraseanet.registry']->get('GV_view_bas_and_coll'))
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
if ($app['phraseanet.registry']->get('GV_thesaurus')) {
|
||||
?>
|
||||
|
||||
<div id="onglet4" style="display:<?php echo ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') ? 'none' : 'block' ?>;height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div>
|
||||
<div id="proposals" style="width:235px; overflow:hidden">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="onglet5" style="display:<?php echo ( ! ($app['phraseanet.registry']->get('GV_client_coll_ckbox') == 'checkbox') && ! $app['phraseanet.registry']->get('GV_thesaurus')) ? 'block' : 'none' ?>;height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
|
||||
<div id="history">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="idongTopic" style="overflow-x:hidden;overflow-y:auto;">
|
||||
|
||||
<?php
|
||||
if ($app['phraseanet.registry']->get('GV_client_render_topics') == 'popups')
|
||||
echo queries::dropdown_topics($app['locale.I18n']);
|
||||
elseif ($app['phraseanet.registry']->get('GV_client_render_topics') == 'tree')
|
||||
echo queries::tree_topics($app['locale.I18n']);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="bodySearchBottom">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="baskets" class="loading" style="overflow:hidden;border:none;padding:0;margin:0;position:relative;bottom:0;width:265px;height:320px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="right" style="position:relative;top:0;height:100%;float:right;">
|
||||
<div id="nb_answersEXT">
|
||||
<div id="nb_answers"></div>
|
||||
</div>
|
||||
<div id="answers" style="overflow-x:auto;overflow-y:auto;border:none;padding:0;margin:0;position:relative;left:0;top:0;margin:10px 0;">
|
||||
<?php
|
||||
echo phrasea::getHome($app, $start_page, 'client');
|
||||
?>
|
||||
</div>
|
||||
<div class="divNavig" id="navigation"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="OVERLAY" style="display:none;">
|
||||
|
||||
</div><div id="PREVIEWBOX" style="overflow:hidden;">
|
||||
<div id="PREVIEWTITLE" style="height:50px;">
|
||||
<div style="margin:0 20px 8px;height:34px;">
|
||||
<span id="SPANTITLE" style="font-size:16px;font-weight:bold;"> </span>
|
||||
<div style="position:absolute;right:0;top:0;"><div onclick="closePreview();" style="cursor:pointer;color:#CCCCCC;font-size:12px;font-weight:bold;text-align:right;text-decoration:underline;"><?php echo _('boutton::fermer') ?></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWLEFT" class="preview_col" style="width:49%;position:relative;float:left;overflow:hidden;">
|
||||
<div id="PREVIEWCURRENT" class="debug preview_col_film" style="margin-left:20px;">
|
||||
<div id="PREVIEWCURRENTGLOB" style="position:relative;float:left;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWIMGCONT" class="preview_col_cont" style="overflow-x:hidden;overflow-y:hidden;text-align:left;"></div>
|
||||
</div>
|
||||
<div id="PREVIEWRIGHT" class="preview_col" style="width:49%;position:relative;float:right;overflow:hidden;">
|
||||
<div style="margin-right:10px;">
|
||||
<div id="PREVIEWIMGDESC" class="preview_col_cont" style="overflow-x:hidden;overflow-y:auto;">
|
||||
<ul style="height:30px;overflow:hidden;">
|
||||
<li><a href="#PREVIEWIMGDESCINNER-BOX"><?php echo _('preview:: Description'); ?></a></li>
|
||||
<li><a href="#HISTORICOPS-BOX"><?php echo _('preview:: Historique'); ?></a></li>
|
||||
<li><a href="#popularity-BOX"><?php echo _('preview:: Popularite'); ?></a></li>
|
||||
</ul>
|
||||
<div id="PREVIEWIMGDESCINNER-BOX" class="descBoxes">
|
||||
<div id="PREVIEWIMGDESCINNER" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="HISTORICOPS-BOX" class="descBoxes">
|
||||
<div id="HISTORICOPS" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="popularity-BOX" class="descBoxes">
|
||||
<div id="popularity" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWOTHERS" class="preview_col_film" style="overflow-x:hidden;overflow-y:auto;">
|
||||
<div id="PREVIEWOTHERSINNER" style="margin:0 0 0 20px;position:relative;float:left;width:100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWHD"></div>
|
||||
<!-- BOITE MODALE DIALOG -->
|
||||
<div id="DIALOG"></div>
|
||||
<!-- BOITE MODALE DIALOG -->
|
||||
<div id="MESSAGE"></div>
|
||||
|
||||
</div>
|
||||
<iframe id="MODALDL" class="modalbox" src="" name="download" frameborder="0">
|
||||
</iframe>
|
||||
<!--<iframe style="display:none;" id="download" name="download"></iframe>-->
|
||||
<form style="display:none;" action="./index.php" target="_self" id="mainForm">
|
||||
</form>
|
||||
<div id="dialog_dwnl" title="<?php echo _('action : exporter') ?>" style="display:none;z-index12000;"></div>
|
||||
<form name="formChu" id="formChu" action="./baskets.php" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="sbas" id="formChubas" value="">
|
||||
<input type="hidden" name="act" id="formChuact" value="">
|
||||
<input type="hidden" name="p0" id="formChup0" value="">
|
||||
<input type="hidden" name="ssel_id" value="">
|
||||
<input type="hidden" name="courChuId" id="formChuBaskId" value="">
|
||||
</form>
|
||||
<form name="formPrintPage" action="printpage.php" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="lst" value="">
|
||||
</form>
|
||||
<form name="validatorEject" target="wVal" id="validatorEject" action="/lightbox/index.php" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="ssel_id" id="ssel2val" value="">
|
||||
<input type="hidden" name="mode" value="0">
|
||||
</form>
|
||||
<form name="logout" target="_self" id="logout" action="/login/logout/" method="post" style="visibility:hidden; display:none" >
|
||||
<input type="hidden" name="app" value="client">
|
||||
</form>
|
||||
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/include/minify/g=client"></script>
|
||||
<script type="text/javascript" src="/include/jslibs/flowplayer/flowplayer-3.2.11.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function reModCol()
|
||||
{
|
||||
var mod_col = $('#mod')[0].options[$('#mod')[0].selectedIndex].value.split('X');
|
||||
if(mod_col[0])
|
||||
mod_col = mod_col[1]
|
||||
var w = Math.round((bodyW - 16) / (mod_col==1?4:mod_col)) - 12;
|
||||
|
||||
if(w < 128)
|
||||
w = 128;
|
||||
var propname = document.styleSheets[0].cssRules ? "cssRules":"rules"; // firefox=cssRules ; safari,ie=rules
|
||||
document.styleSheets[0][propname][0].style.width = (w-20)+"px"; // IMG.hthbimg
|
||||
document.styleSheets[0][propname][1].style.height = (w-20)+"px"; // IMG.vthbimg
|
||||
document.styleSheets[0][propname][2].style.width = (w)+"px"; // .w160px
|
||||
document.styleSheets[0][propname][3].style.height = (w)+"px"; // .h160px
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sessionactive(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/session/update/",
|
||||
dataType: 'json',
|
||||
data: {
|
||||
module : 2,
|
||||
usr : <?php echo $usr_id ?>
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
},
|
||||
timeout: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
},
|
||||
success: function(data){
|
||||
if(data)
|
||||
manageSession(data);
|
||||
var t = 120000;
|
||||
if(data.apps && parseInt(data.apps)>1)
|
||||
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
||||
window.setTimeout("sessionactive();", t);
|
||||
|
||||
return;
|
||||
}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" language="javascript">
|
||||
var lastAct = null;
|
||||
var baskDisplay = true;
|
||||
$(document).ready(function(){
|
||||
|
||||
chgOngSearch('<?php echo $activeTab ?>');
|
||||
checkBases(true)
|
||||
|
||||
<?php
|
||||
if ( ! $user->is_guest() && $app['request']->cookies->has('last_act')) {
|
||||
?>
|
||||
lastAct = $.parseJSON('<?php echo $app['request']->cookies->get('last_act') ?>');
|
||||
execLastAct(lastAct);
|
||||
<?php
|
||||
}
|
||||
if ($baskStatus == '0') {
|
||||
?>
|
||||
baskDisplay = false;
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
baskDisplay = true;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
setBaskStatus();
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
if (trim($app['phraseanet.registry']->get('GV_googleAnalytics')) != '') {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("<?php echo $app['phraseanet.registry']->get('GV_googleAnalytics') ?>");
|
||||
pageTracker._setDomainName("none");
|
||||
pageTracker._setAllowLinker(true);
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@@ -2,12 +2,12 @@
|
||||
* GLOBALES
|
||||
**************/
|
||||
|
||||
var p4 = {
|
||||
var p4 = $.extend(p4 || {}, {
|
||||
tot:0,
|
||||
preview :{open:false,current:false},
|
||||
currentViewMode:'classic',
|
||||
nbNoview:0
|
||||
};
|
||||
});
|
||||
|
||||
var baskAjax,baskAjaxrunning;
|
||||
baskAjaxrunning = false;
|
||||
@@ -108,40 +108,25 @@ $(document).ready(function(){
|
||||
$(this).removeClass("hover");
|
||||
});
|
||||
|
||||
|
||||
// if (!$.browser.msie || ($.browser.msie && $.browser.version != '6.0')) {
|
||||
// $('#bandeau .publilist').hover(function(){
|
||||
// $(this).addClass("hover");
|
||||
// $(this).children('.hoverlist').show();
|
||||
// },function(){
|
||||
// $(this).removeClass("hover");
|
||||
// $(this).children('.hoverlist').hide();
|
||||
// })
|
||||
// }else
|
||||
// {
|
||||
// $('#bandeau .publilist').hover(function(){
|
||||
// $(this).addClass("hover");
|
||||
// },function(){
|
||||
// $(this).removeClass("hover");
|
||||
// })
|
||||
//
|
||||
// }
|
||||
|
||||
sessionactive();
|
||||
resize();
|
||||
$(window).resize(function(){
|
||||
resize();
|
||||
resizeSearch();
|
||||
});
|
||||
|
||||
initAnswerForm();
|
||||
initBasketForm();
|
||||
|
||||
$('#PREVIEWHD').bind('click',function(){
|
||||
$(this).hide();
|
||||
$(this).empty();
|
||||
});
|
||||
|
||||
$('#PREVIEWHD').trigger('click');
|
||||
|
||||
getBaskets();
|
||||
|
||||
afterSearch();
|
||||
$(this).bind('keydown',function(event)
|
||||
{
|
||||
@@ -282,22 +267,17 @@ function getHome(cas){
|
||||
newSearch();
|
||||
break;
|
||||
case 'PUBLI':
|
||||
case 'HELP':
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/client/clientFeedBack.php",
|
||||
type: "GET",
|
||||
url: "/client/publications/",
|
||||
dataType: 'html',
|
||||
data: {
|
||||
action: "HOME",
|
||||
type: cas
|
||||
},
|
||||
beforeSend: function(){
|
||||
// if (answAjaxrunning)
|
||||
// answAjax.abort();
|
||||
clearAnswers();
|
||||
answAjaxrunning = true;
|
||||
$('#answers').addClass('loading');
|
||||
|
||||
},
|
||||
error: function(){
|
||||
answAjaxrunning = false;
|
||||
@@ -310,19 +290,36 @@ function getHome(cas){
|
||||
success: function(data){
|
||||
$('#answers').append(data);
|
||||
afterSearch();
|
||||
|
||||
if(cas == 'PUBLI')
|
||||
{
|
||||
$('.boxPubli .diapo').css('width','').addClass('w160px').css('margin','0pt 0px 8px 8px');
|
||||
}
|
||||
|
||||
return;
|
||||
});
|
||||
case 'HELP':
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/client/help/",
|
||||
dataType: 'html',
|
||||
data: {
|
||||
type: cas
|
||||
},
|
||||
beforeSend: function(){
|
||||
clearAnswers();
|
||||
answAjaxrunning = true;
|
||||
$('#answers').addClass('loading');
|
||||
},
|
||||
error: function(){
|
||||
answAjaxrunning = false;
|
||||
$('#answers').removeClass('loading');
|
||||
},
|
||||
timeout: function(){
|
||||
answAjaxrunning = false;
|
||||
$('#answers').removeClass('loading');
|
||||
},
|
||||
success: function(data){
|
||||
$('#answers').append(data);
|
||||
afterSearch();
|
||||
}
|
||||
|
||||
});
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -336,15 +333,13 @@ function changeModCol(){
|
||||
|
||||
function getLanguage(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./clientFeedBack.php",
|
||||
type: "GET",
|
||||
url: "/client/language/",
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: "LANGUAGE"
|
||||
},
|
||||
data: {},
|
||||
success: function(data){
|
||||
language = data;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -367,7 +362,7 @@ function initBasketForm(){
|
||||
$('#baskets').removeClass('loading');
|
||||
$('.baskIndicator').removeClass('baskLoading');
|
||||
},
|
||||
success: function(){
|
||||
success: function(data){
|
||||
baskAjaxrunning = false;
|
||||
if(p4.preview.open && $.browser.msie && $.browser.version == '6.0')
|
||||
{
|
||||
@@ -376,6 +371,7 @@ function initBasketForm(){
|
||||
});
|
||||
}
|
||||
setBaskStatus();
|
||||
|
||||
$('#baskets').removeClass('loading');
|
||||
$('.baskIndicator').removeClass('baskLoading');
|
||||
$('#blocBask img.baskTips').tooltip();
|
||||
@@ -400,11 +396,16 @@ function initBasketForm(){
|
||||
$(this).dequeue();
|
||||
});
|
||||
});
|
||||
|
||||
if($('#chutier_name').length > 0) {
|
||||
$('#formChuBaskId')[0].value = $('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
|
||||
$('#formChubas')[0].value = $('#formChuact')[0].value = $('#formChup0')[0].value = '';
|
||||
return;
|
||||
}
|
||||
$('#formChubas')[0].value = $('#formChup0')[0].value = '';
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
baskAjax = $('#formChu').ajaxForm(options);
|
||||
}
|
||||
function setBaskStatus(){
|
||||
@@ -421,24 +422,25 @@ function setBaskStatus(){
|
||||
resizeSearch();
|
||||
}
|
||||
|
||||
function saveBaskStatus(value) {
|
||||
$.post("clientFeedBack.php", {
|
||||
action: "BASK_STATUS",
|
||||
mode: (value?'1':'0')
|
||||
function saveBaskStatus(val) {
|
||||
$.post("/user/preferences/", {
|
||||
prop: "client_basket_status",
|
||||
value: (val?'1':'0')
|
||||
}, function(data){
|
||||
return;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function checkBaskets(){
|
||||
$.post("clientFeedBack.php", {
|
||||
action: 'BASKUPDATE'
|
||||
}, function(data){
|
||||
if(parseInt(data)>p4.nbNoview)
|
||||
$.post("/client/baskets/check/", {}, function(data){
|
||||
if(data.success) {
|
||||
if(parseInt(data.no_view) > p4.nbNoview){
|
||||
getBaskets();
|
||||
}
|
||||
window.setTimeout("checkBaskets();", 52000);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -466,7 +468,7 @@ function initAnswerForm(){
|
||||
success: function(){
|
||||
answAjaxrunning = false;
|
||||
afterSearch();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$('#searchForm').ajaxForm(options);
|
||||
@@ -630,10 +632,22 @@ function clktri(id){
|
||||
**************/
|
||||
|
||||
function evt_add_in_chutier(sbas_id, record_id){
|
||||
// No basket
|
||||
if($('#chutier_name option').length === 0) {
|
||||
var alert = p4.Dialog.Create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
closeButton:true
|
||||
});
|
||||
|
||||
alert.setContent(language.no_basket);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#formChubas')[0].value = sbas_id;
|
||||
$('#formChuact')[0].value = "ADDIMG";
|
||||
$('#formChup0')[0].value = record_id;
|
||||
$('#formChu').submit();
|
||||
$('#formChu').attr('action', '/client/baskets/add-element/').submit();
|
||||
}
|
||||
|
||||
function chg_chu()
|
||||
@@ -645,6 +659,7 @@ function chg_chu()
|
||||
|
||||
function getBaskets()
|
||||
{
|
||||
$('#formChu').attr("action","/client/baskets/")
|
||||
$('#formChu').submit();
|
||||
}
|
||||
|
||||
@@ -678,7 +693,7 @@ function saveNewBask(){
|
||||
alert(language.chuNameEmpty);
|
||||
return;
|
||||
}
|
||||
document.forms["formChu"].act.value = "NEWCHU";
|
||||
$("#formChu").attr('action', '/client/baskets/new/')
|
||||
document.forms["formChu"].p0.value = tmp;
|
||||
$("#formChu").submit();
|
||||
}
|
||||
@@ -688,8 +703,8 @@ function evt_chutier(arg_commande){
|
||||
case "DELSSEL":
|
||||
if (confirm(language.confirmDelBasket)) {
|
||||
if (document.forms["formChu"]) {
|
||||
document.forms["formChu"].act.value = "DELCHU";
|
||||
document.forms["formChu"].p0.value = document.forms["formChu"].courChuId.value;
|
||||
$("#formChu").attr('action', '/client/baskets/delete/')
|
||||
$("#formChu").submit();
|
||||
}
|
||||
}
|
||||
@@ -703,8 +718,8 @@ function reload_chu(id){
|
||||
}
|
||||
|
||||
function evt_del_in_chutier(selid){
|
||||
document.forms["formChu"].act.value = "DELIMG";
|
||||
document.forms["formChu"].p0.value = selid;
|
||||
$("#formChu").attr("action", "/client/baskets/delete-element/")
|
||||
$("#formChu").submit();
|
||||
}
|
||||
|
||||
@@ -732,52 +747,50 @@ function beforeAnswer(){
|
||||
}
|
||||
|
||||
function gotopage(pag){
|
||||
if (document.forms["search"]) {
|
||||
document.forms["search"].nba.value = p4.tot;
|
||||
document.forms["search"].pag.value = pag;
|
||||
$("#answers").innerHTML = "";
|
||||
if ($('#searchForm').length > 0) {
|
||||
$('#searchForm input[name=nba]').val(p4.tot);
|
||||
$('#searchForm input[name=pag]').val(pag);
|
||||
$("#answers").empty();
|
||||
$('#searchForm').submit();
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function evt_print(basrec){
|
||||
var url = "/include/printpage.php?callclient=1";
|
||||
if(typeof(basrec) == 'undefined') {
|
||||
if($('#chutier_name option').length === 0) {
|
||||
return false;
|
||||
}
|
||||
var datas = "&ssel="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
|
||||
} else {
|
||||
var datas = "&lst=" + basrec;
|
||||
}
|
||||
|
||||
var dialog = p4.Dialog.Create({title: typeof(language) !== 'undefined' ? language['print']: ''});
|
||||
|
||||
if(typeof(basrec) == 'undefined')
|
||||
url += "&SSTTID="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
|
||||
else
|
||||
url += "&lst=" + basrec;
|
||||
$.post("/prod/printer/", datas, function(data) {
|
||||
|
||||
var top;
|
||||
var left;
|
||||
dialog.setContent(data);
|
||||
|
||||
$('#MODALDL').attr('src',url);
|
||||
$('.tabs', dialog.getDomElement()).tabs();
|
||||
|
||||
$('.close_button', dialog.getDomElement()).bind('click',function(){
|
||||
dialog.Close();
|
||||
});
|
||||
|
||||
var t = (bodySize.y - 300) / 2;
|
||||
var l = (bodySize.x - 490) / 2;
|
||||
|
||||
$('#MODALDL').css({
|
||||
'display': 'block',
|
||||
'opacity': 0,
|
||||
'width': '490px',
|
||||
'position': 'absolute',
|
||||
'top': t,
|
||||
'left': l,
|
||||
'height': '300px'
|
||||
}).fadeTo(500, 1);
|
||||
|
||||
showOverlay(2);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function evt_dwnl(lst)
|
||||
{
|
||||
if(typeof(lst) == 'undefined') {
|
||||
var datas = "&SSTTID="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
|
||||
if($('#chutier_name option').length === 0) {
|
||||
return false;
|
||||
}
|
||||
var datas = "&ssel="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
|
||||
} else {
|
||||
var datas = "&lst=" + lst;
|
||||
}
|
||||
@@ -835,10 +848,9 @@ function setCss(color)
|
||||
'skins/client/'+color+'/ui.core.css,'+
|
||||
'skins/client/'+color+'/ui.datepicker.css,'+
|
||||
'skins/client/'+color+'/ui.theme.css');
|
||||
$.post("clientFeedBack.php", {
|
||||
action: "CSS",
|
||||
color: color,
|
||||
t: Math.random()
|
||||
$.post("/user/preferences/", {
|
||||
prop: "css",
|
||||
value: color
|
||||
}, function(data){
|
||||
return;
|
||||
});
|
||||
@@ -956,6 +968,10 @@ function execLastAct(lastAct)
|
||||
setTimeout("execLastAct(lastAct);", 500);
|
||||
}
|
||||
else {
|
||||
if($('#chutier_name option').length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value != lastAct.SSTTID)
|
||||
{
|
||||
$('#chutier_name option').each(function(i, n){
|
||||
|
@@ -18,6 +18,7 @@ $groups = array(
|
||||
, '//include/jslibs/json2.js'
|
||||
, '//include/jslibs/audio-player/audio-player-noswfobject.js'
|
||||
, '//include/jslibs/jquery.form.2.49.js'
|
||||
, '//prod/jquery.Dialog.js'
|
||||
, '//client/jquery.p4client.1.0.js'
|
||||
, '//include/jquery.tooltip.js'
|
||||
, '//include/jquery.p4.preview.js'
|
||||
|
@@ -81,10 +81,9 @@ function getHome(cas, page){
|
||||
case 'HELP':
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/client/clientFeedBack.php",
|
||||
url: "/client/home/",
|
||||
dataType: 'html',
|
||||
data: {
|
||||
action: "HOME",
|
||||
type: cas
|
||||
},
|
||||
beforeSend: function(){
|
||||
|
3
www/skins/client/ie6.css
Normal file
3
www/skins/client/ie6.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#mainMenu{
|
||||
width:100%;
|
||||
}
|
Reference in New Issue
Block a user