Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#70 [Class/Js] add: export of url in csv and reword link creation in js #73

Conversation

evarisk-kilyan
Copy link

No description provided.

@@ -0,0 +1,79 @@
<?php
/* Copyright (C) 2024-2024 EVARISK <technique@evarisk.com>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright (C) 2024 EVARISK technique@evarisk.com

/**
* \file class/exportshortenerdocument.class.php
* \ingroup easyurl
* \brief This file is a CRUD class file for ExportShortener (Create/Read/Update/Delete)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExportShortenerDocument

require_once __DIR__ . '/../../saturne/class/saturnedocuments.class.php';

/**
* Class for ExportShortener
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExportShortenerDocument

/**
* @var string Element type of object
*/
public $element = 'export_shortener_document';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH voir je crois que ca créer des problèmes

public $element = 'export_shortener_document';

/**
* Constructor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructor

$shorteners = $shortener->fetchAll('', '', 0, 0, ['t.fk_export_shortener' => $this->id]);

$upload_dir = $conf->easyurl->multidir_output[$conf->entity] . '/' . $this->element;
dol_mkdir($upload_dir);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test mkdir

$fileName = dol_print_date(dol_now(), 'dayhourxcard') . '_' . $this->element . '.csv';
$fp = fopen($upload_dir . '/' . $fileName, 'w');
fputcsv($fp, [1 => 'ref' . ';' . 'label' . ';' . 'original_url' . ';' . 'short_url']);
foreach ($shorteners as $key => $link) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test array

}
fclose($fp);
$this->last_main_doc = $fileName;
$this->update($user);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test setvaluefrom

$fileName = dol_print_date(dol_now(), 'dayhourxcard') . '_' . $this->element . '.csv';
$fp = fopen($upload_dir . '/' . $fileName, 'w');
fputcsv($fp, [1 => 'ref' . ';' . 'label' . ';' . 'original_url' . ';' . 'short_url']);
foreach ($shorteners as $key => $link) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$shorteners as $shortenerId => $shortener

for ($i = 1; $i <= $NbUrl; $i++) {
$urlParameters = '';
$error = 0;
$json = json_decode(file_get_contents('php://input', true));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi tant de haine contre les crochets '[' :(

@nicolas-eoxia nicolas-eoxia merged commit f5615b6 into Eoxia:develop Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Pas d'information sur l'avancement lors de la création des URL Export du fichier CSV des URL raccourcie
2 participants