Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[ task #297 ] Add a installer for external modules #187

Merged
merged 1 commit into from
Apr 30, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 8 additions & 31 deletions htdocs/admin/tools/update.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -56,15 +56,15 @@
if (! $original_file)
{
$langs->load("Error");
$mesg=$langs->trans("ErrorFileRequired");
$mesg = '<div class="warning">'.$langs->trans("ErrorFileRequired").'</div>';
$error++;
}
else
{
if (! preg_match('/\.tgz/i',$original_file) && ! preg_match('/\.zip/i',$original_file))
if (! preg_match('/\.zip/i',$original_file))
{
$langs->load("errors");
$mesg=$langs->trans("ErrorFileMustBeADolibarrPackage");
$mesg = '<div class="error">'.$langs->trans("ErrorFileMustBeADolibarrPackage",$original_file).'</div>';
$error++;
}
}
Expand All @@ -81,26 +81,9 @@
$result=dol_uncompress($newfile,$documentrootalt);
if (! empty($result['error']))
{
if ($result['error'] == -1)
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorBadFileFormat").'</div>';
}
elseif ($result['error'] == -2)
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorOSSystem").'</div>';
}
elseif ($result['error'] == -3)
{
$langs->load("errors");
$mesg = '<div class="warning">'.$langs->trans("ErrorUncompFile",$_FILES['fileinstall']['name']).'</div>';
}
elseif ($result['error'] == -4)
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorUncompFile",$_FILES['fileinstall']['name']).'</div>';
}
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans($result['error'],$original_file).'</div>';

}
else
{
Expand Down Expand Up @@ -161,19 +144,13 @@
print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'<br>';
if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE))
{
if ($vale == 1 && $dirins != 'DOL_DOCUMENT_ROOT_ALT' && ($system=="Linux" || $system=="Darwin"))
if ($vale == 1 && $dirins != 'DOL_DOCUMENT_ROOT_ALT')
{
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
print '<input type="hidden" name="action" value="install">';
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
print '<input type="submit" name="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
print '</form>';
}
elseif ($system!='Linux')
{
$langs->load('errors');
$message=info_admin($langs->transnoentities("ErrorOSSystem"));
print $message;
}
else
{
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -1102,11 +1103,11 @@ function dol_uncompress($inputfile,$outputdir)
}
else
{
return array('error'=>'Failed to unzip with ZipArchive');
return array('error'=>'ErrUnzipFails');
}
}

return array('error'=>'No engine to unzip files int this PHP');
return array('error'=>'ErrNoZipEngine');
}


Expand Down
8 changes: 4 additions & 4 deletions htdocs/langs/ca_ES/errors.lang
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ ErrorBothFieldCantBeNegative=Els camps %s i %s no poden ser negatius
ErrorNoActivatedBarcode=Cap tipus de codi de barres activat
ErrorWebServerUserHasNotPermission=El compte d'execució del servidor web <b>%s</b> no disposa dels permisos per això
ErrorNoActivatedBarcode=No hi ha activat cap tipus de codi de barres
ErrorOSSystem=La instal·lació en línia no suporta el seu sistema operatiu. <br> Instal·leu l'extensió manualment.
ErrorUncompFile=No és possible instal·lar el paquet %s
ErrorFileMustBeADolibarrPackage=L'arxiu ha de ser un paquet Dolibarr
ErrorFileRequired=Es requereix un fitxer de paquet Dolibarr
ErrUnzipFails=No s'ha pogut descomprimir el fitxer %s amb ZipArchive
ErrNoZipEngine=En aquest PHP no hi ha motor per descomprimir l'arxiu %s
ErrorFileMustBeADolibarrPackage=El fitxer %s ha de ser un paquet Dolibarr en format zip
ErrorFileRequired=Es requereix un fitxer de paquet Dolibarr en format zip

# Warnings
WarningSafeModeOnCheckExecDir=Atenció, està activada l'opció PHP <b>safe_mode</b>, la comanda ha d'estar dins d'un directori declarat dins del paràmetre php <b>safe_mode_exec_dir</b>.
Expand Down
6 changes: 3 additions & 3 deletions htdocs/langs/en_US/errors.lang
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
ErrorWebServerUserHasNotPermission=User account <b>%s</b> used to execute web server has no permission for that
ErrorNoActivatedBarcode=No barcode type activated
ErrorOSSystem=The online installation does not support your operating system.<br>Install the component manually.
ErrorUncompFile=Unable to install the package %s
ErrorFileMustBeADolibarrPackage=The file must be a Dolibarr package
ErrUnzipFails=Failed to unzip %s with ZipArchive
ErrNoZipEngine=No engine to unzip %s file in this PHP
ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package
ErrorFileRequired=It takes a package Dolibarr file

# Warnings
Expand Down
8 changes: 4 additions & 4 deletions htdocs/langs/es_ES/errors.lang
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ ErrorBothFieldCantBeNegative=Los campos %s y %s no pueden ser negativos
ErrorNoActivatedBarcode=Ningún tipo de código de barra activado
ErrorWebServerUserHasNotPermission=La cuenta de ejecución del servidor web <b>%s</b> no dispone de los permisos para esto
ErrorNoActivatedBarcode=No hay activado ningún tipo de código de barras
ErrorOSSystem=La instalación online no soporta su sistema operativo.<br>Instale la extensión manualmente.
ErrorUncompFile=No es posible instalar el paquete %s
ErrorFileMustBeADolibarrPackage=El archivo debe ser un paquete Dolibarr
ErrorFileRequired=Se requiere un archivo de paquete Dolibarr
ErrUnzipFails=No se ha podido descomprimir el archivo %s con ZipArchive
ErrNoZipEngine=En este PHP no hay motor para descomprimir el archivo %s
ErrorFileMustBeADolibarrPackage=El archivo %s debe ser un paquete Dolibarr en formato zip
ErrorFileRequired=Se requiere un archivo de paquete Dolibarr en formato zip

# Warnings
WarningSafeModeOnCheckExecDir=Atención, está activada la opción PHP <b>safe_mode</b>, el comando deberá estar dentro de un directorio declarado dentro del parámetro php <b>safe_mode_exec_dir</b>.
Expand Down
4 changes: 2 additions & 2 deletions htdocs/langs/fr_FR/errors.lang
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une no
ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
ErrorWebServerUserHasNotPermission=Le compte d'execution du serveur web <b>%s</b> n'a pas les permissions pour cela
ErrorNoActivatedBarcode=Aucun type de code bar activé
ErrorOSSystem=L'installation en ligne ne prend pas en charge votre OS. <br> Installez le composant manuellement.
ErrorUncompFile=Impossible d'installer le package %s
ErrUnzipFails=Impossible de décompresser le fichier %s avec ZipArchive
ErrNoZipEngine=Pas de moteur pour décompresser le fichier %s dans ce PHP
ErrorFileMustBeADolibarrPackage=Le fichier doit être un package Dolibarr
ErrorFileRequired=Il faut un fichier de package Dolibarr

Expand Down