Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.4' into 3.4_backported
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/modules/modFacture.class.php
  • Loading branch information
eldy committed Dec 9, 2013
2 parents 13be9c9 + 7051922 commit 3bf4957
Show file tree
Hide file tree
Showing 23 changed files with 428 additions and 253 deletions.
15 changes: 13 additions & 2 deletions ChangeLog
@@ -1,14 +1,26 @@
--------------------------------------------------------------
English Dolibarr ChangeLog
--------------------------------------------------------------

***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB)
Fix: Document cerfa doesn't contained firstname & lastname from donator
Fix: Bad rounding on margin calculations and display.
Fix: Option drop table into backup was broken.
Fix: [ bug #1105 ] Searching Boxes other search option
Fix: wrong buy price update
Fix :[ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1145 ] Agenda button list type do not display
Fix: [ bug #1148 ] Product consomation : supplier order bad status
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
Fix: [ bug #1174 ] Product translated description not good into PDF
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
Fix: [ bug #1162 ] Translaction for morning and afternoon
Fix: [ bug #1161 ] Search on product label
Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
Fix: [ bug #1171 ] Documents lost in interventions after validating
Fix: fix unsubscribe URL into mailing when sending manually (not by script)
Fix: [ bug #1182 ] ODT company_country tag is htmlencoded

***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined
Expand Down Expand Up @@ -39,7 +51,6 @@ Fix: there was no escaping on filter fields in supplier product list
Fix: bugs on margin reports and better margin calculation on credit notes
Qual: Add travis-ci integration


***** ChangeLog for 3.4 compared to 3.3.* *****
For users:
- New: Can use ODS templates as document templates.
Expand Down
17 changes: 13 additions & 4 deletions build/makepack-dolibarr.pl
Expand Up @@ -59,14 +59,22 @@

$SOURCE="$DIR/..";
$DESTI="$SOURCE/build";
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
{
print "Error: Missing environment variables.\n";
print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n";
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 1;
}

# Detect OS type
# --------------
if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
if (! $OS) {
print "$PROG.$Extension was not able to detect your OS.\n";
print "Error: Can't detect your OS.\n";
print "Can't continue.\n";
print "$PROG.$Extension aborted.\n";
sleep 2;
Expand Down Expand Up @@ -105,8 +113,8 @@
$FILENAMESNAPSHOT.="-".$PREFIX;
}
}
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined


print "Makepack version $VERSION\n";
Expand Down Expand Up @@ -483,11 +491,12 @@
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
$newbuild =~ s/beta/0.2.beta1/gi; # beta
$newbuild =~ s/rc./0.3.rc1/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
#$newbuild =~ s/beta/1/gi; # beta
#$newbuild =~ s/rc./2/gi; # rc
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
#print "newbuild=".$newbuild."\n";exit;
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
Expand Down
14 changes: 8 additions & 6 deletions htdocs/.gitignore
@@ -1,9 +1,11 @@
/test.php
/custom*
/bootstrap
/multicompany
/ovh
/numberingpack
/google
/skincoloreditor
/extensions*
/nltechno*
/bootstrap*
/google*
/multicompany*
/numberingpack*
/ovh*
/pos
/ultimatepdf*
2 changes: 1 addition & 1 deletion htdocs/cashdesk/validation_verif.php
Expand Up @@ -212,7 +212,7 @@
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
if ($resultcreate > 0)
{
$resultvalid=$invoice->validate($user,$obj_facturation->numInvoice());
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/mailing/fiche.php
Expand Up @@ -221,8 +221,8 @@
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
'__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->firstname,
Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/propal.php
Expand Up @@ -786,7 +786,7 @@

$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;

if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
Expand Down Expand Up @@ -920,7 +920,7 @@
$error++;
}
}

if (! $error)
{
$result = $object->updateline(
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/list.php
Expand Up @@ -167,7 +167,7 @@
{
$sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'";
}
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')";
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note_private LIKE '%".$db->escape($sall)."%' OR p.note_public LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')";
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if ($viewstatut <> '')
{
Expand Down
218 changes: 104 additions & 114 deletions htdocs/core/lib/agenda.lib.php
Expand Up @@ -43,126 +43,116 @@
* @param string $actioncode Preselected value of actioncode for filter on type
* @return void
*/
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$showextcals=array(),$actioncode='')
{
global $conf,$user,$langs,$db;
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals = array(), $actioncode = '') {

global $conf, $user, $langs, $db;

// Filters
if ($canedit || ! empty($conf->projet->enabled))
{
print '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="status" value="'.$status.'">';
print '<input type="hidden" name="year" value="'.$year.'">';
print '<input type="hidden" name="month" value="'.$month.'">';
print '<input type="hidden" name="day" value="'.$day.'">';
print '<input type="hidden" name="showbirthday" value="'.$showbirthday.'">';
print '<table class="nobordernopadding" width="100%">';
if ($canedit || ! empty($conf->projet->enabled))
{
print '<tr><td class="nowrap">';

print '<table class="nobordernopadding">';

if ($canedit)
{
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("ActionsAskedBy");
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers($filtera,'userasked',1,'',!$canedit);
print '</td>';
print '</tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy");
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit);
print '</td></tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers($filterd,'userdone',1,'',!$canedit);
print '</td></tr>';

include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap">';

print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));

print '</td></tr>';
}

if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap">';
select_projects($socid?$socid:-1, $pid, 'projectid', 64);
print '</td></tr>';
}

print '</table>';
print '</td>';

// Buttons
print '<td align="center" valign="middle" class="nowrap">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '<br>';
print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '<br>';
print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '<br>';
print img_picto($langs->trans("ViewList"),'object_list','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="'.$langs->trans("ViewList").'">';
print '</td>';

// Legend
if ($conf->use_javascript_ajax && is_array($showextcals))
{
print '<td align="center" valign="middle" class="nowrap">';
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'."\n";
print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'."\n";
print 'jQuery(".family_birthday").toggle();'."\n";
print '});'."\n";
print '</script>'."\n";
print '<table>';
if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{
if (count($showextcals) > 0)
{
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> '.$langs->trans("LocalAgenda").'</td></tr>';
foreach($showextcals as $val)
{
$htmlname=dol_string_nospecial($val['name']);
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#check_'.$htmlname.'").click(function() { jQuery(".family_'.$htmlname.'").toggle(); });'."\n";
print '});'."\n";
print '</script>'."\n";
print '<tr><td><input type="checkbox" id="check_'.$htmlname.'" name="check_'.$htmlname.'" checked="true"> '.$val['name'].'</td></tr>';
}
}
}
print '<tr><td><input type="checkbox" id="check_birthday" name="check_birthday checked="false"> '.$langs->trans("AgendaShowBirthdayEvents").'</td></tr>';
print '</table>';
print '</td>';
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER ["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="status" value="' . $status . '">';
print '<input type="hidden" name="year" value="' . $year . '">';
print '<input type="hidden" name="month" value="' . $month . '">';
print '<input type="hidden" name="day" value="' . $day . '">';
print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
print '<table class="nobordernopadding" width="100%">';

print '<tr><td class="nowrap">';

print '<table class="nobordernopadding">';

if ($canedit) {
print '<tr>';
print '<td class="nowrap">';
print $langs->trans ( "ActionsAskedBy" );
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers ( $filtera, 'userasked', 1, '', ! $canedit );
print '</td>';
print '</tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans ( "or" ) . ' ' . $langs->trans ( "ActionsToDoBy" );
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers ( $filtert, 'usertodo', 1, '', ! $canedit );
print '</td></tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans ( "or" ) . ' ' . $langs->trans ( "ActionsDoneBy" );
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers ( $filterd, 'userdone', 1, '', ! $canedit );
print '</td></tr>';

include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions ( $db );
print '<tr>';
print '<td class="nowrap">';
print $langs->trans ( "Type" );
print ' &nbsp;</td><td class="nowrap">';

print $formactions->select_type_actions ( $actioncode, "actioncode", '', (empty ( $conf->global->AGENDA_USE_EVENT_TYPE ) ? 1 : 0) );

print '</td></tr>';
}

if (! empty ( $conf->projet->enabled ) && $user->rights->projet->lire) {
print '<tr>';
print '<td class="nowrap">';
print $langs->trans ( "Project" ) . ' &nbsp; ';
print '</td><td class="nowrap">';
select_projects ( $socid ? $socid : - 1, $pid, 'projectid', 64 );
print '</td></tr>';
}

print '</table>';
print '</td>';

// Buttons
print '<td align="center" valign="middle" class="nowrap">';
print img_picto ( $langs->trans ( "ViewCal" ), 'object_calendar', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans ( "ViewCal" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewWeek" ), 'object_calendarweek', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="' . $langs->trans ( "ViewWeek" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewDay" ), 'object_calendarday', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewday" value="' . $langs->trans ( "ViewDay" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewList" ), 'object_list', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans ( "ViewList" ) . '">';
print '</td>';

// Legend
if ($conf->use_javascript_ajax && is_array ( $showextcals )) {
print '<td align="center" valign="middle" class="nowrap">';
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
print 'jQuery(".family_birthday").toggle();' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<table>';
if (! empty ( $conf->global->MAIN_JS_SWITCH_AGENDA )) {
if (count ( $showextcals ) > 0) {
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans ( "LocalAgenda" ) . '</td></tr>';
foreach ( $showextcals as $val ) {
$htmlname = dol_string_nospecial ( $val ['name'] );
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_' . $htmlname . '").click(function() { jQuery(".family_' . $htmlname . '").toggle(); });' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<tr><td><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . '</td></tr>';
}
}

print '</tr>';
}
print '<tr><td><input type="checkbox" id="check_birthday" name="check_birthday checked="false"> ' . $langs->trans ( "AgendaShowBirthdayEvents" ) . '</td></tr>';
print '</table>';
print '</form>';
print '</td>';
}

print '</tr>';

print '</table>';
print '</form>';
}


Expand Down
12 changes: 11 additions & 1 deletion htdocs/core/lib/pdf.lib.php
Expand Up @@ -923,7 +923,17 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang))
{
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];

//Manage HTML entities description test
//Cause $prodser->description is store with htmlentities but $desc no
$needdesctranslation=false;
if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
$needdesctranslation=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false);
} else {
$needdesctranslation=($desc == $prodser->description);
}

if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($needdesctranslation)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"];
}
}
Expand Down

0 comments on commit 3bf4957

Please sign in to comment.