mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
Remove dead code
This commit is contained in:
@@ -21,12 +21,10 @@ use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
||||
use MediaVorus\Media\MediaInterface;
|
||||
use MediaVorus\MediaVorus;
|
||||
use MediaVorus\Exception\FileNotFoundException;
|
||||
use PHPExiftool\Writer;
|
||||
use PHPExiftool\Driver\TagFactory;
|
||||
use PHPExiftool\Driver\Metadata\Metadata;
|
||||
use PHPExiftool\Driver\Metadata\MetadataBag as ExiftoolMetadataBag;
|
||||
use PHPExiftool\Driver\Value\Mono as MonoValue;
|
||||
use PHPExiftool\Exiftool;
|
||||
use PHPExiftool\Exception\ExceptionInterface as PHPExiftoolException;
|
||||
|
||||
/**
|
||||
@@ -149,8 +147,6 @@ class File
|
||||
}
|
||||
}
|
||||
|
||||
$reader = $metadatas = null;
|
||||
|
||||
return $this->uuid;
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ abstract class AbstractPluginCommand extends Command
|
||||
|
||||
$output->write("Validating plugins...");
|
||||
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>");
|
||||
|
||||
|
@@ -28,7 +28,7 @@ abstract class AbstractDelivery implements ControllerProviderInterface
|
||||
{
|
||||
$file = $record->get_subdef($subdef);
|
||||
|
||||
$pathIn = $pathOut = $file->get_pathfile();
|
||||
$pathOut = $file->get_pathfile();
|
||||
|
||||
if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) {
|
||||
$pathOut = \recordutils_image::watermark($app, $file);
|
||||
|
@@ -118,8 +118,6 @@ class Databoxes implements ControllerProviderInterface
|
||||
*/
|
||||
public function getDatabases(Application $app, Request $request)
|
||||
{
|
||||
$createBase = $mountBase = false;
|
||||
|
||||
$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_modify_struct')))
|
||||
|
@@ -248,7 +248,7 @@ class Lazaret implements ControllerProviderInterface
|
||||
$attributesToKeep = $request->request->get('attributes', array());
|
||||
|
||||
//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');
|
||||
|
||||
return $app->json($ret);
|
||||
|
@@ -324,7 +324,7 @@ class Account implements ControllerProviderInterface
|
||||
return $app['twig']->render('account/account.html.twig', array(
|
||||
'user' => $app['authentication']->getUser(),
|
||||
'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());
|
||||
|
||||
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) {
|
||||
$notifId = $notification['id'];
|
||||
$notifName = sprintf('notification_%d', $notifId);
|
||||
|
@@ -562,7 +562,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
{
|
||||
set_time_limit(300);
|
||||
|
||||
$imported = false;
|
||||
$err = '';
|
||||
|
||||
if (null === $bid = $request->get("bid")) {
|
||||
@@ -595,7 +594,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
if (($fp = fopen($file, 'rb'))) {
|
||||
$iline = 0;
|
||||
$curdepth = -1;
|
||||
$tid = array(-1 => -1, 0 => -1);
|
||||
while ( ! $err && ! feof($fp) && ($line = fgets($fp)) !== FALSE) {
|
||||
$iline ++;
|
||||
if (trim($line) == '') {
|
||||
@@ -629,7 +627,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
$curdepth = $depth;
|
||||
|
||||
$nid = (int) ($node->getAttribute('nextid'));
|
||||
$id = $node->getAttribute('id') . '.' . $nid;
|
||||
$pid = $node->getAttribute('id');
|
||||
|
||||
$te_id = ($pid ? ($pid . '.') : 'T') . $nid;
|
||||
@@ -645,7 +642,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
$nsy = 0;
|
||||
foreach ($tsy as $syn) {
|
||||
$lng = $request->get('piv');
|
||||
$hit = '';
|
||||
$kon = '';
|
||||
|
||||
if (($ob = strpos($syn, '[')) !== false) {
|
||||
@@ -659,10 +655,8 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
if (($ob = strpos($syn, '[')) !== 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);
|
||||
} else {
|
||||
$hit = trim(substr($syn, $ob + 1));
|
||||
$syn = substr($syn, 0, $ob);
|
||||
}
|
||||
}
|
||||
@@ -707,7 +701,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
if (! $err) {
|
||||
$imported = true;
|
||||
$databox->saveThesaurus($dom);
|
||||
}
|
||||
}
|
||||
@@ -784,7 +777,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
foreach ($rs as $row) {
|
||||
try {
|
||||
$connbas = \connection::getPDOConnection($app, $row['sbas_id']);
|
||||
\connection::getPDOConnection($app, $row['sbas_id']);
|
||||
} catch (\Exception $e) {
|
||||
continue;
|
||||
}
|
||||
@@ -966,7 +959,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
if ($domct && $domst) {
|
||||
$xpathct = new \DOMXPath($domct);
|
||||
$xpathst = new \DOMXPath($domst);
|
||||
$ctchanged = false;
|
||||
|
||||
$candidates2del = array();
|
||||
@@ -1035,7 +1027,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
private function fixThesaurus($app, &$domct, &$domth, &$connbas)
|
||||
{
|
||||
$oldversion = $version = $domth->documentElement->getAttribute("version");
|
||||
$version = $domth->documentElement->getAttribute("version");
|
||||
|
||||
if ('' === trim($version)) {
|
||||
$version = '1.0.0';
|
||||
@@ -1057,7 +1049,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1090,7 +1082,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
if ($domct && $domth) {
|
||||
|
||||
$oldversion = $domth->documentElement->getAttribute("version");
|
||||
if (($version = $this->fixThesaurus($app, $domct, $domth, $connbas)) != $oldversion) {
|
||||
if ($this->fixThesaurus($app, $domct, $domth, $connbas) != $oldversion) {
|
||||
$updated = true;
|
||||
$databox->saveCterms($domct);
|
||||
$databox->saveThesaurus($domth);
|
||||
@@ -1266,7 +1258,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
try {
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $bid);
|
||||
$connbas = \connection::getPDOConnection($app, $bid);
|
||||
\connection::getPDOConnection($app, $bid);
|
||||
|
||||
$dom = $databox->get_dom_cterms();
|
||||
$xpath = new \DOMXPath($dom);
|
||||
@@ -1884,9 +1876,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
$r->setAttribute("id", "C");
|
||||
}
|
||||
} else {
|
||||
$xmlct = str_replace(array("\r", "\n", "\t"), array("", "", ""), $domct->saveXML());
|
||||
$xmlte = str_replace(array("\r", "\n", "\t"), array("", "", ""), $dom->saveXML());
|
||||
|
||||
$databox->saveThesaurus($dom);
|
||||
|
||||
$r = $refresh_list->appendChild($ret->createElement("refresh"));
|
||||
@@ -1902,11 +1891,9 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) {
|
||||
$sl = $ret->importNode($sl, true);
|
||||
$sy_list = $root->appendChild($sl);
|
||||
}
|
||||
|
||||
if ($request->get('debug')) {
|
||||
printf("url: %s<br/>\n", $url);
|
||||
printf("<pre>" . $ret2->saveXML() . "</pre>");
|
||||
}
|
||||
}
|
||||
@@ -2651,7 +2638,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) {
|
||||
$sl = $ret->importNode($sl, true);
|
||||
$sy_list = $root->appendChild($sl);
|
||||
}
|
||||
|
||||
if ($request->get('debug')) {
|
||||
@@ -3018,9 +3004,6 @@ class Thesaurus implements ControllerProviderInterface
|
||||
}
|
||||
} elseif ($n->nodeName == "sy") {
|
||||
$t = $n->getAttribute("v");
|
||||
if ($k = $n->getAttribute("k")) {
|
||||
// $t .= " ($k)";
|
||||
}
|
||||
$allsy .= ( $allsy ? " ; " : "") . $t;
|
||||
}
|
||||
}
|
||||
@@ -3113,7 +3096,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@@ -933,13 +933,9 @@ class Xmlhttp implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
if ($dom) {
|
||||
$term0 = '';
|
||||
$firstTerm0 = '';
|
||||
|
||||
$xpath = new \DOMXPath($dom);
|
||||
if ($thid == 'T' || $thid == 'C') {
|
||||
$q = '/' . $xqroot;
|
||||
$term0 = $dbname;
|
||||
} else {
|
||||
$q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']';
|
||||
}
|
||||
@@ -1454,7 +1450,7 @@ class Xmlhttp implements ControllerProviderInterface
|
||||
$xp = '//te[@id="' . $tid . '"]/sy';
|
||||
$nodes = $xpathct->query($xp);
|
||||
if ($nodes->length == 1) {
|
||||
$sy = $term = $nodes->item(0);
|
||||
$sy = $nodes->item(0);
|
||||
$syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd';
|
||||
$lid .= ( $lid ? ',' : '') . "'" . $syid . "'";
|
||||
$field = $sy->parentNode->parentNode->getAttribute('field');
|
||||
@@ -1625,7 +1621,6 @@ class Xmlhttp implements ControllerProviderInterface
|
||||
|
||||
$html = '';
|
||||
$sbid = (int) $request->get('sbid');
|
||||
$dbname = '';
|
||||
|
||||
try {
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbid);
|
||||
|
@@ -152,14 +152,4 @@ class PhraseaRegisterForm extends AbstractType
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@@ -229,8 +229,6 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$msk_and = null;
|
||||
$msk_xor = null;
|
||||
$tbits_and = array();
|
||||
$tbits_xor = array();
|
||||
|
||||
|
@@ -81,8 +81,6 @@ class Manage extends Helper
|
||||
|
||||
public function search()
|
||||
{
|
||||
$request = $this->request;
|
||||
|
||||
$offset_start = (int) $this->request->get('offset_start');
|
||||
$offset_start = $offset_start < 0 ? 0 : $offset_start;
|
||||
$results_quantity = (int) $this->request->get('per_page');
|
||||
|
@@ -78,6 +78,5 @@ class WorkZone extends Helper
|
||||
|
||||
protected function sortBaskets(array $baskets)
|
||||
{
|
||||
$tmp_baskets = array();
|
||||
}
|
||||
}
|
||||
|
@@ -219,15 +219,12 @@ class PDF
|
||||
$this->pdf->AddPage();
|
||||
$oldMargins = $this->pdf->getMargins();
|
||||
|
||||
$tmargin = $oldMargins['top'];
|
||||
$lmargin = $oldMargins['left'];
|
||||
$bmargin = $oldMargins['bottom'];
|
||||
$rmargin = $oldMargins['right'];
|
||||
|
||||
$this->pdf->SetLeftMargin($lmargin + 55);
|
||||
|
||||
$ndoc = 0;
|
||||
$lastpage = $this->pdf->PageNo();
|
||||
foreach ($this->records as $rec) {
|
||||
/* @var $rec record_adapter */
|
||||
$subdef = $rec->get_subdef('thumbnail');
|
||||
@@ -324,7 +321,6 @@ class PDF
|
||||
$rec->set_number($this->pdf->PageNo());
|
||||
}
|
||||
$lmargin = $this->pdf->GetX();
|
||||
$tmargin = $this->pdf->GetY();
|
||||
$himg = 0;
|
||||
$y = 0;
|
||||
$miniConv = NULL;
|
||||
|
@@ -27,7 +27,7 @@ class PhraseaPDF extends \TCPDF
|
||||
|
||||
public function Footer()
|
||||
{
|
||||
$ml = $this->SetLeftMargin(0);
|
||||
$this->SetLeftMargin(0);
|
||||
$mr = $this->SetRightMargin(0);
|
||||
|
||||
$this->SetY(-15);
|
||||
|
@@ -454,8 +454,6 @@ class PhraseaEngineQueryParser
|
||||
|
||||
public function _extendThesaurusOnTerms(&$tree, &$copy, $useFullText, $useThesaurus, $keepfuzzy, $depth, $path)
|
||||
{
|
||||
if ($depth == 0)
|
||||
$ret = $tree;
|
||||
if (!$useThesaurus) {
|
||||
return; // full-text only : inchangé
|
||||
}
|
||||
@@ -586,7 +584,7 @@ class PhraseaEngineQueryParser
|
||||
|
||||
$ambigus = 0;
|
||||
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") {
|
||||
$ambigus += $this->thesaurus2($tree["LB"], $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)
|
||||
{
|
||||
global $parm;
|
||||
if ($depth > 0) {
|
||||
$tsy = array();
|
||||
$lngfound = "?";
|
||||
@@ -676,9 +673,6 @@ class PhraseaEngineQueryParser
|
||||
|
||||
public function _queryAsHTML($tree, $depth = 0)
|
||||
{
|
||||
if ($depth == 0) {
|
||||
$ambiguites = array("n" => 0, "refs" => array());
|
||||
}
|
||||
switch ($tree["CLASS"]) {
|
||||
case "SIMPLE":
|
||||
case "QSIMPLE":
|
||||
@@ -720,7 +714,7 @@ class PhraseaEngineQueryParser
|
||||
}
|
||||
}
|
||||
|
||||
public function setTids(&$tree, $bid, &$domthe, $searchsynonyms)
|
||||
public function setTids(&$tree, $bid, &$domthe)
|
||||
{
|
||||
if ($this->debug)
|
||||
print("============================ setTids:\n\$tree=" . var_export($tree, true) . "\n");
|
||||
@@ -761,7 +755,6 @@ class PhraseaEngineQueryParser
|
||||
// $this->thesaurusDOMNodes[] = $nodes->item(0);
|
||||
} else {
|
||||
// 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) {
|
||||
if (!isset($tree["CONTEXT"]))
|
||||
$ambigus++;
|
||||
@@ -865,7 +858,6 @@ class PhraseaEngineQueryParser
|
||||
switch ($tree["CLASS"]) {
|
||||
case "SIMPLE":
|
||||
case "QSIMPLE":
|
||||
$prelink = $postlink = "";
|
||||
$w = is_array($tree["VALUE"]) ? implode(" ", $tree["VALUE"]) : $tree["VALUE"];
|
||||
$tab = "\n" . str_repeat("\t", $depth);
|
||||
if (isset($tree["TIDS"]) && count($tree["TIDS"]) > 1) {
|
||||
|
@@ -96,7 +96,7 @@ class StoryWZRepository extends EntityRepository
|
||||
|
||||
if ($story) {
|
||||
try {
|
||||
$record = $story->getRecord($app);
|
||||
$story->getRecord($app);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
$this->getEntityManager()->remove($story);
|
||||
$this->getEntityManager()->flush();
|
||||
@@ -122,7 +122,7 @@ class StoryWZRepository extends EntityRepository
|
||||
|
||||
foreach ($stories as $key => $story) {
|
||||
try {
|
||||
$record = $story->getRecord($app);
|
||||
$story->getRecord($app);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
$this->getEntityManager()->remove($story);
|
||||
$this->getEntityManager()->flush();
|
||||
@@ -146,7 +146,7 @@ class StoryWZRepository extends EntityRepository
|
||||
|
||||
foreach ($stories as $key => $story) {
|
||||
try {
|
||||
$record = $story->getRecord($app);
|
||||
$story->getRecord($app);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
$this->getEntityManager()->remove($story);
|
||||
$this->getEntityManager()->flush();
|
||||
|
@@ -687,7 +687,6 @@ class ACL implements cache_cacheableInterface
|
||||
}
|
||||
|
||||
$base_id = $collection->get_base_id();
|
||||
$datas = $this->_rights_bas[$base_id];
|
||||
|
||||
foreach ($rights as $right) {
|
||||
if (!$this->has_right_on_base($base_id, $right)) {
|
||||
|
@@ -9,7 +9,6 @@ use Symfony\Component\HttpKernel\KernelEvents;
|
||||
|
||||
class API_V1_Timer implements ServiceProviderInterface
|
||||
{
|
||||
private $app;
|
||||
private $starting;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -1239,7 +1239,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
{
|
||||
$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)));
|
||||
|
||||
|
@@ -375,7 +375,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
switch ($object) {
|
||||
case self::ELEMENT_TYPE_VIDEO :
|
||||
$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;
|
||||
default:
|
||||
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);
|
||||
|
||||
$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);
|
||||
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);
|
||||
switch ($object) {
|
||||
case self::ELEMENT_TYPE_VIDEO:
|
||||
$result = $this->_api->call($url, array(), $this->oauth_token);
|
||||
$this->_api->call($url, array(), $this->oauth_token);
|
||||
break;
|
||||
case self::CONTAINER_TYPE_PLAYLIST:
|
||||
$result = $this->_api->call($url, array(), $this->oauth_token);
|
||||
$this->_api->call($url, array(), $this->oauth_token);
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ObjectUnknown('Unknown object ' . $object);
|
||||
|
@@ -837,7 +837,6 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
|
||||
$xml = $response->getXml();
|
||||
$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 ((int) $complete == 0)
|
||||
|
@@ -564,7 +564,6 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
}
|
||||
|
||||
if ($error = $this->parse_xml_error($response->getBody())) {
|
||||
$type = $error['type'];
|
||||
$code = $error['code'];
|
||||
|
||||
if ($code == "too_many_recent_calls") {
|
||||
|
@@ -1079,7 +1079,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
|
||||
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 ($nots as $notification) {
|
||||
|
@@ -266,8 +266,6 @@ class User_Query implements User_QueryInterface
|
||||
$sql .= $this->generate_field_constraints('lastModel', $this->templates);
|
||||
}
|
||||
|
||||
$baslist = array();
|
||||
|
||||
if (count($this->base_ids) == 0) {
|
||||
if ($this->bases_restrictions)
|
||||
throw new Exception('No base available for you, not enough rights');
|
||||
|
@@ -191,7 +191,6 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
$this->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();
|
||||
|
||||
return $this;
|
||||
@@ -247,7 +246,6 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
$sbas_id = $this->databox_field->get_databox()->get_sbas_id();
|
||||
$connbas = $this->databox_field->get_connection();
|
||||
|
||||
$params = array(
|
||||
@@ -491,7 +489,6 @@ class caption_Field_Value implements cache_cacheableInterface
|
||||
*/
|
||||
public function delete_data_from_cache($option = null)
|
||||
{
|
||||
$databox = $this->record->get_databox();
|
||||
$this->value = $this->VocabularyId = $this->VocabularyType = null;
|
||||
$this->record->delete_data_from_cache(record_adapter::CACHE_TITLE);
|
||||
|
||||
|
@@ -586,7 +586,7 @@ class databox extends base
|
||||
*/
|
||||
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();
|
||||
$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;
|
||||
|
||||
$com_struct = $this->get_dom_structure();
|
||||
$xp_struct = $this->get_xpath_structure();
|
||||
|
||||
$this->meta_struct = null;
|
||||
|
||||
$this->app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES);
|
||||
@@ -1139,7 +1136,6 @@ class databox extends base
|
||||
unset($e);
|
||||
}
|
||||
|
||||
$thesaurus = false;
|
||||
try {
|
||||
$sql = 'SELECT value AS thesaurus FROM pref WHERE prop="thesaurus" LIMIT 1;';
|
||||
$stmt = $this->get_connection()->prepare($sql);
|
||||
@@ -1418,7 +1414,6 @@ class databox extends base
|
||||
$stmt = $this->get_connection()->prepare($sql);
|
||||
$stmt->execute(array(':terms' => $terms, ':locale' => $locale));
|
||||
$stmt->closeCursor();
|
||||
$update = true;
|
||||
$this->cgus = null;
|
||||
$this->delete_data_from_cache(self::CACHE_CGUS);
|
||||
|
||||
|
@@ -434,7 +434,6 @@ class databox_field implements cache_cacheableInterface
|
||||
} else {
|
||||
$meta = $nodes->item(0);
|
||||
|
||||
$current_name = $meta->nodeName;
|
||||
if ($this->name != $meta->nodeName) {
|
||||
$old_meta = $meta;
|
||||
$meta = $dom_struct->createElement($this->name);
|
||||
|
@@ -260,7 +260,7 @@ class databox_status
|
||||
$doc = $databox->get_dom_structure();
|
||||
if ($doc) {
|
||||
$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) {
|
||||
if ($p = $sbit->previousSibling) {
|
||||
|
@@ -231,7 +231,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
|
||||
foreach ($labels as $code => $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->value = $code;
|
||||
$subdef->appendChild($child);
|
||||
|
@@ -110,10 +110,8 @@ function giveMeBases(Application $app, $usr = null)
|
||||
$cguColl = false;
|
||||
|
||||
$collInscript = $baseInscript;
|
||||
$defined = false;
|
||||
$cguSpec = false;
|
||||
if (false !== $xml = simplexml_load_string($collection->get_prefs())) {
|
||||
$defined = true;
|
||||
foreach ($xml->xpath('/baseprefs/caninscript') as $caninscript) {
|
||||
$tmp = (string) $caninscript;
|
||||
if ($tmp === "1")
|
||||
@@ -170,7 +168,7 @@ function giveMeBases(Application $app, $usr = null)
|
||||
return $inscriptions;
|
||||
}
|
||||
|
||||
function giveMeBaseUsr(Application $app, $usr, $lng)
|
||||
function giveMeBaseUsr(Application $app, $usr)
|
||||
{
|
||||
$noDemand = true;
|
||||
|
||||
@@ -308,7 +306,7 @@ function giveModInscript($usr, $lng)
|
||||
'<form id="conf_mod" target="_self" action="mod_inscript.php" method="post">' .
|
||||
'<div style="width:400px;center;margin:0 100px;">';
|
||||
|
||||
$demandes = giveMeBaseUsr($app, $usr, $lng);
|
||||
$demandes = giveMeBaseUsr($app, $usr);
|
||||
|
||||
$out .= $demandes['tab'];
|
||||
|
||||
@@ -331,75 +329,3 @@ function giveModInscript($usr, $lng)
|
||||
|
||||
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"> </td>' .
|
||||
'<td width="25px" style="width:25px"> </td>' .
|
||||
'<td style="width:325px;"> </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;
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@ use Alchemy\Phrasea\Application;
|
||||
|
||||
class eventsmanager_broker
|
||||
{
|
||||
private static $_instance = false;
|
||||
protected $events = array();
|
||||
protected $notifications = array();
|
||||
protected $pool_classes = array();
|
||||
@@ -113,7 +112,6 @@ class eventsmanager_broker
|
||||
|
||||
public function get_notifications_as_array($page = 0)
|
||||
{
|
||||
$unread = 0;
|
||||
$total = 0;
|
||||
|
||||
$sql = 'SELECT count(id) as total, sum(unread) as unread
|
||||
@@ -125,7 +123,6 @@ class eventsmanager_broker
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($row) {
|
||||
$unread = $row['unread'];
|
||||
$total = $row['total'];
|
||||
}
|
||||
|
||||
@@ -203,7 +200,6 @@ class eventsmanager_broker
|
||||
public function get_notifications()
|
||||
{
|
||||
$unread = 0;
|
||||
$total = 0;
|
||||
|
||||
$sql = 'SELECT count(id) as total, sum(unread) as unread
|
||||
FROM notifications WHERE usr_id = :usr_id';
|
||||
@@ -215,7 +211,6 @@ class eventsmanager_broker
|
||||
|
||||
if ($row) {
|
||||
$unread = $row['unread'];
|
||||
$total = $row['total'];
|
||||
}
|
||||
|
||||
if ($unread < 3) {
|
||||
@@ -226,7 +221,7 @@ class eventsmanager_broker
|
||||
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->execute(array(':usr_id' => $this->app['authentication']->getUser()->get_id()));
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -258,8 +253,6 @@ class eventsmanager_broker
|
||||
);
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -280,21 +273,8 @@ class eventsmanager_broker
|
||||
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();
|
||||
|
||||
foreach ($this->notifications as $notification) {
|
||||
|
@@ -147,7 +147,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
||||
|
||||
$usr_id = (string) $sx->usr_id;
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($usr_id, $this->app);
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -82,16 +82,6 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract
|
||||
$mailed = false;
|
||||
|
||||
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())
|
||||
$mailed = true;
|
||||
}
|
||||
@@ -110,10 +100,7 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract
|
||||
public function datas($datas, $unread)
|
||||
{
|
||||
$sx = simplexml_load_string($datas);
|
||||
$usr_id = (int) $sx->usr_id;
|
||||
$reason = (int) $sx->reason;
|
||||
$lst = (string) $sx->lst;
|
||||
$ssttid = (int) $sx->ssttid;
|
||||
$dest = (string) $sx->dest;
|
||||
|
||||
if ($reason == self::MAIL_NO_VALID) {
|
||||
|
@@ -79,11 +79,6 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
|
||||
$start = 0;
|
||||
$perLoop = 100;
|
||||
|
||||
$from = array(
|
||||
'email' => $entry->get_author_email(),
|
||||
'name' => $entry->get_author_name()
|
||||
);
|
||||
|
||||
do {
|
||||
$results = $Query->limit($start, $perLoop)->execute()->get_results();
|
||||
|
||||
|
@@ -145,7 +145,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
|
||||
$order_id = (string) $sx->order_id;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($usr_id, $this->app);
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
|
||||
$n = (int) $sx->n;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -113,7 +113,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
|
||||
$n = (int) $sx->n;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -126,7 +126,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
|
||||
$from = (string) $sx->from;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -157,7 +157,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
||||
$usr_id = (string) $sx->usr_id;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($usr_id, $this->app);
|
||||
User_Adapter::getInstance($usr_id, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
||||
$ssel_id = (string) $sx->ssel_id;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
$ssel_id = (string) $sx->ssel_id;
|
||||
|
||||
try {
|
||||
$registered_user = User_Adapter::getInstance($from, $this->app);
|
||||
User_Adapter::getInstance($from, $this->app);
|
||||
} catch (Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ class ftpclient
|
||||
{
|
||||
$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 = $proxy ? $proxy : $host;
|
||||
|
@@ -109,7 +109,6 @@ class module_console_taskrun extends Command
|
||||
);
|
||||
|
||||
$tmpTask = $task_manager->getTask($task_id, null);
|
||||
$taskname = $tmpTask->getName();
|
||||
unset($tmpTask);
|
||||
|
||||
if (($ttyloglevel = strtoupper($input->getOption('ttyloglevel'))) != '') {
|
||||
|
@@ -727,7 +727,7 @@ class module_report
|
||||
* effectue le mechanism de pagination
|
||||
* @param resultset $rs
|
||||
*/
|
||||
protected function calculatePages($rs)
|
||||
protected function calculatePages()
|
||||
{
|
||||
if ($this->nb_record && $this->total > $this->nb_record) {
|
||||
$this->previous_page = $this->nb_page - 1;
|
||||
@@ -843,7 +843,7 @@ class module_report
|
||||
//construct results
|
||||
$this->buildResult($this->app, $rs);
|
||||
//calculate prev and next page
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
//do we display navigator ?
|
||||
$this->setDisplayNav();
|
||||
//assign all variables
|
||||
|
@@ -131,7 +131,7 @@ class module_report_activity extends module_report
|
||||
|
||||
$this->result[] = $res;
|
||||
//calculate prev and next page
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
//display navigator
|
||||
$this->setDisplayNav();
|
||||
//set report
|
||||
@@ -251,7 +251,7 @@ class module_report_activity extends module_report
|
||||
|
||||
$this->total = sizeof($this->result);
|
||||
//calculate prev and next page
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
//do we display navigator ?
|
||||
$this->setDisplayNav();
|
||||
//set report
|
||||
@@ -357,7 +357,6 @@ class module_report_activity extends module_report
|
||||
|
||||
$this->setChamp($rs);
|
||||
$this->setDisplay($tab);
|
||||
$save_date = "";
|
||||
$total = array('tot_doc' => 0, 'tot_prev' => 0, 'tot_dl' => 0);
|
||||
$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]['total'] = '<b>' . $total['tot_dl'] . '</b>';
|
||||
}
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -482,7 +481,7 @@ class module_report_activity extends module_report
|
||||
$this->result[$i][$on] = '<b>TOTAL</b>';
|
||||
}
|
||||
//calculate prev and next page
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
//do we display navigator ?
|
||||
$this->setDisplayNav();
|
||||
//set report
|
||||
@@ -609,7 +608,7 @@ class module_report_activity extends module_report
|
||||
'<b>' . p4string::format_octets($total['poidprev']) . '</b>';
|
||||
}
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -653,7 +652,6 @@ class module_report_activity extends module_report
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$save_id = "";
|
||||
foreach ($rs as $row) {
|
||||
$kttd = 'top_ten_doc';
|
||||
$kttp = 'top_ten_poiddoc';
|
||||
@@ -692,7 +690,6 @@ class module_report_activity extends module_report
|
||||
$result[$kttpp][$id]['id'] = $id;
|
||||
}
|
||||
}
|
||||
$save_id = $id;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
@@ -96,7 +96,6 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
public function __construct(Application $app, $sbasid, $sbas_collection, $dmin, $dmax)
|
||||
{
|
||||
$this->app = $app;
|
||||
$conn = connection::getPDOConnection($app, $sbasid);
|
||||
$this->dmin = $dmin;
|
||||
$this->dmax = $dmax;
|
||||
$this->dminsql = $this->dateToSqlDate('dmin');
|
||||
|
@@ -142,7 +142,7 @@ class module_report_nav extends module_report
|
||||
}
|
||||
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -200,7 +200,7 @@ class module_report_nav extends module_report
|
||||
$this->report['legend'][] = $row['os'];
|
||||
}
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -261,7 +261,7 @@ class module_report_nav extends module_report
|
||||
}
|
||||
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -320,7 +320,7 @@ class module_report_nav extends module_report
|
||||
$this->report['legend'][] = $row['combo'];
|
||||
}
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -401,7 +401,7 @@ class module_report_nav extends module_report
|
||||
$this->report['legend'][] = $appli;
|
||||
}
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -475,7 +475,7 @@ class module_report_nav extends module_report
|
||||
_('report:: Information sur l\'utilisateur %s'), $login
|
||||
);
|
||||
}
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -566,7 +566,7 @@ class module_report_nav extends module_report
|
||||
|
||||
$this->result = $rs;
|
||||
$this->total = sizeof($this->result);
|
||||
$this->calculatePages($rs);
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
|
@@ -84,7 +84,6 @@ class module_report_question extends module_report
|
||||
|
||||
protected function buildResult(Application $app, $rs)
|
||||
{
|
||||
$tab = array();
|
||||
$i = 0;
|
||||
foreach ($rs as $row) {
|
||||
if ($this->enable_limit && ($i > $this->nb_record))
|
||||
|
@@ -17,7 +17,7 @@ class p4file
|
||||
$ret = false;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -77,8 +77,6 @@ class patch_320a implements patchInterface
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$tasks = array();
|
||||
|
||||
$sql = 'UPDATE task2 SET `class` = :class WHERE task_id = :task_id';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
foreach ($rs as $row) {
|
||||
|
@@ -64,14 +64,12 @@ class patch_370a8 implements patchInterface
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
$taskManager = $app['task-manager'];
|
||||
|
||||
$ttasks = array();
|
||||
$conn = $appbox->get_connection();
|
||||
$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) {
|
||||
$stmt->execute();
|
||||
$ttasks = $row = $stmt->fetchAll();
|
||||
$ttasks = $stmt->fetchAll();
|
||||
$stmt->closeCursor();
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,6 @@ class patchthesaurus_203
|
||||
|
||||
public function patch($version, &$domct, &$domth, connection_pdo &$connbas)
|
||||
{
|
||||
global $debug;
|
||||
global $ctchanged, $thchanged, $needreindex;
|
||||
$unicode = new unicode();
|
||||
|
||||
@@ -106,8 +105,6 @@ class patchthesaurus_203
|
||||
|
||||
public function fixRejected(connection_pdo &$connbas, &$node, $rejected)
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if ($node->nodeType != XML_ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
@@ -138,8 +135,6 @@ class patchthesaurus_203
|
||||
|
||||
public function fixIds(connection_pdo &$connbas, &$node)
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if ($node->nodeType != XML_ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ class patchthesaurus_204
|
||||
|
||||
public function patch($version, &$domct, &$domth, connection_pdo &$connbas)
|
||||
{
|
||||
global $debug;
|
||||
global $ctchanged, $thchanged, $needreindex;
|
||||
|
||||
$unicode = new unicode();
|
||||
@@ -109,8 +108,6 @@ class patchthesaurus_204
|
||||
|
||||
public function fixRejected(connection_pdo &$connbas, &$node, $rejected)
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if ($node->nodeType != XML_ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
@@ -141,8 +138,6 @@ class patchthesaurus_204
|
||||
|
||||
public function fixIds(connection_pdo &$connbas, &$node)
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if ($node->nodeType != XML_ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
|
@@ -973,8 +973,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
{
|
||||
$newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension();
|
||||
|
||||
$base_url = '';
|
||||
|
||||
$subdef_def = false;
|
||||
|
||||
if ($name == 'document') {
|
||||
@@ -1351,7 +1349,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$app['filesystem']->copy($file->getFile()->getRealPath(), $pathhd . $newname, true);
|
||||
|
||||
$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);
|
||||
|
||||
@@ -1500,8 +1498,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
public function delete()
|
||||
{
|
||||
$connbas = $this->get_databox()->get_connection();
|
||||
$sbas_id = $this->get_databox()->get_sbas_id();
|
||||
$conn = $this->app['phraseanet.appbox']->get_connection();
|
||||
|
||||
$ftodel = array();
|
||||
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->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";
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$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->closeCursor();
|
||||
|
||||
$base_ids = array_map(function($collection) {
|
||||
return $collection->get_base_id();
|
||||
}, $this->databox->get_collections());
|
||||
|
||||
$orderElementRepository = $this->app['EM']->getRepository('\Entities\OrderElement');
|
||||
|
||||
/* @var $repository \Repositories\OrderElementRepository */
|
||||
|
@@ -127,7 +127,6 @@ class record_preview extends record_adapter
|
||||
$this->original_item = $this->container;
|
||||
if ($pos == 0) {
|
||||
$number = 0;
|
||||
$title = _('preview:: regroupement ');
|
||||
} else {
|
||||
$children = $this->container->get_children();
|
||||
foreach ($children as $child) {
|
||||
@@ -219,7 +218,6 @@ class record_preview extends record_adapter
|
||||
case 'RESULT':
|
||||
$perPage = 56;
|
||||
$index = ($pos - 3) < 0 ? 0 : ($pos - 3);
|
||||
$page = (int) ceil($pos / $perPage);
|
||||
$results = $search_engine->query($query, $index, $perPage);
|
||||
|
||||
$this->train = $results->getResults()->toArray();
|
||||
@@ -593,8 +591,6 @@ class record_preview extends record_adapter
|
||||
$views = $dwnls = array();
|
||||
$top = 1;
|
||||
$day = 30;
|
||||
$min = 0;
|
||||
$average = 0;
|
||||
|
||||
while ($day >= 0) {
|
||||
|
||||
|
@@ -191,7 +191,6 @@ class recordutils_image extends recordutils
|
||||
|
||||
$domprefs->normalizeDocument();
|
||||
|
||||
$text_xpos = 0;
|
||||
$text_width = $image_width;
|
||||
|
||||
$logopos = null;
|
||||
@@ -224,9 +223,7 @@ class recordutils_image extends recordutils
|
||||
$text_width -= $logo_reswidth;
|
||||
if ($logopos == 'LEFT') {
|
||||
$logo_xpos = 0;
|
||||
$text_xpos = $logo_reswidth;
|
||||
} else {
|
||||
$text_xpos = 0;
|
||||
$logo_xpos = ($image_width - $logo_reswidth);
|
||||
}
|
||||
}
|
||||
|
@@ -431,8 +431,6 @@ class set_export extends set_abstract
|
||||
'subdefs' => array()
|
||||
);
|
||||
|
||||
$rename_done = false;
|
||||
|
||||
$BF = false;
|
||||
|
||||
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));
|
||||
|
||||
$files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true, true, true);
|
||||
$rename_done = true;
|
||||
} else {
|
||||
$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));
|
||||
|
||||
if (!$anonymous) {
|
||||
|
@@ -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)
|
||||
{
|
||||
$conn = $this->app['phraseanet.appbox']->get_connection();
|
||||
|
||||
$email_dest = '';
|
||||
if ($usr_to) {
|
||||
$user_t = User_Adapter::getInstance($usr_to, $this->app);
|
||||
|
@@ -28,11 +28,8 @@ class setup
|
||||
{
|
||||
$GV = require(__DIR__ . "/../../lib/conf.d/_GV_template.inc");
|
||||
|
||||
$debug = $log_errors = false;
|
||||
$vars = array();
|
||||
|
||||
$error = false;
|
||||
$extra_conf = '';
|
||||
|
||||
foreach ($GV as $section) {
|
||||
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')
|
||||
$datas[$variable['name']] = $datas[$variable['name']];
|
||||
|
||||
|
@@ -99,8 +99,6 @@ abstract class task_abstract
|
||||
*/
|
||||
protected $maxmegs;
|
||||
protected $runner;
|
||||
private $input;
|
||||
private $output;
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
// nb : self::log_levels ARE standard log levels, ok with monolog
|
||||
@@ -875,17 +857,6 @@ abstract class task_abstract
|
||||
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
|
||||
|
@@ -46,7 +46,6 @@ class task_period_RecordMover extends task_appboxAbstract
|
||||
$dom->formatOutput = true;
|
||||
|
||||
if ($dom->loadXML($oldxml)) {
|
||||
$xmlchanged = false;
|
||||
foreach (array(
|
||||
'str:period'
|
||||
, 'boo:logsql'
|
||||
@@ -72,7 +71,6 @@ class task_period_RecordMover extends task_appboxAbstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,6 @@ class task_period_archive extends task_abstract
|
||||
$dom->formatOutput = true;
|
||||
$dom->preserveWhiteSpace = false;
|
||||
if ($dom->loadXML($oldxml)) {
|
||||
$xmlchanged = false;
|
||||
foreach (array(
|
||||
'str:base_id'
|
||||
, 'str:hotfolder'
|
||||
@@ -125,7 +124,6 @@ class task_period_archive extends task_abstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +294,8 @@ class task_period_archive extends task_abstract
|
||||
{
|
||||
$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);
|
||||
|
||||
@@ -378,7 +377,7 @@ class task_period_archive extends task_abstract
|
||||
$loop = 0;
|
||||
while ($this->running) {
|
||||
try {
|
||||
$conn = connection::getPDOConnection($this->dependencyContainer);
|
||||
connection::getPDOConnection($this->dependencyContainer);
|
||||
} catch (Exception $e) {
|
||||
$this->log($e->getMessage());
|
||||
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('grp')) {
|
||||
// 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 {
|
||||
// ...normal subfolder : recurse
|
||||
$name = $n->getAttribute('name');
|
||||
@@ -1807,7 +1806,6 @@ class task_period_archive extends task_abstract
|
||||
}
|
||||
|
||||
$file = $node->getAttribute('name');
|
||||
$cid = $node->getAttribute('cid');
|
||||
$captionFileNode = null;
|
||||
|
||||
$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)
|
||||
{
|
||||
$ret = false;
|
||||
|
||||
$file = $node->getAttribute('name');
|
||||
$cid = $node->getAttribute('cid');
|
||||
$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);
|
||||
|
||||
if ($captionFileName === null) {
|
||||
$record = $this->createRecord($collection, $path . '/' . $file, null, $grp_rid);
|
||||
$this->createRecord($collection, $path . '/' . $file, null, $grp_rid);
|
||||
} else {
|
||||
$record = $this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid);
|
||||
$this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid);
|
||||
}
|
||||
|
||||
$node->setAttribute('archived', '1');
|
||||
@@ -1940,8 +1936,6 @@ class task_period_archive extends task_abstract
|
||||
$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) {
|
||||
@@ -1968,10 +1962,6 @@ class task_period_archive extends task_abstract
|
||||
$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')) {
|
||||
|
@@ -128,7 +128,6 @@ class task_period_cindexer extends task_abstract
|
||||
$dom = new DOMDocument();
|
||||
$dom->formatOutput = true;
|
||||
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) {
|
||||
$ptype = substr($pname, 0, 3);
|
||||
$pname = substr($pname, 4);
|
||||
@@ -151,7 +150,6 @@ class task_period_cindexer extends task_abstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,13 +387,8 @@ class task_period_cindexer extends task_abstract
|
||||
{
|
||||
$cmd = $this->getIndexer();
|
||||
|
||||
$nullfile = '/dev/null';
|
||||
$this->method = self::METHOD_PROC_OPEN;
|
||||
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
$nullfile = '/dev/null';
|
||||
}
|
||||
|
||||
if ( ! file_exists($cmd) || ! is_executable($cmd)) {
|
||||
$this->setState(self::STATE_STOPPED);
|
||||
$this->log(sprintf('File \'%s\' does not exists', $cmd));
|
||||
@@ -459,8 +452,6 @@ class task_period_cindexer extends task_abstract
|
||||
$args_nopwd[] = '--run';
|
||||
}
|
||||
|
||||
$logdir = $this->dependencyContainer['root.path'] . '/logs/';
|
||||
|
||||
$this->new_status = NULL; // new status to set 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));
|
||||
|
||||
$pid = NULL;
|
||||
if (is_resource($process)) {
|
||||
$proc_status = proc_get_status($process);
|
||||
if ($proc_status['running']) {
|
||||
$pid = $proc_status['pid'];
|
||||
}
|
||||
}
|
||||
$qsent = '';
|
||||
$timetokill = NULL;
|
||||
$sock = NULL;
|
||||
|
@@ -52,7 +52,6 @@ class task_period_ftp extends task_appboxAbstract
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
if ((@$dom->loadXML($oldxml)) != FALSE) {
|
||||
$xmlchanged = false;
|
||||
foreach (array('str:proxy', 'str:proxyport', 'str:period', 'pop:syslog') as $pname) {
|
||||
$ptype = substr($pname, 0, 3);
|
||||
$pname = substr($pname, 4);
|
||||
@@ -76,7 +75,6 @@ class task_period_ftp extends task_appboxAbstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,15 +272,10 @@ class task_period_ftp extends task_appboxAbstract
|
||||
|
||||
protected function processOneContent(appbox $appbox, $export)
|
||||
{
|
||||
$conn = $appbox->get_connection();
|
||||
|
||||
$id = $export->getId();
|
||||
|
||||
$state = "";
|
||||
$ftp_server = $export->getAddr();
|
||||
$ftp_user_name = $export->getLogin();
|
||||
$ftp_user_pass = $export->getPwd();
|
||||
$usr_id = $export->getUsrId();
|
||||
|
||||
$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)
|
||||
{
|
||||
$conn = $appbox->get_connection();
|
||||
|
||||
if ($export->getCrash() >= $export->getNbretry()) {
|
||||
$this->send_mails($appbox, $export);
|
||||
|
||||
|
@@ -100,7 +100,6 @@ class task_period_ftpPull extends task_appboxAbstract
|
||||
|
||||
public function printInterfaceJS()
|
||||
{
|
||||
global $parm;
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -156,7 +155,6 @@ class task_period_ftpPull extends task_appboxAbstract
|
||||
|
||||
public function getInterfaceHTML()
|
||||
{
|
||||
global $parm;
|
||||
ob_start();
|
||||
?>
|
||||
<form name="graphicForm" onsubmit="return(false);" method="post">
|
||||
|
@@ -80,8 +80,6 @@ class task_period_subdef extends task_databoxAbstract
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
if (@$dom->loadXML($oldxml)) {
|
||||
$xmlchanged = false;
|
||||
|
||||
foreach (array('str:period', 'str:flush', 'str:maxrecs', 'str:maxmegs', 'boo:embedded') as $pname) {
|
||||
$ptype = substr($pname, 0, 3);
|
||||
$pname = substr($pname, 4);
|
||||
@@ -102,7 +100,6 @@ class task_period_subdef extends task_databoxAbstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,6 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
if ($dom->loadXML($oldxml)) {
|
||||
$xmlchanged = false;
|
||||
foreach (array('str:period', 'str:maxrecs', 'str:maxmegs', 'boo:cleardoc') as $pname) {
|
||||
$ptype = substr($pname, 0, 3);
|
||||
$pname = substr($pname, 4);
|
||||
@@ -68,7 +67,6 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
$ns->appendChild($dom->createTextNode($pvalue ? '1' : '0'));
|
||||
break;
|
||||
}
|
||||
$xmlchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user