This commit is contained in:
Romain Neutron
2012-05-23 00:01:29 +02:00
parent 41e56ed86b
commit 4afa21d419
346 changed files with 2234 additions and 3759 deletions

View File

@@ -18,7 +18,7 @@
class module_admin
{
function getTree($position = false)
public function getTree($position = false)
{
$appbox = appbox::get_instance(\bootstrap::getCore());
$session = $appbox->get_session();

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,8 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

View File

@@ -15,10 +15,8 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,7 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;

View File

@@ -15,10 +15,8 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,7 +15,6 @@ use Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Output\OutputInterface,
Symfony\Component\Console\Command\Command;
use Alchemy\Phrasea\Core;
use Symfony\Component\Yaml;
/**
* @todo write tests
@@ -765,8 +764,7 @@ class module_console_fileEnsureDevSetting extends Command
$key = $scope . ":" . $key;
$this->printConf($output, $key, $val, $scopage, '');
}
}
elseif (is_bool($value)) {
} elseif (is_bool($value)) {
if ($value === false) {
$value = 'false';
} elseif ($value === true) {

View File

@@ -15,7 +15,6 @@ use Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Output\OutputInterface,
Symfony\Component\Console\Command\Command;
use Alchemy\Phrasea\Core;
use Symfony\Component\Yaml;
/**
* @todo write tests
@@ -771,8 +770,7 @@ class module_console_fileEnsureProductionSetting extends Command
$key = $scope . ":" . $key;
$this->printConf($output, $key, $val, $scopage, '');
}
}
elseif (is_bool($value)) {
} elseif (is_bool($value)) {
if ($value === false) {
$value = 'false';
} elseif ($value === true) {

View File

@@ -15,8 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -65,8 +63,7 @@ class module_console_schedulerStart extends Command
$scheduler = new task_Scheduler();
$scheduler->run($input, $output);
} catch (\Exception $e) {
switch($e->getCode())
{
switch ($e->getCode()) {
case task_Scheduler::ERR_ALREADY_RUNNING: // 114 : aka EALREADY (Operation already in progress)
$exitCode = ERR_ALREADY_RUNNING;
break;
@@ -74,6 +71,7 @@ class module_console_schedulerStart extends Command
$exitCode = 1; // default exit code (error)
break;
}
return $exitCode;
}
}

View File

@@ -15,8 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -14,11 +14,8 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -16,10 +16,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,8 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

View File

@@ -16,10 +16,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,10 +15,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -16,10 +16,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,7 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;

View File

@@ -16,10 +16,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;

View File

@@ -15,7 +15,6 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -54,7 +53,7 @@ class module_console_taskrun extends Command
return $this;
}
function sig_handler($signo)
public function sig_handler($signo)
{
if ($this->task) {
$this->task->log(sprintf("signal %s received", $signo));

View File

@@ -564,7 +564,7 @@ class module_report
/**
* Retourne un objet qui genere la requete selon le type de report
* @param string $domain
* @param string $domain
* @return module_report_sqlconnexion
*/
public function sqlBuilder($domain)
@@ -601,8 +601,8 @@ class module_report
/**
* initialise les configuration des columns ex : boundable, linkable orderable
* etc .. par defaut ou celle passe en parametre par $tab
* @param array $tab
* @param string $groupby
* @param array $tab
* @param string $groupby
* @return void
*/
protected function setDisplay($tab, $groupby = false)
@@ -751,7 +751,7 @@ class module_report
/**
* @desc Initialize the configuration foreach column displayed in the report
* @param array $display contain the conf's variables
* @param array $display contain the conf's variables
* @return void
*/
protected function initDefaultConfigColumn($display)
@@ -806,8 +806,8 @@ class module_report
/**
* @desc build the final formated array which contains all the result,
* we construct the html code from this array
* @param array $tab pass the configcolumn parameter to this tab
* @return the formated array
* @param array $tab pass the configcolumn parameter to this tab
* @return the formated array
*/
public function buildReport($tab = false, $groupby = false, $on = false)
{

View File

@@ -52,7 +52,7 @@ class module_report_activity extends module_report
/**
* set top value
* @param int $nb_top
* @param int $nb_top
* @return module_report_activity
*/
public function setTop($nb_top)
@@ -213,8 +213,8 @@ class module_report_activity extends module_report
/**
* get the most asked question
* @param array $tab config for html table
* @param bool $no_answer true for question with no answer
* @param array $tab config for html table
* @param bool $no_answer true for question with no answer
*/
public function getTopQuestion($tab = false, $no_answer = false)
{
@@ -284,7 +284,7 @@ class module_report_activity extends module_report
/**
* @desc get all downloads from one specific user
* @param $usr user id
* @param array $config config for the html table
* @param array $config config for the html table
* @return array
*/
public function getAllDownloadByUserBase($usr, $config = false)
@@ -360,7 +360,7 @@ class module_report_activity extends module_report
/**
* @desc get all download by base by day
* @param array $tab config for html table
* @param array $tab config for html table
* @return array
*/
public function getDownloadByBaseByDay($tab = false)
@@ -461,8 +461,8 @@ class module_report_activity extends module_report
/**
* @desc get nb connexion by user , fonction ,societe etc..
* @param array $tab config for html table
* @param string $on choose the field on what you want the result
* @param array $tab config for html table
* @param string $on choose the field on what you want the result
* @return array
*/
public function getConnexionBase($tab = false, $on = "")
@@ -555,8 +555,8 @@ class module_report_activity extends module_report
/**
* @desc get the deail of download by users
* @param bool $ext false for your appbox conn, true for external connections
* @param array $tab config for the html table
* @param bool $ext false for your appbox conn, true for external connections
* @param array $tab config for the html table
* @return array
*/
public function getDetailDownload($tab = false, $on = "")

View File

@@ -109,11 +109,9 @@ class module_report_add extends module_report
$this->result[$i][$value] = $this->pretty_string ? phraseadate::getPrettyString(new DateTime($row[$value])) : $row[$value];
} elseif ($value == 'size') {
$this->result[$i][$value] = p4string::format_octets($row[$value]);
}
else
} else
$this->result[$i][$value] = $row[$value];
}
else {
} else {
if ($value == 'comment') {
$this->result[$i][$value] = ' ';
} else {

View File

@@ -63,7 +63,7 @@ class module_report_connexion extends module_report
/**
* @desc build the list with all distinct result
* @param string $field the field from the request displayed in a array
* @param string $field the field from the request displayed in a array
* @return string $liste
*/
public function colFilter($field)
@@ -95,8 +95,8 @@ class module_report_connexion extends module_report
/**
* @desc build the result from the specified sql
* @param array $champ all the field from the request displayed in a array
* @param string $sql the request from buildreq
* @param array $champ all the field from the request displayed in a array
* @param string $sql the request from buildreq
* @return $this->result
*/
protected function buildResult($rs)

View File

@@ -98,8 +98,8 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
/**
* @desc modifier les date du report
* @param Datetime $dmin
* @param Datetime $dmax
* @param Datetime $dmin
* @param Datetime $dmax
* @return <void>
*/
public function setDate($dmin, $dmax)
@@ -128,7 +128,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
/**
* @desc return le titre de la date
* @param <string> $d vaut 'dmin' ou 'dmax'
* @param <string> $d vaut 'dmin' ou 'dmax'
* @return <string>
*/
public function getTitleDate($d)
@@ -141,8 +141,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
$datetime = new Datetime($this->dmin);
return phraseadate::getPrettyString($datetime);
}
else
} else
throw new Exception('argument must be string dmin or dmax');
}
@@ -171,8 +170,8 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
/**
* @desc construct the legend for charts
* if dmax === false dmax = now();
* @param <Datetime> $dmin
* @param <Datetime> $dmax
* @param <Datetime> $dmin
* @param <Datetime> $dmax
* @return <void>
*/
protected function getPlotLegendDay($dmin, $dmax = false)
@@ -287,7 +286,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
/**
* @desc la liste des base authorisee sous forme de string
* @param <string> $separotor
* @param <string> $separotor
* @return string
*/
public function getListeBase($separator)

View File

@@ -63,10 +63,10 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
/**
* @desc return l'objet stockee dans le cache si i l existe sinon instancie
* un nouveau objet dashboard_feed
* @param <int> $sbasid
* @param <string> $sbas_coll
* @param <string> $dmin
* @param <string> $dmax
* @param <int> $sbasid
* @param <string> $sbas_coll
* @param <string> $dmin
* @param <string> $dmax
* @return self
*/
public static function getInstance($sbasid, $sbas_coll, $dmin, $dmax)
@@ -89,7 +89,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
/**
* @desc Remplis les resultats bruts pour valeures passees en param
* @param <int> $sbasid
* @param <int> $sbasid
* @param <string> $sbas_collection, les collection sous forme de string
* séparés par une virgule
* @param <string> $dmin, Y-m-d
@@ -109,7 +109,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
/**
* @desc return les date dormate pour les requetes sql;
* @param <string> $d, vaut 'dmin' ou 'dmax'
* @param <string> $d, vaut 'dmin' ou 'dmax'
* @return Datetime
*/
private function dateToSqlDate($d)

View File

@@ -107,7 +107,7 @@ class module_report_dashboard_merge implements module_report_dashboard_component
}
/**
* @return le dashboard trie
* @return le dashboard trie
* @return <type>
*/
public function getDash()

View File

@@ -109,8 +109,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
foreach ($data as $key => $row)
$tmp[$key] = $row[$field];
$args[$n] = &$tmp;
}
else
} else
$args[$n] = &$field;
}
$args[] = &$data;

View File

@@ -99,8 +99,8 @@ class module_report_download extends module_report
/**
* @desc build the result from the specified sql
* @param array $champ all the field from the request displayed in a array
* @param string $sql the request from buildreq
* @param array $champ all the field from the request displayed in a array
* @param string $sql the request from buildreq
* @return $this->result
*/
protected function buildResult($rs)
@@ -144,8 +144,7 @@ class module_report_download extends module_report
$this->result[$i][$column] = p4string::format_octets($value);
else
$this->result[$i][$column] = $value;
}
else {
} else {
if ($column == 'comment')
$this->result[$i][$column] = '';
else

View File

@@ -113,11 +113,9 @@ class module_report_edit extends module_report
$this->result[$i][$value] = $this->pretty_string ? phraseadate::getPrettyString(new DateTime($row[$value])) : $row[$value];
} elseif ($value == 'size') {
$this->result[$i][$value] = p4string::format_octets($row[$value]);
}
else
} else
$this->result[$i][$value] = $row[$value];
}
else {
} else {
if ($value == 'comment') {
$this->result[$i][$value] = '&nbsp;';
} else {

View File

@@ -103,7 +103,7 @@ class module_report_nav extends module_report
/**
* @desc return the filter to generate the good request
* @param object $conn the current connexion to appbox
* @param object $conn the current connexion to appbox
* @return string
*/
private function getFilter()
@@ -113,7 +113,7 @@ class module_report_nav extends module_report
/**
* @desc report the browser used by users
* @param array $tab config for the html table
* @param array $tab config for the html table
* @return tab
*/
public function buildTabNav($tab = false)
@@ -178,7 +178,7 @@ class module_report_nav extends module_report
/**
* @desc report the OS from user
* @param array $tab config for the html table
* @param array $tab config for the html table
* @return array
*/
public function buildTabOs($tab = false)
@@ -238,7 +238,7 @@ class module_report_nav extends module_report
/**
* @desc report the resolution that are using the users
* @param array $tab config for the html table
* @param array $tab config for the html table
* @return array
*/
public function buildTabRes($tab = false)
@@ -362,7 +362,7 @@ class module_report_nav extends module_report
/**
* @desc report the most consulted module by the users
* @param array $tab
* @param array $tab
* @return array
*/
public function buildTabModule($tab = false)
@@ -444,9 +444,9 @@ class module_report_nav extends module_report
/**
* @desc report basic user informations
* @param int $val user id
* @param array $tab config for the html table
* @param string $on the field
* @param int $val user id
* @param array $tab config for the html table
* @param string $on the field
* @return array
*/
public function buildTabGrpInfo($req, array $params, $val, $tab = false, $on = false)

View File

@@ -114,11 +114,9 @@ class module_report_push extends module_report
$row[$value];
} elseif ($value == 'size') {
$this->result[$i][$value] = p4string::format_octets($row[$value]);
}
else
} else
$this->result[$i][$value] = $row[$value];
}
else {
} else {
if ($value == 'comment') {
$this->result[$i][$value] = '&nbsp;';
} else {

View File

@@ -100,8 +100,7 @@ class module_report_question extends module_report
$this->pretty_string ? phraseadate::getPrettyString(new DateTime($row[$value])) : $row[$value];
else
$this->result[$i][$value] = $row[$value];
}
else
} else
$this->result[$i][$value] = "<i>" . _('report:: non-renseigne') . "</i>";
}
$i ++;

View File

@@ -56,8 +56,7 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
$stmt->closeCursor();
if ($this->enable_limit)
$this->sql .= $this->filter->getLimitFilter() ? : '';
}
else {
} else {
$this->sql = "
SELECT TRIM(" . $this->getTransQuery($this->groupby) . ")
as " . $this->groupby . ", SUM(1) as nb

View File

@@ -72,8 +72,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
$stmt->closeCursor();
$this->sql .= $this->filter->getLimitFilter() ? : '';
}
else {
} else {
$name = $this->groupby;
$field = $this->getTransQuery($this->groupby);

View File

@@ -114,11 +114,9 @@ class module_report_validate extends module_report
$row[$value];
} elseif ($value == 'size') {
$this->result[$i][$value] = p4string::format_octets($row[$value]);
}
else
} else
$this->result[$i][$value] = $row[$value];
}
else {
} else {
if ($value == 'comment') {
$this->result[$i][$value] = '&nbsp;';
} else {