Remove dead code

This commit is contained in:
Romain Neutron
2013-09-04 12:06:48 +02:00
parent c8d415c562
commit dbd06e9091
67 changed files with 63 additions and 378 deletions

View File

@@ -21,12 +21,10 @@ use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
use MediaVorus\Media\MediaInterface; use MediaVorus\Media\MediaInterface;
use MediaVorus\MediaVorus; use MediaVorus\MediaVorus;
use MediaVorus\Exception\FileNotFoundException; use MediaVorus\Exception\FileNotFoundException;
use PHPExiftool\Writer;
use PHPExiftool\Driver\TagFactory; use PHPExiftool\Driver\TagFactory;
use PHPExiftool\Driver\Metadata\Metadata; use PHPExiftool\Driver\Metadata\Metadata;
use PHPExiftool\Driver\Metadata\MetadataBag as ExiftoolMetadataBag; use PHPExiftool\Driver\Metadata\MetadataBag as ExiftoolMetadataBag;
use PHPExiftool\Driver\Value\Mono as MonoValue; use PHPExiftool\Driver\Value\Mono as MonoValue;
use PHPExiftool\Exiftool;
use PHPExiftool\Exception\ExceptionInterface as PHPExiftoolException; use PHPExiftool\Exception\ExceptionInterface as PHPExiftoolException;
/** /**
@@ -149,8 +147,6 @@ class File
} }
} }
$reader = $metadatas = null;
return $this->uuid; return $this->uuid;
} }

View File

@@ -23,7 +23,7 @@ abstract class AbstractPluginCommand extends Command
$output->write("Validating plugins..."); $output->write("Validating plugins...");
foreach ($this->container['plugins.explorer'] as $directory) { foreach ($this->container['plugins.explorer'] as $directory) {
$manifests[] = $manifest = $this->container['plugins.plugins-validator']->validatePlugin($directory); $manifests[] = $this->container['plugins.plugins-validator']->validatePlugin($directory);
} }
$output->writeln(" <comment>OK</comment>"); $output->writeln(" <comment>OK</comment>");

View File

@@ -28,7 +28,7 @@ abstract class AbstractDelivery implements ControllerProviderInterface
{ {
$file = $record->get_subdef($subdef); $file = $record->get_subdef($subdef);
$pathIn = $pathOut = $file->get_pathfile(); $pathOut = $file->get_pathfile();
if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) { if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) {
$pathOut = \recordutils_image::watermark($app, $file); $pathOut = \recordutils_image::watermark($app, $file);

View File

@@ -118,8 +118,6 @@ class Databoxes implements ControllerProviderInterface
*/ */
public function getDatabases(Application $app, Request $request) public function getDatabases(Application $app, Request $request)
{ {
$createBase = $mountBase = false;
$sbasIds = array_merge( $sbasIds = array_merge(
array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_manage'))) array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_manage')))
, array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_modify_struct'))) , array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_modify_struct')))

View File

@@ -248,7 +248,7 @@ class Lazaret implements ControllerProviderInterface
$attributesToKeep = $request->request->get('attributes', array()); $attributesToKeep = $request->request->get('attributes', array());
//Mandatory parameter //Mandatory parameter
if (null === $baseId = $request->request->get('bas_id')) { if (null === $request->request->get('bas_id')) {
$ret['message'] = _('You must give a destination collection'); $ret['message'] = _('You must give a destination collection');
return $app->json($ret); return $app->json($ret);

View File

@@ -324,7 +324,7 @@ class Account implements ControllerProviderInterface
return $app['twig']->render('account/account.html.twig', array( return $app['twig']->render('account/account.html.twig', array(
'user' => $app['authentication']->getUser(), 'user' => $app['authentication']->getUser(),
'evt_mngr' => $app['events-manager'], 'evt_mngr' => $app['events-manager'],
'notifications' => $app['events-manager']->list_notifications_available($app['authentication']->getUser()->get_id()), 'notifications' => $app['events-manager']->list_notifications_available(),
)); ));
} }
@@ -412,7 +412,7 @@ class Account implements ControllerProviderInterface
$requestedNotifications = (array) $request->request->get('notifications', array()); $requestedNotifications = (array) $request->request->get('notifications', array());
foreach ($app['events-manager']->list_notifications_available($app['authentication']->getUser()->get_id()) as $notifications) { foreach ($app['events-manager']->list_notifications_available() as $notifications) {
foreach ($notifications as $notification) { foreach ($notifications as $notification) {
$notifId = $notification['id']; $notifId = $notification['id'];
$notifName = sprintf('notification_%d', $notifId); $notifName = sprintf('notification_%d', $notifId);

View File

@@ -562,7 +562,6 @@ class Thesaurus implements ControllerProviderInterface
{ {
set_time_limit(300); set_time_limit(300);
$imported = false;
$err = ''; $err = '';
if (null === $bid = $request->get("bid")) { if (null === $bid = $request->get("bid")) {
@@ -595,7 +594,6 @@ class Thesaurus implements ControllerProviderInterface
if (($fp = fopen($file, 'rb'))) { if (($fp = fopen($file, 'rb'))) {
$iline = 0; $iline = 0;
$curdepth = -1; $curdepth = -1;
$tid = array(-1 => -1, 0 => -1);
while ( ! $err && ! feof($fp) && ($line = fgets($fp)) !== FALSE) { while ( ! $err && ! feof($fp) && ($line = fgets($fp)) !== FALSE) {
$iline ++; $iline ++;
if (trim($line) == '') { if (trim($line) == '') {
@@ -629,7 +627,6 @@ class Thesaurus implements ControllerProviderInterface
$curdepth = $depth; $curdepth = $depth;
$nid = (int) ($node->getAttribute('nextid')); $nid = (int) ($node->getAttribute('nextid'));
$id = $node->getAttribute('id') . '.' . $nid;
$pid = $node->getAttribute('id'); $pid = $node->getAttribute('id');
$te_id = ($pid ? ($pid . '.') : 'T') . $nid; $te_id = ($pid ? ($pid . '.') : 'T') . $nid;
@@ -645,7 +642,6 @@ class Thesaurus implements ControllerProviderInterface
$nsy = 0; $nsy = 0;
foreach ($tsy as $syn) { foreach ($tsy as $syn) {
$lng = $request->get('piv'); $lng = $request->get('piv');
$hit = '';
$kon = ''; $kon = '';
if (($ob = strpos($syn, '[')) !== false) { if (($ob = strpos($syn, '[')) !== false) {
@@ -659,10 +655,8 @@ class Thesaurus implements ControllerProviderInterface
if (($ob = strpos($syn, '[')) !== false) { if (($ob = strpos($syn, '[')) !== false) {
if (($cb = strpos($syn, ']', $ob)) !== false) { if (($cb = strpos($syn, ']', $ob)) !== false) {
$hit = trim(substr($syn, $ob + 1, $cb - $ob - 1));
$syn = substr($syn, 0, $ob) . substr($syn, $cb + 1); $syn = substr($syn, 0, $ob) . substr($syn, $cb + 1);
} else { } else {
$hit = trim(substr($syn, $ob + 1));
$syn = substr($syn, 0, $ob); $syn = substr($syn, 0, $ob);
} }
} }
@@ -707,7 +701,6 @@ class Thesaurus implements ControllerProviderInterface
} }
if (! $err) { if (! $err) {
$imported = true;
$databox->saveThesaurus($dom); $databox->saveThesaurus($dom);
} }
} }
@@ -784,7 +777,7 @@ class Thesaurus implements ControllerProviderInterface
foreach ($rs as $row) { foreach ($rs as $row) {
try { try {
$connbas = \connection::getPDOConnection($app, $row['sbas_id']); \connection::getPDOConnection($app, $row['sbas_id']);
} catch (\Exception $e) { } catch (\Exception $e) {
continue; continue;
} }
@@ -966,7 +959,6 @@ class Thesaurus implements ControllerProviderInterface
if ($domct && $domst) { if ($domct && $domst) {
$xpathct = new \DOMXPath($domct); $xpathct = new \DOMXPath($domct);
$xpathst = new \DOMXPath($domst);
$ctchanged = false; $ctchanged = false;
$candidates2del = array(); $candidates2del = array();
@@ -1035,7 +1027,7 @@ class Thesaurus implements ControllerProviderInterface
private function fixThesaurus($app, &$domct, &$domth, &$connbas) private function fixThesaurus($app, &$domct, &$domth, &$connbas)
{ {
$oldversion = $version = $domth->documentElement->getAttribute("version"); $version = $domth->documentElement->getAttribute("version");
if ('' === trim($version)) { if ('' === trim($version)) {
$version = '1.0.0'; $version = '1.0.0';
@@ -1057,7 +1049,7 @@ class Thesaurus implements ControllerProviderInterface
public function loadThesaurus(Application $app, Request $request) public function loadThesaurus(Application $app, Request $request)
{ {
if (null === $bid = $request->get("bid")) { if (null === $request->get("bid")) {
return new Response('Missing bid parameter', 400); return new Response('Missing bid parameter', 400);
} }
@@ -1090,7 +1082,7 @@ class Thesaurus implements ControllerProviderInterface
if ($domct && $domth) { if ($domct && $domth) {
$oldversion = $domth->documentElement->getAttribute("version"); $oldversion = $domth->documentElement->getAttribute("version");
if (($version = $this->fixThesaurus($app, $domct, $domth, $connbas)) != $oldversion) { if ($this->fixThesaurus($app, $domct, $domth, $connbas) != $oldversion) {
$updated = true; $updated = true;
$databox->saveCterms($domct); $databox->saveCterms($domct);
$databox->saveThesaurus($domth); $databox->saveThesaurus($domth);
@@ -1266,7 +1258,7 @@ class Thesaurus implements ControllerProviderInterface
try { try {
$databox = $app['phraseanet.appbox']->get_databox((int) $bid); $databox = $app['phraseanet.appbox']->get_databox((int) $bid);
$connbas = \connection::getPDOConnection($app, $bid); \connection::getPDOConnection($app, $bid);
$dom = $databox->get_dom_cterms(); $dom = $databox->get_dom_cterms();
$xpath = new \DOMXPath($dom); $xpath = new \DOMXPath($dom);
@@ -1884,9 +1876,6 @@ class Thesaurus implements ControllerProviderInterface
$r->setAttribute("id", "C"); $r->setAttribute("id", "C");
} }
} else { } else {
$xmlct = str_replace(array("\r", "\n", "\t"), array("", "", ""), $domct->saveXML());
$xmlte = str_replace(array("\r", "\n", "\t"), array("", "", ""), $dom->saveXML());
$databox->saveThesaurus($dom); $databox->saveThesaurus($dom);
$r = $refresh_list->appendChild($ret->createElement("refresh")); $r = $refresh_list->appendChild($ret->createElement("refresh"));
@@ -1902,11 +1891,9 @@ class Thesaurus implements ControllerProviderInterface
if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) { if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) {
$sl = $ret->importNode($sl, true); $sl = $ret->importNode($sl, true);
$sy_list = $root->appendChild($sl);
} }
if ($request->get('debug')) { if ($request->get('debug')) {
printf("url: %s<br/>\n", $url);
printf("<pre>" . $ret2->saveXML() . "</pre>"); printf("<pre>" . $ret2->saveXML() . "</pre>");
} }
} }
@@ -2651,7 +2638,6 @@ class Thesaurus implements ControllerProviderInterface
if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) { if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) {
$sl = $ret->importNode($sl, true); $sl = $ret->importNode($sl, true);
$sy_list = $root->appendChild($sl);
} }
if ($request->get('debug')) { if ($request->get('debug')) {
@@ -3018,9 +3004,6 @@ class Thesaurus implements ControllerProviderInterface
} }
} elseif ($n->nodeName == "sy") { } elseif ($n->nodeName == "sy") {
$t = $n->getAttribute("v"); $t = $n->getAttribute("v");
if ($k = $n->getAttribute("k")) {
// $t .= " ($k)";
}
$allsy .= ( $allsy ? " ; " : "") . $t; $allsy .= ( $allsy ? " ; " : "") . $t;
} }
} }
@@ -3113,7 +3096,7 @@ class Thesaurus implements ControllerProviderInterface
public function searchCandidateXml(Application $app, Request $request) public function searchCandidateXml(Application $app, Request $request)
{ {
if (null === $bid = $request->get("bid")) { if (null === $request->get("bid")) {
return new Response('Missing bid parameter', 400); return new Response('Missing bid parameter', 400);
} }

View File

@@ -933,13 +933,9 @@ class Xmlhttp implements ControllerProviderInterface
} }
if ($dom) { if ($dom) {
$term0 = '';
$firstTerm0 = '';
$xpath = new \DOMXPath($dom); $xpath = new \DOMXPath($dom);
if ($thid == 'T' || $thid == 'C') { if ($thid == 'T' || $thid == 'C') {
$q = '/' . $xqroot; $q = '/' . $xqroot;
$term0 = $dbname;
} else { } else {
$q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']'; $q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']';
} }
@@ -1454,7 +1450,7 @@ class Xmlhttp implements ControllerProviderInterface
$xp = '//te[@id="' . $tid . '"]/sy'; $xp = '//te[@id="' . $tid . '"]/sy';
$nodes = $xpathct->query($xp); $nodes = $xpathct->query($xp);
if ($nodes->length == 1) { if ($nodes->length == 1) {
$sy = $term = $nodes->item(0); $sy = $nodes->item(0);
$syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd'; $syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd';
$lid .= ( $lid ? ',' : '') . "'" . $syid . "'"; $lid .= ( $lid ? ',' : '') . "'" . $syid . "'";
$field = $sy->parentNode->parentNode->getAttribute('field'); $field = $sy->parentNode->parentNode->getAttribute('field');
@@ -1625,7 +1621,6 @@ class Xmlhttp implements ControllerProviderInterface
$html = ''; $html = '';
$sbid = (int) $request->get('sbid'); $sbid = (int) $request->get('sbid');
$dbname = '';
try { try {
$databox = $app['phraseanet.appbox']->get_databox($sbid); $databox = $app['phraseanet.appbox']->get_databox($sbid);

View File

@@ -152,14 +152,4 @@ class PhraseaRegisterForm extends AbstractType
{ {
return $this->available[$name]['type']; return $this->available[$name]['type'];
} }
private function getLabel($name)
{
return $this->available[$name]['label'];
}
private function getConstraints($name, array $constraints = array())
{
return isset($this->available[$name]['constraints']) ? $this->available[$name]['constraints'] : array();
}
} }

View File

@@ -229,8 +229,6 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$msk_and = null;
$msk_xor = null;
$tbits_and = array(); $tbits_and = array();
$tbits_xor = array(); $tbits_xor = array();

View File

@@ -81,8 +81,6 @@ class Manage extends Helper
public function search() public function search()
{ {
$request = $this->request;
$offset_start = (int) $this->request->get('offset_start'); $offset_start = (int) $this->request->get('offset_start');
$offset_start = $offset_start < 0 ? 0 : $offset_start; $offset_start = $offset_start < 0 ? 0 : $offset_start;
$results_quantity = (int) $this->request->get('per_page'); $results_quantity = (int) $this->request->get('per_page');

View File

@@ -78,6 +78,5 @@ class WorkZone extends Helper
protected function sortBaskets(array $baskets) protected function sortBaskets(array $baskets)
{ {
$tmp_baskets = array();
} }
} }

View File

@@ -219,15 +219,12 @@ class PDF
$this->pdf->AddPage(); $this->pdf->AddPage();
$oldMargins = $this->pdf->getMargins(); $oldMargins = $this->pdf->getMargins();
$tmargin = $oldMargins['top'];
$lmargin = $oldMargins['left']; $lmargin = $oldMargins['left'];
$bmargin = $oldMargins['bottom'];
$rmargin = $oldMargins['right']; $rmargin = $oldMargins['right'];
$this->pdf->SetLeftMargin($lmargin + 55); $this->pdf->SetLeftMargin($lmargin + 55);
$ndoc = 0; $ndoc = 0;
$lastpage = $this->pdf->PageNo();
foreach ($this->records as $rec) { foreach ($this->records as $rec) {
/* @var $rec record_adapter */ /* @var $rec record_adapter */
$subdef = $rec->get_subdef('thumbnail'); $subdef = $rec->get_subdef('thumbnail');
@@ -324,7 +321,6 @@ class PDF
$rec->set_number($this->pdf->PageNo()); $rec->set_number($this->pdf->PageNo());
} }
$lmargin = $this->pdf->GetX(); $lmargin = $this->pdf->GetX();
$tmargin = $this->pdf->GetY();
$himg = 0; $himg = 0;
$y = 0; $y = 0;
$miniConv = NULL; $miniConv = NULL;

View File

@@ -27,7 +27,7 @@ class PhraseaPDF extends \TCPDF
public function Footer() public function Footer()
{ {
$ml = $this->SetLeftMargin(0); $this->SetLeftMargin(0);
$mr = $this->SetRightMargin(0); $mr = $this->SetRightMargin(0);
$this->SetY(-15); $this->SetY(-15);

View File

@@ -454,8 +454,6 @@ class PhraseaEngineQueryParser
public function _extendThesaurusOnTerms(&$tree, &$copy, $useFullText, $useThesaurus, $keepfuzzy, $depth, $path) public function _extendThesaurusOnTerms(&$tree, &$copy, $useFullText, $useThesaurus, $keepfuzzy, $depth, $path)
{ {
if ($depth == 0)
$ret = $tree;
if (!$useThesaurus) { if (!$useThesaurus) {
return; // full-text only : inchangé return; // full-text only : inchangé
} }
@@ -586,7 +584,7 @@ class PhraseaEngineQueryParser
$ambigus = 0; $ambigus = 0;
if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON) { if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON) {
$ambigus = $this->setTids($tree, $bid, $domthe, $searchsynonyms); $ambigus = $this->setTids($tree, $bid, $domthe);
} elseif ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") { } elseif ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") {
$ambigus += $this->thesaurus2($tree["LB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1); $ambigus += $this->thesaurus2($tree["LB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1);
$ambigus += $this->thesaurus2($tree["RB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1); $ambigus += $this->thesaurus2($tree["RB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1);
@@ -597,7 +595,6 @@ class PhraseaEngineQueryParser
public function propAsHTML(&$node, &$html, $path, $depth = 0) public function propAsHTML(&$node, &$html, $path, $depth = 0)
{ {
global $parm;
if ($depth > 0) { if ($depth > 0) {
$tsy = array(); $tsy = array();
$lngfound = "?"; $lngfound = "?";
@@ -676,9 +673,6 @@ class PhraseaEngineQueryParser
public function _queryAsHTML($tree, $depth = 0) public function _queryAsHTML($tree, $depth = 0)
{ {
if ($depth == 0) {
$ambiguites = array("n" => 0, "refs" => array());
}
switch ($tree["CLASS"]) { switch ($tree["CLASS"]) {
case "SIMPLE": case "SIMPLE":
case "QSIMPLE": case "QSIMPLE":
@@ -720,7 +714,7 @@ class PhraseaEngineQueryParser
} }
} }
public function setTids(&$tree, $bid, &$domthe, $searchsynonyms) public function setTids(&$tree, $bid, &$domthe)
{ {
if ($this->debug) if ($this->debug)
print("============================ setTids:\n\$tree=" . var_export($tree, true) . "\n"); print("============================ setTids:\n\$tree=" . var_export($tree, true) . "\n");
@@ -761,7 +755,6 @@ class PhraseaEngineQueryParser
// $this->thesaurusDOMNodes[] = $nodes->item(0); // $this->thesaurusDOMNodes[] = $nodes->item(0);
} else { } else {
// on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$') // on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$')
$val = "";
foreach ($nodes as $node) { foreach ($nodes as $node) {
if (!isset($tree["CONTEXT"])) if (!isset($tree["CONTEXT"]))
$ambigus++; $ambigus++;
@@ -865,7 +858,6 @@ class PhraseaEngineQueryParser
switch ($tree["CLASS"]) { switch ($tree["CLASS"]) {
case "SIMPLE": case "SIMPLE":
case "QSIMPLE": case "QSIMPLE":
$prelink = $postlink = "";
$w = is_array($tree["VALUE"]) ? implode(" ", $tree["VALUE"]) : $tree["VALUE"]; $w = is_array($tree["VALUE"]) ? implode(" ", $tree["VALUE"]) : $tree["VALUE"];
$tab = "\n" . str_repeat("\t", $depth); $tab = "\n" . str_repeat("\t", $depth);
if (isset($tree["TIDS"]) && count($tree["TIDS"]) > 1) { if (isset($tree["TIDS"]) && count($tree["TIDS"]) > 1) {

View File

@@ -96,7 +96,7 @@ class StoryWZRepository extends EntityRepository
if ($story) { if ($story) {
try { try {
$record = $story->getRecord($app); $story->getRecord($app);
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$this->getEntityManager()->remove($story); $this->getEntityManager()->remove($story);
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();
@@ -122,7 +122,7 @@ class StoryWZRepository extends EntityRepository
foreach ($stories as $key => $story) { foreach ($stories as $key => $story) {
try { try {
$record = $story->getRecord($app); $story->getRecord($app);
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$this->getEntityManager()->remove($story); $this->getEntityManager()->remove($story);
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();
@@ -146,7 +146,7 @@ class StoryWZRepository extends EntityRepository
foreach ($stories as $key => $story) { foreach ($stories as $key => $story) {
try { try {
$record = $story->getRecord($app); $story->getRecord($app);
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$this->getEntityManager()->remove($story); $this->getEntityManager()->remove($story);
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();

View File

@@ -687,7 +687,6 @@ class ACL implements cache_cacheableInterface
} }
$base_id = $collection->get_base_id(); $base_id = $collection->get_base_id();
$datas = $this->_rights_bas[$base_id];
foreach ($rights as $right) { foreach ($rights as $right) {
if (!$this->has_right_on_base($base_id, $right)) { if (!$this->has_right_on_base($base_id, $right)) {

View File

@@ -9,7 +9,6 @@ use Symfony\Component\HttpKernel\KernelEvents;
class API_V1_Timer implements ServiceProviderInterface class API_V1_Timer implements ServiceProviderInterface
{ {
private $app;
private $starting; private $starting;
public function __construct() public function __construct()

View File

@@ -1239,7 +1239,7 @@ class API_V1_adapter extends API_V1_Abstract
{ {
$result = new API_V1_result($this->app, $request, $this); $result = new API_V1_result($this->app, $request, $this);
$usr_id = $session = $this->app['authentication']->getUser()->get_id(); $usr_id = $this->app['authentication']->getUser()->get_id();
$result->set_datas(array('baskets' => $this->list_baskets($usr_id))); $result->set_datas(array('baskets' => $this->list_baskets($usr_id)));

View File

@@ -375,7 +375,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
switch ($object) { switch ($object) {
case self::ELEMENT_TYPE_VIDEO : case self::ELEMENT_TYPE_VIDEO :
$url = sprintf("POST /video/%s", $object_id); $url = sprintf("POST /video/%s", $object_id);
$result = $this->_api->call($url, $params, $this->oauth_token); $this->_api->call($url, $params, $this->oauth_token);
break; break;
default: default:
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
@@ -432,7 +432,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
$url = sprintf('POST /%s/%s/%ss', $destination, $container_id, $element_type); $url = sprintf('POST /%s/%s/%ss', $destination, $container_id, $element_type);
$result = $this->_api->call($url, array('ids' => implode(",", $array)), $this->oauth_token); $this->_api->call($url, array('ids' => implode(",", $array)), $this->oauth_token);
return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id); return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id);
break; break;
@@ -458,10 +458,10 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
$url = sprintf("DELETE /%s/%s", $object, $object_id); $url = sprintf("DELETE /%s/%s", $object, $object_id);
switch ($object) { switch ($object) {
case self::ELEMENT_TYPE_VIDEO: case self::ELEMENT_TYPE_VIDEO:
$result = $this->_api->call($url, array(), $this->oauth_token); $this->_api->call($url, array(), $this->oauth_token);
break; break;
case self::CONTAINER_TYPE_PLAYLIST: case self::CONTAINER_TYPE_PLAYLIST:
$result = $this->_api->call($url, array(), $this->oauth_token); $this->_api->call($url, array(), $this->oauth_token);
break; break;
default: default:
throw new Bridge_Exception_ObjectUnknown('Unknown object ' . $object); throw new Bridge_Exception_ObjectUnknown('Unknown object ' . $object);

View File

@@ -837,7 +837,6 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
$xml = $response->getXml(); $xml = $response->getXml();
$complete = isset($xml->uploader->ticket["complete"]) ? (string) $xml->uploader->ticket["complete"] : null; $complete = isset($xml->uploader->ticket["complete"]) ? (string) $xml->uploader->ticket["complete"] : null;
$invalid = isset($xml->uploader->ticket["invalid"]) ? (string) $xml->uploader->ticket["invalid"] : null;
if ($complete) { if ($complete) {
if ((int) $complete == 0) if ((int) $complete == 0)

View File

@@ -564,7 +564,6 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
} }
if ($error = $this->parse_xml_error($response->getBody())) { if ($error = $this->parse_xml_error($response->getBody())) {
$type = $error['type'];
$code = $error['code']; $code = $error['code'];
if ($code == "too_many_recent_calls") { if ($code == "too_many_recent_calls") {

View File

@@ -1079,7 +1079,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
protected function load_notifications_preferences(Application $app) protected function load_notifications_preferences(Application $app)
{ {
$notifications = $app['events-manager']->list_notifications_available($this->id); $notifications = $app['events-manager']->list_notifications_available();
foreach ($notifications as $notification_group => $nots) { foreach ($notifications as $notification_group => $nots) {
foreach ($nots as $notification) { foreach ($nots as $notification) {

View File

@@ -266,8 +266,6 @@ class User_Query implements User_QueryInterface
$sql .= $this->generate_field_constraints('lastModel', $this->templates); $sql .= $this->generate_field_constraints('lastModel', $this->templates);
} }
$baslist = array();
if (count($this->base_ids) == 0) { if (count($this->base_ids) == 0) {
if ($this->bases_restrictions) if ($this->bases_restrictions)
throw new Exception('No base available for you, not enough rights'); throw new Exception('No base available for you, not enough rights');

View File

@@ -191,7 +191,6 @@ class caption_Field_Value implements cache_cacheableInterface
$this->delete_data_from_cache(); $this->delete_data_from_cache();
$this->databox_field->delete_data_from_cache(); $this->databox_field->delete_data_from_cache();
$sbas_id = $this->record->get_sbas_id();
$this->record->get_caption()->delete_data_from_cache(); $this->record->get_caption()->delete_data_from_cache();
return $this; return $this;
@@ -247,7 +246,6 @@ class caption_Field_Value implements cache_cacheableInterface
{ {
$this->value = $value; $this->value = $value;
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
$connbas = $this->databox_field->get_connection(); $connbas = $this->databox_field->get_connection();
$params = array( $params = array(
@@ -491,7 +489,6 @@ class caption_Field_Value implements cache_cacheableInterface
*/ */
public function delete_data_from_cache($option = null) public function delete_data_from_cache($option = null)
{ {
$databox = $this->record->get_databox();
$this->value = $this->VocabularyId = $this->VocabularyType = null; $this->value = $this->VocabularyId = $this->VocabularyType = null;
$this->record->delete_data_from_cache(record_adapter::CACHE_TITLE); $this->record->delete_data_from_cache(record_adapter::CACHE_TITLE);

View File

@@ -586,7 +586,7 @@ class databox extends base
*/ */
public static function mount(Application $app, $host, $port, $user, $password, $dbname, registry $registry) public static function mount(Application $app, $host, $port, $user, $password, $dbname, registry $registry)
{ {
$connection = new connection_pdo('test', $host, $port, $user, $password, $dbname, array(), $app['debug']); new connection_pdo('test', $host, $port, $user, $password, $dbname, array(), $app['debug']);
$conn = $app['phraseanet.appbox']->get_connection(); $conn = $app['phraseanet.appbox']->get_connection();
$sql = 'SELECT MAX(ord) as ord FROM sbas'; $sql = 'SELECT MAX(ord) as ord FROM sbas';
@@ -838,9 +838,6 @@ class databox extends base
$this->_sxml_structure = $this->_dom_structure = $this->_xpath_structure = null; $this->_sxml_structure = $this->_dom_structure = $this->_xpath_structure = null;
$com_struct = $this->get_dom_structure();
$xp_struct = $this->get_xpath_structure();
$this->meta_struct = null; $this->meta_struct = null;
$this->app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES); $this->app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES);
@@ -1139,7 +1136,6 @@ class databox extends base
unset($e); unset($e);
} }
$thesaurus = false;
try { try {
$sql = 'SELECT value AS thesaurus FROM pref WHERE prop="thesaurus" LIMIT 1;'; $sql = 'SELECT value AS thesaurus FROM pref WHERE prop="thesaurus" LIMIT 1;';
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
@@ -1418,7 +1414,6 @@ class databox extends base
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
$stmt->execute(array(':terms' => $terms, ':locale' => $locale)); $stmt->execute(array(':terms' => $terms, ':locale' => $locale));
$stmt->closeCursor(); $stmt->closeCursor();
$update = true;
$this->cgus = null; $this->cgus = null;
$this->delete_data_from_cache(self::CACHE_CGUS); $this->delete_data_from_cache(self::CACHE_CGUS);

View File

@@ -434,7 +434,6 @@ class databox_field implements cache_cacheableInterface
} else { } else {
$meta = $nodes->item(0); $meta = $nodes->item(0);
$current_name = $meta->nodeName;
if ($this->name != $meta->nodeName) { if ($this->name != $meta->nodeName) {
$old_meta = $meta; $old_meta = $meta;
$meta = $dom_struct->createElement($this->name); $meta = $dom_struct->createElement($this->name);

View File

@@ -260,7 +260,7 @@ class databox_status
$doc = $databox->get_dom_structure(); $doc = $databox->get_dom_structure();
if ($doc) { if ($doc) {
$xpath = $databox->get_xpath_structure(); $xpath = $databox->get_xpath_structure();
$entries = $xpath->query($q = "/record/statbits/bit[@n=" . $bit . "]"); $entries = $xpath->query("/record/statbits/bit[@n=" . $bit . "]");
foreach ($entries as $sbit) { foreach ($entries as $sbit) {
if ($p = $sbit->previousSibling) { if ($p = $sbit->previousSibling) {

View File

@@ -231,7 +231,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
foreach ($labels as $code => $label) { foreach ($labels as $code => $label) {
$child = $dom_struct->createElement('label'); $child = $dom_struct->createElement('label');
$labelElement = $child->appendChild($dom_struct->createTextNode($label)); $child->appendChild($dom_struct->createTextNode($label));
$lang = $child->appendChild($dom_struct->createAttribute('lang')); $lang = $child->appendChild($dom_struct->createAttribute('lang'));
$lang->value = $code; $lang->value = $code;
$subdef->appendChild($child); $subdef->appendChild($child);

View File

@@ -110,10 +110,8 @@ function giveMeBases(Application $app, $usr = null)
$cguColl = false; $cguColl = false;
$collInscript = $baseInscript; $collInscript = $baseInscript;
$defined = false;
$cguSpec = false; $cguSpec = false;
if (false !== $xml = simplexml_load_string($collection->get_prefs())) { if (false !== $xml = simplexml_load_string($collection->get_prefs())) {
$defined = true;
foreach ($xml->xpath('/baseprefs/caninscript') as $caninscript) { foreach ($xml->xpath('/baseprefs/caninscript') as $caninscript) {
$tmp = (string) $caninscript; $tmp = (string) $caninscript;
if ($tmp === "1") if ($tmp === "1")
@@ -170,7 +168,7 @@ function giveMeBases(Application $app, $usr = null)
return $inscriptions; return $inscriptions;
} }
function giveMeBaseUsr(Application $app, $usr, $lng) function giveMeBaseUsr(Application $app, $usr)
{ {
$noDemand = true; $noDemand = true;
@@ -308,7 +306,7 @@ function giveModInscript($usr, $lng)
'<form id="conf_mod" target="_self" action="mod_inscript.php" method="post">' . '<form id="conf_mod" target="_self" action="mod_inscript.php" method="post">' .
'<div style="width:400px;center;margin:0 100px;">'; '<div style="width:400px;center;margin:0 100px;">';
$demandes = giveMeBaseUsr($app, $usr, $lng); $demandes = giveMeBaseUsr($app, $usr);
$out .= $demandes['tab']; $out .= $demandes['tab'];
@@ -331,75 +329,3 @@ function giveModInscript($usr, $lng)
return $out; return $out;
} }
function giveInscript(Application $app, $lng, $demandes = null)
{
$out = '<table border="0" style="table-layout:fixed" cellspacing=0 width="590">' .
'<tr>' .
'<td style="width:240px; text-align:right">&nbsp;</td>' .
'<td width="25px" style="width:25px">&nbsp;</td>' .
'<td style="width:325px;">&nbsp;</td>' .
'</tr>';
$inscriptions = giveMeBases($app);
foreach ($inscriptions as $sbasId => $baseInsc) {
if (($baseInsc['CollsCGU'] || $baseInsc['Colls']) && $baseInsc['inscript']) {// il y a des coll ou s'inscrire !
//je pr<70>sente la base
$out .= '<tr><td colspan="3" style="text-align:center;"><h3 style="margin: 15px 0pt 2px;" class="inscriptbase">' . phrasea::sbas_labels($sbasId, $app) . '</h3></td></tr>';
if ($baseInsc['Colls']) {//des coll ou on peut s'inscrire sans cgu specifiques
//je check si ya des cgu pour la base
if ($baseInsc['CGU']) {
$out .= '<tr><td colspan="3" style="text-align:center;">' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>';
//$out .= '<tr><td colspan="3" style="text-align:center;"><div id="CGUTXT'.$sbasId.'" style="width:90%;height:120px;text-align:left;overflow:auto;">'.(string) $baseInsc['CGU'].'</div></td></tr>';
}
foreach ($baseInsc['Colls'] as $collId => $collName) {
$baseId = phrasea::baseFromColl($sbasId, $collId, $app);
$ch = "checked";
if (( ! is_null($demandes) && ! isset($demandes[$baseId])))
$ch = "";
$out .= '<tr>' .
'<td style="text-align:right;">' . $collName . '</td>' .
'<td></td>' .
'<td class="TD_R" style="width:200px;">' .
'<input style="width:15px;" class="checkbox" type="checkbox" ' . $ch . ' name="demand[]" value="' . $baseId . '" >' .
'<span>' . _('login::register: Faire une demande d\'acces') . '</span>' .
'</td>' .
'</tr>';
}
}
if ($baseInsc['CollsCGU']) {
foreach ($baseInsc['CollsCGU'] as $collId => $collDesc) {
$baseId = phrasea::baseFromColl($sbasId, $collId, $app);
$ch = "checked";
if ( ! is_null($demandes) && ! isset($demandes[$baseId]))
$ch = "";
$out .= '<tr><td colspan="3" style="text-align:center;"><hr style="width:80%"/></td></tr>' .
'<tr><td colspan="3" style="text-align:center;">' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') .
'<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '&col=' . $collId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>' .
// '<tr >' .
// '<td colspan="3" style="text-align:center;"><div style="height:120px;text-align:left;overflow:auto;">' .
// ''.(string) $collDesc['CGU'].'' .
// '</div></td>' .
// '</tr>' .
'<tr >' .
'<td style="text-align:right;">' . $collDesc['name'] . '</td>' .
'<td></td>' .
'<td class="TD_R" style="width:200px;">' .
'<input style="width:15px;" class="checkbox" type="checkbox" ' . $ch . ' name="demand[]" value="' . $baseId . '" >' .
'<span>' . _('login::register: Faire une demande d\'acces') . '</span>' .
'</td>' .
'</tr>';
}
}
}
}
$out .= '</table>';
return $out;
}

View File

@@ -4,7 +4,6 @@ use Alchemy\Phrasea\Application;
class eventsmanager_broker class eventsmanager_broker
{ {
private static $_instance = false;
protected $events = array(); protected $events = array();
protected $notifications = array(); protected $notifications = array();
protected $pool_classes = array(); protected $pool_classes = array();
@@ -113,7 +112,6 @@ class eventsmanager_broker
public function get_notifications_as_array($page = 0) public function get_notifications_as_array($page = 0)
{ {
$unread = 0;
$total = 0; $total = 0;
$sql = 'SELECT count(id) as total, sum(unread) as unread $sql = 'SELECT count(id) as total, sum(unread) as unread
@@ -125,7 +123,6 @@ class eventsmanager_broker
$stmt->closeCursor(); $stmt->closeCursor();
if ($row) { if ($row) {
$unread = $row['unread'];
$total = $row['total']; $total = $row['total'];
} }
@@ -203,7 +200,6 @@ class eventsmanager_broker
public function get_notifications() public function get_notifications()
{ {
$unread = 0; $unread = 0;
$total = 0;
$sql = 'SELECT count(id) as total, sum(unread) as unread $sql = 'SELECT count(id) as total, sum(unread) as unread
FROM notifications WHERE usr_id = :usr_id'; FROM notifications WHERE usr_id = :usr_id';
@@ -215,7 +211,6 @@ class eventsmanager_broker
if ($row) { if ($row) {
$unread = $row['unread']; $unread = $row['unread'];
$total = $row['total'];
} }
if ($unread < 3) { if ($unread < 3) {
@@ -226,7 +221,7 @@ class eventsmanager_broker
WHERE usr_id = :usr_id AND unread="1" ORDER BY created_on DESC'; WHERE usr_id = :usr_id AND unread="1" ORDER BY created_on DESC';
} }
$ret = $bloc = array(); $ret = array();
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(array(':usr_id' => $this->app['authentication']->getUser()->get_id())); $stmt->execute(array(':usr_id' => $this->app['authentication']->getUser()->get_id()));
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -258,8 +253,6 @@ class eventsmanager_broker
); );
} }
$html = '';
return $ret; return $ret;
} }
@@ -280,21 +273,8 @@ class eventsmanager_broker
return $this; return $this;
} }
public function mailed($notification, $usr_id) public function list_notifications_available()
{ {
$sql = 'UPDATE notifications SET mailed="0"
WHERE usr_id = :usr_id AND id = :notif_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(array(':usr_id' => $usr_id, ':notif_id' => $notifications));
$stmt->closeCursor();
return;
}
public function list_notifications_available($usr_id)
{
$personnal_notifications = array(); $personnal_notifications = array();
foreach ($this->notifications as $notification) { foreach ($this->notifications as $notification) {

View File

@@ -147,7 +147,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
$usr_id = (string) $sx->usr_id; $usr_id = (string) $sx->usr_id;
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -82,16 +82,6 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract
$mailed = false; $mailed = false;
if ($this->shouldSendNotificationFor($params['usr_id'])) { if ($this->shouldSendNotificationFor($params['usr_id'])) {
$user = User_Adapter::getInstance($params['usr_id'], $this->app);
$name = $user->get_display_name();
$to = array('email' => $user->get_email(), 'name' => $name);
$from = array(
'email' => $this->app['phraseanet.registry']->get('GV_defaulmailsenderaddr'),
'name' => $this->app['phraseanet.registry']->get('GV_homeTitle')
);
if (parent::email()) if (parent::email())
$mailed = true; $mailed = true;
} }
@@ -110,10 +100,7 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract
public function datas($datas, $unread) public function datas($datas, $unread)
{ {
$sx = simplexml_load_string($datas); $sx = simplexml_load_string($datas);
$usr_id = (int) $sx->usr_id;
$reason = (int) $sx->reason; $reason = (int) $sx->reason;
$lst = (string) $sx->lst;
$ssttid = (int) $sx->ssttid;
$dest = (string) $sx->dest; $dest = (string) $sx->dest;
if ($reason == self::MAIL_NO_VALID) { if ($reason == self::MAIL_NO_VALID) {

View File

@@ -79,11 +79,6 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
$start = 0; $start = 0;
$perLoop = 100; $perLoop = 100;
$from = array(
'email' => $entry->get_author_email(),
'name' => $entry->get_author_name()
);
do { do {
$results = $Query->limit($start, $perLoop)->execute()->get_results(); $results = $Query->limit($start, $perLoop)->execute()->get_results();

View File

@@ -145,7 +145,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
$order_id = (string) $sx->order_id; $order_id = (string) $sx->order_id;
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -151,7 +151,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
$n = (int) $sx->n; $n = (int) $sx->n;
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -113,7 +113,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
$n = (int) $sx->n; $n = (int) $sx->n;
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -126,7 +126,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
$from = (string) $sx->from; $from = (string) $sx->from;
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -157,7 +157,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
$usr_id = (string) $sx->usr_id; $usr_id = (string) $sx->usr_id;
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -137,7 +137,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
$ssel_id = (string) $sx->ssel_id; $ssel_id = (string) $sx->ssel_id;
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -137,7 +137,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
$ssel_id = (string) $sx->ssel_id; $ssel_id = (string) $sx->ssel_id;
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (Exception $e) {
return array(); return array();
} }

View File

@@ -12,7 +12,7 @@ class ftpclient
{ {
$host = mb_substr($host, -1, 1) == '/' ? mb_substr($host, 0, (mb_strlen($host) - 1)) : $host; $host = mb_substr($host, -1, 1) == '/' ? mb_substr($host, 0, (mb_strlen($host) - 1)) : $host;
if (($p = mb_strpos($host, 'ftp://')) !== false) if (mb_strpos($host, 'ftp://') !== false)
$host = mb_substr($host, 6); $host = mb_substr($host, 6);
$host = $proxy ? $proxy : $host; $host = $proxy ? $proxy : $host;

View File

@@ -109,7 +109,6 @@ class module_console_taskrun extends Command
); );
$tmpTask = $task_manager->getTask($task_id, null); $tmpTask = $task_manager->getTask($task_id, null);
$taskname = $tmpTask->getName();
unset($tmpTask); unset($tmpTask);
if (($ttyloglevel = strtoupper($input->getOption('ttyloglevel'))) != '') { if (($ttyloglevel = strtoupper($input->getOption('ttyloglevel'))) != '') {

View File

@@ -727,7 +727,7 @@ class module_report
* effectue le mechanism de pagination * effectue le mechanism de pagination
* @param resultset $rs * @param resultset $rs
*/ */
protected function calculatePages($rs) protected function calculatePages()
{ {
if ($this->nb_record && $this->total > $this->nb_record) { if ($this->nb_record && $this->total > $this->nb_record) {
$this->previous_page = $this->nb_page - 1; $this->previous_page = $this->nb_page - 1;
@@ -843,7 +843,7 @@ class module_report
//construct results //construct results
$this->buildResult($this->app, $rs); $this->buildResult($this->app, $rs);
//calculate prev and next page //calculate prev and next page
$this->calculatePages($rs); $this->calculatePages();
//do we display navigator ? //do we display navigator ?
$this->setDisplayNav(); $this->setDisplayNav();
//assign all variables //assign all variables

View File

@@ -131,7 +131,7 @@ class module_report_activity extends module_report
$this->result[] = $res; $this->result[] = $res;
//calculate prev and next page //calculate prev and next page
$this->calculatePages($rs); $this->calculatePages();
//display navigator //display navigator
$this->setDisplayNav(); $this->setDisplayNav();
//set report //set report
@@ -251,7 +251,7 @@ class module_report_activity extends module_report
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
//calculate prev and next page //calculate prev and next page
$this->calculatePages($rs); $this->calculatePages();
//do we display navigator ? //do we display navigator ?
$this->setDisplayNav(); $this->setDisplayNav();
//set report //set report
@@ -357,7 +357,6 @@ class module_report_activity extends module_report
$this->setChamp($rs); $this->setChamp($rs);
$this->setDisplay($tab); $this->setDisplay($tab);
$save_date = "";
$total = array('tot_doc' => 0, 'tot_prev' => 0, 'tot_dl' => 0); $total = array('tot_doc' => 0, 'tot_prev' => 0, 'tot_dl' => 0);
$i = -1; $i = -1;
@@ -398,7 +397,7 @@ class module_report_activity extends module_report
$this->result[$nb_row]['preview'] = '<b>' . $total['tot_prev'] . '</b>'; $this->result[$nb_row]['preview'] = '<b>' . $total['tot_prev'] . '</b>';
$this->result[$nb_row]['total'] = '<b>' . $total['tot_dl'] . '</b>'; $this->result[$nb_row]['total'] = '<b>' . $total['tot_dl'] . '</b>';
} }
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -482,7 +481,7 @@ class module_report_activity extends module_report
$this->result[$i][$on] = '<b>TOTAL</b>'; $this->result[$i][$on] = '<b>TOTAL</b>';
} }
//calculate prev and next page //calculate prev and next page
$this->calculatePages($rs); $this->calculatePages();
//do we display navigator ? //do we display navigator ?
$this->setDisplayNav(); $this->setDisplayNav();
//set report //set report
@@ -609,7 +608,7 @@ class module_report_activity extends module_report
'<b>' . p4string::format_octets($total['poidprev']) . '</b>'; '<b>' . p4string::format_octets($total['poidprev']) . '</b>';
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -653,7 +652,6 @@ class module_report_activity extends module_report
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$save_id = "";
foreach ($rs as $row) { foreach ($rs as $row) {
$kttd = 'top_ten_doc'; $kttd = 'top_ten_doc';
$kttp = 'top_ten_poiddoc'; $kttp = 'top_ten_poiddoc';
@@ -692,7 +690,6 @@ class module_report_activity extends module_report
$result[$kttpp][$id]['id'] = $id; $result[$kttpp][$id]['id'] = $id;
} }
} }
$save_id = $id;
} }
return $result; return $result;

View File

@@ -96,7 +96,6 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
public function __construct(Application $app, $sbasid, $sbas_collection, $dmin, $dmax) public function __construct(Application $app, $sbasid, $sbas_collection, $dmin, $dmax)
{ {
$this->app = $app; $this->app = $app;
$conn = connection::getPDOConnection($app, $sbasid);
$this->dmin = $dmin; $this->dmin = $dmin;
$this->dmax = $dmax; $this->dmax = $dmax;
$this->dminsql = $this->dateToSqlDate('dmin'); $this->dminsql = $this->dateToSqlDate('dmin');

View File

@@ -142,7 +142,7 @@ class module_report_nav extends module_report
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -200,7 +200,7 @@ class module_report_nav extends module_report
$this->report['legend'][] = $row['os']; $this->report['legend'][] = $row['os'];
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -261,7 +261,7 @@ class module_report_nav extends module_report
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -320,7 +320,7 @@ class module_report_nav extends module_report
$this->report['legend'][] = $row['combo']; $this->report['legend'][] = $row['combo'];
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -401,7 +401,7 @@ class module_report_nav extends module_report
$this->report['legend'][] = $appli; $this->report['legend'][] = $appli;
} }
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -475,7 +475,7 @@ class module_report_nav extends module_report
_('report:: Information sur l\'utilisateur %s'), $login _('report:: Information sur l\'utilisateur %s'), $login
); );
} }
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();
@@ -566,7 +566,7 @@ class module_report_nav extends module_report
$this->result = $rs; $this->result = $rs;
$this->total = sizeof($this->result); $this->total = sizeof($this->result);
$this->calculatePages($rs); $this->calculatePages();
$this->setDisplayNav(); $this->setDisplayNav();
$this->setReport(); $this->setReport();

View File

@@ -84,7 +84,6 @@ class module_report_question extends module_report
protected function buildResult(Application $app, $rs) protected function buildResult(Application $app, $rs)
{ {
$tab = array();
$i = 0; $i = 0;
foreach ($rs as $row) { foreach ($rs as $row) {
if ($this->enable_limit && ($i > $this->nb_record)) if ($this->enable_limit && ($i > $this->nb_record))

View File

@@ -17,7 +17,7 @@ class p4file
$ret = false; $ret = false;
if ($registry->get('GV_h264_streaming') && is_file($file)) { if ($registry->get('GV_h264_streaming') && is_file($file)) {
if (($pos = mb_strpos($file, $registry->get('GV_mod_auth_token_directory_path'))) === false) { if (mb_strpos($file, $registry->get('GV_mod_auth_token_directory_path')) === false) {
return false; return false;
} }

View File

@@ -77,8 +77,6 @@ class patch_320a implements patchInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$tasks = array();
$sql = 'UPDATE task2 SET `class` = :class WHERE task_id = :task_id'; $sql = 'UPDATE task2 SET `class` = :class WHERE task_id = :task_id';
$stmt = $appbox->get_connection()->prepare($sql); $stmt = $appbox->get_connection()->prepare($sql);
foreach ($rs as $row) { foreach ($rs as $row) {

View File

@@ -64,14 +64,12 @@ class patch_370a8 implements patchInterface
*/ */
public function apply(base $appbox, Application $app) public function apply(base $appbox, Application $app)
{ {
$taskManager = $app['task-manager'];
$ttasks = array(); $ttasks = array();
$conn = $appbox->get_connection(); $conn = $appbox->get_connection();
$sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\' OR class=\'task_period_ftv\''; $sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\' OR class=\'task_period_ftv\'';
if (($stmt = $conn->prepare($sql)) !== FALSE) { if (($stmt = $conn->prepare($sql)) !== FALSE) {
$stmt->execute(); $stmt->execute();
$ttasks = $row = $stmt->fetchAll(); $ttasks = $stmt->fetchAll();
$stmt->closeCursor(); $stmt->closeCursor();
} }

View File

@@ -19,7 +19,6 @@ class patchthesaurus_203
public function patch($version, &$domct, &$domth, connection_pdo &$connbas) public function patch($version, &$domct, &$domth, connection_pdo &$connbas)
{ {
global $debug;
global $ctchanged, $thchanged, $needreindex; global $ctchanged, $thchanged, $needreindex;
$unicode = new unicode(); $unicode = new unicode();
@@ -106,8 +105,6 @@ class patchthesaurus_203
public function fixRejected(connection_pdo &$connbas, &$node, $rejected) public function fixRejected(connection_pdo &$connbas, &$node, $rejected)
{ {
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE) { if ($node->nodeType != XML_ELEMENT_NODE) {
return; return;
} }
@@ -138,8 +135,6 @@ class patchthesaurus_203
public function fixIds(connection_pdo &$connbas, &$node) public function fixIds(connection_pdo &$connbas, &$node)
{ {
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE) { if ($node->nodeType != XML_ELEMENT_NODE) {
return; return;
} }

View File

@@ -19,7 +19,6 @@ class patchthesaurus_204
public function patch($version, &$domct, &$domth, connection_pdo &$connbas) public function patch($version, &$domct, &$domth, connection_pdo &$connbas)
{ {
global $debug;
global $ctchanged, $thchanged, $needreindex; global $ctchanged, $thchanged, $needreindex;
$unicode = new unicode(); $unicode = new unicode();
@@ -109,8 +108,6 @@ class patchthesaurus_204
public function fixRejected(connection_pdo &$connbas, &$node, $rejected) public function fixRejected(connection_pdo &$connbas, &$node, $rejected)
{ {
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE) { if ($node->nodeType != XML_ELEMENT_NODE) {
return; return;
} }
@@ -141,8 +138,6 @@ class patchthesaurus_204
public function fixIds(connection_pdo &$connbas, &$node) public function fixIds(connection_pdo &$connbas, &$node)
{ {
global $debug;
if ($node->nodeType != XML_ELEMENT_NODE) { if ($node->nodeType != XML_ELEMENT_NODE) {
return; return;
} }

View File

@@ -973,8 +973,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{ {
$newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension(); $newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension();
$base_url = '';
$subdef_def = false; $subdef_def = false;
if ($name == 'document') { if ($name == 'document') {
@@ -1351,7 +1349,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$app['filesystem']->copy($file->getFile()->getRealPath(), $pathhd . $newname, true); $app['filesystem']->copy($file->getFile()->getRealPath(), $pathhd . $newname, true);
$media = $app['mediavorus']->guess($pathhd . $newname); $media = $app['mediavorus']->guess($pathhd . $newname);
$subdef = media_subdef::create($app, $record, 'document', $media); media_subdef::create($app, $record, 'document', $media);
$record->delete_data_from_cache(\record_adapter::CACHE_SUBDEFS); $record->delete_data_from_cache(\record_adapter::CACHE_SUBDEFS);
@@ -1500,8 +1498,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function delete() public function delete()
{ {
$connbas = $this->get_databox()->get_connection(); $connbas = $this->get_databox()->get_connection();
$sbas_id = $this->get_databox()->get_sbas_id();
$conn = $this->app['phraseanet.appbox']->get_connection();
$ftodel = array(); $ftodel = array();
foreach ($this->get_subdefs() as $subdef) { foreach ($this->get_subdefs() as $subdef) {
@@ -1529,12 +1525,6 @@ 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();
$sql = 'SELECT id FROM metadatas WHERE record_id = :record_id';
$stmt = $connbas->prepare($sql);
$stmt->execute(array(':record_id' => $this->get_record_id()));
$rs = $stmt->fetchAll();
$stmt->closeCursor();
$sql = "DELETE FROM metadatas WHERE record_id = :record_id"; $sql = "DELETE FROM metadatas WHERE record_id = :record_id";
$stmt = $connbas->prepare($sql); $stmt = $connbas->prepare($sql);
$stmt->execute(array(':record_id' => $this->get_record_id())); $stmt->execute(array(':record_id' => $this->get_record_id()));
@@ -1582,10 +1572,6 @@ 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();
$base_ids = array_map(function($collection) {
return $collection->get_base_id();
}, $this->databox->get_collections());
$orderElementRepository = $this->app['EM']->getRepository('\Entities\OrderElement'); $orderElementRepository = $this->app['EM']->getRepository('\Entities\OrderElement');
/* @var $repository \Repositories\OrderElementRepository */ /* @var $repository \Repositories\OrderElementRepository */

View File

@@ -127,7 +127,6 @@ class record_preview extends record_adapter
$this->original_item = $this->container; $this->original_item = $this->container;
if ($pos == 0) { if ($pos == 0) {
$number = 0; $number = 0;
$title = _('preview:: regroupement ');
} else { } else {
$children = $this->container->get_children(); $children = $this->container->get_children();
foreach ($children as $child) { foreach ($children as $child) {
@@ -219,7 +218,6 @@ class record_preview extends record_adapter
case 'RESULT': case 'RESULT':
$perPage = 56; $perPage = 56;
$index = ($pos - 3) < 0 ? 0 : ($pos - 3); $index = ($pos - 3) < 0 ? 0 : ($pos - 3);
$page = (int) ceil($pos / $perPage);
$results = $search_engine->query($query, $index, $perPage); $results = $search_engine->query($query, $index, $perPage);
$this->train = $results->getResults()->toArray(); $this->train = $results->getResults()->toArray();
@@ -593,8 +591,6 @@ class record_preview extends record_adapter
$views = $dwnls = array(); $views = $dwnls = array();
$top = 1; $top = 1;
$day = 30; $day = 30;
$min = 0;
$average = 0;
while ($day >= 0) { while ($day >= 0) {

View File

@@ -191,7 +191,6 @@ class recordutils_image extends recordutils
$domprefs->normalizeDocument(); $domprefs->normalizeDocument();
$text_xpos = 0;
$text_width = $image_width; $text_width = $image_width;
$logopos = null; $logopos = null;
@@ -224,9 +223,7 @@ class recordutils_image extends recordutils
$text_width -= $logo_reswidth; $text_width -= $logo_reswidth;
if ($logopos == 'LEFT') { if ($logopos == 'LEFT') {
$logo_xpos = 0; $logo_xpos = 0;
$text_xpos = $logo_reswidth;
} else { } else {
$text_xpos = 0;
$logo_xpos = ($image_width - $logo_reswidth); $logo_xpos = ($image_width - $logo_reswidth);
} }
} }

View File

@@ -431,8 +431,6 @@ class set_export extends set_abstract
'subdefs' => array() 'subdefs' => array()
); );
$rename_done = false;
$BF = false; $BF = false;
if ($includeBusinessFields && $user->ACL()->has_right_on_base($download_element->get_base_id(), 'canmodifrecord')) { if ($includeBusinessFields && $user->ACL()->has_right_on_base($download_element->get_base_id(), 'canmodifrecord')) {
@@ -457,7 +455,6 @@ class set_export extends set_abstract
$title = strip_tags($download_element->get_title(null, null, true)); $title = strip_tags($download_element->get_title(null, null, true));
$files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true, true, true); $files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true, true, true);
$rename_done = true;
} else { } else {
$files[$id]["export_name"] = $infos['filename']; $files[$id]["export_name"] = $infos['filename'];
} }
@@ -804,12 +801,6 @@ class set_export extends set_abstract
} }
} }
$export_types = array(
'download' => 0,
'mail-export' => 2,
'ftp' => 4
);
$list_base = array_unique(array_keys($tmplog)); $list_base = array_unique(array_keys($tmplog));
if (!$anonymous) { if (!$anonymous) {

View File

@@ -31,8 +31,6 @@ class set_exportftp extends set_export
*/ */
public function export_ftp($usr_to, $host, $login, $password, $ssl, $retry, $passif, $destfolder, $makedirectory, $logfile) public function export_ftp($usr_to, $host, $login, $password, $ssl, $retry, $passif, $destfolder, $makedirectory, $logfile)
{ {
$conn = $this->app['phraseanet.appbox']->get_connection();
$email_dest = ''; $email_dest = '';
if ($usr_to) { if ($usr_to) {
$user_t = User_Adapter::getInstance($usr_to, $this->app); $user_t = User_Adapter::getInstance($usr_to, $this->app);

View File

@@ -28,11 +28,8 @@ class setup
{ {
$GV = require(__DIR__ . "/../../lib/conf.d/_GV_template.inc"); $GV = require(__DIR__ . "/../../lib/conf.d/_GV_template.inc");
$debug = $log_errors = false;
$vars = array(); $vars = array();
$error = false; $error = false;
$extra_conf = '';
foreach ($GV as $section) { foreach ($GV as $section) {
foreach ($section['vars'] as $variable) { foreach ($section['vars'] as $variable) {
@@ -94,11 +91,6 @@ class setup
} }
} }
if ($variable['name'] === 'GV_debug' && $datas[$variable['name']] === '1')
$debug = true;
if ($variable['name'] === 'GV_log_errors' && $datas[$variable['name']] === '1')
$log_errors = true;
if ($variable['type'] !== 'integer' && $variable['type'] !== 'boolean') if ($variable['type'] !== 'integer' && $variable['type'] !== 'boolean')
$datas[$variable['name']] = $datas[$variable['name']]; $datas[$variable['name']] = $datas[$variable['name']];

View File

@@ -99,8 +99,6 @@ abstract class task_abstract
*/ */
protected $maxmegs; protected $maxmegs;
protected $runner; protected $runner;
private $input;
private $output;
/** /**
* delay between two loops * delay between two loops
@@ -794,22 +792,6 @@ abstract class task_abstract
} }
} }
public function traceRam($msg = '')
{
static $lastt = null;
$t = explode(' ', ($ut = microtime()));
if ($lastt === null) {
$lastt = $t;
}
$dt = ($t[0] - $lastt[0]) + ($t[1] - $lastt[1]);
$m = memory_get_usage() >> 10;
$d = debug_backtrace(false);
$lastt = $t;
$this->logger->addDebug(memory_get_usage() . " -- " . memory_get_usage(true));
}
public function log($message, $level=self::LOG_INFO) public function log($message, $level=self::LOG_INFO)
{ {
// nb : self::log_levels ARE standard log levels, ok with monolog // nb : self::log_levels ARE standard log levels, ok with monolog
@@ -875,17 +857,6 @@ abstract class task_abstract
return $task; return $task;
} }
public function getUsage()
{
global $argc, $argv;
$t = "usage: " . $argv[0] . " [options]\noptions:\n";
foreach ($this->argt as $n => $v) {
$t .= "\t" . $n . $v["usage"] . "\n";
}
return $t;
}
/** /**
* *
* @return int id of the task * @return int id of the task

View File

@@ -46,7 +46,6 @@ class task_period_RecordMover extends task_appboxAbstract
$dom->formatOutput = true; $dom->formatOutput = true;
if ($dom->loadXML($oldxml)) { if ($dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array( foreach (array(
'str:period' 'str:period'
, 'boo:logsql' , 'boo:logsql'
@@ -72,7 +71,6 @@ class task_period_RecordMover extends task_appboxAbstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }

View File

@@ -92,7 +92,6 @@ class task_period_archive extends task_abstract
$dom->formatOutput = true; $dom->formatOutput = true;
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
if ($dom->loadXML($oldxml)) { if ($dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array( foreach (array(
'str:base_id' 'str:base_id'
, 'str:hotfolder' , 'str:hotfolder'
@@ -125,7 +124,6 @@ class task_period_archive extends task_abstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }
@@ -296,7 +294,8 @@ class task_period_archive extends task_abstract
{ {
$this->debug = false; $this->debug = false;
$conn = $this->dependencyContainer['phraseanet.appbox']->get_connection(); // test if connection is available
$this->dependencyContainer['phraseanet.appbox']->get_connection();
$this->sxTaskSettings = simplexml_load_string($this->settings); $this->sxTaskSettings = simplexml_load_string($this->settings);
@@ -378,7 +377,7 @@ class task_period_archive extends task_abstract
$loop = 0; $loop = 0;
while ($this->running) { while ($this->running) {
try { try {
$conn = connection::getPDOConnection($this->dependencyContainer); connection::getPDOConnection($this->dependencyContainer);
} catch (Exception $e) { } catch (Exception $e) {
$this->log($e->getMessage()); $this->log($e->getMessage());
if ($this->getRunner() == self::RUNNER_SCHEDULER) { if ($this->getRunner() == self::RUNNER_SCHEDULER) {
@@ -1184,7 +1183,7 @@ class task_period_archive extends task_abstract
if ($n->getAttribute('isdir') == '1') { if ($n->getAttribute('isdir') == '1') {
if ($n->getAttribute('grp')) { if ($n->getAttribute('grp')) {
// a grp folder : special work // a grp folder : special work
$this->ArchiveGrp($dom, $n, $path, $path_archived, $path_error, $nodesToDel); $this->archiveGrp($dom, $n, $path, $path_archived, $path_error, $nodesToDel);
} else { } else {
// ...normal subfolder : recurse // ...normal subfolder : recurse
$name = $n->getAttribute('name'); $name = $n->getAttribute('name');
@@ -1807,7 +1806,6 @@ class task_period_archive extends task_abstract
} }
$file = $node->getAttribute('name'); $file = $node->getAttribute('name');
$cid = $node->getAttribute('cid');
$captionFileNode = null; $captionFileNode = null;
$rootpath = p4string::delEndSlash(trim((string) ($this->sxTaskSettings->hotfolder))); $rootpath = p4string::delEndSlash(trim((string) ($this->sxTaskSettings->hotfolder)));
@@ -1857,8 +1855,6 @@ class task_period_archive extends task_abstract
*/ */
private function archiveFileAndCaption(\DOMDocument $dom, \DOMElement $node, \DOMElement $captionFileNode = null, $path, $path_archived, $path_error, $grp_rid, array &$nodesToDel) private function archiveFileAndCaption(\DOMDocument $dom, \DOMElement $node, \DOMElement $captionFileNode = null, $path, $path_archived, $path_error, $grp_rid, array &$nodesToDel)
{ {
$ret = false;
$file = $node->getAttribute('name'); $file = $node->getAttribute('name');
$cid = $node->getAttribute('cid'); $cid = $node->getAttribute('cid');
$captionFileName = $captionFileNode ? $captionFileNode->getAttribute('name') : null; $captionFileName = $captionFileNode ? $captionFileNode->getAttribute('name') : null;
@@ -1893,9 +1889,9 @@ class task_period_archive extends task_abstract
$collection = collection::get_from_coll_id($this->dependencyContainer, $databox, (int) $cid); $collection = collection::get_from_coll_id($this->dependencyContainer, $databox, (int) $cid);
if ($captionFileName === null) { if ($captionFileName === null) {
$record = $this->createRecord($collection, $path . '/' . $file, null, $grp_rid); $this->createRecord($collection, $path . '/' . $file, null, $grp_rid);
} else { } else {
$record = $this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid); $this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid);
} }
$node->setAttribute('archived', '1'); $node->setAttribute('archived', '1');
@@ -1940,8 +1936,6 @@ class task_period_archive extends task_abstract
$this->log($e->getMessage()); $this->log($e->getMessage());
} }
} }
if (!$node->getAttribute('keep')) // do not count copy of special files as a real event
$ret = true;
} }
if ($node->getAttribute('error') && $this->move_error) { if ($node->getAttribute('error') && $this->move_error) {
@@ -1968,10 +1962,6 @@ class task_period_archive extends task_abstract
$this->log($e->getMessage()); $this->log($e->getMessage());
} }
} }
// do not count copy of special files as a real event
if (!$node->getAttribute('keep')) {
$ret = true;
}
} }
if (!$node->getAttribute('keep')) { if (!$node->getAttribute('keep')) {

View File

@@ -128,7 +128,6 @@ class task_period_cindexer extends task_abstract
$dom = new DOMDocument(); $dom = new DOMDocument();
$dom->formatOutput = true; $dom->formatOutput = true;
if ($dom->loadXML($oldxml)) { if ($dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array("str:host", "str:port", "str:base", "str:user", "str:password", "str:socket", "boo:nolog", "str:clng", "boo:winsvc_run", "str:charset", 'str:debugmask', 'str:stem', 'str:sortempty') as $pname) { foreach (array("str:host", "str:port", "str:base", "str:user", "str:password", "str:socket", "boo:nolog", "str:clng", "boo:winsvc_run", "str:charset", 'str:debugmask', 'str:stem', 'str:sortempty') as $pname) {
$ptype = substr($pname, 0, 3); $ptype = substr($pname, 0, 3);
$pname = substr($pname, 4); $pname = substr($pname, 4);
@@ -151,7 +150,6 @@ class task_period_cindexer extends task_abstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }
@@ -389,13 +387,8 @@ class task_period_cindexer extends task_abstract
{ {
$cmd = $this->getIndexer(); $cmd = $this->getIndexer();
$nullfile = '/dev/null';
$this->method = self::METHOD_PROC_OPEN; $this->method = self::METHOD_PROC_OPEN;
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$nullfile = '/dev/null';
}
if ( ! file_exists($cmd) || ! is_executable($cmd)) { if ( ! file_exists($cmd) || ! is_executable($cmd)) {
$this->setState(self::STATE_STOPPED); $this->setState(self::STATE_STOPPED);
$this->log(sprintf('File \'%s\' does not exists', $cmd)); $this->log(sprintf('File \'%s\' does not exists', $cmd));
@@ -459,8 +452,6 @@ class task_period_cindexer extends task_abstract
$args_nopwd[] = '--run'; $args_nopwd[] = '--run';
} }
$logdir = $this->dependencyContainer['root.path'] . '/logs/';
$this->new_status = NULL; // new status to set at the end $this->new_status = NULL; // new status to set at the end
$this->exception = NULL; // exception to throw at the end $this->exception = NULL; // exception to throw at the end
@@ -503,13 +494,6 @@ class task_period_cindexer extends task_abstract
$process = proc_open($execmd, $descriptors, $pipes, dirname($cmd), null, array('bypass_shell' => true)); $process = proc_open($execmd, $descriptors, $pipes, dirname($cmd), null, array('bypass_shell' => true));
$pid = NULL;
if (is_resource($process)) {
$proc_status = proc_get_status($process);
if ($proc_status['running']) {
$pid = $proc_status['pid'];
}
}
$qsent = ''; $qsent = '';
$timetokill = NULL; $timetokill = NULL;
$sock = NULL; $sock = NULL;

View File

@@ -52,7 +52,6 @@ class task_period_ftp extends task_appboxAbstract
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
$dom->formatOutput = true; $dom->formatOutput = true;
if ((@$dom->loadXML($oldxml)) != FALSE) { if ((@$dom->loadXML($oldxml)) != FALSE) {
$xmlchanged = false;
foreach (array('str:proxy', 'str:proxyport', 'str:period', 'pop:syslog') as $pname) { foreach (array('str:proxy', 'str:proxyport', 'str:period', 'pop:syslog') as $pname) {
$ptype = substr($pname, 0, 3); $ptype = substr($pname, 0, 3);
$pname = substr($pname, 4); $pname = substr($pname, 4);
@@ -76,7 +75,6 @@ class task_period_ftp extends task_appboxAbstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }
@@ -274,15 +272,10 @@ class task_period_ftp extends task_appboxAbstract
protected function processOneContent(appbox $appbox, $export) protected function processOneContent(appbox $appbox, $export)
{ {
$conn = $appbox->get_connection();
$id = $export->getId();
$state = ""; $state = "";
$ftp_server = $export->getAddr(); $ftp_server = $export->getAddr();
$ftp_user_name = $export->getLogin(); $ftp_user_name = $export->getLogin();
$ftp_user_pass = $export->getPwd(); $ftp_user_pass = $export->getPwd();
$usr_id = $export->getUsrId();
$ftpLog = $ftp_user_name . "@" . p4string::addEndSlash($ftp_server) . $export->getDestfolder(); $ftpLog = $ftp_user_name . "@" . p4string::addEndSlash($ftp_server) . $export->getDestfolder();
@@ -498,8 +491,6 @@ class task_period_ftp extends task_appboxAbstract
public function finalize(appbox $appbox, FtpExport $export) public function finalize(appbox $appbox, FtpExport $export)
{ {
$conn = $appbox->get_connection();
if ($export->getCrash() >= $export->getNbretry()) { if ($export->getCrash() >= $export->getNbretry()) {
$this->send_mails($appbox, $export); $this->send_mails($appbox, $export);

View File

@@ -100,7 +100,6 @@ class task_period_ftpPull extends task_appboxAbstract
public function printInterfaceJS() public function printInterfaceJS()
{ {
global $parm;
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@@ -156,7 +155,6 @@ class task_period_ftpPull extends task_appboxAbstract
public function getInterfaceHTML() public function getInterfaceHTML()
{ {
global $parm;
ob_start(); ob_start();
?> ?>
<form name="graphicForm" onsubmit="return(false);" method="post"> <form name="graphicForm" onsubmit="return(false);" method="post">

View File

@@ -80,8 +80,6 @@ class task_period_subdef extends task_databoxAbstract
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
$dom->formatOutput = true; $dom->formatOutput = true;
if (@$dom->loadXML($oldxml)) { if (@$dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array('str:period', 'str:flush', 'str:maxrecs', 'str:maxmegs', 'boo:embedded') as $pname) { foreach (array('str:period', 'str:flush', 'str:maxrecs', 'str:maxmegs', 'boo:embedded') as $pname) {
$ptype = substr($pname, 0, 3); $ptype = substr($pname, 0, 3);
$pname = substr($pname, 4); $pname = substr($pname, 4);
@@ -102,7 +100,6 @@ class task_period_subdef extends task_databoxAbstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }

View File

@@ -44,7 +44,6 @@ class task_period_writemeta extends task_databoxAbstract
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
$dom->formatOutput = true; $dom->formatOutput = true;
if ($dom->loadXML($oldxml)) { if ($dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array('str:period', 'str:maxrecs', 'str:maxmegs', 'boo:cleardoc') as $pname) { foreach (array('str:period', 'str:maxrecs', 'str:maxmegs', 'boo:cleardoc') as $pname) {
$ptype = substr($pname, 0, 3); $ptype = substr($pname, 0, 3);
$pname = substr($pname, 4); $pname = substr($pname, 4);
@@ -68,7 +67,6 @@ class task_period_writemeta extends task_databoxAbstract
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
break; break;
} }
$xmlchanged = true;
} }
} }