Merged with 3.5.1
74
README.md
@@ -1,10 +1,33 @@
|
||||
Phraseanet - Digital Asset Management application
|
||||
Phraseanet 3.5 - Digital Asset Management application
|
||||
=================================================
|
||||
|
||||
#Installation
|
||||
#Features :
|
||||
|
||||
**Nginx**
|
||||
Metadatas Management (include Thesaurus and DublinCore Mapping)
|
||||
Search Engine (Sphinx Search Integration)
|
||||
RestFull APIS (See Developer Documentation http://docs.phraseanet.com/Devel)
|
||||
Bridge to Youtube/Dailymotion/Flickr
|
||||
|
||||
#Documentation :
|
||||
|
||||
http://docs.phraseanet.com
|
||||
|
||||
#Easy Installation
|
||||
|
||||
**Fetch Sources**
|
||||
|
||||
<pre>
|
||||
|
||||
git clone git://github.com/alchemy-fr/Phraseanet.git Phraseanet
|
||||
cd Phraseanet
|
||||
./vendors.php
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
**Setup your webserver**
|
||||
|
||||
***Nginx***
|
||||
<pre>
|
||||
server {
|
||||
listen 80;
|
||||
@@ -15,58 +38,21 @@ server {
|
||||
|
||||
|
||||
location /web {
|
||||
alias /home/grosroro/workspace/Phraseanet-Trunk/datas/web;
|
||||
alias /path/to/Phraseanet/datas/web;
|
||||
}
|
||||
location /download {
|
||||
internal;
|
||||
alias /home/grosroro/workspace/Phraseanet-Trunk/tmp/download;
|
||||
alias /path/to/Phraseanet/tmp/download;
|
||||
}
|
||||
location /lazaret {
|
||||
internal;
|
||||
alias /home/grosroro/workspace/Phraseanet-Trunk/tmp/lazaret;
|
||||
alias /path/to/Phraseanet/tmp/lazaret;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
#Pimp my install
|
||||
|
||||
**xsendfile**
|
||||
<pre>
|
||||
location /protected {
|
||||
internal;
|
||||
alias /home/grosroro/workspace/Phraseanet-Trunk/datas/noweb/;
|
||||
}
|
||||
</pre>
|
||||
|
||||
**MP4 pseudo stream**
|
||||
<pre>
|
||||
location /mp4_video {
|
||||
internal;
|
||||
mp4;
|
||||
alias /home/grosroro/workspace/Phraseanet-Trunk/datas/noweb/;
|
||||
}
|
||||
|
||||
location /mp4_videos {
|
||||
secure_download on;
|
||||
secure_download_secret S3cre3t;
|
||||
secure_download_path_mode file;
|
||||
|
||||
if ($secure_download = "-1") {
|
||||
return 403;
|
||||
}
|
||||
if ($secure_download = "-2") {
|
||||
return 403;
|
||||
}
|
||||
if ($secure_download = "-3") {
|
||||
return 500;
|
||||
}
|
||||
rewrite ^/mp4_videos(.*)/[0-9a-zA-Z]*/[0-9a-zA-Z]*$ /mp4_video$1 last;
|
||||
}
|
||||
</pre>
|
||||
|
||||
#RESTFULL APIs
|
||||
|
||||
See the [online developer reference] [1]
|
||||
Let's go !
|
||||
|
||||
#License
|
||||
|
||||
|
2
config/stamp/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
config/topics/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
config/wm/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@@ -357,6 +357,16 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
|
||||
|
||||
return $this->publisher;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param User_adapter $user
|
||||
* @return boolean
|
||||
*/
|
||||
public function is_publisher(User_adapter $user)
|
||||
{
|
||||
return $user->get_id() === $this->get_publisher()->get_user()->get_id();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -576,7 +576,7 @@ class Session_Handler
|
||||
$sql = 'SELECT v.id as validate_id, v.usr_id, v.ssel_id
|
||||
, s.usr_id as owner, t.value
|
||||
FROM (validate v, ssel s)
|
||||
LEFT JOIN tokens t
|
||||
INNER JOIN tokens t
|
||||
ON (t.datas = s.ssel_id
|
||||
AND v.usr_id=t.usr_id AND t.type="validate")
|
||||
WHERE expires_on < :expires_on
|
||||
@@ -594,7 +594,8 @@ class Session_Handler
|
||||
'ssel_id' => $row['ssel_id'],
|
||||
'from' => $row['owner'],
|
||||
'validate_id' => $row['validate_id'],
|
||||
'url' => $registry->get('GV_ServerName') . 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value']
|
||||
'url' => $registry->get('GV_ServerName')
|
||||
. 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value']
|
||||
);
|
||||
|
||||
$events_mngr->trigger('__VALIDATION_REMINDER__', $params);
|
||||
|
@@ -399,7 +399,14 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
{
|
||||
if (!trim($email))
|
||||
$email = null;
|
||||
|
||||
$test_user = User_Adapter::get_usr_id_from_email($email);
|
||||
|
||||
if($test_user && $test_user != $this->get_id())
|
||||
{
|
||||
throw new Exception_InvalidArgument (sprintf(_('A user already exists with email addres %s'), $email));
|
||||
}
|
||||
|
||||
$sql = 'UPDATE usr SET usr_mail = :new_email WHERE usr_id = :usr_id';
|
||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute(array(':new_email' => $email, ':usr_id' => $this->get_id()));
|
||||
@@ -1231,6 +1238,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
protected function load_preferences()
|
||||
{
|
||||
if ($this->_prefs)
|
||||
|
||||
return $this;
|
||||
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
|
||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||
@@ -1324,7 +1332,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -1556,6 +1564,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
if (!$session->is_authenticated())
|
||||
|
||||
return;
|
||||
|
||||
$ses_id = $session->get_ses_id();
|
||||
@@ -1614,7 +1623,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1678,7 +1687,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1765,7 +1774,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $locale;
|
||||
@@ -1831,6 +1840,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
public function get_nonce()
|
||||
{
|
||||
if ($this->nonce)
|
||||
|
||||
return $this->nonce;
|
||||
$nonce = false;
|
||||
|
||||
@@ -1848,6 +1858,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
return $this->nonce;
|
||||
}
|
||||
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
$vars = array();
|
||||
|
@@ -255,8 +255,7 @@ class mail
|
||||
$mail->ConfirmReadingTo = $reading_confirm_to;
|
||||
}
|
||||
|
||||
$mail->MsgHTML(strip_tags($body));
|
||||
// $mail->MsgHTML(p4string::cleanTags($body));
|
||||
$mail->MsgHTML(strip_tags($body, '<div><br>'));
|
||||
|
||||
foreach ($files as $f)
|
||||
{
|
||||
|
@@ -148,9 +148,9 @@ $app->before(function($request) use ($app)
|
||||
|
||||
return;
|
||||
}
|
||||
catch (Exception $e)
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
$auth = new Session_Authentication_None($app['p4user']);
|
||||
|
@@ -49,7 +49,7 @@ class module_prod
|
||||
'sbas_id' => $sbas_id
|
||||
);
|
||||
|
||||
foreach($user->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll)
|
||||
foreach ($user->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll)
|
||||
{
|
||||
$selected = ($searchSet &&
|
||||
isset($searchSet->bases) &&
|
||||
@@ -75,12 +75,19 @@ class module_prod
|
||||
else
|
||||
$dates[$id] = array('sbas' => array($sbas_id), 'fieldname' => $name);
|
||||
}
|
||||
|
||||
if (isset($fields[$name]))
|
||||
{
|
||||
$fields[$name]['sbas'][] = $sbas_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($fields[$name]))
|
||||
$fields[$name]['sbas'][] = $sbas_id;
|
||||
else
|
||||
$fields[$name] = array('sbas' => array($sbas_id), 'fieldname' => $name, 'id' => $id);
|
||||
$fields[$name] = array(
|
||||
'sbas' => array($sbas_id)
|
||||
, 'fieldname' => $name
|
||||
, 'type' => $meta->get_type()
|
||||
, 'id' => $id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ class random
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM tokens WHERE expire_on < :date';
|
||||
$sql = 'DELETE FROM tokens WHERE expire_on < :date and type="download"';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':date' => $date));
|
||||
$stmt->closeCursor();
|
||||
@@ -201,7 +201,9 @@ class random
|
||||
self::cleanTokens();
|
||||
|
||||
$conn = connection::getPDOConnection();
|
||||
$sql = 'SELECT * FROM tokens WHERE value = :token ';
|
||||
$sql = 'SELECT * FROM tokens
|
||||
WHERE value = :token
|
||||
AND (expire_on > NOW() OR expire_on IS NULL)';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':token' => $token));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
@@ -56,7 +56,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
||||
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
* @var searchEngine_options
|
||||
*/
|
||||
protected $options = false;
|
||||
|
||||
@@ -142,6 +142,8 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
||||
*/
|
||||
public function set_options(searchEngine_options $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
|
||||
$this->opt_search_type = (int) $options->get_search_type();
|
||||
$this->opt_bases = $options->get_bases();
|
||||
$this->opt_fields = $options->get_fields();
|
||||
@@ -394,34 +396,37 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
||||
|
||||
$total_time = 0;
|
||||
|
||||
$sort = '';
|
||||
|
||||
if($this->options->get_sortby())
|
||||
{
|
||||
switch($this->options->get_sortord())
|
||||
{
|
||||
case searchEngine_options::SORT_MODE_ASC:
|
||||
$sort = '+';
|
||||
break;
|
||||
case searchEngine_options::SORT_MODE_DESC:
|
||||
default:
|
||||
$sort = '-';
|
||||
break;
|
||||
}
|
||||
$sort .= '0' . $this->options->get_sortby();
|
||||
}
|
||||
|
||||
foreach ($this->queries as $sbas_id => $qry)
|
||||
{
|
||||
if ($this->opt_search_type == 1)
|
||||
{
|
||||
$this->results[$sbas_id] = phrasea_query2(
|
||||
$session->get_ses_id()
|
||||
, $sbas_id
|
||||
, $this->colls[$sbas_id]
|
||||
, $this->arrayq[$sbas_id]
|
||||
, $registry->get('GV_sit')
|
||||
, (string) $session->get_usr_id()
|
||||
, false
|
||||
, PHRASEA_MULTIDOC_REGONLY
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->results[$sbas_id] = phrasea_query2(
|
||||
$session->get_ses_id()
|
||||
, $sbas_id
|
||||
, $this->colls[$sbas_id]
|
||||
, $this->arrayq[$sbas_id]
|
||||
, $registry->get('GV_sit')
|
||||
, (string) $session->get_usr_id()
|
||||
, false
|
||||
, PHRASEA_MULTIDOC_DOCONLY
|
||||
);
|
||||
}
|
||||
$this->results[$sbas_id] = phrasea_query2(
|
||||
$session->get_ses_id()
|
||||
, $sbas_id
|
||||
, $this->colls[$sbas_id]
|
||||
, $this->arrayq[$sbas_id]
|
||||
, $registry->get('GV_sit')
|
||||
, (string) $session->get_usr_id()
|
||||
, false
|
||||
, $this->opt_search_type == 1 ? PHRASEA_MULTIDOC_REGONLY : PHRASEA_MULTIDOC_DOCONLY
|
||||
, $sort
|
||||
);
|
||||
|
||||
$total_time += $this->results[$sbas_id]['time_all'];
|
||||
|
||||
if ($this->results[$sbas_id])
|
||||
|
@@ -436,7 +436,7 @@ class setup
|
||||
$message = 'Directory MUST be writable';
|
||||
break;
|
||||
case 'version':
|
||||
$result = version_compare($value, '1.17.0.2', '>=');
|
||||
$result = version_compare($value, '1.18.0.3', '>=');
|
||||
if ($result)
|
||||
$message = sprintf ('Phrasea version %s is ok', $value);
|
||||
else
|
||||
|
@@ -100,11 +100,10 @@ class supertwig
|
||||
$options = array_merge($default_options, $options);
|
||||
$extensions = array_merge($default_extensions, $extensions);
|
||||
|
||||
$this->init_twig();
|
||||
|
||||
try
|
||||
{
|
||||
$this->set_options($options);
|
||||
$this->init_twig();
|
||||
$this->set_extensions($extensions);
|
||||
$this->addFilter(array('round' => 'round'));
|
||||
}
|
||||
|
0
lib/unitTest/testfiles/cestlafete.jpg
Normal file → Executable file
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
@@ -15,5 +15,5 @@
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
define('GV_version', '3.5.0.0RC1');
|
||||
define('GV_version_name', 'Archaeopteryx');
|
||||
define('GV_version', '3.6.0.0a1');
|
||||
define('GV_version_name', 'Brachiosaurus');
|
||||
|
@@ -227,55 +227,58 @@
|
||||
</div>
|
||||
<div>
|
||||
<button class="field_adder">
|
||||
{% trans 'boutton::ajouter' %}
|
||||
</button>
|
||||
</div>
|
||||
<form action="/admin/description.php" method="post" target="_self" id="form_struct">
|
||||
<input name="newfield" id="newfield" type="hidden" />
|
||||
<table class="admintable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Nom' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Source' %}Source
|
||||
</th>
|
||||
<th>
|
||||
<span title="{% trans 'DublinCore Element Set' %}">DCES</span>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Multivalue' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Indexable' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Lecture seule' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Branche Thesaurus' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Affiche dans report' %}
|
||||
</th>
|
||||
<th>
|
||||
Regdate
|
||||
</th>
|
||||
<th>
|
||||
Regname
|
||||
</th>
|
||||
<th>
|
||||
Regdesc
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Afficher en titre' %}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% trans 'boutton::ajouter' %}
|
||||
</button>
|
||||
</div>
|
||||
<form action="/admin/description.php" method="post" target="_self" id="form_struct">
|
||||
<input name="newfield" id="newfield" type="hidden" />
|
||||
<table class="admintable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Nom' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Source' %}Source
|
||||
</th>
|
||||
<th>
|
||||
<span title="{% trans 'DublinCore Element Set' %}">DCES</span>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Multivalue' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Indexable' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Lecture seule' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Type' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Branche Thesaurus' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Affiche dans report' %}
|
||||
</th>
|
||||
<th>
|
||||
Regdate
|
||||
</th>
|
||||
<th>
|
||||
Regname
|
||||
</th>
|
||||
<th>
|
||||
Regdesc
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Afficher en titre' %}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for field in fields %}
|
||||
{% set disabled = '' %}
|
||||
{% if field.is_on_error() %}
|
||||
@@ -309,6 +312,14 @@
|
||||
<img class="alert alertTips alert_not_readonly" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne n\'est pas en lecture seule, vous devriez decocher cette case' %}" style="display:none;" />
|
||||
<img class="alert alertTips alert_is_readonly" src="/skins/icons/alert.png" title="{% trans 'Attention, la source descriptive selectionne est en lecture seule, vous devriez cocher cette case' %}" style="display:none;" />
|
||||
</td>
|
||||
<td>
|
||||
<select class="metafield_{{field.get_id()}}" {{disabled}} name="type_{{field.get_id()}}">
|
||||
<option value=""></option>
|
||||
<option {% if field.get_type() == 'text' %}selected{% endif %} value="text">text</option>
|
||||
<option {% if field.get_type() == 'number' %}selected{% endif %} value="number">number</option>
|
||||
<option {% if field.get_type() == 'date' %}selected{% endif %} value="date">date</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width:100px;" class="metafield_{{field.get_id()}}" {{disabled}} name="tbranch_{{field.get_id()}}" type="text" value="{{field.get_tbranch()}}"/>
|
||||
</td>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
{% set display = 'block' %}
|
||||
|
||||
{% if right[name] != users|length and name != 'access' and right['access'] != users|length %}
|
||||
{% if right[name] != users|length and name != 'access' and right['access'] != users|length and type != 'sbas' %}
|
||||
{% set display = 'none' %}
|
||||
{% endif %}
|
||||
|
||||
|
@@ -48,7 +48,7 @@
|
||||
<th>{% trans 'Titre' %}</th>
|
||||
<th style="width:150px;">{% trans 'Date Creation' %}</th>
|
||||
<th style="width:220px;">{% trans 'Restriction' %}</th>
|
||||
<th style="width:80px;">{% trans 'Visible sur la homepage' %}</th>
|
||||
<th style="width:80px;">{% trans 'Public' %}</th>
|
||||
<th style="width:80px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -72,7 +72,7 @@
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
{% if feed.is_public() %}
|
||||
<img src="/skins/icons/ok.png"/>
|
||||
<img src="/skins/icons/ligth-on.png" title="{% trans 'This feed is public' %}"/>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<div id="mainContainer" class="PNB">
|
||||
{% include 'common/menubar.twig' %}
|
||||
<div class="PNB" style="top:30px;overflow-y:auto;overflow-x:auto;">
|
||||
<div class="PNB" id="mainContent" style="min-height:500px;min-width:900px;">
|
||||
<div class="PNB" id="mainContent" style="min-width:900px;">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -55,6 +55,9 @@
|
||||
{% if feed.is_publisher(user) %}
|
||||
<div class="feed {% if loop.index is odd%}odd{% endif %}">
|
||||
<span>{{ feed.get_title() }}</span>
|
||||
{% if feed.is_public() %}
|
||||
<img src="/skins/icons/ligth-on.png" title="{% trans 'This feed is public' %}"/>
|
||||
{% endif %}
|
||||
<input type="hidden" value="{{ feed.get_id() }}"/>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
</h1>
|
||||
</td>
|
||||
<td style="width:60px;text-align:right;">
|
||||
{% if entry.get_feed().is_owner(user) %}
|
||||
{% if entry.get_feed().is_owner(user) or entry.is_publisher(user) %}
|
||||
<a class="tools options feed_edit" href="/prod/feeds/entry/{{ entry.get_id() }}/edit/">
|
||||
<img src="/skins/icons/file-edit.png" title="{% trans 'boutton::editer' %}"/>
|
||||
</a>
|
||||
@@ -55,8 +55,8 @@
|
||||
<div class="contents selectable">
|
||||
{% for item in entry.get_content() %}
|
||||
{% set record = item.get_record() %}
|
||||
{% set prefix = 'PUBLI' %}
|
||||
{{record_format.block(record, user, session, false, null, prefix, entry.get_id(), item.get_id())}}
|
||||
{% set prefix = 'PUBLI_' ~ item.get_id() %}
|
||||
{{record_format.block(record, user, session, false, null, prefix, entry.get_id())}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -372,18 +372,31 @@
|
||||
<div>
|
||||
{% if registry.get('GV_sphinx') %}
|
||||
{% trans 'Trier par ' %}
|
||||
<select name="sort">
|
||||
<option value="relevance">{% trans 'pertinence'%}</option>
|
||||
<option value="created_on">{% trans 'date dajout'%}</option>
|
||||
<option value="random">{% trans 'aleatoire'%}</option>
|
||||
</select>
|
||||
<select name="ord">
|
||||
<option value="desc">{% trans 'descendant'%}</option>
|
||||
<option value="asc">{% trans 'ascendant'%}</option>
|
||||
</select>
|
||||
<input type="checkbox" checked="checked" name="stemme" /> {% trans 'rechercher par stemme' %}
|
||||
<select name="sort">
|
||||
<option value="relevance">{% trans 'pertinence'%}</option>
|
||||
<option value="created_on">{% trans 'date dajout'%}</option>
|
||||
<option value="random">{% trans 'aleatoire'%}</option>
|
||||
</select>
|
||||
<select name="ord">
|
||||
<option value="desc">{% trans 'descendant'%}</option>
|
||||
<option value="asc">{% trans 'ascendant'%}</option>
|
||||
</select>
|
||||
<input type="checkbox" checked="checked" name="stemme" /> {% trans 'rechercher par stemme' %}
|
||||
{% else %}
|
||||
<input type="hidden" name="ord" id="searchOrd" value="PHRASEA_ORDER_DESC" />
|
||||
{% trans 'Trier par ' %}
|
||||
<select name="sort">
|
||||
<option value=""></option>
|
||||
{% for field_id, field in search_datas['fields'] %}
|
||||
{% if field['type'] == 'date' %}
|
||||
<option class="field_switch field_{{field['sbas']|implode(' field_')}}" value="{{field_id}}">{{field['fieldname']}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="ord">
|
||||
<option value="desc">{% trans 'descendant'%}</option>
|
||||
<option value="asc">{% trans 'ascendant'%}</option>
|
||||
</select>
|
||||
<input type="hidden" name="ord" id="searchOrd" value="PHRASEA_ORDER_DESC" />
|
||||
{% endif %}
|
||||
<div class="field_filter">
|
||||
<div>
|
||||
@@ -392,7 +405,9 @@
|
||||
<select size="8" multiple onchange="checkFilters(true);" name="fields[]" style="vertical-align:middle;width:100%;">
|
||||
<option value="phraseanet--all--fields">{% trans 'rechercher dans tous les champs' %}</option>
|
||||
{% for field_id, field in search_datas['fields'] %}
|
||||
<option class="field_switch field_{{field['sbas']|implode(' field_')}}" value="{{field_id}}">{{field['fieldname']}}</option>
|
||||
{% if field['type'] != 'date' %}
|
||||
<option class="field_switch field_{{field['sbas']|implode(' field_')}}" value="{{field_id}}">{{field['fieldname']}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{% macro block(record, user, session, highlight, searchEngine, prefix, entry_id, suffix)%}
|
||||
{% macro block(record, user, session, highlight, searchEngine, prefix, entry_id)%}
|
||||
{% import 'common/thumbnail.html' as thumbnail %}
|
||||
{% import 'common/doctype_icons.html' as doctype_icons %}
|
||||
{% import 'common/drop_down_options.html' as drop_down %}
|
||||
@@ -6,7 +6,7 @@
|
||||
{% set sbas_id = record.get_base_id|sbasFromBas %}
|
||||
{% if entry_id %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}_{{ suffix|default('') }}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.get_sbas_id}}_{{record.get_record_id}}"
|
||||
class="IMGT diapo grouping type-{{record.get_type}}"
|
||||
onDblClick="openPreview('FEED',{{record.get_number()}},{{entry_id}});">
|
||||
{% elseif record.is_grouping() %}
|
||||
|
2
tmp/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@@ -63,7 +63,6 @@ phrasea::headers();
|
||||
|
||||
$code = _('Propositions de modifications des tables')
|
||||
. '<blockquote>' . $code . '</blockquote>';
|
||||
|
||||
?>
|
||||
<pre>
|
||||
<?php echo $code; ?>
|
||||
@@ -87,10 +86,11 @@ phrasea::headers();
|
||||
{
|
||||
if (!$parm['new_settings'] && $parm['new_dbname'] && $parm['new_data_template'])
|
||||
{
|
||||
|
||||
if (p4string::hasAccent($parm['new_dbname']))
|
||||
$error['new_dbname'] = 'No special chars in dbname';
|
||||
|
||||
{
|
||||
$error[] = _('Database name can not contains special characters');
|
||||
}
|
||||
|
||||
if (count($error) === 0)
|
||||
{
|
||||
try
|
||||
@@ -99,23 +99,34 @@ phrasea::headers();
|
||||
$data_template = new system_file($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
|
||||
|
||||
$connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname']);
|
||||
$base = databox::create($appbox, $connbas, $data_template, $registry);
|
||||
$base->registerAdmin($user_obj);
|
||||
$createBase = $sbas_id = $base->get_sbas_id();
|
||||
|
||||
try
|
||||
{
|
||||
$base = databox::create($appbox, $connbas, $data_template, $registry);
|
||||
$base->registerAdmin($user_obj);
|
||||
$createBase = $sbas_id = $base->get_sbas_id();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$error[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$errors = $e->getMessage();
|
||||
$error[] = _('Database does not exists or can not be accessed');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port'] && $parm['new_user'] && $parm['new_password']
|
||||
elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port']
|
||||
&& $parm['new_user'] && $parm['new_password']
|
||||
&& $parm['new_dbname'] && $parm['new_data_template'])
|
||||
{
|
||||
|
||||
if (p4string::hasAccent($parm['new_dbname']))
|
||||
$error['new_dbname'] = 'No special chars in dbname';
|
||||
|
||||
{
|
||||
$error[] = _('Database name can not contains special characters');
|
||||
}
|
||||
|
||||
if (count($error) === 0)
|
||||
{
|
||||
|
||||
@@ -129,7 +140,7 @@ phrasea::headers();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$errors = $e->getMessage();
|
||||
$error[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +151,7 @@ phrasea::headers();
|
||||
{
|
||||
|
||||
if (p4string::hasAccent($parm['new_dbname']))
|
||||
$error['new_dbname'] = 'No special chars in dbname';
|
||||
$error[] = _('Database name can not contains special characters');
|
||||
|
||||
if (count($error) === 0)
|
||||
{
|
||||
@@ -156,7 +167,7 @@ phrasea::headers();
|
||||
catch (Exception $e)
|
||||
{
|
||||
$appbox->get_connection()->rollBack();
|
||||
$errors = $e->getMessage();
|
||||
$error[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,7 +176,7 @@ phrasea::headers();
|
||||
{
|
||||
|
||||
if (p4string::hasAccent($parm['new_dbname']))
|
||||
$error['new_dbname'] = 'No special chars in dbname';
|
||||
$error[] = 'No special chars in dbname';
|
||||
|
||||
if (count($error) === 0)
|
||||
{
|
||||
@@ -174,13 +185,12 @@ phrasea::headers();
|
||||
$appbox->get_connection()->beginTransaction();
|
||||
$base = databox::mount($appbox, $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], $registry);
|
||||
$base->registerAdmin($user_obj);
|
||||
// $createBase = $sbas_id = $base->get_sbas_id();
|
||||
$appbox->get_connection()->commit();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$appbox->get_connection()->rollBack();
|
||||
$errors = $e->getMessage();
|
||||
$error[] = $e->getMessage() . '@' . $e->getFile() . $e->getLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +226,7 @@ phrasea::headers();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -227,7 +237,7 @@ if ($createBase || $mountBase)
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
$user->ACL()->delete_data_from_cache();
|
||||
?>
|
||||
parent.reloadTree('bases:bases');
|
||||
parent.reloadTree('bases:bases');
|
||||
<?php
|
||||
if ($createBase)
|
||||
{
|
||||
@@ -240,9 +250,18 @@ if ($createBase || $mountBase)
|
||||
phrasea::redirect('/admin/databases.php');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</script>
|
||||
<?php
|
||||
foreach($error as $e)
|
||||
{
|
||||
?>
|
||||
<span style="background-color:red;color:white;padding:3px"><?php echo $e; ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div style="position:relative;float:left;width:100%;">
|
||||
<h2>Bases actuelles :</h2>
|
||||
<ul>
|
||||
@@ -306,20 +325,20 @@ if ($createBase || $mountBase)
|
||||
</div>
|
||||
<div id="server_opts" style="display:none;">
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/><span class="error"><?php echo isset($error['new_hostname']) ? $error['new_hostname'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/><span class="error"><?php echo isset($error['new_port']) ? $error['new_port'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/><span class="error"><?php echo isset($error['new_user']) ? $error['new_user'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/><span class="error"><?php echo isset($error['new_password']) ? $error['new_password'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/><span class="error"><?php echo isset($error['new_dbname']) ? $error['new_dbname'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: Modele de donnees'); ?></label>
|
||||
@@ -358,20 +377,20 @@ if ($createBase || $mountBase)
|
||||
</div>
|
||||
<div id="servermount_opts" style="display:none;">
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/><span class="error"><?php echo isset($error['new_hostname']) ? $error['new_hostname'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: hostname'); ?></label><input name="new_hostname" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/><span class="error"><?php echo isset($error['new_port']) ? $error['new_port'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: port'); ?></label><input name="new_port" value="3306" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/><span class="error"><?php echo isset($error['new_user']) ? $error['new_user'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: user'); ?></label><input name="new_user" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/><span class="error"><?php echo isset($error['new_password']) ? $error['new_password'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: password'); ?></label><input name="new_password" value="" type="password"/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/><span class="error"><?php echo isset($error['new_dbname']) ? $error['new_dbname'] : ''; ?></span>
|
||||
<label><?php echo _('phraseanet:: dbname'); ?></label><input name="new_dbname" value="" type="text"/>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" name="mount_base" value="yes"/>
|
||||
|
@@ -21,7 +21,7 @@ $session = $appbox->get_session();
|
||||
|
||||
$request = http_request::getInstance();
|
||||
$parm = $request->get_parms("srt", "ord", "act", "p0", // base_id
|
||||
"str" // si act=CHGSTRUCTURE, structure en xml
|
||||
"str" // si act=CHGSTRUCTURE, structure en xml
|
||||
);
|
||||
|
||||
|
||||
@@ -61,7 +61,16 @@ if (!empty($_POST))
|
||||
try
|
||||
{
|
||||
$local_parms = $httpRequest->get_parms(
|
||||
'name_' . $id, 'thumbtitle_' . $id, 'src_' . $id, 'multi_' . $id, 'indexable_' . $id, 'readonly_' . $id, 'tbranch_' . $id, 'report_' . $id, 'dces_' . $id
|
||||
'name_' . $id
|
||||
, 'thumbtitle_' . $id
|
||||
, 'src_' . $id
|
||||
, 'multi_' . $id
|
||||
, 'indexable_' . $id
|
||||
, 'readonly_' . $id
|
||||
, 'type_' . $id
|
||||
, 'tbranch_' . $id
|
||||
, 'report_' . $id
|
||||
, 'dces_' . $id
|
||||
);
|
||||
|
||||
$field = databox_field::get_instance($databox, $id);
|
||||
@@ -71,6 +80,7 @@ if (!empty($_POST))
|
||||
$field->set_multi($local_parms['multi_' . $id]);
|
||||
$field->set_indexable($local_parms['indexable_' . $id]);
|
||||
$field->set_readonly($local_parms['readonly_' . $id]);
|
||||
$field->set_type($local_parms['type_' . $id]);
|
||||
$field->set_tbranch($local_parms['tbranch_' . $id]);
|
||||
$field->set_report($local_parms['report_' . $id]);
|
||||
|
||||
@@ -107,7 +117,7 @@ if (!empty($_POST))
|
||||
|
||||
$parms = $httpRequest->get_parms('newfield');
|
||||
|
||||
if($parms['newfield'])
|
||||
if ($parms['newfield'])
|
||||
{
|
||||
databox_field::create($databox, $parms['newfield']);
|
||||
}
|
||||
@@ -124,7 +134,7 @@ if (!empty($_POST))
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.3 KiB |