mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6
This commit is contained in:
@@ -74,7 +74,6 @@ return call_user_func(
|
|||||||
{
|
{
|
||||||
/* @var $twig \Twig_Environment */
|
/* @var $twig \Twig_Environment */
|
||||||
$twig = $app['Core']->getTwig();
|
$twig = $app['Core']->getTwig();
|
||||||
// var_dump($twig->getLoader()->getPaths());
|
|
||||||
$browser = \Browser::getInstance();
|
$browser = \Browser::getInstance();
|
||||||
|
|
||||||
if (!$browser->isMobile())
|
if (!$browser->isMobile())
|
||||||
|
@@ -566,7 +566,7 @@ class Edit extends RecordHelper
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$record->set_metadatas($metas);
|
$record->set_metadatas($metas, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$newstat = $record->get_status();
|
$newstat = $record->get_status();
|
||||||
|
@@ -18,4 +18,17 @@
|
|||||||
class Exception_Session_MailLocked extends Exception
|
class Exception_Session_MailLocked extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $usr_id;
|
||||||
|
|
||||||
|
public function __construct($usr_id = null, $message = null, $code = null, $previous = null)
|
||||||
|
{
|
||||||
|
$this->usr_id = $usr_id;
|
||||||
|
parent::__construct($message, $code, $previous);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_usr_id()
|
||||||
|
{
|
||||||
|
return $this->usr_id;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -141,7 +141,7 @@ class Session_Authentication_Native implements Session_Authentication_Interface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
if ($row && $row['mail_locked'] == "1")
|
if ($row && $row['mail_locked'] == "1")
|
||||||
throw new Exception_Session_MailLocked();
|
throw new Exception_Session_MailLocked($this->user->get_id());
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@@ -256,7 +256,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
|||||||
$body .= "<br/>\n<div>"
|
$body .= "<br/>\n<div>"
|
||||||
. _('admin::register: l\'utilisateur s\'est inscrit sur les bases suivantes')
|
. _('admin::register: l\'utilisateur s\'est inscrit sur les bases suivantes')
|
||||||
. "</div>\n";
|
. "</div>\n";
|
||||||
$body .= "<ul>";
|
$body .= "<ul>\n";
|
||||||
|
|
||||||
foreach ($base_ids->base_id as $base_id)
|
foreach ($base_ids->base_id as $base_id)
|
||||||
{
|
{
|
||||||
@@ -265,7 +265,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
|||||||
. ' - ' . phrasea::bas_names((string) $base_id) . "</li>\n";
|
. ' - ' . phrasea::bas_names((string) $base_id) . "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$body .= "</ul>";
|
$body .= "</ul>\n";
|
||||||
|
|
||||||
$body .= "<br/>\n<div><a href='/login/?redirect=/admin' target='_blank'>"
|
$body .= "<br/>\n<div><a href='/login/?redirect=/admin' target='_blank'>"
|
||||||
. _('admin::register: vous pourrez consulter son compte en ligne via l\'interface d\'administration')
|
. _('admin::register: vous pourrez consulter son compte en ligne via l\'interface d\'administration')
|
||||||
|
@@ -261,7 +261,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
|||||||
$body .= "<br/>\n<div>"
|
$body .= "<br/>\n<div>"
|
||||||
. _('admin::register: les demandes de l\'utilisateur portent sur les bases suivantes')
|
. _('admin::register: les demandes de l\'utilisateur portent sur les bases suivantes')
|
||||||
. "</div>\n";
|
. "</div>\n";
|
||||||
$body .= "<ul>";
|
$body .= "<ul>\n";
|
||||||
|
|
||||||
foreach ($base_ids->base_id as $base_id)
|
foreach ($base_ids->base_id as $base_id)
|
||||||
{
|
{
|
||||||
@@ -271,7 +271,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
|||||||
. phrasea::bas_names((string) $base_id) . "</li>\n";
|
. phrasea::bas_names((string) $base_id) . "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$body .= "</ul>";
|
$body .= "</ul>\n";
|
||||||
|
|
||||||
$body .= "<br/>\n<div><a href='" . $this->registry->get('GV_ServerName')
|
$body .= "<br/>\n<div><a href='" . $this->registry->get('GV_ServerName')
|
||||||
. "login/admin' target='_blank'>"
|
. "login/admin' target='_blank'>"
|
||||||
|
@@ -2,7 +2,16 @@
|
|||||||
|
|
||||||
class geonames
|
class geonames
|
||||||
{
|
{
|
||||||
|
protected static $NamesFromId = array();
|
||||||
|
|
||||||
|
protected static $CountryFromId = array();
|
||||||
|
|
||||||
|
protected static $CountryCodeFromId = array();
|
||||||
|
|
||||||
|
protected static $GeonameFromIp = array();
|
||||||
|
|
||||||
|
protected static $Searches = array();
|
||||||
|
|
||||||
public function name_from_id($geonameid)
|
public function name_from_id($geonameid)
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
$registry = registry::get_instance();
|
||||||
|
@@ -25,26 +25,37 @@ class http_query
|
|||||||
*/
|
*/
|
||||||
public static function getHttpCodeFromUrl($url)
|
public static function getHttpCodeFromUrl($url)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
if (!is_scalar($url))
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
return null;
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
||||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
|
||||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
|
||||||
|
|
||||||
curl_exec($ch);
|
if (trim($url) === '')
|
||||||
$result = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
return null;
|
||||||
|
|
||||||
curl_close($ch);
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||||
|
|
||||||
return $result;
|
curl_exec($ch);
|
||||||
|
$result = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getHttpHeaders($url)
|
public static function getHttpHeaders($url)
|
||||||
{
|
{
|
||||||
|
if (!is_scalar($url))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (trim($url) === '')
|
||||||
|
return null;
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
@@ -69,24 +80,30 @@ class http_query
|
|||||||
* @param array $post_data
|
* @param array $post_data
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getUrl($url, $post_data=false)
|
public static function getUrl($url, $post_data = false)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
if (!is_scalar($url))
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
return null;
|
||||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
|
||||||
|
|
||||||
if ($post_data)
|
if (trim($url) === '')
|
||||||
{
|
return null;
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = (curl_exec($ch));
|
$ch = curl_init();
|
||||||
curl_close($ch);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||||
|
|
||||||
|
if ($post_data)
|
||||||
|
{
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = (curl_exec($ch));
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@@ -170,7 +170,7 @@ class mail
|
|||||||
|
|
||||||
public static function mail_confirmation($email, $usr_id)
|
public static function mail_confirmation($email, $usr_id)
|
||||||
{
|
{
|
||||||
|
$registry = registry::get_instance();
|
||||||
$expire = new DateTime('+3 days');
|
$expire = new DateTime('+3 days');
|
||||||
$token = random::getUrlToken('password', $usr_id, $expire, $email);
|
$token = random::getUrlToken('password', $usr_id, $expire, $email);
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ class mail
|
|||||||
$mail->ConfirmReadingTo = $reading_confirm_to;
|
$mail->ConfirmReadingTo = $reading_confirm_to;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail->MsgHTML(strip_tags($body, '<div><br>'));
|
$mail->MsgHTML(strip_tags($body, '<div><br><ul><li>'));
|
||||||
|
|
||||||
foreach ($files as $f)
|
foreach ($files as $f)
|
||||||
{
|
{
|
||||||
|
@@ -23,171 +23,205 @@ class module_report
|
|||||||
* @var string - timestamp
|
* @var string - timestamp
|
||||||
*/
|
*/
|
||||||
protected $dmin;
|
protected $dmin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* End date of the report
|
* End date of the report
|
||||||
* @var string - timestamp
|
* @var string - timestamp
|
||||||
*/
|
*/
|
||||||
protected $dmax;
|
protected $dmax;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the base we want to connect
|
* Id of the base we want to connect
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $sbas_id;
|
protected $sbas_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the current app's box user
|
* Id of the current app's box user
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $user_id;
|
protected $user_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The result of the report
|
* The result of the report
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $report = array();
|
public $report = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The title of the report
|
* The title of the report
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $title = '';
|
protected $title = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* default displayed value in the formated tab
|
* default displayed value in the formated tab
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $display = array();
|
protected $display = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ?
|
* ?
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $default_display = array();
|
protected $default_display = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contain all the field from the sql request
|
* Contain all the field from the sql request
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $champ = array();
|
protected $champ = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* result of the report
|
* result of the report
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $result = array();
|
protected $result = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The id of all collections from a databox
|
* The id of all collections from a databox
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $list_coll_id = '';
|
protected $list_coll_id = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of record displayed by page if enable limit is false
|
* The number of record displayed by page if enable limit is false
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $nb_record = 30;
|
protected $nb_record = 30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current number of the page where are displaying the results
|
* The current number of the page where are displaying the results
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $nb_page = 1;
|
protected $nb_page = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if there is a previous page
|
* check if there is a previous page
|
||||||
* @var <bool>
|
* @var <bool>
|
||||||
*/
|
*/
|
||||||
protected $previous_page = false;
|
protected $previous_page = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if there is a next page
|
* check if there is a next page
|
||||||
* @var <bool>
|
* @var <bool>
|
||||||
*/
|
*/
|
||||||
protected $next_page = false;
|
protected $next_page = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var int total of result
|
* @var int total of result
|
||||||
*/
|
*/
|
||||||
protected $total = 0;
|
protected $total = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the request executed
|
* the request executed
|
||||||
*/
|
*/
|
||||||
protected $req = '';
|
protected $req = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the request executed
|
* the request executed
|
||||||
*/
|
*/
|
||||||
protected $params = array();
|
protected $params = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we display next and previous button
|
* do we display next and previous button
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $display_nav = false;
|
protected $display_nav = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we display the configuration button
|
* do we display the configuration button
|
||||||
* @var <bool>
|
* @var <bool>
|
||||||
*/
|
*/
|
||||||
protected $config = true;
|
protected $config = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gettext tags for days
|
* gettext tags for days
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $jour;
|
protected $jour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gettext tags for month
|
* gettext tags for month
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $month;
|
protected $month;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the database
|
* The name of the database
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $dbname;
|
protected $dbname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The periode displayed in a string of the report
|
* The periode displayed in a string of the report
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $periode;
|
protected $periode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* filter executed on report choose by the user
|
* filter executed on report choose by the user
|
||||||
* @var array;
|
* @var array;
|
||||||
*/
|
*/
|
||||||
protected $tab_filter = array();
|
protected $tab_filter = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* column displayed in the report choose by the user
|
* column displayed in the report choose by the user
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $active_column = array();
|
protected $active_column = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* array that contains the string displayed
|
* array that contains the string displayed
|
||||||
* foreach filters
|
* foreach filters
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $posting_filter = array();
|
protected $posting_filter = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ORDER BY filters of the query
|
* The ORDER BY filters of the query
|
||||||
* by default is empty
|
* by default is empty
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $tab_order = array();
|
protected $tab_order = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define columns that are boundable
|
* define columns that are boundable
|
||||||
* @var <array>
|
* @var <array>
|
||||||
*/
|
*/
|
||||||
protected $bound = array();
|
protected $bound = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we display print button
|
* do we display print button
|
||||||
* @var <bool>
|
* @var <bool>
|
||||||
*/
|
*/
|
||||||
protected $print = true;
|
protected $print = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we display csv button
|
* do we display csv button
|
||||||
* @var <bool>
|
* @var <bool>
|
||||||
*/
|
*/
|
||||||
protected $csv = true;
|
protected $csv = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we enable limit filter for the report
|
* do we enable limit filter for the report
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $enable_limit = true;
|
protected $enable_limit = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gettext correspondance for all available columns in report
|
* gettext correspondance for all available columns in report
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $cor = array();
|
protected $cor = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* group result of a report this is the name ogf the grouped column
|
* group result of a report this is the name ogf the grouped column
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $groupby;
|
protected $groupby;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* disbale or enable pretty string useful for export in csv
|
* disbale or enable pretty string useful for export in csv
|
||||||
* @var boolean
|
* @var boolean
|
||||||
@@ -197,9 +231,8 @@ class module_report
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected $cor_query = array();/* ~*~*~*~*~*~*~*~*~*~*~*~ */
|
protected $cor_query = array();
|
||||||
/* METHODS, VARIABLES */
|
protected $isInformative;
|
||||||
/* ~*~*~*~*~*~*~*~*~*~*~*~ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -212,7 +245,7 @@ class module_report
|
|||||||
*/
|
*/
|
||||||
public function __construct($d1, $d2, $sbas_id, $collist)
|
public function __construct($d1, $d2, $sbas_id, $collist)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance();
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$this->dmin = $d1;
|
$this->dmin = $d1;
|
||||||
$this->dmax = $d2;
|
$this->dmax = $d2;
|
||||||
@@ -220,13 +253,23 @@ class module_report
|
|||||||
$this->list_coll_id = $collist;
|
$this->list_coll_id = $collist;
|
||||||
$this->user_id = $session->get_usr_id();
|
$this->user_id = $session->get_usr_id();
|
||||||
$this->periode = phraseadate::getPrettyString(new DateTime($d1))
|
$this->periode = phraseadate::getPrettyString(new DateTime($d1))
|
||||||
. ' - ' . phraseadate::getPrettyString(new DateTime($d2));
|
. ' - ' . phraseadate::getPrettyString(new DateTime($d2));
|
||||||
$this->dbname = phrasea::sbas_names($sbas_id);
|
$this->dbname = phrasea::sbas_names($sbas_id);
|
||||||
$this->cor = $this->setCor();
|
$this->cor = $this->setCor();
|
||||||
$this->jour = $this->setDay();
|
$this->jour = $this->setDay();
|
||||||
$this->month = $this->setMonth();
|
$this->month = $this->setMonth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsInformative()
|
||||||
|
{
|
||||||
|
return $this->isInformative;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIsInformative($isInformative)
|
||||||
|
{
|
||||||
|
$this->isInformative = $isInformative;
|
||||||
|
}
|
||||||
|
|
||||||
public function getUser_id()
|
public function getUser_id()
|
||||||
{
|
{
|
||||||
return $this->user_id;
|
return $this->user_id;
|
||||||
@@ -242,7 +285,6 @@ class module_report
|
|||||||
$this->user_id = $user_id;
|
$this->user_id = $user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getSbas_id()
|
public function getSbas_id()
|
||||||
{
|
{
|
||||||
return $this->sbas_id;
|
return $this->sbas_id;
|
||||||
@@ -253,7 +295,7 @@ class module_report
|
|||||||
$this->sbas_id = $sbas_id;
|
$this->sbas_id = $sbas_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPrettyString($bool)
|
public function setPrettyString($bool)
|
||||||
{
|
{
|
||||||
$this->pretty_string = $bool;
|
$this->pretty_string = $bool;
|
||||||
}
|
}
|
||||||
@@ -301,8 +343,6 @@ class module_report
|
|||||||
$this->req = $sql;
|
$this->req = $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getPeriode()
|
public function getPeriode()
|
||||||
{
|
{
|
||||||
return $this->periode;
|
return $this->periode;
|
||||||
@@ -342,9 +382,9 @@ class module_report
|
|||||||
|
|
||||||
public function setActiveColumn(array $active_column)
|
public function setActiveColumn(array $active_column)
|
||||||
{
|
{
|
||||||
$this->active_column = $active_column;
|
$this->active_column = $active_column;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActiveColumn()
|
public function getActiveColumn()
|
||||||
@@ -460,7 +500,6 @@ class module_report
|
|||||||
public function getOrder($k = false)
|
public function getOrder($k = false)
|
||||||
{
|
{
|
||||||
if ($k === false)
|
if ($k === false)
|
||||||
|
|
||||||
return $this->tab_order;
|
return $this->tab_order;
|
||||||
return $this->tab_order[$k];
|
return $this->tab_order[$k];
|
||||||
}
|
}
|
||||||
@@ -509,6 +548,7 @@ class module_report
|
|||||||
{
|
{
|
||||||
$this->total = $total;
|
$this->total = $total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDefault_display()
|
public function getDefault_display()
|
||||||
{
|
{
|
||||||
return $this->default_display;
|
return $this->default_display;
|
||||||
@@ -524,7 +564,6 @@ class module_report
|
|||||||
return $this->champ;
|
return $this->champ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne un objet qui genere la requete selon le type de report
|
* Retourne un objet qui genere la requete selon le type de report
|
||||||
* @param string $domain
|
* @param string $domain
|
||||||
@@ -619,28 +658,28 @@ class module_report
|
|||||||
private function setCor()
|
private function setCor()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'user' => _('report:: utilisateur'),
|
'user' => _('report:: utilisateur'),
|
||||||
'coll_id' => _('report:: collections'),
|
'coll_id' => _('report:: collections'),
|
||||||
'connexion' => _('report:: Connexion'),
|
'connexion' => _('report:: Connexion'),
|
||||||
'comment' => _('report:: commentaire'),
|
'comment' => _('report:: commentaire'),
|
||||||
'search' => _('report:: question'),
|
'search' => _('report:: question'),
|
||||||
'date' => _('report:: date'),
|
'date' => _('report:: date'),
|
||||||
'ddate' => _('report:: date'),
|
'ddate' => _('report:: date'),
|
||||||
'fonction' => _('report:: fonction'),
|
'fonction' => _('report:: fonction'),
|
||||||
'activite' => _('report:: activite'),
|
'activite' => _('report:: activite'),
|
||||||
'pays' => _('report:: pays'),
|
'pays' => _('report:: pays'),
|
||||||
'societe' => _('report:: societe'),
|
'societe' => _('report:: societe'),
|
||||||
'nb' => _('report:: nombre'),
|
'nb' => _('report:: nombre'),
|
||||||
'pourcent' => _('report:: pourcentage'),
|
'pourcent' => _('report:: pourcentage'),
|
||||||
'telechargement' => _('report:: telechargement'),
|
'telechargement' => _('report:: telechargement'),
|
||||||
'record_id' => _('report:: record id'),
|
'record_id' => _('report:: record id'),
|
||||||
'final' => _('report:: type d\'action'),
|
'final' => _('report:: type d\'action'),
|
||||||
'xml' => _('report:: sujet'),
|
'xml' => _('report:: sujet'),
|
||||||
'file' => _('report:: fichier'),
|
'file' => _('report:: fichier'),
|
||||||
'mime' => _('report:: type'),
|
'mime' => _('report:: type'),
|
||||||
'size' => _('report:: taille'),
|
'size' => _('report:: taille'),
|
||||||
'copyright' => _('report:: copyright'),
|
'copyright' => _('report:: copyright'),
|
||||||
'final' => _('phraseanet:: sous definition')
|
'final' => _('phraseanet:: sous definition')
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -653,13 +692,13 @@ class module_report
|
|||||||
private function setDay()
|
private function setDay()
|
||||||
{
|
{
|
||||||
return Array(
|
return Array(
|
||||||
1 => _('phraseanet::jours:: lundi'),
|
1 => _('phraseanet::jours:: lundi'),
|
||||||
2 => _('phraseanet::jours:: mardi'),
|
2 => _('phraseanet::jours:: mardi'),
|
||||||
3 => _('phraseanet::jours:: mercredi'),
|
3 => _('phraseanet::jours:: mercredi'),
|
||||||
4 => _('phraseanet::jours:: jeudi'),
|
4 => _('phraseanet::jours:: jeudi'),
|
||||||
5 => _('phraseanet::jours:: vendredi'),
|
5 => _('phraseanet::jours:: vendredi'),
|
||||||
6 => _('phraseanet::jours:: samedi'),
|
6 => _('phraseanet::jours:: samedi'),
|
||||||
7 => _('phraseanet::jours:: dimanche'));
|
7 => _('phraseanet::jours:: dimanche'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -669,18 +708,18 @@ class module_report
|
|||||||
private function setMonth()
|
private function setMonth()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
_('janvier'),
|
_('janvier'),
|
||||||
_('fevrier'),
|
_('fevrier'),
|
||||||
_('mars'),
|
_('mars'),
|
||||||
_('avril'),
|
_('avril'),
|
||||||
_('mai'),
|
_('mai'),
|
||||||
_('juin'),
|
_('juin'),
|
||||||
_('juillet'),
|
_('juillet'),
|
||||||
_('aout'),
|
_('aout'),
|
||||||
_('septembre'),
|
_('septembre'),
|
||||||
_('octobre'),
|
_('octobre'),
|
||||||
_('novembre'),
|
_('novembre'),
|
||||||
_('decembre')
|
_('decembre')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,21 +787,21 @@ class module_report
|
|||||||
if (array_key_exists($column, $this->cor))
|
if (array_key_exists($column, $this->cor))
|
||||||
{
|
{
|
||||||
$title_text = $this->cor[$column];
|
$title_text = $this->cor[$column];
|
||||||
$def = true;
|
$def = true;
|
||||||
}
|
}
|
||||||
empty($row[0]) ? $title = $column : $title = $row[0];
|
empty($row[0]) ? $title = $column : $title = $row[0];
|
||||||
|
|
||||||
$sort = $row[1];
|
$sort = $row[1];
|
||||||
array_key_exists($column, $this->bound) ?
|
array_key_exists($column, $this->bound) ?
|
||||||
$bound = $this->bound[$column] : $bound = $row[2];
|
$bound = $this->bound[$column] : $bound = $row[2];
|
||||||
$filter = (isset($row[3]) ? $row[3] : 0);
|
$filter = (isset($row[3]) ? $row[3] : 0);
|
||||||
$groupby = $row[4];
|
$groupby = $row[4];
|
||||||
$config = array(
|
$config = array(
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'sort' => $sort,
|
'sort' => $sort,
|
||||||
'bound' => $bound,
|
'bound' => $bound,
|
||||||
'filter' => $filter,
|
'filter' => $filter,
|
||||||
'groupby' => $groupby
|
'groupby' => $groupby
|
||||||
);
|
);
|
||||||
$def ? $config['title'] = $title_text : "";
|
$def ? $config['title'] = $title_text : "";
|
||||||
|
|
||||||
@@ -780,7 +819,6 @@ class module_report
|
|||||||
public function buildReport($tab = false, $groupby = false, $on = false)
|
public function buildReport($tab = false, $groupby = false, $on = false)
|
||||||
{
|
{
|
||||||
if (sizeof($this->report) > 0)
|
if (sizeof($this->report) > 0)
|
||||||
|
|
||||||
return $this->report;
|
return $this->report;
|
||||||
$conn = connection::getPDOConnection($this->sbas_id);
|
$conn = connection::getPDOConnection($this->sbas_id);
|
||||||
|
|
||||||
@@ -792,10 +830,10 @@ class module_report
|
|||||||
{
|
{
|
||||||
$stmt = $conn->prepare($this->req);
|
$stmt = $conn->prepare($this->req);
|
||||||
$stmt->execute($this->params);
|
$stmt->execute($this->params);
|
||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
}
|
}
|
||||||
catch(PDOException $e)
|
catch (PDOException $e)
|
||||||
{
|
{
|
||||||
echo $e->getMessage();
|
echo $e->getMessage();
|
||||||
|
|
||||||
@@ -837,13 +875,13 @@ class module_report
|
|||||||
{
|
{
|
||||||
if ($attribut)
|
if ($attribut)
|
||||||
{
|
{
|
||||||
foreach ($sxe->$champ->attributes() as $a => $b)
|
foreach ($sxe->$champ->attributes() as $a => $b)
|
||||||
|
{
|
||||||
|
if ($a == $attribut)
|
||||||
{
|
{
|
||||||
if ($a == $attribut)
|
$ret.= $b;
|
||||||
{
|
|
||||||
$ret.= $b;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -871,7 +909,7 @@ class module_report
|
|||||||
$tab["struct"] = "";
|
$tab["struct"] = "";
|
||||||
$tab['champs'] = array();
|
$tab['champs'] = array();
|
||||||
|
|
||||||
$databox = databox::get_instance((int) $sbasid);
|
$databox = databox::get_instance((int) $sbasid);
|
||||||
$tab['struct'] = $databox->get_structure();
|
$tab['struct'] = $databox->get_structure();
|
||||||
|
|
||||||
$sxe = $databox->get_sxml_structure();
|
$sxe = $databox->get_sxml_structure();
|
||||||
@@ -897,7 +935,7 @@ class module_report
|
|||||||
public static function getHost($url)
|
public static function getHost($url)
|
||||||
{
|
{
|
||||||
$parse_url = parse_url(trim($url));
|
$parse_url = parse_url(trim($url));
|
||||||
$result = isset($parse_url['host']) ? $parse_url['host'] : array_shift(explode('/', $parse_url['path'], 2));
|
$result = isset($parse_url['host']) ? $parse_url['host'] : array_shift(explode('/', $parse_url['path'], 2));
|
||||||
|
|
||||||
return trim($result);
|
return trim($result);
|
||||||
}
|
}
|
||||||
|
@@ -38,8 +38,7 @@ class module_report_download extends module_report
|
|||||||
'mime' => 'subdef.mime',
|
'mime' => 'subdef.mime',
|
||||||
'file' => 'subdef.file'
|
'file' => 'subdef.file'
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $isInformative;
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@@ -278,16 +277,6 @@ class module_report_download extends module_report
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function IsInformative()
|
|
||||||
{
|
|
||||||
return $this->isInformative;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setIsInformative($isInformative)
|
|
||||||
{
|
|
||||||
$this->isInformative = $isInformative;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,7 +70,6 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
||||||
|
|
||||||
// var_dump(str_replace(array_keys($this->params), array_values($this->params), $this->sql), $this->sql, $this->params);
|
|
||||||
$stmt = $this->connbas->prepare($this->sql);
|
$stmt = $this->connbas->prepare($this->sql);
|
||||||
$stmt->execute($this->params);
|
$stmt->execute($this->params);
|
||||||
$this->total_row = $stmt->rowCount();
|
$this->total_row = $stmt->rowCount();
|
||||||
|
@@ -113,7 +113,7 @@ class p4file
|
|||||||
{
|
{
|
||||||
$record = record_adapter::create($collection, $system_file, $name);
|
$record = record_adapter::create($collection, $system_file, $name);
|
||||||
$record_id = $record->get_record_id();
|
$record_id = $record->get_record_id();
|
||||||
$record->set_metadatas($metadatas['metadatas']);
|
$record->set_metadatas($metadatas['metadatas'], true);
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
|
@@ -85,7 +85,7 @@ interface record_Interface
|
|||||||
|
|
||||||
public function substitute_subdef($name, system_file $pathfile);
|
public function substitute_subdef($name, system_file $pathfile);
|
||||||
|
|
||||||
public function set_metadatas(Array $metadatas);
|
public function set_metadatas(Array $metadatas, $force_readonly = false);
|
||||||
|
|
||||||
public function reindex();
|
public function reindex();
|
||||||
|
|
||||||
|
@@ -862,6 +862,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
, 'meta_id' => $value->getId()
|
, 'meta_id' => $value->getId()
|
||||||
, 'value' => $original_name
|
, 'value' => $original_name
|
||||||
)
|
)
|
||||||
|
, true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1211,8 +1212,20 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$stmt->execute(array(':record_id' => $this->get_record_id()));
|
$stmt->execute(array(':record_id' => $this->get_record_id()));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$subdef = $this->get_subdef($name);
|
||||||
|
$subdef->delete_data_from_cache();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
|
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
|
||||||
|
|
||||||
|
|
||||||
if ($meta_writable)
|
if ($meta_writable)
|
||||||
{
|
{
|
||||||
$this->write_metas();
|
$this->write_metas();
|
||||||
@@ -1337,13 +1350,20 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
* @param array $metadatas
|
* @param array $metadatas
|
||||||
* @return record_adapter
|
* @return record_adapter
|
||||||
*/
|
*/
|
||||||
public function set_metadatas(Array $metadatas)
|
public function set_metadatas(Array $metadatas, $force_readonly = false)
|
||||||
{
|
{
|
||||||
foreach ($metadatas as $param)
|
foreach ($metadatas as $param)
|
||||||
{
|
{
|
||||||
if (!is_array($param))
|
if (!is_array($param))
|
||||||
throw new Exception_InvalidArgument();
|
throw new Exception_InvalidArgument();
|
||||||
|
|
||||||
|
$db_field = \databox_field::get_instance($this->get_databox(), $param['meta_struct_id']);
|
||||||
|
|
||||||
|
if ($db_field->is_readonly() === false && !$force_readonly)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->set_metadata($param, $this->databox);
|
$this->set_metadata($param, $this->databox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
lib/classes/recordutils/arial.ttf
Normal file
BIN
lib/classes/recordutils/arial.ttf
Normal file
Binary file not shown.
@@ -292,7 +292,7 @@ class recordutils_image extends recordutils
|
|||||||
$txtlines = recordutils_image::wrap(
|
$txtlines = recordutils_image::wrap(
|
||||||
$fontsize,
|
$fontsize,
|
||||||
0,
|
0,
|
||||||
$registry->get('GV_RootPath') . 'lib/stamper/arial.ttf',
|
__DIR__ . '/arial.ttf',
|
||||||
$txtline,
|
$txtline,
|
||||||
$text_width
|
$text_width
|
||||||
);
|
);
|
||||||
@@ -352,7 +352,7 @@ class recordutils_image extends recordutils
|
|||||||
{
|
{
|
||||||
imagettftext($im, $block['s'], 0, $block['x'],
|
imagettftext($im, $block['s'], 0, $block['x'],
|
||||||
$txt_ypos - $block['dy'], $black,
|
$txt_ypos - $block['dy'], $black,
|
||||||
$registry->get('GV_RootPath') . 'lib/stamper/arial.ttf', $block['t']);
|
__DIR__ . '/arial.ttf', $block['t']);
|
||||||
$txt_ypos += $block['h'];
|
$txt_ypos += $block['h'];
|
||||||
}
|
}
|
||||||
imagecolordeallocate($im, $black);
|
imagecolordeallocate($im, $black);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -713,8 +713,6 @@ class system_file extends SplFileObject
|
|||||||
|
|
||||||
public function read_uuid()
|
public function read_uuid()
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
|
||||||
|
|
||||||
if ($this->uuid)
|
if ($this->uuid)
|
||||||
|
|
||||||
return $this->uuid;
|
return $this->uuid;
|
||||||
@@ -1135,12 +1133,12 @@ class system_file extends SplFileObject
|
|||||||
|
|
||||||
foreach ($tmpval as $val)
|
foreach ($tmpval as $val)
|
||||||
{
|
{
|
||||||
$ret[] = array(
|
$ret[] = array(
|
||||||
'meta_struct_id' => $meta->get_id(),
|
'meta_struct_id' => $meta->get_id(),
|
||||||
'meta_id' => null,
|
'meta_id' => null,
|
||||||
'value' => $val
|
'value' => $val
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1390,7 +1388,7 @@ if (!function_exists('mime_content_type'))
|
|||||||
, 'movie' => 'video/x-sgi-movie' // Videos MoviePlayer
|
, 'movie' => 'video/x-sgi-movie' // Videos MoviePlayer
|
||||||
);
|
);
|
||||||
$fileinfo = new system_file($f);
|
$fileinfo = new system_file($f);
|
||||||
$extension = $fileinfo->get_extension(true);
|
$ext = $fileinfo->get_extension(true);
|
||||||
|
|
||||||
return array_key_exists($ext, $ext2mime) ?
|
return array_key_exists($ext, $ext2mime) ?
|
||||||
$ext2mime[$ext] : 'application/octet-stream';
|
$ext2mime[$ext] : 'application/octet-stream';
|
||||||
|
@@ -1538,7 +1538,7 @@ class task_period_archive extends task_abstract
|
|||||||
$collection = collection::get_from_coll_id($databox, $cid);
|
$collection = collection::get_from_coll_id($databox, $cid);
|
||||||
$record = record_adapter::create($collection, $system_file, false, true);
|
$record = record_adapter::create($collection, $system_file, false, true);
|
||||||
|
|
||||||
$record->set_metadatas($meta['metadatas']);
|
$record->set_metadatas($meta['metadatas'], true);
|
||||||
$record->set_binary_status(databox_status::operation_or($stat0, $stat1));
|
$record->set_binary_status(databox_status::operation_or($stat0, $stat1));
|
||||||
$record->rebuild_subdefs();
|
$record->rebuild_subdefs();
|
||||||
$record->reindex();
|
$record->reindex();
|
||||||
@@ -1879,7 +1879,7 @@ class task_period_archive extends task_abstract
|
|||||||
{
|
{
|
||||||
$collection = collection::get_from_base_id($base_id);
|
$collection = collection::get_from_base_id($base_id);
|
||||||
$record = record_adapter::create($collection, $system_file, false, false);
|
$record = record_adapter::create($collection, $system_file, false, false);
|
||||||
$record->set_metadatas($meta['metadatas']);
|
$record->set_metadatas($meta['metadatas'], true);
|
||||||
$record->set_binary_status(databox_status::operation_or(databox_status::operation_or($stat0, $stat1), databox_status::hex2bin($hexstat)));
|
$record->set_binary_status(databox_status::operation_or(databox_status::operation_or($stat0, $stat1), databox_status::hex2bin($hexstat)));
|
||||||
$record->rebuild_subdefs();
|
$record->rebuild_subdefs();
|
||||||
$record->reindex();
|
$record->reindex();
|
||||||
|
@@ -100,7 +100,7 @@ class task_period_batchupload extends task_appboxAbstract
|
|||||||
$collection = collection::get_from_coll_id($databox, $coll_id);
|
$collection = collection::get_from_coll_id($databox, $coll_id);
|
||||||
|
|
||||||
$record = record_adapter::create($collection, $system_file, $row2['filename'], false);
|
$record = record_adapter::create($collection, $system_file, $row2['filename'], false);
|
||||||
$record->set_metadatas($meta['metadatas']);
|
$record->set_metadatas($meta['metadatas'], true);
|
||||||
$record->rebuild_subdefs();
|
$record->rebuild_subdefs();
|
||||||
$record->reindex();
|
$record->reindex();
|
||||||
unset($record);
|
unset($record);
|
||||||
|
@@ -1232,9 +1232,6 @@ class task_period_outofdate extends task_abstract
|
|||||||
);
|
);
|
||||||
|
|
||||||
phrasea::headers(200, true, 'application/json', 'UTF-8', false);
|
phrasea::headers(200, true, 'application/json', 'UTF-8', false);
|
||||||
// return("hello4");
|
|
||||||
//var_dump($parm2);
|
|
||||||
//return;
|
|
||||||
$ret = NULL;
|
$ret = NULL;
|
||||||
switch($parm2['ACT'])
|
switch($parm2['ACT'])
|
||||||
{
|
{
|
||||||
|
@@ -338,7 +338,7 @@ class task_period_upgradetov32 extends task_abstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$record->set_metadatas($metadatas);
|
$record->set_metadatas($metadatas, true);
|
||||||
unset($record);
|
unset($record);
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
|
@@ -282,7 +282,6 @@ class task_period_writemeta extends task_databoxAbstract
|
|||||||
{
|
{
|
||||||
$coll_id = $row['coll_id'];
|
$coll_id = $row['coll_id'];
|
||||||
$record_id = $row['record_id'];
|
$record_id = $row['record_id'];
|
||||||
$base_id = phrasea::baseFromColl($this->sbas_id, $coll_id);
|
|
||||||
$jeton = $row['jeton'];
|
$jeton = $row['jeton'];
|
||||||
|
|
||||||
$record = new record_adapter($this->sbas_id, $record_id);
|
$record = new record_adapter($this->sbas_id, $record_id);
|
||||||
@@ -303,92 +302,51 @@ class task_period_writemeta extends task_databoxAbstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$uuid = $record->get_uuid();
|
|
||||||
|
|
||||||
$registry = $databox->get_registry();
|
$registry = $databox->get_registry();
|
||||||
|
|
||||||
$dom = new DOMDocument('1.0', 'UTF-8');
|
|
||||||
$dom->formatOutput = true;
|
|
||||||
$dom->preserveWhiteSpace = true;
|
|
||||||
|
|
||||||
$noderoot = $dom->appendChild($dom->createElement('rdf:RDF'));
|
|
||||||
$noderoot->setAttribute('xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
|
|
||||||
|
|
||||||
$nodedesc = $noderoot->appendChild($dom->createElement('rdf:Description'));
|
|
||||||
|
|
||||||
if ($uuid)
|
|
||||||
{
|
|
||||||
$node = $nodedesc->appendChild($dom->createElement('XMP-exif:ImageUniqueID'));
|
|
||||||
$node->appendChild($dom->createTextNode($uuid));
|
|
||||||
$node = $nodedesc->appendChild($dom->createElement('IPTC:UniqueDocumentID'));
|
|
||||||
$node->appendChild($dom->createTextNode($uuid));
|
|
||||||
}
|
|
||||||
|
|
||||||
$nodedesc->setAttribute('xmlns:et', 'http://ns.exiftool.ca/1.0/');
|
|
||||||
$nodedesc->setAttribute('et:toolkit', 'Image::ExifTool 7.62');
|
|
||||||
|
|
||||||
$nodedesc->setAttribute('xmlns:ExifTool', 'http://ns.exiftool.ca/ExifTool/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:File', 'http://ns.exiftool.ca/File/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:JFIF', 'http://ns.exiftool.ca/JFIF/JFIF/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:Photoshop', 'http://ns.exiftool.ca/Photoshop/Photoshop/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:IPTC', 'http://ns.exiftool.ca/IPTC/IPTC/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:Adobe', 'http://ns.exiftool.ca/APP14/Adobe/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:FotoStation', 'http://ns.exiftool.ca/FotoStation/FotoStation/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:File2', 'http://ns.exiftool.ca/File/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:IPTC2', 'http://ns.exiftool.ca/IPTC/IPTC2/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:Composite', 'http://ns.exiftool.ca/Composite/1.0/');
|
|
||||||
|
|
||||||
$nodedesc->setAttribute('xmlns:IFD0', 'http://ns.exiftool.ca/EXIF/IFD0/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-x', 'http://ns.exiftool.ca/XMP/XMP-x/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-exif', 'http://ns.exiftool.ca/XMP/XMP-exif/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-photoshop', 'http://ns.exiftool.ca/XMP/XMP-photoshop/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-tiff', 'http://ns.exiftool.ca/XMP/XMP-tiff/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-xmp', 'http://ns.exiftool.ca/XMP/XMP-xmp/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-xmpMM', 'http://ns.exiftool.ca/XMP/XMP-xmpMM/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-xmpRights', 'http://ns.exiftool.ca/XMP/XMP-xmpRights/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:XMP-dc', 'http://ns.exiftool.ca/XMP/XMP-dc/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:ExifIFD', 'http://ns.exiftool.ca/EXIF/ExifIFD/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:GPS', 'http://ns.exiftool.ca/EXIF/GPS/1.0/');
|
|
||||||
$nodedesc->setAttribute('xmlns:PDF', 'http://ns.exiftool.ca/PDF/PDF/1.0/');
|
|
||||||
|
|
||||||
$meta_struct = $databox->get_meta_structure();
|
|
||||||
|
|
||||||
$fields = $record->get_caption()->get_fields();
|
$fields = $record->get_caption()->get_fields();
|
||||||
|
|
||||||
|
$subCMD = '';
|
||||||
|
|
||||||
|
if ($record->get_uuid())
|
||||||
|
{
|
||||||
|
$subCMD .= '-XMP-exif:ImageUniqueID=';
|
||||||
|
$subCMD .= escapeshellarg($record->get_uuid());
|
||||||
|
$subCMD .= '-IPTC:UniqueDocumentID=';
|
||||||
|
$subCMD .= escapeshellarg($record->get_uuid());
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($fields as $field)
|
foreach ($fields as $field)
|
||||||
{
|
{
|
||||||
$meta = $field->get_databox_field();
|
$meta = $field->get_databox_field();
|
||||||
|
|
||||||
$fname = $field->get_name();
|
|
||||||
if (trim($meta->get_metadata_source()) === '')
|
if (trim($meta->get_metadata_source()) === '')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$tag = $meta->get_metadata_tagname();
|
|
||||||
$multi = $meta->is_multi();
|
$multi = $meta->is_multi();
|
||||||
$type = $meta->get_type();
|
$type = $meta->get_type();
|
||||||
$datas = $field->get_value();
|
$datas = $field->get_value();
|
||||||
$node = $nodedesc->appendChild($dom->createElement($tag));
|
|
||||||
if ($multi)
|
if ($multi)
|
||||||
{
|
{
|
||||||
$node = $node->appendChild($dom->createElement('rdf:Bag'));
|
|
||||||
$datas = $field->get_value();
|
$datas = $field->get_value();
|
||||||
foreach ($datas as $value)
|
foreach ($datas as $value)
|
||||||
{
|
{
|
||||||
$value = $this->format_value($type, $value);
|
$value = $this->format_value($type, $value);
|
||||||
$node->appendChild($dom->createElement('rdf:li'))->appendChild($dom->createTextNode($value));
|
|
||||||
|
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||||
|
$subCMD .= escapeshellarg($value).' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$datas = $this->format_value($type, $datas);
|
$datas = $this->format_value($type, $datas);
|
||||||
$node->appendChild($dom->createTextNode($datas));
|
|
||||||
|
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||||
|
$subCMD .= escapeshellarg($datas).' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp = tempnam($registry->get('GV_RootPath') . 'tmp/', 'meta');
|
|
||||||
rename($temp, $tempxml = $temp . '.xml');
|
|
||||||
$dom->save($tempxml);
|
|
||||||
|
|
||||||
foreach ($tsub as $name => $file)
|
foreach ($tsub as $name => $file)
|
||||||
{
|
{
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
@@ -397,16 +355,18 @@ class task_period_writemeta extends task_databoxAbstract
|
|||||||
$cmd .= ( $registry->get('GV_exiftool') . ' -m -overwrite_original ');
|
$cmd .= ( $registry->get('GV_exiftool') . ' -m -overwrite_original ');
|
||||||
if ($name != 'document' || $this->clear_doc)
|
if ($name != 'document' || $this->clear_doc)
|
||||||
$cmd .= '-all:all= ';
|
$cmd .= '-all:all= ';
|
||||||
$cmd .= ( ' -codedcharacterset=utf8 -TagsFromFile ' . escapeshellarg($tempxml) . ' ' . escapeshellarg($file) );
|
|
||||||
|
$cmd .= ' -codedcharacterset=utf8 ';
|
||||||
|
|
||||||
|
$cmd .= $subCMD.' '.escapeshellarg($file);
|
||||||
|
|
||||||
$this->log(sprintf(('writing meta for sbas_id=%1$d - record_id=%2$d (%3$s)'), $this->sbas_id, $record_id, $name));
|
$this->log(sprintf(('writing meta for sbas_id=%1$d - record_id=%2$d (%3$s)'), $this->sbas_id, $record_id, $name));
|
||||||
|
|
||||||
$s = trim(shell_exec($cmd));
|
$s = trim(shell_exec($cmd));
|
||||||
|
|
||||||
$this->log("\t" . $s);
|
$this->log("\t" . $s);
|
||||||
}
|
}
|
||||||
|
return $this;
|
||||||
unlink($tempxml);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function flush_records_sbas()
|
protected function flush_records_sbas()
|
||||||
|
@@ -894,12 +894,6 @@ $GV = array(
|
|||||||
), array(
|
), array(
|
||||||
'section' => _('GV::section:: Parametrage de l\'inscription'),
|
'section' => _('GV::section:: Parametrage de l\'inscription'),
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
array(
|
|
||||||
'type' => 'boolean',
|
|
||||||
'name' => 'GV_needMail',
|
|
||||||
'comment' => _('reglages:: Une addresse email valide est necessaire pour l\'inscription online'),
|
|
||||||
'default' => false
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'name' => 'GV_autoselectDB',
|
'name' => 'GV_autoselectDB',
|
||||||
|
@@ -1154,7 +1154,6 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
|||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
*/
|
*/
|
||||||
// var_dump($record["technical_informations"]);
|
|
||||||
|
|
||||||
$this->assertTrue(is_array($record["technical_informations"]));
|
$this->assertTrue(is_array($record["technical_informations"]));
|
||||||
|
|
||||||
|
@@ -109,7 +109,6 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance();
|
||||||
$crawler = $this->client->request('POST', '/feeds/requestavailable/');
|
$crawler = $this->client->request('POST', '/feeds/requestavailable/');
|
||||||
var_dump($this->client->getResponse()->getStatusCode());
|
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
||||||
foreach ($feeds->get_feeds() as $one_feed)
|
foreach ($feeds->get_feeds() as $one_feed)
|
||||||
|
@@ -24,7 +24,8 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
*/
|
*/
|
||||||
public static $entry;
|
public static $entry;
|
||||||
public static $publisher;
|
public static $publisher;
|
||||||
public static $need_records = 1;
|
public static $need_records = 2;
|
||||||
|
public static $need_subdefs = true;
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
@@ -35,6 +36,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(), self::$feed, self::$user);
|
self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(), self::$feed, self::$user);
|
||||||
self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com");
|
self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com");
|
||||||
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_1);
|
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_1);
|
||||||
|
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_2);
|
||||||
self::$feed->set_public(true);
|
self::$feed->set_public(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +75,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
||||||
$this->assertEquals("application/rss+xml", $this->client->getResponse()->headers->get("content-type"));
|
$this->assertEquals("application/rss+xml", $this->client->getResponse()->headers->get("content-type"));
|
||||||
$xml = $this->client->getResponse()->getContent();
|
$xml = $this->client->getResponse()->getContent();
|
||||||
|
|
||||||
$this->verifyXML($xml);
|
$this->verifyXML($xml);
|
||||||
$this->verifyRSS($feed, $xml);
|
$this->verifyRSS($feed, $xml);
|
||||||
|
|
||||||
@@ -141,6 +144,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
$xml = $this->client->getResponse()->getContent();
|
$xml = $this->client->getResponse()->getContent();
|
||||||
|
$this->verifyXML($xml);
|
||||||
$this->verifyRSS($feed, $xml);
|
$this->verifyRSS($feed, $xml);
|
||||||
|
|
||||||
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/atom/");
|
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/atom/");
|
||||||
@@ -161,7 +165,12 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function verifyXML($xml)
|
public function verifyXML($xml)
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* XML is not verified due to Validator Service bug
|
||||||
|
*/
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$validator = new W3CFeedRawValidator($xml);
|
$validator = new W3CFeedRawValidator($xml);
|
||||||
@@ -177,8 +186,6 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
function verifyRSS(Feed_Adapter $feed, $xml_string)
|
function verifyRSS(Feed_Adapter $feed, $xml_string)
|
||||||
{
|
{
|
||||||
$this->verifyXML($xml_string);
|
|
||||||
|
|
||||||
$dom_doc = new DOMDocument();
|
$dom_doc = new DOMDocument();
|
||||||
$dom_doc->loadXML($xml_string);
|
$dom_doc->loadXML($xml_string);
|
||||||
|
|
||||||
@@ -213,7 +220,6 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
break;
|
break;
|
||||||
case 'pubDate':
|
case 'pubDate':
|
||||||
$this->assertTrue(new DateTime() >= new DateTime($child->nodeValue));
|
$this->assertTrue(new DateTime() >= new DateTime($child->nodeValue));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'generator':
|
case 'generator':
|
||||||
$this->assertEquals("Phraseanet", $child->nodeValue);
|
$this->assertEquals("Phraseanet", $child->nodeValue);
|
||||||
@@ -314,8 +320,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
case 'media:content' :
|
case 'media:content' :
|
||||||
$this->checkMediaContentAttributes($item, $node);
|
$this->checkMediaContentAttributes($item, $node);
|
||||||
break;
|
break;
|
||||||
case 'media:thumbnail' :
|
case 'media:thumbnail':
|
||||||
break;
|
|
||||||
default :
|
default :
|
||||||
$this->checkOptionnalMediaGroupNode($node, $item);
|
$this->checkOptionnalMediaGroupNode($node, $item);
|
||||||
break;
|
break;
|
||||||
@@ -470,6 +475,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
foreach ($fields as $key_field => $field)
|
foreach ($fields as $key_field => $field)
|
||||||
{
|
{
|
||||||
if ($field["media_field"]["name"] == $node->nodeName)
|
if ($field["media_field"]["name"] == $node->nodeName)
|
||||||
@@ -482,7 +488,8 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
{
|
{
|
||||||
foreach ($node->attributes as $attribute)
|
foreach ($node->attributes as $attribute)
|
||||||
{
|
{
|
||||||
$this->assertTrue(array_key_exists($attribute->name, $field["media_field"]["attributes"]), "MIssing attribute " . $attribute->name . " for " . $field['media_field']['name']);
|
$this->assertTrue(array_key_exists($attribute->name, $field["media_field"]["attributes"]), "Checkin attribute ".$attribute->name." for " . $field['media_field']['name']);
|
||||||
|
$this->assertEquals($attribute->value, $field["media_field"]["attributes"][$attribute->name], "Checkin attribute ".$attribute->name." for " . $field['media_field']['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -640,4 +647,4 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,13 +17,13 @@ require_once __DIR__ . '/../../../../../../PhraseanetPHPUnitAbstract.class.inc';
|
|||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
*/
|
*/
|
||||||
class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
|
class DoctrinePhpechoTest extends PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testService()
|
public function testService()
|
||||||
{
|
{
|
||||||
|
|
||||||
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
|
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
|
||||||
'hello', array(), array()
|
'hello', array(), array()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testType()
|
public function testType()
|
||||||
{
|
{
|
||||||
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
|
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
|
||||||
'hello', array(), array()
|
'hello', array(), array()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testScope()
|
public function testScope()
|
||||||
{
|
{
|
||||||
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
|
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
|
||||||
'hello', array(), array());
|
'hello', array(), array());
|
||||||
$this->assertEquals("log", $log->getScope());
|
$this->assertEquals("log", $log->getScope());
|
||||||
}
|
}
|
||||||
|
@@ -38,8 +38,7 @@ class Bridge_AccountSettingsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
var_dump($e->getMessage());
|
$this->fail($e->getMessage());
|
||||||
$this->fail();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -108,17 +108,6 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$date = $this->basket->getUpdated();
|
$date = $this->basket->getUpdated();
|
||||||
$this->assertInstanceOf('\DateTime', $date);
|
$this->assertInstanceOf('\DateTime', $date);
|
||||||
|
|
||||||
// sleep(5);
|
|
||||||
// $this->basket->setName('hello COCOCOCO');
|
|
||||||
// $this->basket->setDescription('44WDFDFOLSDF');
|
|
||||||
// $this->em->persist($this->basket);
|
|
||||||
// $this->em->flush();
|
|
||||||
// var_dump($this->basket->getId());
|
|
||||||
// $basket = $this->em->getRepository('\Entities\Basket')->find($this->basket->getId());
|
|
||||||
// $dateUpdated = $basket->getUpdated();
|
|
||||||
// var_dump($date->format(DATE_ATOM), $dateUpdated->format(DATE_ATOM));
|
|
||||||
// $this->assertGreaterThan($dateUpdated, $date);
|
|
||||||
// $this->assertGreaterThan($dateUpdated, $this->basket->getCreated());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetElements()
|
public function testGetElements()
|
||||||
|
@@ -371,7 +371,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$record_1->set_metadatas($metadatas);
|
self::$record_1->set_metadatas($metadatas, true);
|
||||||
|
|
||||||
$caption = self::$record_1->get_caption();
|
$caption = self::$record_1->get_caption();
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
$current_fields = $caption->get_fields(array($meta_el->get_name()));
|
$current_fields = $caption->get_fields(array($meta_el->get_name()));
|
||||||
|
|
||||||
$this->assertTrue(count($current_fields) == 1);
|
$this->assertEquals(1, count($current_fields));
|
||||||
$field = $current_fields[0];
|
$field = $current_fields[0];
|
||||||
|
|
||||||
$multi_imploded = implode(' ' . $meta_el->get_separator() . ' ', array('un', 'jeu', 'de', 'test'));
|
$multi_imploded = implode(' ' . $meta_el->get_separator() . ' ', array('un', 'jeu', 'de', 'test'));
|
||||||
|
@@ -69,17 +69,19 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% for field in editing.get_fields() %}
|
{% for field in editing.get_fields() %}
|
||||||
{% set i = field.get_id() %}
|
{% set i = field.get_id() %}
|
||||||
<div class="edit_field" id="EditFieldBox_{{i}}" onclick="return(edit_mdwn_fld(event, {{i}}, '{{field.get_name()}}'));" >
|
{% if field.is_readonly() is empty %}
|
||||||
<img id="editSGtri_{{i}}" style="visibility:hidden;" src="/skins/prod/{{cssfile}}/images/suggested.gif" />
|
<div class="edit_field" id="EditFieldBox_{{i}}" onclick="return(edit_mdwn_fld(event, {{i}}, '{{field.get_name()}}'));" >
|
||||||
<img src="/skins/icons/info.gif" tooltipsrc="/prod/tooltip/metas/FieldInfos/{{field.get_databox().get_sbas_id()}}/{{field.get_id()}}/" class="fieldTips" alt=""/>
|
<img id="editSGtri_{{i}}" style="visibility:hidden;" src="/skins/prod/{{cssfile}}/images/suggested.gif" />
|
||||||
{% if field.get_dces_element %}
|
<img src="/skins/icons/info.gif" tooltipsrc="/prod/tooltip/metas/FieldInfos/{{field.get_databox().get_sbas_id()}}/{{field.get_id()}}/" class="fieldTips" alt=""/>
|
||||||
<img src="/skins/icons/dublincore.png" tooltipsrc="/prod/tooltip/DCESInfos/{{field.get_databox().get_sbas_id()}}/{{field.get_id()}}/" alt="{% trans 'Ce champ est decrit comme un element DublinCore' %}" class="DCESTips" alt=""/>
|
{% if field.get_dces_element %}
|
||||||
{% endif %}
|
<img src="/skins/icons/dublincore.png" tooltipsrc="/prod/tooltip/DCESInfos/{{field.get_databox().get_sbas_id()}}/{{field.get_id()}}/" alt="{% trans 'Ce champ est decrit comme un element DublinCore' %}" class="DCESTips" alt=""/>
|
||||||
<span id="spanidEditFieldBox_{{i}}">
|
{% endif %}
|
||||||
{{field.get_name()}} {% if field.is_required() %}<span style="font-weight:bold;font-size:16px;"> * </span>{% endif %} :
|
<span id="spanidEditFieldBox_{{i}}">
|
||||||
</span>
|
{{field.get_name()}} {% if field.is_required() %}<span style="font-weight:bold;font-size:16px;"> * </span>{% endif %} :
|
||||||
<span class="fieldvalue" id="idEditField_{{i}}" >???</span>
|
</span>
|
||||||
</div>
|
<span class="fieldvalue" id="idEditField_{{i}}" >???</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ if ((!is_null($parm['login']) && !is_null($parm['pwd'])) || $is_guest)
|
|||||||
}
|
}
|
||||||
catch (Exception_Session_MailLocked $e)
|
catch (Exception_Session_MailLocked $e)
|
||||||
{
|
{
|
||||||
return phrasea::redirect("/login/?redirect=" . $parm['redirect'] . "&error=mailNotConfirm&usr=" . $logged['usr_id']);
|
return phrasea::redirect("/login/?redirect=" . $parm['redirect'] . "&error=mailNotConfirm&usr=" . $e->get_usr_id());
|
||||||
}
|
}
|
||||||
catch (Exception_Session_WrongToken $e)
|
catch (Exception_Session_WrongToken $e)
|
||||||
{
|
{
|
||||||
|
@@ -72,7 +72,7 @@ if ($parm['error'] !== null)
|
|||||||
break;
|
break;
|
||||||
case 'mailNotConfirm' :
|
case 'mailNotConfirm' :
|
||||||
$errorWarning = '<div class="notice">' . _('login::erreur: Vous n\'avez pas confirme votre email') . '</div>';
|
$errorWarning = '<div class="notice">' . _('login::erreur: Vous n\'avez pas confirme votre email') . '</div>';
|
||||||
if (is_numeric((int) $parm['usr']))
|
if (ctype_digit($parm['usr']))
|
||||||
$errorWarning .= '<div class="notice"><a href="/login/sendmail-confirm.php?usr_id=' . $parm['usr'] . '" target ="_self" style="color:black;text-decoration:none;">' . _('login:: Envoyer a nouveau le mail de confirmation') . '</a></div>';
|
$errorWarning .= '<div class="notice"><a href="/login/sendmail-confirm.php?usr_id=' . $parm['usr'] . '" target ="_self" style="color:black;text-decoration:none;">' . _('login:: Envoyer a nouveau le mail de confirmation') . '</a></div>';
|
||||||
break;
|
break;
|
||||||
case 'no-base' :
|
case 'no-base' :
|
||||||
|
@@ -19,7 +19,7 @@ require_once __DIR__ . "/../../lib/bootstrap.php";
|
|||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance();
|
||||||
$request = http_request::getInstance();
|
$request = http_request::getInstance();
|
||||||
$parm = $request->get_post_datas('code');
|
$parm = $request->get_parms('code');
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -27,7 +27,7 @@ try
|
|||||||
}
|
}
|
||||||
catch(Exception_NotFound $e)
|
catch(Exception_NotFound $e)
|
||||||
{
|
{
|
||||||
return phrasea::redirect('/login/?redirect=/prod');
|
return phrasea::redirect('/login/?redirect=/prod&error=TokenNotFound');
|
||||||
}
|
}
|
||||||
|
|
||||||
$usr_id = $datas['usr_id'];
|
$usr_id = $datas['usr_id'];
|
||||||
|
@@ -175,23 +175,17 @@ if ($request->has_post_datas())
|
|||||||
->set_company($parm['form_company'])
|
->set_company($parm['form_company'])
|
||||||
->set_position($parm['form_activity'])
|
->set_position($parm['form_activity'])
|
||||||
->set_geonameid($parm['form_geonameid']);
|
->set_geonameid($parm['form_geonameid']);
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo implement this shit
|
|
||||||
*/
|
|
||||||
$fieldsname.= ",mail_locked";
|
|
||||||
$fieldsvalue.= ",'1'";
|
|
||||||
|
|
||||||
$newid = $user->get_id();
|
$newid = $user->get_id();
|
||||||
|
|
||||||
// //user cree, je branche autoregister si ya
|
|
||||||
// $autoSB = $autoB = array();
|
|
||||||
|
|
||||||
$demandOK = array();
|
$demandOK = array();
|
||||||
|
|
||||||
if ($registry->get('GV_autoregister'))
|
if ($registry->get('GV_autoregister'))
|
||||||
{
|
{
|
||||||
$template_user = User_Adapter::get_usr_id_from_login('autoregister');
|
$template_user_id = User_Adapter::get_usr_id_from_login('autoregister');
|
||||||
|
|
||||||
|
$template_user = User_Adapter::getInstance($template_user_id, appbox::get_instance());
|
||||||
|
|
||||||
$user->ACL()->apply_model($template_user, array_keys($inscOK[$base_id]));
|
$user->ACL()->apply_model($template_user, array_keys($inscOK[$base_id]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +219,7 @@ if ($request->has_post_datas())
|
|||||||
|
|
||||||
if ($newUsrEmail)
|
if ($newUsrEmail)
|
||||||
{
|
{
|
||||||
|
$user->set_mail_locked(true);
|
||||||
return phrasea::redirect('/login/sendmail-confirm.php?usr_id=' . $newid);
|
return phrasea::redirect('/login/sendmail-confirm.php?usr_id=' . $newid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
require_once __DIR__ . "/../../lib/bootstrap.php";
|
require_once __DIR__ . "/../../lib/bootstrap.php";
|
||||||
|
|
||||||
$request = http_request::getInstance();
|
$request = http_request::getInstance();
|
||||||
$parm = $request->get_post_datas('usr_id');
|
$parm = $request->get_parms('usr_id');
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance();
|
||||||
|
|
||||||
$confirm = '';
|
$confirm = '';
|
||||||
|
@@ -41,7 +41,6 @@ if (!$parm['bas'])
|
|||||||
|
|
||||||
$parm["pag"] = (int) $parm["pag"];
|
$parm["pag"] = (int) $parm["pag"];
|
||||||
$mod = $user->getPrefs('view');
|
$mod = $user->getPrefs('view');
|
||||||
//var_dump($session->get_ses_id(), phrasea_open_session($session->get_ses_id(), $session->get_usr_id()));
|
|
||||||
function dmicrotime_float($message = '', $stack = 'def')
|
function dmicrotime_float($message = '', $stack = 'def')
|
||||||
{
|
{
|
||||||
static $last = array();
|
static $last = array();
|
||||||
@@ -49,9 +48,6 @@ function dmicrotime_float($message = '', $stack = 'def')
|
|||||||
|
|
||||||
$new = ((float) $usec + (float) $sec);
|
$new = ((float) $usec + (float) $sec);
|
||||||
|
|
||||||
// if (isset($last[$stack]) && $message)
|
|
||||||
// echo "$stack \t\t temps : $message " . ($new - $last[$stack]) . "\n";
|
|
||||||
|
|
||||||
$last[$stack] = $new;
|
$last[$stack] = $new;
|
||||||
|
|
||||||
return ($new - $last[$stack]);
|
return ($new - $last[$stack]);
|
||||||
|
@@ -64,9 +64,6 @@ if ($parm["bid"] !== null)
|
|||||||
$s_thits .= ( str_replace('d', '.', $rowbas['value']) . ';');
|
$s_thits .= ( str_replace('d', '.', $rowbas['value']) . ';');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($parm['debug'])
|
|
||||||
var_dump($s_thits);
|
|
||||||
|
|
||||||
if ($parm['typ'] == 'CT')
|
if ($parm['typ'] == 'CT')
|
||||||
{
|
{
|
||||||
$dom = $databox->get_dom_cterms();
|
$dom = $databox->get_dom_cterms();
|
||||||
|
@@ -242,10 +242,7 @@ function simplified($t)
|
|||||||
return(array('a' => $sa, 'u' => $su));
|
return(array('a' => $sa, 'u' => $su));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($parm['debug'])
|
print(p4string::jsonencode(array('parm' => $parm, 'result' => $result)));
|
||||||
var_dump($result);
|
|
||||||
else
|
|
||||||
print(p4string::jsonencode(array('parm' => $parm, 'result' => $result)));
|
|
||||||
|
|
||||||
if ($parm['debug'])
|
if ($parm['debug'])
|
||||||
print("</pre>");
|
print("</pre>");
|
||||||
|
Reference in New Issue
Block a user