mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Merge with master
This commit is contained in:
@@ -28,7 +28,7 @@ class module_report_download extends module_report
|
|||||||
'usrid' => 'log.usrid',
|
'usrid' => 'log.usrid',
|
||||||
'coll_id' => 'record.coll_id',
|
'coll_id' => 'record.coll_id',
|
||||||
'xml' => 'record.xml',
|
'xml' => 'record.xml',
|
||||||
'ddate' => "log.date",
|
'ddate' => "log_docs.date",
|
||||||
'id' => 'log_docs.id',
|
'id' => 'log_docs.id',
|
||||||
'log_id' => 'log_docs.log_id',
|
'log_id' => 'log_docs.log_id',
|
||||||
'record_id' => 'log_docs.record_id',
|
'record_id' => 'log_docs.record_id',
|
||||||
@@ -39,6 +39,7 @@ class module_report_download extends module_report
|
|||||||
'file' => 'subdef.file'
|
'file' => 'subdef.file'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $isInformative;
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@@ -277,5 +278,16 @@ class module_report_download extends module_report
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsInformative()
|
||||||
|
{
|
||||||
|
return $this->isInformative;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIsInformative($isInformative)
|
||||||
|
{
|
||||||
|
$this->isInformative = $isInformative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,17 +18,23 @@
|
|||||||
class module_report_sqldownload extends module_report_sql implements module_report_sqlReportInterface
|
class module_report_sqldownload extends module_report_sql implements module_report_sqlReportInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $restrict = false;
|
||||||
|
|
||||||
public function __construct(module_report $report)
|
public function __construct(module_report $report)
|
||||||
{
|
{
|
||||||
parent::__construct($report);
|
parent::__construct($report);
|
||||||
|
if($report->isInformative())
|
||||||
|
{
|
||||||
|
$this->restrict = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildSql()
|
public function buildSql()
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
$registry = registry::get_instance();
|
||||||
$report_filters = $this->filter->getReportFilter();
|
$report_filters = $this->filter->getReportFilter();
|
||||||
$record_filters = $this->filter->getRecordFilter() ?: array('sql'=>'', 'params'=> array());
|
$record_filters = $this->filter->getRecordFilter() ? : array('sql' => '', 'params' => array());
|
||||||
$this->params = array_merge($report_filters['params'], $record_filters['params']);
|
$this->params = array_merge($report_filters['params'], $record_filters['params']);
|
||||||
|
|
||||||
if ($this->groupby == false)
|
if ($this->groupby == false)
|
||||||
{
|
{
|
||||||
@@ -58,17 +64,19 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
$this->sql .= $report_filters['sql'] ? : '';
|
$this->sql .= $report_filters['sql'] ? : '';
|
||||||
|
|
||||||
$this->sql .= ' AND ( log_docs.action = \'download\' OR log_docs.action = \'mail\')';
|
$this->sql .= ' AND ( log_docs.action = \'download\' OR log_docs.action = \'mail\')';
|
||||||
|
if($this->restrict)
|
||||||
|
$this->sql .= ' AND ( log_docs.final = "document" OR log_docs.final = "preview")';
|
||||||
$this->sql .= empty($record_filters['sql']) ? '' : ' AND ( ' . $record_filters['sql'] . ' )';
|
$this->sql .= empty($record_filters['sql']) ? '' : ' AND ( ' . $record_filters['sql'] . ' )';
|
||||||
|
|
||||||
$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();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->sql .= $this->filter->getLimitFilter() ?: '';
|
$this->sql .= $this->filter->getLimitFilter() ? : '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -141,14 +149,15 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
$this->sql .= ( $name == 'record_id' && $this->on == 'DOC') ? ' , final' : '';
|
$this->sql .= ( $name == 'record_id' && $this->on == 'DOC') ? ' , final' : '';
|
||||||
|
|
||||||
if ($this->filter->getOrderFilter()) $this->sql .= $this->filter->getOrderFilter();
|
if ($this->filter->getOrderFilter())
|
||||||
|
$this->sql .= $this->filter->getOrderFilter();
|
||||||
|
|
||||||
$stmt = $this->connbas->prepare($this->sql);
|
$stmt = $this->connbas->prepare($this->sql);
|
||||||
$stmt->execute($this->params);
|
$stmt->execute($this->params);
|
||||||
$this->total = $stmt->rowCount();
|
$this->total = $stmt->rowCount();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->sql .= $this->filter->getLimitFilter() ?: '';
|
$this->sql .= $this->filter->getLimitFilter() ? : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@@ -953,7 +953,7 @@ class system_file extends SplFileObject
|
|||||||
= array($this->get_phrasea_tech_field(self::TECH_FIELD_SUBPATH));
|
= array($this->get_phrasea_tech_field(self::TECH_FIELD_SUBPATH));
|
||||||
$tfields[metadata_description_PHRASEANET_tfparentdir::get_source()]
|
$tfields[metadata_description_PHRASEANET_tfparentdir::get_source()]
|
||||||
= array($this->get_phrasea_tech_field(self::TECH_FIELD_PARENTDIRECTORY));
|
= array($this->get_phrasea_tech_field(self::TECH_FIELD_PARENTDIRECTORY));
|
||||||
$tfields[metadata_description_PHRASEANET_tfparentdir::get_source()]
|
$tfields[metadata_description_PHRASEANET_tffilename::get_source()]
|
||||||
= array($this->get_phrasea_tech_field(self::TECH_FIELD_ORIGINALNAME));
|
= array($this->get_phrasea_tech_field(self::TECH_FIELD_ORIGINALNAME));
|
||||||
|
|
||||||
$tfields[metadata_description_PHRASEANET_tfextension::get_source()]
|
$tfields[metadata_description_PHRASEANET_tfextension::get_source()]
|
||||||
|
@@ -111,7 +111,7 @@ class task_Scheduler
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tid = $task->get_task_id();
|
$tid = $task->get_task_id();
|
||||||
|
|
||||||
if (!$task->is_running())
|
if (!$task->is_running())
|
||||||
@@ -275,18 +275,35 @@ class task_Scheduler
|
|||||||
* Launch task that are not yet launched
|
* Launch task that are not yet launched
|
||||||
*/
|
*/
|
||||||
$runningtask = 0;
|
$runningtask = 0;
|
||||||
|
|
||||||
|
$common_status = array(
|
||||||
|
task_abstract::STATUS_STARTED
|
||||||
|
, task_abstract::RETURNSTATUS_STOPPED
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($ttask as $tkey => $tv)
|
foreach ($ttask as $tkey => $tv)
|
||||||
{
|
{
|
||||||
$this->log(
|
if (!in_array($ttask[$tkey]["task"]->get_status(), $common_status))
|
||||||
sprintf(
|
{
|
||||||
'task %s has status %s'
|
$this->log(
|
||||||
, $ttask[$tkey]["task"]->get_task_id()
|
sprintf(
|
||||||
, $ttask[$tkey]["task"]->get_status()
|
'task %s has status %s'
|
||||||
)
|
, $ttask[$tkey]["task"]->get_task_id()
|
||||||
);
|
, $ttask[$tkey]["task"]->get_status()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
switch ($ttask[$tkey]["task"]->get_status())
|
switch ($ttask[$tkey]["task"]->get_status())
|
||||||
{
|
{
|
||||||
case 'torestart':
|
default:
|
||||||
|
$this->log(
|
||||||
|
sprintf(
|
||||||
|
'Unknow status `%s`'
|
||||||
|
, $ttask[$tkey]["task"]->get_status()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case task_abstract::RETURNSTATUS_TORESTART:
|
||||||
@fclose($ttask[$tkey]["pipes"][1]);
|
@fclose($ttask[$tkey]["pipes"][1]);
|
||||||
@fclose($ttask[$tkey]["pipes"][2]);
|
@fclose($ttask[$tkey]["pipes"][2]);
|
||||||
@proc_close($ttask[$tkey]["process"]);
|
@proc_close($ttask[$tkey]["process"]);
|
||||||
@@ -297,7 +314,7 @@ class task_Scheduler
|
|||||||
$ttask[$tkey]["task"]->set_status(task_abstract::STATUS_TOSTART);
|
$ttask[$tkey]["task"]->set_status(task_abstract::STATUS_TOSTART);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'tostart':
|
case task_abstract::STATUS_TOSTART:
|
||||||
$ttask[$tkey]["killat"] = NULL;
|
$ttask[$tkey]["killat"] = NULL;
|
||||||
if ($schedstatus == 'started' && !$ttask[$tkey]["process"])
|
if ($schedstatus == 'started' && !$ttask[$tkey]["process"])
|
||||||
{
|
{
|
||||||
@@ -380,7 +397,7 @@ class task_Scheduler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'started':
|
case task_abstract::STATUS_STARTED:
|
||||||
$crashed = false;
|
$crashed = false;
|
||||||
/**
|
/**
|
||||||
* If no process, the task is probably manually ran
|
* If no process, the task is probably manually ran
|
||||||
@@ -437,7 +454,7 @@ class task_Scheduler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tostop':
|
case task_abstract::STATUS_TOSTOP:
|
||||||
if ($ttask[$tkey]["process"])
|
if ($ttask[$tkey]["process"])
|
||||||
{
|
{
|
||||||
if ($ttask[$tkey]["killat"] === NULL)
|
if ($ttask[$tkey]["killat"] === NULL)
|
||||||
@@ -487,8 +504,8 @@ class task_Scheduler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'stopped':
|
case task_abstract::RETURNSTATUS_STOPPED:
|
||||||
case 'todelete':
|
case task_abstract::RETURNSTATUS_TODELETE:
|
||||||
if ($ttask[$tkey]["process"])
|
if ($ttask[$tkey]["process"])
|
||||||
{
|
{
|
||||||
@fclose($ttask[$tkey]["pipes"][1]);
|
@fclose($ttask[$tkey]["pipes"][1]);
|
||||||
@@ -497,6 +514,7 @@ class task_Scheduler
|
|||||||
|
|
||||||
$ttask[$tkey]["process"] = null;
|
$ttask[$tkey]["process"] = null;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<li class="{{class}} prevTrainCurrent" style="">
|
<li class="{{class}} prevTrainCurrent" style="">
|
||||||
<img {{tooltip}} jsargs="REG|{{loop.index}}|{{regroupement.get_serialize_key}}"
|
<img {{tooltip}} jsargs="REG|{{loop.index}}|{{regroupement.get_serialize_key}}"
|
||||||
class="openPreview prevRegToolTip" return(false);" src="{{thumbnail.get_url()}}"
|
class="openPreview prevRegToolTip" src="{{thumbnail.get_url()}}"
|
||||||
style="{{style}}margin:7px;position:relative;"/></li>
|
style="{{style}}margin:7px;position:relative;"/></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ $cls = 'task_period_' . $parm['cls'];
|
|||||||
$registry = registry::get_instance();
|
$registry = registry::get_instance();
|
||||||
$tskfile = $registry->get('GV_RootPath') . 'lib/classes/task/period/' . $parm['cls'] . '.class.php';
|
$tskfile = $registry->get('GV_RootPath') . 'lib/classes/task/period/' . $parm['cls'] . '.class.php';
|
||||||
|
|
||||||
require_once $tskfile;
|
// require_once $tskfile;
|
||||||
|
|
||||||
$ztask = new $cls($parm['taskid']);
|
$ztask = new $cls($parm['taskid']);
|
||||||
|
|
||||||
|
@@ -396,8 +396,9 @@ function getHistory($obj, $param, $twig, $conf, $dl = false, $title)
|
|||||||
elseif (!empty($param['on']) && !empty($param['user']))
|
elseif (!empty($param['on']) && !empty($param['user']))
|
||||||
$filter->addfilter($param['on'], '=', $param['user']);
|
$filter->addfilter($param['on'], '=', $param['user']);
|
||||||
if ($dl)
|
if ($dl)
|
||||||
$filter->addfilter("(log_docs.final = 'document'", "OR", "log_docs.final = 'preview')");
|
{
|
||||||
|
$obj->setIsInformative(true);
|
||||||
|
}
|
||||||
$tab_filter = $filter->getTabFilter();
|
$tab_filter = $filter->getTabFilter();
|
||||||
$obj->setFilter($tab_filter);
|
$obj->setFilter($tab_filter);
|
||||||
|
|
||||||
|
@@ -948,7 +948,7 @@ function scid_click(event, el)
|
|||||||
$('.basket_element', el).addClass('selected');
|
$('.basket_element', el).addClass('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
var sselcont_id = $(el).attr('id').split('_').pop();
|
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
||||||
var ssel_id = $('#navigation').val();
|
var ssel_id = $('#navigation').val();
|
||||||
|
|
||||||
var container = $('#sc_container');
|
var container = $('#sc_container');
|
||||||
|
@@ -311,7 +311,7 @@ function scid_click(event, el)
|
|||||||
$('.basket_element', el).addClass('selected');
|
$('.basket_element', el).addClass('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
var sselcont_id = $(el).attr('id').split('_').pop();
|
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
||||||
var ssel_id = $('#navigation').val();
|
var ssel_id = $('#navigation').val();
|
||||||
|
|
||||||
var container = $('#sc_container');
|
var container = $('#sc_container');
|
||||||
|
@@ -129,6 +129,7 @@ iframe{
|
|||||||
padding: 0 auto;
|
padding: 0 auto;
|
||||||
clear:both;
|
clear:both;
|
||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
|
overflow:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.report-table table {
|
.report-table table {
|
||||||
@@ -417,15 +418,11 @@ table.tablesorter tr th.SortDown {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.onload{
|
.onload{
|
||||||
background-image:url(ajax-loader.gif);
|
|
||||||
background-position:center center;
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
}
|
|
||||||
.onloadd{
|
|
||||||
background-image:url(ajax-loader2.gif);
|
background-image:url(ajax-loader2.gif);
|
||||||
background-position:center center;
|
background-position:center center;
|
||||||
background-repeat:no-repeat;
|
background-repeat:no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-tabs, .ui-tabs .ui-tabs-panel{
|
.ui-tabs, .ui-tabs .ui-tabs-panel{
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user