Skip to content

Commit

Permalink
Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian HENRY committed May 7, 2014
2 parents 3f22bc7 + 182dd77 commit e35008b
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 56 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -16,6 +16,10 @@ Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice docume
Fix: Suppliers invoice mask fails using {tttt} in numbering.
Fix: pdf template name for typhon was not correctly et when enabling module.
Fix: Navigation on notes for shipments was not working.
Fix: [ bug #1353 ] Email notifications, wrong URL.
Fix: [ bug #1362 ] Note is not saved.
Fix: tr/td balance.
Fix: [ bug #1360 ] note indicator for member tab.

***** ChangeLog for 3.5.2 compared to 3.5.1 *****
Fix: Can't add user for a task.
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/note.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 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 All @@ -19,7 +19,7 @@
/**
* \file htdocs/adherents/note.php
* \ingroup member
* \brief Fiche de notes sur un adherent
* \brief Tabe for note of a member
*/

require '../main.inc.php';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/categories/class/categorie.class.php
Expand Up @@ -46,7 +46,7 @@ class Categorie
var $label;
var $description;
var $socid;
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member, 4=Contact
var $import_key;

var $cats=array(); // Tableau en memoire des categories
Expand Down Expand Up @@ -296,7 +296,7 @@ function delete($user)
if (! $error)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
$sql.= " SET fk_parent = ".$this->fk_parent;
$sql.= " SET fk_parent = ".$this->fk_parent;
$sql.= " WHERE fk_parent = ".$this->id;

if (!$this->db->query($sql))
Expand Down
53 changes: 25 additions & 28 deletions htdocs/compta/paiement_charge.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2014 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 @@ -28,7 +28,8 @@

$langs->load("bills");

$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
$chid=GETPOST("id");
$action=GETPOST('action');
$amounts = array();

// Security check
Expand All @@ -43,7 +44,7 @@
* Actions
*/

if ($_POST["action"] == 'add_payment')
if ($action == 'add_payment')
{
$error=0;

Expand Down Expand Up @@ -171,7 +172,8 @@

print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$charge->id.'">';
print '<input type="hidden" name="id" value="'.$chid.'">';
print '<input type="hidden" name="chid" value="'.$chid.'">';
print '<input type="hidden" name="action" value="add_payment">';

print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
Expand All @@ -184,7 +186,6 @@
print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";

print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';

$sql = "SELECT sum(p.amount) as total";
Expand All @@ -198,43 +199,50 @@
$db->free();
}
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay").'</td><td colspan="2"><b>'.price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';

print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>';
print '<tr class="liste_titre">';

print "<input type=\"hidden\" name=\"chid\" value=\"$chid\">";
print "<td colspan=\"3\">".$langs->trans("Payment").'</td>';

print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0;
$form->select_date($datepayment,'','','','',"add_payment",1,1);
print "</td>";
print '<td>'.$langs->trans("Comments").'</td></tr>';
print '</tr>';

print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
$form->select_types_paiements(isset($_POST["paiementtype"])?$_POST["paiementtype"]:$charge->paiementtype, "paiementtype");
print "</td>\n";

print '<td rowspan="3" valign="top"><textarea name="comment" wrap="soft" cols="40" rows="'.ROWS_3.'"></textarea></td></tr>';
print '</tr>';

print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
print '<td>';
print '<td colspan="2">';
$form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$charge->accountid, "accountid", 0, '',1); // Show opend bank account list
print '</td></tr>';

print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print "<td><input name=\"num_paiement\" type=\"text\"></td></tr>\n";
print '<td colspan="2"><input name="num_paiement" type="text"></td></tr>'."\n";

print '<tr>';
print '<td valign="top">'.$langs->trans("Comments").'</td>';
print '<td valign="top" colspan="2"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
print '</tr>';

print '</table>';

print '<br>';

/*
* Autres charges impayees
*/
$num = 1;
$i = 0;
print '<tr><td colspan="3">';

print '<table class="nobordernopadding" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
//print '<td>'.$langs->trans("SocialContribution").'</td>';
print '<td align="left">'.$langs->trans("DateDue").'</td>';
Expand Down Expand Up @@ -303,17 +311,6 @@
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}
print "</table></td></tr>\n";
// }
// $db->free();
// }
// else
// {
// print $sql ."<br>".$db->error();
// }
/*
*
*/

print "</table>";

Expand Down
30 changes: 17 additions & 13 deletions htdocs/compta/sociales/charges.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -256,7 +256,7 @@

$head=tax_prepare_head($object);

print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');

// Confirmation de la suppression de la charge
if ($action == 'paid')
Expand Down Expand Up @@ -303,8 +303,8 @@
print '<td rowspan="'.$rowspan.'" valign="top">';

/*
* Paiements
*/
* Payments
*/
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
$sql.= "c.libelle as paiement_type";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
Expand All @@ -324,24 +324,28 @@
$i = 0; $total = 0;
echo '<table class="nobordernopadding" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Payments").'</td><td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td><td>&nbsp;</td></tr>';
print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';

$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var]."><td>";
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").'</a> ';
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print "</tr>";
$totalpaye += $objp->amount;
$i++;
}

if ($object->paye == 0)
{
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
Expand All @@ -363,7 +367,7 @@

print "</tr>";

// Period end date
// Period end date
print "<tr><td>".$langs->trans("PeriodEndDate")."</td>";
print "<td>";
if ($action == 'edit')
Expand All @@ -375,7 +379,7 @@
print dol_print_date($object->periode,"day");
}
print "</td></tr>";

// Due date
if ($action == 'edit')
{
Expand Down Expand Up @@ -406,7 +410,7 @@

if ($action == 'edit') print "</form>\n";

print '</div>';
dol_fiche_end();


/*
Expand Down
5 changes: 4 additions & 1 deletion htdocs/core/class/commondocgenerator.class.php
Expand Up @@ -118,7 +118,10 @@ function get_substitutionarray_mysoc($mysoc,$outputlangs)
'mycompany_idprof5'=>$mysoc->idprof5,
'mycompany_idprof6'=>$mysoc->idprof6,
'mycompany_vatnumber'=>$mysoc->tva_intra,
'mycompany_note'=>$mysoc->note
// Only private not exists for "mysoc"
'mycompany_note'=>$mysoc->note_private
//'mycompany_note_private'=>$mysoc->note_private,
//'mycompany_note_public'=>$mysoc->note_public,
);
}

Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/class/notify.class.php
Expand Up @@ -133,7 +133,7 @@ function send($action, $socid, $texte, $objet_type, $objet_id, $file="")

$langs->load("other");

dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file");
dol_syslog(get_class($this)."::send action=".$action.", socid=".$socid.", texte=".$texte.", objet_type=".$objet_type.", objet_id=".$objet_id.", file=".$file);

$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,";
$sql.= " a.rowid as adid, a.label, a.code, n.rowid";
Expand Down Expand Up @@ -185,10 +185,10 @@ function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
$link='/compta/facture.php?facid='.$objet_id;
break;
case 'order':
$link='/commande/fiche.php?facid='.$objet_id;
$link='/commande/fiche.php?id='.$objet_id;
break;
case 'order_supplier':
$link='/fourn/commande/fiche.php?facid='.$objet_id;
$link='/fourn/commande/fiche.php?id='.$objet_id;
break;
}
// Define $urlwithroot
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/db/mysql.class.php
Expand Up @@ -257,7 +257,7 @@ function getVersionArray()
{
return explode('.',$this->getVersion());
}

/**
* Return version of database client driver
*
Expand All @@ -267,7 +267,7 @@ function getDriverInfo()
{
return mysqli_get_client_info();
}


/**
* Close database connexion
Expand Down Expand Up @@ -651,6 +651,7 @@ function errno()
1006 => 'DB_ERROR_CANNOT_CREATE',
1007 => 'DB_ERROR_ALREADY_EXISTS',
1008 => 'DB_ERROR_CANNOT_DROP',
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
1044 => 'DB_ERROR_ACCESSDENIED',
1046 => 'DB_ERROR_NODBSELECTED',
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/db/mysqli.class.php
Expand Up @@ -262,7 +262,7 @@ function getDriverInfo()
{
return mysqli_get_client_info($this->db);
}


/**
* Close database connexion
Expand Down Expand Up @@ -650,6 +650,7 @@ function errno()
1006 => 'DB_ERROR_CANNOT_CREATE',
1007 => 'DB_ERROR_ALREADY_EXISTS',
1008 => 'DB_ERROR_CANNOT_DROP',
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
1044 => 'DB_ERROR_ACCESSDENIED',
1046 => 'DB_ERROR_NODBSELECTED',
Expand Down
7 changes: 6 additions & 1 deletion htdocs/core/lib/member.lib.php
Expand Up @@ -81,9 +81,14 @@ function member_prepare_head($object)
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'member');

$nbNote = 0;
if(!empty($object->note)) $nbNote++;
if(!empty($object->note_private)) $nbNote++;
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
$h++;

$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
Expand Down Expand Up @@ -130,7 +135,7 @@ function member_admin_prepare_head()
$head[$h][1] = $langs->trans("ExtraFieldsMember");
$head[$h][2] = 'attributes';
$h++;

$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_type_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsMemberType");
$head[$h][2] = 'attributes_type';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/modExpedition.class.php
Expand Up @@ -103,7 +103,7 @@ function __construct($db)
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;

$this->const[$r][0] = "LIVRAISON_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "typhon";
Expand Down Expand Up @@ -270,7 +270,7 @@ function init($options='')
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")",
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[2][2]."' AND entity = ".$conf->entity,
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[3][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[3][2]."','delivery',".$conf->entity.")",
);

Expand Down
1 change: 0 additions & 1 deletion htdocs/install/mysql/migration/3.4.0-3.5.0.sql
Expand Up @@ -117,7 +117,6 @@ create table llx_links
objectid INTEGER NOT NULL
)ENGINE=innodb;


ALTER TABLE llx_categorie_contact ADD PRIMARY KEY pk_categorie_contact (fk_categorie, fk_socpeople);
ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_socpeople (fk_socpeople);
Expand Down
1 change: 1 addition & 0 deletions htdocs/install/mysql/migration/repair.sql
Expand Up @@ -65,6 +65,7 @@ drop table tmp_categorie;
delete from llx_categorie_product where fk_categorie not in (select rowid from llx_categorie where type = 0);
delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type in (1, 2));
delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3);
delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4);


-- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links.
Expand Down

0 comments on commit e35008b

Please sign in to comment.