Skip to content

Commit

Permalink
Merge remote branch 'dolibarr/3.1-beta' into 3.1-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Sep 15, 2011
2 parents b8ac7a1 + 712e779 commit e0a5f84
Show file tree
Hide file tree
Showing 20 changed files with 192 additions and 177 deletions.
74 changes: 15 additions & 59 deletions build/makepack-dolibarrtheme.pl
Expand Up @@ -2,7 +2,6 @@
#-----------------------------------------------------------------------------
# \file build/makepack-dolibarrtheme.pl
# \brief Script to build a theme Package for Dolibarr
# \version $Revision: 1.10 $
# \author (c)2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
#-----------------------------------------------------------------------------

Expand All @@ -25,7 +24,7 @@


use vars qw/ $REVISION $VERSION /;
$REVISION='$Revision: 1.10 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
$REVISION='1.11';
$VERSION="1.0 (build $REVISION)";


Expand Down Expand Up @@ -75,10 +74,14 @@
my $batch=0;

print "Makepack theme version $VERSION\n";
print "Enter name of theme to package: ";
print "Enter name of theme(s) to package (separated with space): ";
$PROJECT=<STDIN>;
chomp($PROJECT);

@PROJECTLIST=split(/ /,$PROJECT);
$PROJECT=join('',@PROJECTLIST);


# Ask and set version $MAJOR and $MINOR
print "Enter value for version: ";
$PROJVERSION=<STDIN>;
Expand All @@ -94,6 +97,8 @@

$FILENAME="$PROJECT";
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
$FILENAMEZIP="theme_$PROJECT-$MAJOR.$MINOR";

if (-d "/usr/src/redhat") {
# redhat
$RPMDIR="/usr/src/redhat";
Expand Down Expand Up @@ -202,11 +207,13 @@
mkdir "$BUILDROOT";
mkdir "$BUILDROOT/htdocs";
mkdir "$BUILDROOT/htdocs/theme";
mkdir "$BUILDROOT/htdocs/theme/$PROJECT";

print "Copy $SOURCE into $BUILDROOT\n";
mkdir "$BUILDROOT";
$ret=`cp -pr "$SOURCE/htdocs/theme/$PROJECT" "$BUILDROOT/htdocs/theme"`;
foreach my $tmp (@PROJECTLIST)
{
$ret=`cp -pr "$SOURCE/htdocs/theme/$tmp" "$BUILDROOT/htdocs/theme"`;
}
}
print "Clean $BUILDROOT\n";
$ret=`rm -fr $BUILDROOT/htdocs/theme/$PROJECT/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/*/Thumbs.db`;
Expand All @@ -222,16 +229,12 @@

if ($target eq 'TGZ') {
unlink $FILENAMETGZ.tgz;
# unlink $BUILDROOT/$FILENAMETGZ.tgz;
print "Compress $BUILDROOT/htdocs into $FILENAMETGZ.tgz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" htdocs";
$ret=`$cmd`;
# $cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" htdocs\n";
# $ret=`$cmd`;
if ($OS =~ /windows/i) {
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
# $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
}
next;
}
Expand All @@ -240,56 +243,9 @@
unlink $FILENAMEZIP.zip;
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
chdir("$BUILDROOT");
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
print "Move $FILENAMEZIP.zip to $DESTI\n";
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
next;
}

if ($target eq 'RPM') { # Linux only
$BUILDFIC="$FILENAME.spec";
unlink $FILENAMETGZ.tgz;
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
$ret=`tar --exclude-vcs --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" --group=500 --owner=500 -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;

print "Move $FILENAMETGZ.tgz to $RPMDIR/SOURCES/$FILENAMETGZ.tgz\n";
$cmd="mv \"$BUILDROOT/$FILENAMETGZ.tgz\" \"$RPMDIR/SOURCES/$FILENAMETGZ.tgz\"";
$ret=`$cmd`;

print "Copy $SOURCE/make/rpm/${BUILDFIC} to $BUILDROOT\n";
# $ret=`cp -p "$SOURCE/make/rpm/${BUILDFIC}" "$BUILDROOT"`;
open (SPECFROM,"<$SOURCE/make/rpm/${BUILDFIC}") || die "Error";
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
while (<SPECFROM>) {
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$BUILD/;
print SPECTO $_;
}
close SPECFROM;
close SPECTO;

print "Launch RPM build (rpm --clean -ba $BUILDROOT/${BUILDFIC})\n";
$ret=`rpm --clean -ba $BUILDROOT/${BUILDFIC}`;

print "Move $RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm into $DESTI/${FILENAMERPM}.noarch.rpm\n";
$cmd="mv \"$RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm\" \"$DESTI/${FILENAMERPM}.noarch.rpm\"";
$ret=`$cmd`;
next;
}

if ($target eq 'DEB') {
print "Automatic build for DEB is not yet supported.\n";
}

if ($target eq 'EXE') {
unlink "$FILENAMEEXE.exe";
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
print "$command\n";
$ret=`$command`;
print "Move $FILENAMEEXE.exe to $DESTI\n";
rename("$SOURCE\\build\\exe\\$FILENAMEEXE.exe","$DESTI/$FILENAMEEXE.exe");
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip htdocs`;
print "Move $FILENAMEZIP.zip to $DESTI\n";
$ret=`mv "$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
next;
}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/cashdesk/admin/cashdesk.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2011 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
Expand Down Expand Up @@ -89,7 +89,7 @@
$var=!$var;
print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td colspan="2">';
print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',1,1);
print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
print '</td></tr>';
if ($conf->banque->enabled)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/index.php
Expand Up @@ -87,7 +87,7 @@
$disabled=0;
$langs->load("companies");
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',!$disabled,$disabled,1);
$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
print '</td>';
print "</tr>\n";
Expand Down

0 comments on commit e0a5f84

Please sign in to comment.