-
Notifications
You must be signed in to change notification settings - Fork 7
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
#70 [Class/Js] add: export of url in csv and reword link creation in js #73
Conversation
@@ -0,0 +1,79 @@ | |||
<?php | |||
/* Copyright (C) 2024-2024 EVARISK <technique@evarisk.com> |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$shorteners as $shortenerId => $shortener
view/easyurltools.php
Outdated
for ($i = 1; $i <= $NbUrl; $i++) { | ||
$urlParameters = ''; | ||
$error = 0; | ||
$json = json_decode(file_get_contents('php://input', true)); |
There was a problem hiding this comment.
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 '[' :(
No description provided.