Skip to content

Commit

Permalink
Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Jan 29, 2014
2 parents a7c892e + 1ec5387 commit ca55648
Show file tree
Hide file tree
Showing 36 changed files with 271 additions and 209 deletions.
92 changes: 51 additions & 41 deletions build/makepack-dolibarrmodule.pl
Expand Up @@ -88,18 +88,6 @@
print "Target directory: $NEWDESTI\n";


# Ask and set version $MAJOR, $MINOR and $BUILD
print "Enter value for version: ";
$PROJVERSION=<STDIN>;
chomp($PROJVERSION);
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
if ($MINOR eq '')
{
print "Enter value for minor version: ";
$MINOR=<STDIN>;
chomp($MINOR);
}

# Ask module
print "Enter name for your module (mymodule, mywonderfulmondule, ... or 'all') : ";
$PROJECTINPUT=<STDIN>;
Expand Down Expand Up @@ -130,6 +118,8 @@
# Loop on each projects
foreach my $PROJECT (@PROJECTLIST) {

$PROJECTLC=lc($PROJECT);

if (! -f "makepack-".$PROJECT.".conf")
{
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
Expand All @@ -141,9 +131,28 @@
exit 2;
}

$FILENAME="$PROJECT";
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":"");
$FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":"");
# Get version $MAJOR, $MINOR and $BUILD
print "Version detected for module ".$PROJECT.": ";
$result=open(IN,"<".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php");
if (! $result) { die "Error: Can't open descriptor file ".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n"; }
while(<IN>)
{
if ($_ =~ /this->version\s*=\s*'([\d\.]+)'/) { $PROJVERSION=$1; break; }
}
close IN;
print $PROJVERSION."\n";

($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
if ($MINOR eq '')
{
print "Enter value for minor version for module ".$PROJECT.": ";
$MINOR=<STDIN>;
chomp($MINOR);
}

$FILENAME="$PROJECTLC";
$FILENAMETGZ="module_$PROJECTLC-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":"");
$FILENAMEZIP="module_$PROJECTLC-$MAJOR.$MINOR".($BUILD ne ''?".$BUILD":"");
if (-d "/usr/src/redhat") {
# redhat
$RPMDIR="/usr/src/redhat";
Expand Down Expand Up @@ -230,7 +239,7 @@
$ret=`rm -fr "$BUILDROOT"`;

mkdir "$BUILDROOT";
mkdir "$BUILDROOT/$PROJECT";
mkdir "$BUILDROOT/$PROJECTLC";

$result=open(IN,"<makepack-".$PROJECT.".conf");
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
Expand All @@ -240,43 +249,44 @@

$_ =~ s/\n//;
$_ =~ /^(.*)\/[^\/]+/;
print "Create directory $BUILDROOT/$PROJECT/$1\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`;
print "Create directory $BUILDROOT/$PROJECTLC/$1\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECTLC/$1"`;
if ($_ !~ /version\-/)
{
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n";
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`;
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECTLC/$_\n";
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECTLC/$_"`;
if ($? != 0) { die "Failed to make copy of a file declared into makepack-".$PROJECT.".conf file (Fails on line ".$_.")\n"; }
}
}
close IN;

@timearray=localtime(time());
$fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1];
open(VF,">$BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt");
open(VF,">$BUILDROOT/$PROJECTLC/build/version-".$PROJECTLC.".txt");

print "Create version file $BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt with date ".$fulldate."\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT/build"`;
print "Create version file $BUILDROOT/$PROJECTLC/build/version-".$PROJECTLC.".txt with date ".$fulldate."\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECTLC/build"`;
print VF "Version: ".$MAJOR.".".$MINOR.($BUILD ne ''?".$BUILD":"")."\n";
print VF "Build : ".$fulldate."\n";
close VF;
}
print "Clean $BUILDROOT\n";
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
$ret=`rm -fr $BUILDROOT/$PROJECT/index.php`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/.project`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/.settings`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/index.php`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/build/html`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/document`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.mysql`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.old`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.postgres`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/test`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/Thumbs.db $BUILDROOT/$PROJECTLC/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/*/Thumbs.db`;
$ret=`rm -fr $BUILDROOT/$PROJECTLC/CVS* $BUILDROOT/$PROJECTLC/*/CVS* $BUILDROOT/$PROJECTLC/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/*/CVS*`;
}

# Build package for each target
Expand Down Expand Up @@ -314,9 +324,9 @@
unlink "$NEWDESTI/$FILENAMEZIP.zip";
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";

print "Go to directory $BUILDROOT/$PROJECT\n";
print "Go to directory $BUILDROOT/$PROJECTLC\n";
$olddir=getcwd();
chdir("$BUILDROOT/$PROJECT");
chdir("$BUILDROOT/$PROJECTLC");
$cmd= "7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip *";
print $cmd."\n";
$ret= `$cmd`;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/fiche.php
Expand Up @@ -1272,10 +1272,10 @@ function initfieldrequired()
// Cree un tableau formulaire
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
if (! empty($conf->global->ADHERENT_USE_MAILMAN)) {
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_MAILMAN)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>'');
}
if (! empty($conf->global->ADHERENT_USE_SPIP)) {
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
}
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
Expand Down
1 change: 1 addition & 0 deletions htdocs/admin/workflow.php
Expand Up @@ -80,6 +80,7 @@
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
// For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card.
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),

Expand Down
9 changes: 4 additions & 5 deletions htdocs/comm/action/fiche.php
Expand Up @@ -586,11 +586,10 @@ function setdatefields()
// Project
if (! empty($conf->projet->enabled))
{

$formproject=new FormProjets($db);

// Projet associe
$langs->load("project");
$langs->load("projects");

print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';

Expand Down Expand Up @@ -626,7 +625,7 @@ function setdatefields()


// Other attributes
$parameters=array();
$parameters=array('id'=>$actioncomm->id);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$actioncomm,$action); // Note that $action and $object may have been modified by hook


Expand Down Expand Up @@ -861,7 +860,7 @@ function setdatefields()
print '</td></tr>';

// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$act->id);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
Expand Down Expand Up @@ -1043,7 +1042,7 @@ function setdatefields()
print '</td></tr>';

// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$act->id);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook

print '</table>';
Expand Down
58 changes: 29 additions & 29 deletions htdocs/commande/fiche.php
@@ -1,34 +1,34 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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/>.
*/
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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/commande/fiche.php
* \ingroup commande
* \brief Page to show customer order
*/
* \ingroup commande
* \brief Page to show customer order
*/

require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
Expand Down Expand Up @@ -2483,15 +2483,15 @@
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans('ReOpen').'</a></div>';
}


// Create bill and Classify billed
if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed)
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
if ($object->statut > 0 && ! $object->billed)
{
if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
if (! empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a></div>';
}
if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORsKFLOW_BILL_ON_SHIPMENT))
if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a></div>';
}
Expand Down
26 changes: 18 additions & 8 deletions htdocs/contact/fiche.php
Expand Up @@ -744,11 +744,17 @@
print $form->selectarray('priv',$selectarray,$object->priv,0);
print '</td></tr>';

// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
print isset($_POST["note"])?$_POST["note"]:$object->note;
print '</textarea></td></tr>';
// Note Public
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td><td colspan="3">';
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';

// Note Private
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td><td colspan="3">';
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';

// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
Expand Down Expand Up @@ -961,10 +967,14 @@
print $object->LibPubPriv($object->priv);
print '</td></tr>';

// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print nl2br($object->note);
// Note Public
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td><td colspan="3">';
print nl2br($object->note_public);
print '</td></tr>';

// Note Private
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td><td colspan="3">';
print nl2br($object->note_private);

// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
Expand Down
9 changes: 4 additions & 5 deletions htdocs/contrat/fiche.php
Expand Up @@ -241,8 +241,8 @@
for ($i=0;$i<$num;$i++)
{
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);

if ($product_type == 1) { //only services
if ($product_type == 1) { //only services // TODO Exclude also deee
// service prédéfini
if ($lines[$i]->fk_product > 0)
{
Expand Down Expand Up @@ -286,8 +286,8 @@
$lines[$i]->localtax2_tx,
$lines[$i]->fk_product,
$lines[$i]->remise_percent,
$date_start =0,
$date_end =0,
$lines[$i]->date_start,
$lines[$i]->date_end,
'HT',
0,
$lines[$i]->info_bits,
Expand All @@ -303,7 +303,6 @@

}
}

}
else
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/boxes/box_comptes.php
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2005 Christophe
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* 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 @@ -122,7 +123,7 @@ function loadBox($max=5)
);

$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => price($solde, 1, $langs, 0, -1, 0, $objp->currency_code)
'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code)
);

$listofcurrencies[$objp->currency_code]=1;
Expand Down

0 comments on commit ca55648

Please sign in to comment.