Merge remote-tracking branch 'Upstream/develop' into develop-63
Conflicts: htdocs/install/mysql/migration/3.8.0-3.9.0.sql
This commit is contained in:
commit
cf869f22b5
@ -23,7 +23,7 @@ php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: 7.0
|
||||
@ -130,6 +130,8 @@ script:
|
||||
- php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log
|
||||
# - cat upgrade370380.log
|
||||
- php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
|
||||
- php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log
|
||||
- php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log
|
||||
# - cat upgrade370380-2.log
|
||||
- cd ../..
|
||||
- date
|
||||
|
||||
@ -6,9 +6,11 @@
|
||||
"homepage": "http://www.dolibarr.org",
|
||||
"license": "GPL-3.0+",
|
||||
"support": {
|
||||
"issues": "https://doliforge.org/projects/dolibarr",
|
||||
"issues": "https://github.com/Dolibarr/dolibarr/issues",
|
||||
"forum": "http://www.dolibarr.org/forum",
|
||||
"wiki": "http://wiki.dolibarr.org"
|
||||
"wiki": "http://wiki.dolibarr.org",
|
||||
"irc": "irc://chat.freenode.net/dolibarr",
|
||||
"source": "https://github.com/Dolibarr/dolibarr"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
|
||||
2
composer.lock
generated
2
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "32e1fa78cc95c32b154a38e07706874c",
|
||||
"hash": "2ab34d0ff69b48500c20621330c1bfd7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ccampbell/chromephp",
|
||||
|
||||
@ -225,7 +225,11 @@ foreach ($syslogModules as $moduleName)
|
||||
print '<td align="left">';
|
||||
if ($module->getInfo())
|
||||
{
|
||||
print $form->textwithpicto('', $module->getInfo());
|
||||
print $form->textwithpicto('', $module->getInfo(), 1, 'help');
|
||||
}
|
||||
if ($module->getWarning())
|
||||
{
|
||||
print $form->textwithpicto('', $module->getWarning(), 1, 'warning');
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1053,49 +1053,6 @@ if (empty($reshook))
|
||||
exit();
|
||||
}
|
||||
|
||||
// Generation doc (depuis lien ou depuis cartouche doc)
|
||||
else if ($action == 'builddoc' && $user->rights->propal->creer) {
|
||||
if (GETPOST('model')) {
|
||||
$object->setDocModel($user, GETPOST('model'));
|
||||
}
|
||||
if (GETPOST('fk_bank')) { // this field may come from an external module
|
||||
$object->fk_bank = GETPOST('fk_bank');
|
||||
} else {
|
||||
$object->fk_bank = $object->fk_account;
|
||||
}
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
// Remove file in doc form
|
||||
else if ($action == 'remove_file' && $user->rights->propal->creer) {
|
||||
if ($object->id > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->propal->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||
if ($ret)
|
||||
setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
|
||||
else
|
||||
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Set project
|
||||
else if ($action == 'classin' && $user->rights->propal->creer) {
|
||||
$object->setProject($_POST['projectid']);
|
||||
@ -1211,6 +1168,12 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->propal->dir_output;
|
||||
$permissioncreate=$user->rights->propal->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1088,8 +1088,8 @@ class Account extends CommonObject
|
||||
{
|
||||
$country_code=$this->getCountryCode();
|
||||
|
||||
if (in_array($country_code,array('CH','DE','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon
|
||||
if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, Great Britain...
|
||||
if (in_array($country_code,array('CH','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon, ...
|
||||
if (in_array($country_code,array('AU','BE','CA','DE','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, England...
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
232
htdocs/compta/bank/document.php
Normal file
232
htdocs/compta/bank/document.php
Normal file
@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/document.php
|
||||
* \ingroup banque
|
||||
* \brief Page de gestion des documents attaches a un compte bancaire
|
||||
*/
|
||||
require('../../main.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT . "/core/lib/bank.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT . "/core/class/html.formfile.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
|
||||
|
||||
$langs->load('companies');
|
||||
$langs->load('other');
|
||||
|
||||
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int'));
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$mesg = '';
|
||||
if (isset($_SESSION['DolMessage'])) {
|
||||
$mesg = $_SESSION['DolMessage'];
|
||||
unset($_SESSION['DolMessage']);
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) {
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
if ($user->societe_id)
|
||||
$socid = $user->societe_id;
|
||||
$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '',
|
||||
$fieldtype);
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortorder)
|
||||
$sortorder = "ASC";
|
||||
if (!$sortfield)
|
||||
$sortfield = "name";
|
||||
|
||||
$object = new Account($db);
|
||||
if ($id)
|
||||
$object->fetch($id);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||
if ($object->fetch($id)) {
|
||||
|
||||
$upload_dir = $conf->bank->dir_output . "/" . $object->ref;
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0) {
|
||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'],
|
||||
$upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),
|
||||
0, 0, $_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0) {
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name'])
|
||||
== 1) {
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'],
|
||||
$maxwidthsmall, $maxheightsmall, '_small', $quality,
|
||||
"thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'],
|
||||
$maxwidthmini, $maxheightmini, '_mini', $quality,
|
||||
"thumbs");
|
||||
}
|
||||
$mesg = '<div class="ok">' . $langs->trans("FileTransferComplete") . '</div>';
|
||||
}
|
||||
else {
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) { // Unknown error
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFileNotUploaded") . '</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',
|
||||
$resupload)) { // Files infected by a virus
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFileIsInfectedWithAVirus") . '</div>';
|
||||
}
|
||||
else { // Known error
|
||||
$mesg = '<div class="error">' . $langs->trans($resupload) . '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes') {
|
||||
if ($object->fetch($id)) {
|
||||
|
||||
$upload_dir = $conf->bank->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
|
||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||
if ($ret) {
|
||||
setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
} else {
|
||||
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
|
||||
Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
if ($object->fetch($id, $ref)) {
|
||||
|
||||
$upload_dir = $conf->bank->dir_output . '/' . $object->ref;
|
||||
|
||||
// Onglets
|
||||
$head = bank_prepare_head($object);
|
||||
dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), 0,
|
||||
'account');
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$',
|
||||
$sortfield,
|
||||
(strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
|
||||
$totalsize = 0;
|
||||
foreach ($filearray as $key => $file) {
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Ref
|
||||
// Ref
|
||||
print '<tr><td valign="top" width="25%">' . $langs->trans("Ref") . '</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object, 'ref', '', 1, 'ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top">' . $langs->trans("Label") . '</td>';
|
||||
print '<td colspan="3">' . $object->label . '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td valign="top">' . $langs->trans("Status") . '</td>';
|
||||
print '<td colspan="3">' . $object->getLibStatut(4) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg, $mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($action == 'delete') {
|
||||
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
|
||||
$langs->trans('DeleteFile'),
|
||||
$langs->trans('ConfirmDeleteFile'), 'confirm_deletefile',
|
||||
'', 0, 1);
|
||||
if ($ret == 'html')
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile = new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/bank/document.php?id=' . $object->id,
|
||||
'', 0, 0, $user->rights->banque, 50, $object);
|
||||
|
||||
|
||||
// List of document
|
||||
$param = '&id=' . $object->id;
|
||||
$formfile->list_of_documents($filearray, $object, 'bank', $param);
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Header('Location: index.php');
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
108
htdocs/core/actions_builddoc.inc.php
Normal file
108
htdocs/core/actions_builddoc.inc.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/actions_builddoc.inc.php
|
||||
* \brief Code for actions on building or deleting documents
|
||||
*/
|
||||
|
||||
|
||||
// $action must be defined
|
||||
// $id must be defined
|
||||
// $object must be defined and must have a method generateDocument.
|
||||
// $permissioncreate must be defined
|
||||
// $upload_dir must be defined (example $conf->projet->dir_output . "/";)
|
||||
// $hidedetails, $hidedesc and $hideref may have been set or not.
|
||||
|
||||
|
||||
// Build doc
|
||||
if ($action == 'builddoc' && $permissioncreate)
|
||||
{
|
||||
if (is_numeric(GETPOST('model')))
|
||||
{
|
||||
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reload to get all modified line records and be ready for hooks
|
||||
$ret = $object->fetch($id);
|
||||
$ret = $object->fetch_thirdparty();
|
||||
/*if (empty($object->id) || ! $object->id > 0)
|
||||
{
|
||||
dol_print_error('Object must have been loaded by a fetch');
|
||||
exit;
|
||||
}*/
|
||||
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
||||
|
||||
// Special case for invoices
|
||||
if (property_exists($object, 'fk_bank'))
|
||||
{
|
||||
if (GETPOST('fk_bank')) { // this field may come from an external module
|
||||
$object->fk_bank = GETPOST('fk_bank');
|
||||
} else {
|
||||
$object->fk_bank = $object->fk_account;
|
||||
}
|
||||
}
|
||||
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->client->default_lang)) $newlang=$object->client->default_lang; // for proposal, order, invoice, ...
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) $newlang=$object->default_lang; // for thirdparty
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
// To be sure vars is defined
|
||||
if (empty($hidedetails)) $hidedetails=0;
|
||||
if (empty($hidedesc)) $hidedesc=0;
|
||||
if (empty($hideref)) $hideref=0;
|
||||
|
||||
$result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete file in doc form
|
||||
if ($action == 'remove_file' && $permissioncreate)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if (empty($object->id) || ! $object->id > 0)
|
||||
{
|
||||
// Reload to get all modified line records and be ready for hooks
|
||||
$ret = $object->fetch($id);
|
||||
$ret = $object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$langs->load("other");
|
||||
$filetodelete=GETPOST('file','alpha');
|
||||
$file = $upload_dir . '/' . $filetodelete;
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", $filetodelete));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", $filetodelete), 'errors');
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
// $action must be defined
|
||||
// $object must be defined
|
||||
// $permissiondellink must be defined
|
||||
// $uploaddir (example $conf->projet->dir_output . "/";)
|
||||
|
||||
$dellinkid = GETPOST('dellinkid','int');
|
||||
|
||||
@ -34,3 +35,5 @@ if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') &
|
||||
$result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid);
|
||||
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3432,7 +3432,6 @@ abstract class CommonObject
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($this->db);
|
||||
//$obj->message = $message;
|
||||
|
||||
// If generator is ODT, we must have srctemplatepath defined, if not we set it.
|
||||
if ($obj->type == 'odt' && empty($srctemplatepath))
|
||||
|
||||
@ -346,6 +346,9 @@ class Conf
|
||||
// Module contrat
|
||||
$this->contrat->dir_output=$rootfordata."/contracts";
|
||||
$this->contrat->dir_temp =$rootfordata."/contracts/temp";
|
||||
// Module bank
|
||||
$this->bank->dir_output=$rootfordata."/bank";
|
||||
$this->bank->dir_temp =$rootfordata."/bank/temp";
|
||||
|
||||
|
||||
// Set some default values
|
||||
|
||||
@ -364,7 +364,8 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a text and picto with tooltip on text or picto
|
||||
* Show a text and picto with tooltip on text or picto.
|
||||
* Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip
|
||||
*
|
||||
* @param string $text Text to show
|
||||
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
|
||||
|
||||
@ -234,7 +234,8 @@ class Translate
|
||||
if ($usecachekey)
|
||||
{
|
||||
//dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey);
|
||||
|
||||
//global $aaa; $aaa+=1;
|
||||
//print $aaa." ".$usecachekey."\n";
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/memory.lib.php';
|
||||
$tmparray=dol_getcache($usecachekey);
|
||||
if (is_array($tmparray) && count($tmparray))
|
||||
|
||||
@ -72,6 +72,11 @@ function bank_prepare_head(Account $object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
|
||||
$head[$h][1] = $langs->trans("Documents");
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -47,10 +47,16 @@ function dol_setcache($memoryid,$data)
|
||||
// Using a memcached server
|
||||
if (! empty($conf->memcached->enabled) && class_exists('Memcached'))
|
||||
{
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
$m=new Memcached();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
global $m;
|
||||
if (empty($m) || ! is_object($m))
|
||||
{
|
||||
$m=new Memcached();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
if (! $result) return -1;
|
||||
}
|
||||
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
//$m->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
//print "Add memoryid=".$memoryid;
|
||||
$m->add($memoryid,$data); // This fails if key already exists
|
||||
@ -66,10 +72,16 @@ function dol_setcache($memoryid,$data)
|
||||
}
|
||||
else if (! empty($conf->memcached->enabled) && class_exists('Memcache'))
|
||||
{
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
$m=new Memcache();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
global $m;
|
||||
if (empty($m) || ! is_object($m))
|
||||
{
|
||||
$m=new Memcache();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
if (! $result) return -1;
|
||||
}
|
||||
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
//$m->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
$result=$m->add($memoryid,$data); // This fails if key already exists
|
||||
if ($result)
|
||||
@ -103,10 +115,16 @@ function dol_getcache($memoryid)
|
||||
// Using a memcached server
|
||||
if (! empty($conf->memcached->enabled) && class_exists('Memcached'))
|
||||
{
|
||||
global $m;
|
||||
if (empty($m) || ! is_object($m))
|
||||
{
|
||||
$m=new Memcached();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
if (! $result) return -1;
|
||||
}
|
||||
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
$m=new Memcached();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
//$m->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
//print "Get memoryid=".$memoryid;
|
||||
$data=$m->get($memoryid);
|
||||
@ -124,10 +142,16 @@ function dol_getcache($memoryid)
|
||||
}
|
||||
else if (! empty($conf->memcached->enabled) && class_exists('Memcache'))
|
||||
{
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
$m=new Memcache();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
global $m;
|
||||
if (empty($m) || ! is_object($m))
|
||||
{
|
||||
$m=new Memcache();
|
||||
$tmparray=explode(':',$conf->global->MEMCACHED_SERVER);
|
||||
$result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211);
|
||||
if (! $result) return -1;
|
||||
}
|
||||
|
||||
$memoryid=session_name().'_'.$memoryid;
|
||||
//$m->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
$data=$m->get($memoryid);
|
||||
//print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n<br>";
|
||||
|
||||
@ -734,7 +734,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->ficheinter->enabled))
|
||||
{
|
||||
$langs->load("interventions");
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 200);
|
||||
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 200);
|
||||
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs Object lang a utiliser pour traduction
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* TODO
|
||||
* TODO Use commonDocGenerator
|
||||
*/
|
||||
function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
|
||||
{
|
||||
@ -103,7 +103,6 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
|
||||
require_once $dir.$file;
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->message = $message;
|
||||
|
||||
// We save charset_output to restore it because write_file can change it if needed for
|
||||
// output format that does not support UTF8.
|
||||
|
||||
@ -155,8 +155,8 @@ abstract class ModeleNumRefFactures
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @deprecated Use the new function generateDocument of Facture class
|
||||
* @see Facture::generateDocument()
|
||||
* @deprecated Use the new function generateDocument of Facture class
|
||||
* @see Facture::generateDocument()
|
||||
*/
|
||||
function facture_pdf_create(DoliDB $db, Facture $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -20,17 +20,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup fournisseur Module suppliers
|
||||
* \brief Module pour gerer des societes et contacts de type fournisseurs
|
||||
* \defgroup fournisseur suppliers Module
|
||||
* \brief Module to manage companies and contacts of supplier type
|
||||
* \file htdocs/core/modules/modFournisseur.class.php
|
||||
* \ingroup fournisseur
|
||||
* \brief Fichier de description et activation du module Fournisseur
|
||||
* \brief Description and activation file for module Fournisseur
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de description et activation du module Fournisseur
|
||||
* Description and activation class for module Fournisseur
|
||||
*/
|
||||
class modFournisseur extends DolibarrModules
|
||||
{
|
||||
@ -67,7 +67,7 @@ class modFournisseur extends DolibarrModules
|
||||
"/fournisseur/facture/temp"
|
||||
);
|
||||
|
||||
// Dependances
|
||||
// Dependencies
|
||||
$this->depends = array("modSociete");
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array('bills', 'companies', 'suppliers', 'orders');
|
||||
@ -75,7 +75,7 @@ class modFournisseur extends DolibarrModules
|
||||
// Config pages
|
||||
$this->config_page_url = array("supplier_order.php");
|
||||
|
||||
// Constantes
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
@ -363,6 +363,28 @@ abstract class ModeleAccountancyCode
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param Facture $object Object invoice
|
||||
* @param string $message Message (not used, deprecated)
|
||||
* @param string $modele Force template to use ('' to not force)
|
||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @deprecated Use the new function generateDocument of Facture class
|
||||
* @see Societe::generateDocument()
|
||||
*/
|
||||
function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
|
||||
|
||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a document for third party
|
||||
@ -374,7 +396,7 @@ abstract class ModeleAccountancyCode
|
||||
* @param Translate $outputlangs Object lang to use for translation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs)
|
||||
/*function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs)
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
$langs->load("bills");
|
||||
@ -413,7 +435,6 @@ function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs)
|
||||
require_once $dir.'/'.$file;
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->message = $message;
|
||||
|
||||
// We save charset_output to restore it because write_file can change it if needed for
|
||||
// output format that does not support UTF8.
|
||||
@ -438,5 +459,5 @@ function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ -28,13 +28,23 @@ class LogHandler
|
||||
/**
|
||||
* Content of the info tooltip.
|
||||
*
|
||||
* @return false|string
|
||||
* @return string
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
return false;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return warning if something is wrong with logger
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarning()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
|
||||
*
|
||||
|
||||
@ -48,6 +48,13 @@ interface LogHandlerInterface
|
||||
*/
|
||||
public function getInfo();
|
||||
|
||||
/**
|
||||
* Return warning if something is wrong with logger
|
||||
*
|
||||
* @return string Warning message
|
||||
*/
|
||||
public function getWarning();
|
||||
|
||||
/**
|
||||
* Return array of configuration data
|
||||
*
|
||||
|
||||
@ -32,19 +32,29 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
/**
|
||||
* Content of the info tooltip.
|
||||
*
|
||||
* @return false|string
|
||||
* @return string
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return warning if something is wrong with logger
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarning()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
return $this->isActive()?'':$langs->trans('ClassNotFoundIntoPathWarning','ChromePhp.class.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is the module active ?
|
||||
*
|
||||
* @return int
|
||||
* @return int -1 if not active, 0 if active but lib/path not found, 1 if OK
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
@ -65,6 +75,10 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
@ -89,7 +103,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
'constant' => 'SYSLOG_CHROMEPHP_INCLUDEPATH',
|
||||
'default' => DOL_DOCUMENT_ROOT . '/includes/ccampbell/chromephp/',
|
||||
'attr' => 'size="60"',
|
||||
'example' =>'/usr/share/php'
|
||||
'example' =>'/usr/share/php, '.DOL_DOCUMENT_ROOT . '/includes/ccampbell/chromephp/'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/includes/autoload.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/syslog/logHandler.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -94,6 +95,14 @@ $userstatic=new User($db);
|
||||
<div class="tagtd nowrap"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
|
||||
<div class="tagtd nowrap maxwidthonsmartphone">
|
||||
<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
|
||||
<?php
|
||||
// add company icon for direct link
|
||||
if ($selectedCompany)
|
||||
{
|
||||
$companystatic->fetch($selectedCompany);
|
||||
echo $companystatic->getNomUrl(2);
|
||||
}
|
||||
?>
|
||||
<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0); ?>
|
||||
</div>
|
||||
<div class="tagtd maxwidthonsmartphone">
|
||||
|
||||
@ -17,6 +17,11 @@
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
|
||||
// TODO This is an action include, not a presentation template.
|
||||
// Move this file into htdocs/core/actions_document.inc.php
|
||||
|
||||
|
||||
// Variable $upload_dir must be defined when entering here
|
||||
|
||||
// Send file/link
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* $object (invoice, order, ...)
|
||||
* $conf
|
||||
* $langs
|
||||
* $seller, $nuyer
|
||||
* $seller, $buyer
|
||||
* $dateSelector
|
||||
* $forceall (0 by default, 1 for supplier invoices/orders)
|
||||
* $senderissupplier (0 by default, 1 for supplier invoices/orders)
|
||||
@ -259,7 +259,7 @@ if (! empty($conf->margin->enabled))
|
||||
|
||||
/* Init field buying_price and fournprice */
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product?$line->fk_product:0; ?>}, function(data) {
|
||||
if (data && data.length > 0) {
|
||||
if (data && data.length > 0) {
|
||||
var options = '';
|
||||
var trouve=false;
|
||||
$(data).each(function() {
|
||||
@ -302,9 +302,10 @@ if (! empty($conf->margin->enabled))
|
||||
$('#savelinebutton').click(function (e) {
|
||||
return checkEditLine(e, "np_marginRate");
|
||||
});
|
||||
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
|
||||
$("input[name='np_marginRate']:first").blur(function(e) {
|
||||
return checkEditLine(e, "np_marginRate");
|
||||
});
|
||||
});*/
|
||||
<?php
|
||||
}
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||
@ -313,9 +314,10 @@ if (! empty($conf->margin->enabled))
|
||||
$('#savelinebutton').click(function (e) {
|
||||
return checkEditLine(e, "np_markRate");
|
||||
});
|
||||
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
|
||||
$("input[name='np_markRate']:first").blur(function(e) {
|
||||
return checkEditLine(e, "np_markRate");
|
||||
});
|
||||
});*/
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@ -323,7 +325,7 @@ if (! empty($conf->margin->enabled))
|
||||
|
||||
|
||||
/* If margin rate field empty, do nothing. */
|
||||
/* Force content of price_ht to 0 or if a discount is set recalculate it from margin rate */
|
||||
/* Force content of price_ht to 0 or if a discount is set, recalculate it from margin rate */
|
||||
function checkEditLine(e, npRate)
|
||||
{
|
||||
var buying_price = $("input[name='buying_price']:first");
|
||||
@ -332,16 +334,16 @@ if (! empty($conf->margin->enabled))
|
||||
var rate = $("input[name='"+npRate+"']:first");
|
||||
if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true;
|
||||
|
||||
if (! $.isNumeric(rate.val().replace(',','.')))
|
||||
if (! $.isNumeric(rate.val().replace(' ','').replace(',','.')))
|
||||
{
|
||||
alert('<?php echo $langs->trans("rateMustBeNumeric"); ?>');
|
||||
alert('<?php echo $langs->transnoentitiesnoconv("rateMustBeNumeric"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
}
|
||||
if (npRate == "np_markRate" && rate.val() >= 100)
|
||||
{
|
||||
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
|
||||
alert('<?php echo $langs->transnoentitiesnoconv("markRateShouldBeLesserThan100"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
@ -354,14 +356,20 @@ if (! empty($conf->margin->enabled))
|
||||
{
|
||||
bpjs=price2numjs(buying_price.val());
|
||||
ratejs=price2numjs(rate.val());
|
||||
|
||||
/* console.log(npRate+" - "+bpjs+" - "+ratejs); */
|
||||
|
||||
if (npRate == "np_marginRate")
|
||||
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
|
||||
price = ((bpjs * (1 + (ratejs / 100))) / (1 - remisejs / 100));
|
||||
else if (npRate == "np_markRate")
|
||||
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
|
||||
{
|
||||
if (ratejs != 100)
|
||||
{
|
||||
price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100));
|
||||
}
|
||||
else price=$("input[name='price_ht']:first").val();
|
||||
}
|
||||
}
|
||||
/* console.log("new price ht = "+price); */
|
||||
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
|
||||
|
||||
return true;
|
||||
|
||||
365
htdocs/fichinter/index.php
Normal file
365
htdocs/fichinter/index.php
Normal file
@ -0,0 +1,365 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/fichinter/index.php
|
||||
* \ingroup commande
|
||||
* \brief Home page of interventional module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/fichinter/class/fichinter.class.php';
|
||||
|
||||
if (!$user->rights->ficheinter->lire) accessforbidden();
|
||||
|
||||
$langs->load("interventions");
|
||||
|
||||
// Security check
|
||||
$socid=GETPOST('socid','int');
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$fichinterstatic=new Fichinter($db);
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$help_url="EN:ModuleFichinters|FR:Module_Fiche_Interventions|ES:Módulo_FichaInterventiones";
|
||||
|
||||
llxHeader("",$langs->trans("Interventions"),$help_url);
|
||||
|
||||
print_fiche_titre($langs->trans("InterventionsArea"));
|
||||
|
||||
//print '<table width="100%" class="notopnoleftnoright">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
// Search ficheinter
|
||||
$var=false;
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/fichinter/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAnIntervention").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||
print '</tr>';
|
||||
print "</form></table><br>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
|
||||
$sql = "SELECT count(f.rowid), f.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('societe', 1).")";
|
||||
if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id;
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " GROUP BY f.fk_statut";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$total=0;
|
||||
$totalinprocess=0;
|
||||
$dataseries=array();
|
||||
$vals=array();
|
||||
$bool=false;
|
||||
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row)
|
||||
{
|
||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||
{
|
||||
$bool=(! empty($row[2])?true:false);
|
||||
if (! isset($vals[$row[1].$bool])) $vals[$row[1].$bool]=0;
|
||||
$vals[$row[1].$bool]+=$row[0];
|
||||
$totalinprocess+=$row[0];
|
||||
}
|
||||
$total+=$row[0];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</td></tr>'."\n";
|
||||
$listofstatus=array(0,1,2);
|
||||
$bool=false;
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
$dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||
if ($status==3 && $bool==false) $bool=true;
|
||||
else $bool=false;
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
$var=true;
|
||||
$bool=false;
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
if (! $conf->use_javascript_ajax)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
|
||||
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||
print $fichinterstatic->LibStatut($status,$bool,3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
if ($status==3 && $bool==false) $bool=true;
|
||||
else $bool=false;
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
print "</table><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Draft orders
|
||||
*/
|
||||
if (! empty($conf->ficheinter->enabled))
|
||||
{
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('fichinter', 1).")";
|
||||
$sql.= " AND f.fk_statut = 0";
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("DraftFichinter").'</td></tr>';
|
||||
$langs->load("fichinter");
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($resql);
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap">';
|
||||
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowFichinter"),"intervention").' '.$obj->ref."</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</table><br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
$max=5;
|
||||
|
||||
/*
|
||||
* Last modified orders
|
||||
*/
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, f.date_valid as datec, f.tms as datem,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('commande', 1).")";
|
||||
//$sql.= " AND c.fk_statut > 2";
|
||||
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " ORDER BY f.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">'.$langs->trans("LastModifiedInterventions",$max).'</td></tr>';
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="20%" class="nowrap">';
|
||||
|
||||
$fichinterstatic->id=$obj->rowid;
|
||||
$fichinterstatic->ref=$obj->ref;
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
print '<td width="96" class="nobordernopadding nowrap">';
|
||||
print $fichinterstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" class="nobordernopadding nowrap">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($fichinterstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>';
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</table><br>";
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
|
||||
/*
|
||||
* Orders to process
|
||||
*/
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('commande', 1).")";
|
||||
$sql.= " AND f.fk_statut = 1";
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " ORDER BY f.rowid DESC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($resql);
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap" width="20%">';
|
||||
|
||||
$fichinterstatic->id=$obj->rowid;
|
||||
$fichinterstatic->ref=$obj->ref;
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
print '<td width="96" class="nobordernopadding nowrap">';
|
||||
print $fichinterstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" class="nobordernopadding nowrap">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($fichinterstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
|
||||
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -30,7 +30,7 @@
|
||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
||||
*/
|
||||
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.0-beta');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.0-beta');
|
||||
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
|
||||
@ -38,12 +38,13 @@ if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'ftp','');
|
||||
|
||||
// Get parameters
|
||||
$action = isset($_GET["action"])?$_GET["action"]:$_POST['action'];
|
||||
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
|
||||
$action=GETPOST('action');
|
||||
$section=GETPOST('section');
|
||||
if (! $section) $section='/';
|
||||
$numero_ftp = GETPOST("numero_ftp");
|
||||
if (! $numero_ftp) $numero_ftp=1;
|
||||
$file=isset($_GET["file"])?$_GET["file"]:$_POST['file'];
|
||||
/* if (! $numero_ftp) $numero_ftp=1; */
|
||||
$file=GETPOST("file");
|
||||
$confirm=GETPOST('confirm');
|
||||
|
||||
$upload_dir = $conf->ftp->dir_temp;
|
||||
$download_dir = $conf->ftp->dir_temp;
|
||||
@ -71,18 +72,19 @@ $ftp_user=$conf->global->$s_ftp_user;
|
||||
$ftp_password=$conf->global->$s_ftp_password;
|
||||
$ftp_passive=$conf->global->$s_ftp_passive;
|
||||
|
||||
// For result on connection
|
||||
$ok=0;
|
||||
$conn_id=null; // FTP connection ID
|
||||
$mesg='';
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
/*
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
*/
|
||||
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
// Submit file
|
||||
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@ -127,7 +129,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
}
|
||||
|
||||
// Action ajout d'un rep
|
||||
if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
|
||||
if ($action == 'add' && $user->rights->ftp->setup)
|
||||
{
|
||||
$ecmdir->ref = $_POST["ref"];
|
||||
$ecmdir->label = $_POST["label"];
|
||||
@ -143,12 +145,12 @@ if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
|
||||
{
|
||||
//TODO: Translate
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error));
|
||||
$_GET["action"] = "create";
|
||||
$action = "create";
|
||||
}
|
||||
}
|
||||
|
||||
// Remove file
|
||||
if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes')
|
||||
if ($action == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes')
|
||||
{
|
||||
// set up a connection or die
|
||||
if (! $conn_id)
|
||||
@ -246,7 +248,7 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De
|
||||
}
|
||||
|
||||
// Remove directory
|
||||
if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'yes')
|
||||
if ($action == 'confirm_deletesection' && $confirm == 'yes')
|
||||
{
|
||||
// set up a connection or die
|
||||
if (! $conn_id)
|
||||
@ -286,7 +288,7 @@ if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'y
|
||||
}
|
||||
|
||||
// Download directory
|
||||
if ($_REQUEST['action'] == 'download')
|
||||
if ($action == 'download')
|
||||
{
|
||||
// set up a connection or die
|
||||
if (! $conn_id)
|
||||
@ -339,8 +341,7 @@ if ($_REQUEST['action'] == 'download')
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: Translate
|
||||
setEventMessage('Failed to get file '.$remotefile, 'errors');
|
||||
setEventMessages($langs->trans('FailedToGetFile',$remotefile), null, 'errors');
|
||||
}
|
||||
|
||||
}
|
||||
@ -355,11 +356,9 @@ if ($_REQUEST['action'] == 'download')
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* PAGE
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -370,11 +369,24 @@ if ($conf->use_javascript_ajax)
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#delconst").hide();
|
||||
|
||||
jQuery(".checkboxfordelete").click(function() {
|
||||
jQuery("#delconst").show();
|
||||
});
|
||||
|
||||
$("#checkall").click(function() {
|
||||
$(".checkboxfordelete").prop('checked', true);
|
||||
jQuery("#delconst").show();
|
||||
});
|
||||
$("#checknone").click(function() {
|
||||
$(".checkboxfordelete").prop('checked', false);
|
||||
jQuery("#delconst").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -383,10 +395,7 @@ $formfile=new FormFile($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
|
||||
|
||||
//***********************
|
||||
// List
|
||||
//***********************
|
||||
print_fiche_titre($langs->trans("FTPArea"));
|
||||
|
||||
print $langs->trans("FTPAreaDesc")."<br>";
|
||||
@ -397,18 +406,17 @@ if (! function_exists('ftp_connect'))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($ftp_server))
|
||||
if (! empty($ftp_server))
|
||||
{
|
||||
|
||||
// Confirm remove file
|
||||
if ($_GET['action'] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
|
||||
|
||||
}
|
||||
|
||||
// Confirmation de la suppression d'une ligne categorie
|
||||
if ($_GET['action'] == 'delete_section')
|
||||
if ($action == 'delete_section')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
|
||||
|
||||
@ -417,8 +425,9 @@ else
|
||||
print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>';
|
||||
print $langs->trans("Port").': <b>'.$ftp_port.'</b> '.($ftp_passive?"(Passive)":"(Active)").'<br>';
|
||||
print $langs->trans("User").': <b>'.$ftp_user.'</b><br>';
|
||||
|
||||
print $langs->trans("Directory").': ';
|
||||
print $langs->trans("FTPs (FTP over SSH)").': <b>'.yn($conf->global->FTP_CONNECT_WITH_SSL).'</b><br>';
|
||||
print $langs->trans("SFTP (FTP as a subsytem of SSH)").': <b>'.yn($conf->global->FTP_CONNECT_WITH_SFTP).'</b><br>';
|
||||
print $langs->trans("Directory").': ';
|
||||
$sectionarray=preg_split('|[\/]|',$section);
|
||||
// For /
|
||||
$newsection='/';
|
||||
@ -459,30 +468,50 @@ else
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans("Owner").'</td>'."\n";
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans("Group").'</td>'."\n";
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans("Permissions").'</td>'."\n";
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre nowrap" align="right">';
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a> ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshmanual&numero_ftp='.$numero_ftp.($section?'§ion='.urlencode($section):'').'">'.img_picto($langs->trans("Refresh"),'refresh').'</a> ';
|
||||
print '</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
// set up a connection or die
|
||||
if (! $conn_id)
|
||||
if (empty($conn_id))
|
||||
{
|
||||
$resultarray=dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive);
|
||||
|
||||
$conn_id=$resultarray['conn_id'];
|
||||
$ok=$resultarray['ok'];
|
||||
$mesg=$resultarray['mesg'];
|
||||
|
||||
}
|
||||
|
||||
if ($ok)
|
||||
{
|
||||
//$type = ftp_systype($conn_id);
|
||||
|
||||
$newsectioniso=utf8_decode($section);
|
||||
$buff = ftp_rawlist($conn_id, $newsectioniso);
|
||||
$contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist
|
||||
//var_dump($contents);
|
||||
//var_dump($buff);
|
||||
$newsection=$section;
|
||||
$newsectioniso=utf8_decode($section);
|
||||
//$newsection='/home';
|
||||
|
||||
// List content of directory ($newsection = '/', '/home', ...)
|
||||
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
|
||||
{
|
||||
if ($newsection == '/') $newsection='/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
|
||||
//$dirHandle = opendir("ssh2.sftp://$conn_id".$newsection);
|
||||
//var_dump($dirHandle);
|
||||
$contents = scandir('ssh2.sftp://' . $conn_id . $newsection);
|
||||
$buff=array();
|
||||
foreach($contents as $i => $key)
|
||||
{
|
||||
$buff[$i]="---------- - root root 1234 Aug 01 2000 ".$key;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$buff = ftp_rawlist($conn_id, $newsectioniso);
|
||||
$contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist
|
||||
//var_dump($contents);
|
||||
//var_dump($buff);
|
||||
}
|
||||
|
||||
$nboflines=count($contents);
|
||||
$var=true;
|
||||
@ -590,9 +619,16 @@ else
|
||||
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
if (! $ok)
|
||||
{
|
||||
print $mesg.'<br>'."\n";
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
// Actions
|
||||
/*
|
||||
if ($user->rights->ftp->write && ! empty($section))
|
||||
@ -611,20 +647,43 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("SetupOfFTPClientModuleNotComplete");
|
||||
$s_ftp_server='FTP_SERVER_1';
|
||||
if (empty($s_ftp_server))
|
||||
{
|
||||
print $langs->trans("SetupOfFTPClientModuleNotComplete");
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ChooseAFTPEntryIntoMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Close FTP connection
|
||||
if ($conn_id) ftp_close($conn_id);
|
||||
|
||||
// End of page
|
||||
$db->close();
|
||||
if ($conn_id)
|
||||
{
|
||||
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
|
||||
{
|
||||
|
||||
}
|
||||
else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
|
||||
{
|
||||
ftp_close($conn_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
ftp_close($conn_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connect to FTP server
|
||||
@ -642,46 +701,90 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
|
||||
global $langs, $conf;
|
||||
|
||||
$ok=1;
|
||||
|
||||
$conn_id=null;
|
||||
|
||||
if (! is_numeric($ftp_port))
|
||||
{
|
||||
$mesg=$langs->trans("FailedToConnectToFTPServer",$ftp_server,$ftp_port);
|
||||
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServer",$ftp_server,$ftp_port);
|
||||
$ok=0;
|
||||
}
|
||||
|
||||
if ($ok)
|
||||
{
|
||||
$connecttimeout=(empty($conf->global->FTP_CONNECT_TIMEOUT)?40:$conf->global->FTP_CONNECT_TIMEOUT);
|
||||
if (! empty($conf->global->FTP_CONNECT_WITH_SSL)) $conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout);
|
||||
else $conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout);
|
||||
if ($conn_id)
|
||||
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
|
||||
{
|
||||
dol_syslog('Try to connect with ssh2_ftp');
|
||||
$tmp_conn_id = ssh2_connect($ftp_server, $ftp_port);
|
||||
}
|
||||
else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
|
||||
{
|
||||
dol_syslog('Try to connect with ftp_ssl_connect');
|
||||
$conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog('Try to connect with ftp_connect');
|
||||
$conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout);
|
||||
}
|
||||
if ($conn_id || $tmp_conn_id)
|
||||
{
|
||||
if ($ftp_user)
|
||||
{
|
||||
if (ftp_login($conn_id, $ftp_user, $ftp_password))
|
||||
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
|
||||
{
|
||||
// Turn on passive mode transfers (must be after a successful login
|
||||
if ($ftp_passive) ftp_pasv($conn_id, true);
|
||||
|
||||
// Change the dir
|
||||
$newsectioniso=utf8_decode($section);
|
||||
ftp_chdir($conn_id, $newsectioniso);
|
||||
}
|
||||
if (ssh2_auth_password($tmp_conn_id, $ftp_user, $ftp_password))
|
||||
{
|
||||
// Turn on passive mode transfers (must be after a successful login
|
||||
//if ($ftp_passive) ftp_pasv($conn_id, true);
|
||||
|
||||
// Change the dir
|
||||
$newsectioniso=utf8_decode($section);
|
||||
//ftp_chdir($conn_id, $newsectioniso);
|
||||
$conn_id = ssh2_sftp($tmp_conn_id);
|
||||
if (! $conn_id)
|
||||
{
|
||||
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToSFTPAfterSSHAuthentication");
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$langs->trans("FailedToConnectToFTPServerWithCredentials");
|
||||
$ok=0;
|
||||
if (ftp_login($conn_id, $ftp_user, $ftp_password))
|
||||
{
|
||||
// Turn on passive mode transfers (must be after a successful login
|
||||
if ($ftp_passive) ftp_pasv($conn_id, true);
|
||||
|
||||
// Change the dir
|
||||
$newsectioniso=utf8_decode($section);
|
||||
ftp_chdir($conn_id, $newsectioniso);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
|
||||
$ok=0;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$langs->trans("FailedToConnectToFTPServer",$ftp_server,$ftp_port);
|
||||
dol_syslog('FailedToConnectToFTPServer '.$ftp_server.' '.$ftp_port, LOG_ERR);
|
||||
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServer",$ftp_server,$ftp_port);
|
||||
$ok=0;
|
||||
}
|
||||
}
|
||||
|
||||
$arrayresult=array('conn_id'=>$conn_id, 'ok'=>$ok, 'mesg'=>$mesg);
|
||||
$arrayresult=array('conn_id'=>$conn_id, 'ok'=>$ok, 'mesg'=>$mesg, 'curdir'=>$section, 'curdiriso'=>$newsectioniso);
|
||||
return $arrayresult;
|
||||
}
|
||||
|
||||
|
||||
@ -282,7 +282,7 @@ print "</tr>\n";
|
||||
// FILTRES
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left" width="50">';
|
||||
print '<input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '<input class="flat" size="4" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
|
||||
// DATE CREATE
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit8837e679482b97ebb428daf0298d9535::getLoader();
|
||||
@ -1,413 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0 class loader
|
||||
*
|
||||
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
||||
if ('\\' == $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if ($file === null && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if ($file === null) {
|
||||
// Remember that this class does not exist.
|
||||
return $this->classMap[$class] = false;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
|
||||
Copyright (c) 2015 Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname(dirname($vendorDir));
|
||||
|
||||
return array(
|
||||
'Datamatrix' => $vendorDir . '/tecnick.com/tcpdf/include/barcodes/datamatrix.php',
|
||||
'Mobile_Detect' => $vendorDir . '/mobiledetect/mobiledetectlib/Mobile_Detect.php',
|
||||
'PDF417' => $vendorDir . '/tecnick.com/tcpdf/include/barcodes/pdf417.php',
|
||||
'QRcode' => $vendorDir . '/tecnick.com/tcpdf/include/barcodes/qrcode.php',
|
||||
'TCPDF' => $vendorDir . '/tecnick.com/tcpdf/tcpdf.php',
|
||||
'TCPDF2DBarcode' => $vendorDir . '/tecnick.com/tcpdf/tcpdf_barcodes_2d.php',
|
||||
'TCPDFBarcode' => $vendorDir . '/tecnick.com/tcpdf/tcpdf_barcodes_1d.php',
|
||||
'TCPDF_COLORS' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_colors.php',
|
||||
'TCPDF_FILTERS' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_filters.php',
|
||||
'TCPDF_FONTS' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_fonts.php',
|
||||
'TCPDF_FONT_DATA' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_font_data.php',
|
||||
'TCPDF_IMAGES' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_images.php',
|
||||
'TCPDF_IMPORT' => $vendorDir . '/tecnick.com/tcpdf/tcpdf_import.php',
|
||||
'TCPDF_PARSER' => $vendorDir . '/tecnick.com/tcpdf/tcpdf_parser.php',
|
||||
'TCPDF_STATIC' => $vendorDir . '/tecnick.com/tcpdf/include/tcpdf_static.php',
|
||||
);
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname(dirname($vendorDir));
|
||||
|
||||
return array(
|
||||
'Raven_' => array($vendorDir . '/raven/raven/lib'),
|
||||
'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes'),
|
||||
'Luracast\\Restler' => array($vendorDir . '/restler/framework'),
|
||||
'Detection' => array($vendorDir . '/mobiledetect/mobiledetectlib/namespaced'),
|
||||
'ChromePhp' => array($vendorDir . '/ccampbell/chromephp'),
|
||||
);
|
||||
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname(dirname($vendorDir));
|
||||
|
||||
return array(
|
||||
);
|
||||
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit8837e679482b97ebb428daf0298d9535
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit8837e679482b97ebb428daf0298d9535', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit8837e679482b97ebb428daf0298d9535', 'loadClassLoader'));
|
||||
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire8837e679482b97ebb428daf0298d9535($file)
|
||||
{
|
||||
require $file;
|
||||
}
|
||||
@ -1,400 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "ccampbell/chromephp",
|
||||
"version": "4.1.0",
|
||||
"version_normalized": "4.1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ccampbell/chromephp.git",
|
||||
"reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef",
|
||||
"reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.0.0"
|
||||
},
|
||||
"time": "2013-06-26 03:44:33",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"ChromePhp": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Craig Campbell",
|
||||
"email": "iamcraigcampbell@gmail.com",
|
||||
"homepage": "http://craig.is",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Log variables to the Chrome console (via Chrome Logger Google Chrome extension).",
|
||||
"homepage": "http://github.com/ccampbell/chromephp",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ckeditor/ckeditor",
|
||||
"version": "4.3.3",
|
||||
"version_normalized": "4.3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ckeditor/ckeditor-releases.git",
|
||||
"reference": "0068dd540ce8bf1815abb7b5455c55354bc56334"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/0068dd540ce8bf1815abb7b5455c55354bc56334",
|
||||
"reference": "0068dd540ce8bf1815abb7b5455c55354bc56334",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2014-02-26 15:34:37",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-2.0+",
|
||||
"LGPL-2.1+",
|
||||
"MPL-1.1+"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "CKSource - Frederico Knabben",
|
||||
"homepage": "http://cksource.com"
|
||||
}
|
||||
],
|
||||
"description": "JavaScript WYSIWYG web text editor.",
|
||||
"homepage": "http://ckeditor.com",
|
||||
"keywords": [
|
||||
"CKEditor",
|
||||
"editor",
|
||||
"fckeditor",
|
||||
"html",
|
||||
"javascript",
|
||||
"richtext",
|
||||
"text",
|
||||
"wysiwyg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "mobiledetect/mobiledetectlib",
|
||||
"version": "2.8.3",
|
||||
"version_normalized": "2.8.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/serbanghita/Mobile-Detect.git",
|
||||
"reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/f5753e4b90daffe50c902e99df5ce3c58fca3fee",
|
||||
"reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "*"
|
||||
},
|
||||
"time": "2014-07-10 20:00:25",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"Mobile_Detect.php"
|
||||
],
|
||||
"psr-0": {
|
||||
"Detection": "namespaced/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Serban Ghita",
|
||||
"email": "serbanghita@gmail.com",
|
||||
"homepage": "http://ghita.org",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.",
|
||||
"homepage": "https://github.com/serbanghita/Mobile-Detect",
|
||||
"keywords": [
|
||||
"detect mobile devices",
|
||||
"mobile",
|
||||
"mobile detect",
|
||||
"mobile detector",
|
||||
"php mobile detect"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpexcel",
|
||||
"version": "1.8.0",
|
||||
"version_normalized": "1.8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPOffice/PHPExcel.git",
|
||||
"reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/e69a5e4d0ffa7fb6f171859e0a04346e580df30b",
|
||||
"reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-xml": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.2.0"
|
||||
},
|
||||
"time": "2014-03-02 15:22:49",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"PHPExcel": "Classes/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maarten Balliauw",
|
||||
"homepage": "http://blog.maartenballiauw.be"
|
||||
},
|
||||
{
|
||||
"name": "Mark Baker"
|
||||
},
|
||||
{
|
||||
"name": "Franck Lefevre",
|
||||
"homepage": "http://blog.rootslabs.net"
|
||||
},
|
||||
{
|
||||
"name": "Erik Tilt"
|
||||
}
|
||||
],
|
||||
"description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
|
||||
"homepage": "http://phpexcel.codeplex.com",
|
||||
"keywords": [
|
||||
"OpenXML",
|
||||
"excel",
|
||||
"php",
|
||||
"spreadsheet",
|
||||
"xls",
|
||||
"xlsx"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "restler/framework",
|
||||
"version": "3.0.0",
|
||||
"version_normalized": "3.0.0.0",
|
||||
"target-dir": "Luracast/Restler",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Luracast/Restler-Framework.git",
|
||||
"reference": "6ee10b3e5dbc6376916fed55ec2340a37cce436b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Luracast/Restler-Framework/zipball/6ee10b3e5dbc6376916fed55ec2340a37cce436b",
|
||||
"reference": "6ee10b3e5dbc6376916fed55ec2340a37cce436b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"replace": {
|
||||
"luracast/restler": "3.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"bshaffer/oauth2-server-php": "v1.0",
|
||||
"luracast/explorer": "*",
|
||||
"mustache/mustache": "dev-master",
|
||||
"rodneyrehm/plist": "dev-master",
|
||||
"symfony/yaml": "*",
|
||||
"twig/twig": "v1.13.0",
|
||||
"zendframework/zendamf": "dev-master"
|
||||
},
|
||||
"suggest": {
|
||||
"bshaffer/oauth2-server-php": "Restler can provide OAuth2 authentication using this library (see require-dev for details)",
|
||||
"luracast/explorer": "Restler's very own api explorer (see require-dev for details)",
|
||||
"mustache/mustache": "Restler can render HtmlView using mustache/handlebar templates (see require-dev for details)",
|
||||
"rodneyrehm/plist": "Restler supports tho Apple plist xml format (see require-dev for details)",
|
||||
"symfony/yaml": "Restler can produce content in yaml format as well (see require-dev for details)",
|
||||
"twig/twig": "Restler can render HtmlView using twig templates (see require-dev for details)",
|
||||
"zendframework/zendamf": "Support for the amf document format (see require-dev for details)"
|
||||
},
|
||||
"time": "2015-08-04 07:52:49",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"master": "v3.0.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Luracast\\Restler": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-2.1"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Luracast",
|
||||
"email": "arul@luracast.com"
|
||||
},
|
||||
{
|
||||
"name": "Nick nickl- Lombard",
|
||||
"email": "github@jigsoft.co.za"
|
||||
}
|
||||
],
|
||||
"description": "Just the Restler Framework without the tests and examples",
|
||||
"homepage": "http://luracast.com/products/restler/",
|
||||
"keywords": [
|
||||
"api",
|
||||
"framework",
|
||||
"rest",
|
||||
"server"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tecnick.com/tcpdf",
|
||||
"version": "6.2.6",
|
||||
"version_normalized": "6.2.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tecnickcom/TCPDF.git",
|
||||
"reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
|
||||
"reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2015-01-28 18:51:40",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"fonts",
|
||||
"config",
|
||||
"include",
|
||||
"tcpdf.php",
|
||||
"tcpdf_parser.php",
|
||||
"tcpdf_import.php",
|
||||
"tcpdf_barcodes_1d.php",
|
||||
"tcpdf_barcodes_2d.php",
|
||||
"include/tcpdf_colors.php",
|
||||
"include/tcpdf_filters.php",
|
||||
"include/tcpdf_font_data.php",
|
||||
"include/tcpdf_fonts.php",
|
||||
"include/tcpdf_images.php",
|
||||
"include/tcpdf_static.php",
|
||||
"include/barcodes/datamatrix.php",
|
||||
"include/barcodes/pdf417.php",
|
||||
"include/barcodes/qrcode.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPLv3"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicola Asuni",
|
||||
"email": "info@tecnick.com",
|
||||
"homepage": "http://nicolaasuni.tecnick.com"
|
||||
}
|
||||
],
|
||||
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"keywords": [
|
||||
"PDFD32000-2008",
|
||||
"TCPDF",
|
||||
"barcodes",
|
||||
"datamatrix",
|
||||
"pdf",
|
||||
"pdf417",
|
||||
"qrcode"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "raven/raven",
|
||||
"version": "0.12.1",
|
||||
"version_normalized": "0.12.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/getsentry/raven-php.git",
|
||||
"reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/getsentry/raven-php/zipball/b325984c792ff89f985b73da9a3ad8ed8b520bca",
|
||||
"reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"php": ">=5.2.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"fabpot/php-cs-fixer": "^1.8.0",
|
||||
"phpunit/phpunit": "^4.6.6"
|
||||
},
|
||||
"time": "2015-08-25 22:38:46",
|
||||
"bin": [
|
||||
"bin/raven"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.12.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Raven_": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "David Cramer",
|
||||
"email": "dcramer@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A PHP client for Sentry (http://getsentry.com)",
|
||||
"homepage": "http://getsentry.com",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging"
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -387,7 +387,8 @@ else
|
||||
array('from'=>'3.4.0', 'to'=>'3.5.0'),
|
||||
array('from'=>'3.5.0', 'to'=>'3.6.0'),
|
||||
array('from'=>'3.6.0', 'to'=>'3.7.0'),
|
||||
array('from'=>'3.7.0', 'to'=>'3.8.0')
|
||||
array('from'=>'3.7.0', 'to'=>'3.8.0'),
|
||||
array('from'=>'3.8.0', 'to'=>'3.9.0')
|
||||
);
|
||||
|
||||
$count=0;
|
||||
|
||||
@ -25,3 +25,6 @@ ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
|
||||
|
||||
ALTER TABLE llx_accountingaccount RENAME TO llx_accounting_account;
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN model_pdf varchar(255);
|
||||
|
||||
|
||||
@ -67,6 +67,7 @@ create table llx_societe
|
||||
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
|
||||
note_private text, --
|
||||
note_public text, --
|
||||
model_pdf varchar(255),
|
||||
prefix_comm varchar(5), -- prefix commercial
|
||||
client tinyint DEFAULT 0, -- client 0/1/2
|
||||
fournisseur tinyint DEFAULT 0, -- fournisseur 0/1
|
||||
|
||||
@ -339,7 +339,7 @@ MinLength=Minimum length
|
||||
LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory
|
||||
ExamplesWithCurrentSetup=Examples with current running setup
|
||||
ListOfDirectories=List of OpenDocument templates directories
|
||||
ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b>.
|
||||
ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b> or <b>.ods</b>.
|
||||
NumberOfModelFilesFound=Number of ODT/ODS templates files found in those directories
|
||||
ExampleOfDirectoriesForModelGen=Examples of syntax:<br>c:\mydir<br>/home/mydir<br>DOL_DATA_ROOT/ecm/ecmdir
|
||||
FollowingSubstitutionKeysCanBeUsed=<br>To know how to create your odt document templates, before storing them in those directories, read wiki documentation:
|
||||
@ -1392,6 +1392,7 @@ ModifyProductDescAbility=Personalization of product descriptions in forms
|
||||
ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip)
|
||||
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
|
||||
ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the thirdparty language
|
||||
UseMaskOnClone=Use product next ref when we clone a product%s (available if mask configured)
|
||||
UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||
UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list).
|
||||
UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
|
||||
|
||||
@ -10,3 +10,5 @@ FailedToConnectToFTPServerWithCredentials=Failed to login to FTP server with def
|
||||
FTPFailedToRemoveFile=Failed to remove file <b>%s</b>.
|
||||
FTPFailedToRemoveDir=Failed to remove directory <b>%s</b> (Check permissions and that directory is empty).
|
||||
FTPPassiveMode=Passive mode
|
||||
ChooseAFTPEntryIntoMenu=Choose a FTP entry into menu...
|
||||
FailedToGetFile=Failed to get files %s
|
||||
@ -39,6 +39,9 @@ InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled
|
||||
InterventionSentByEMail=Intervention %s sent by EMail
|
||||
InterventionDeletedInDolibarr=Intervention %s deleted
|
||||
SearchAnIntervention=Search an intervention
|
||||
InterventionsArea=Interventions area
|
||||
DraftFichinter=Draft interventions
|
||||
LastModifiedInterventions=Last %s modified interventions
|
||||
##### Types de contacts #####
|
||||
TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention
|
||||
TypeContact_fichinter_internal_INTERVENING=Intervening
|
||||
|
||||
@ -1392,6 +1392,7 @@ ModifyProductDescAbility=Personnalisation des descriptions produits dans les for
|
||||
ViewProductDescInFormAbility=Visualisation des descriptions produits dans les formulaires (sinon en tant que bulle d'aide)
|
||||
MergePropalProductCard=Ajoute dans l'onglet Fichiers joints des produits/services, une option pour fusionner le document PDF du produit au PDF des propositions Azur si le produit/services est inclut dans la proposition.
|
||||
ViewProductDescInThirdpartyLanguageAbility=Visualisation des descriptions produits dans la langue du tiers
|
||||
UseMaskOnClone=Utiliser la prochaine référence lors du clonage d'un produit%s (disponible si le masque est configuré ci-dessus)
|
||||
UseSearchToSelectProductTooltip=Si vous avez un nombre important de produits (>100 000), vous pourrez améliorer les performances en positionnant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines.
|
||||
UseSearchToSelectProduct=Utilisez un champ avec auto-complétion pour choisir les produits (plutôt qu'une liste déroulante).
|
||||
UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE)
|
||||
|
||||
@ -39,6 +39,9 @@ InterventionClassifiedUnbilledInDolibarr=Intervention %s positionné à non fact
|
||||
InterventionSentByEMail=Intervention %s envoyé par EMail
|
||||
InterventionDeletedInDolibarr=Intervention %s effacée
|
||||
SearchAnIntervention=Chercher une intervention
|
||||
InterventionsArea=Espace interventions
|
||||
DraftFichinter=Interventions brouillon
|
||||
LastModifiedInterventions=Les %s dernières interventions modifiées
|
||||
##### Types de contacts #####
|
||||
TypeContact_fichinter_internal_INTERREPFOLL=Responsable suivi de l'intervention
|
||||
TypeContact_fichinter_internal_INTERVENING=Intervenant
|
||||
|
||||
@ -35,8 +35,7 @@ if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande
|
||||
|
||||
|
||||
/**
|
||||
* \class Livraison
|
||||
* \brief Classe de gestion des bons de livraison
|
||||
* Class to manage receptions
|
||||
*/
|
||||
class Livraison extends CommonObject
|
||||
{
|
||||
@ -967,11 +966,14 @@ class Livraison extends CommonObject
|
||||
/**
|
||||
* Create object on disk
|
||||
*
|
||||
* @param string $modele force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @return int 0 if KO, 1 if OK
|
||||
* @param string $modele force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs Object langs to use for output
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs='')
|
||||
public function generateDocument($modele, $outputlangs='',$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@ -992,7 +994,7 @@ class Livraison extends CommonObject
|
||||
|
||||
$modelpath = "core/modules/livraison/doc/";
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, 0, 0, 0);
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1428,7 +1428,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
$menumanager->showmenu('top'); // This contains a \n
|
||||
print "</div>\n";
|
||||
|
||||
$form=new Form($db);
|
||||
//$form=new Form($db);
|
||||
|
||||
// Define link to login card
|
||||
$appli='Dolibarr';
|
||||
@ -1496,11 +1496,11 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
$text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
|
||||
$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer.png', 'class="printer"');
|
||||
$text.='</a>';
|
||||
$toprightmenu.=$form->textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
|
||||
$toprightmenu.=Form::textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
|
||||
}
|
||||
|
||||
// Logout link
|
||||
$toprightmenu.=$form->textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2);
|
||||
$toprightmenu.=Form::textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2);
|
||||
|
||||
$toprightmenu.='</div>';
|
||||
|
||||
@ -1509,7 +1509,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
print "</div>\n";
|
||||
print '</div></div>';
|
||||
|
||||
unset($form);
|
||||
//unset($form);
|
||||
}
|
||||
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "</div><!-- End top layout -->\n";
|
||||
|
||||
@ -1601,11 +1601,25 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Load object modCodeProduct
|
||||
$module=(! empty($conf->global->PRODUCT_CODEPRODUCT_ADDON)?$conf->global->PRODUCT_CODEPRODUCT_ADDON:'mod_codeproduct_leopard');
|
||||
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php')
|
||||
{
|
||||
$module = substr($module, 0, dol_strlen($module)-4);
|
||||
}
|
||||
$result=dol_include_once('/core/modules/product/'.$module.'.php');
|
||||
if ($result > 0)
|
||||
{
|
||||
$modCodeProduct = new $module();
|
||||
}
|
||||
|
||||
$tmpcode='';
|
||||
if (! empty($modCodeProduct->code_auto)) $tmpcode=$modCodeProduct->getNextValue($object,$object->type);
|
||||
|
||||
// Define confirmation messages
|
||||
$formquestionclone=array(
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => $langs->trans("CopyOf").' '.$object->ref, 'size'=>24),
|
||||
array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24),
|
||||
array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1),
|
||||
array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1)
|
||||
|
||||
@ -655,7 +655,7 @@ if (empty($action) && $product->id)
|
||||
}
|
||||
|
||||
//if (($user->rights->stock->mouvement->creer) && ! $product->hasbatch())
|
||||
if (($user->rights->stock->mouvement->creer))
|
||||
if ($user->rights->stock->mouvement->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'&action=transfert">'.$langs->trans("StockMovement").'</a>';
|
||||
}
|
||||
|
||||
@ -310,10 +310,11 @@ if (empty($reshook))
|
||||
{
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->dir_output . "/";
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$urlfile=GETPOST('urlfile','alpha');
|
||||
$file = $upload_dir . '/' . $filetodelete;
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", $urlfile));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1486,10 +1486,9 @@ class Task extends CommonObject
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @param HookManager $hookmanager Hook manager instance
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
||||
@ -1012,7 +1012,7 @@ class Societe extends CommonObject
|
||||
$sql .= ', s.status';
|
||||
$sql .= ', s.price_level';
|
||||
$sql .= ', s.tms as date_modification';
|
||||
$sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.client, s.fournisseur';
|
||||
$sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
|
||||
$sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
|
||||
$sql .= ', s.capital, s.tva_intra';
|
||||
$sql .= ', s.fk_typent as typent_id';
|
||||
@ -1154,6 +1154,7 @@ class Societe extends CommonObject
|
||||
$this->note = $obj->note_private; // TODO Deprecated for backward comtability
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->default_lang = $obj->default_lang;
|
||||
$this->logo = $obj->logo;
|
||||
|
||||
@ -3342,6 +3343,43 @@ class Societe extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example.
|
||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
// Positionne le modele sur le nom du modele a utiliser
|
||||
if (! dol_strlen($modele))
|
||||
{
|
||||
if (! empty($conf->global->COMPANY_ADDON_PDF))
|
||||
{
|
||||
$modele = $conf->global->COMPANY_ADDON_PDF;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$modelpath = "core/modules/societe/doc/";
|
||||
|
||||
$result=$this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
* It must be used within a transaction to avoid trouble
|
||||
|
||||
@ -702,56 +702,11 @@ if (empty($reshook))
|
||||
$mode='emailfromthirdparty';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* Generate document
|
||||
*/
|
||||
if ($action == 'builddoc') // En get ou en post
|
||||
{
|
||||
if (is_numeric(GETPOST('model')))
|
||||
{
|
||||
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php';
|
||||
|
||||
$object->fetch($socid);
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=thirdparty_doc_create($db, $object, '', GETPOST('model','alpha'), $outputlangs);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove file in doc form
|
||||
else if ($action == 'remove_file')
|
||||
{
|
||||
if ($object->fetch($socid))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->societe->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
}
|
||||
// Actions to build doc
|
||||
$id = $socid;
|
||||
$upload_dir = $conf->societe->dir_output;
|
||||
$permissioncreate=$user->rights->societe->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
|
||||
|
||||
@ -2556,7 +2511,7 @@ else
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
|
||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
@ -1888,6 +1888,8 @@ class User extends CommonObject
|
||||
$s=picto_from_langcode($langs->getDefaultLang());
|
||||
$label.= '<br><b>'.$langs->trans("CurrentUserLanguage").':</b> '.($s?$s.' ':'').$langs->getDefaultLang();
|
||||
$label.= '<br><b>'.$langs->trans("Browser").':</b> '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
|
||||
$label.= '<br><b>'.$langs->trans("Layout").':</b> '.$conf->browser->layout;
|
||||
$label.= '<br><b>'.$langs->trans("Screen").':</b> '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||
if (! empty($conf->browser->phone)) $label.= '<br><b>'.$langs->trans("Phone").':</b> '.$conf->browser->phone;
|
||||
if (! empty($_SESSION["disablemodules"])) $label.= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user