Merge branch '3.5' into bug-3206

Conflicts:
	ChangeLog
This commit is contained in:
Marcos García de La Fuente 2015-08-03 18:55:01 +02:00
commit a1f74763da
10 changed files with 484 additions and 464 deletions

View File

@ -23,6 +23,10 @@ Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled
Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information
***** ChangeLog for 3.5.6 compared to 3.5.5 ***** ***** ChangeLog for 3.5.6 compared to 3.5.5 *****

View File

@ -2877,11 +2877,12 @@ class PropaleLigne extends CommonObject
if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->total_localtax2)) $this->total_localtax2=0;
if (empty($this->rang)) $this->rang=0; if (empty($this->rang)) $this->rang=0;
if (empty($this->remise)) $this->remise=0; if (empty($this->remise)) $this->remise=0;
if (empty($this->remise_percent)) $this->remise_percent=0; if (empty($this->remise_percent) || ! is_numeric($this->remise_percent)) $this->remise_percent=0;
if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
if (! is_numeric($this->qty)) $this->qty = 0;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;

View File

@ -33,21 +33,23 @@ $id = GETPOST('id', 'int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
/* /*
* View * View
*/ */
$form = new Form($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
$form = new Form($db); if ($id > 0)
{
$contact = new Contact($db);
$contact->fetch($id, $user); $contact->fetch($id, $user);
$head = contact_prepare_head($contact); $head = contact_prepare_head($contact);
dol_fiche_head($head, 'exportimport', $title, 0, 'contact'); dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
@ -103,11 +105,8 @@ print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' '; print img_picto($langs->trans("VCard"),'vcard.png').' ';
print $langs->trans("VCard"); print $langs->trans("VCard");
print '</a>'; print '</a>';
}
$db->close(); $db->close();
llxFooter(); llxFooter();
?>

View File

@ -35,6 +35,8 @@ $contactid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
$contact = new Contact($db);
/* /*
@ -43,9 +45,10 @@ $result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
if ($contactid > 0)
{
$result = $contact->fetch($contactid, $user);
$contact = new Contact($db);
$contact->fetch($contactid, $user);
$contact->info($contactid); $contact->info($contactid);
@ -60,8 +63,8 @@ print '</td></tr></table>';
dol_print_object_info($contact); dol_print_object_info($contact);
print "</div>"; print "</div>";
}
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -40,8 +40,10 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db); $contact = new Contact($db);
$contact->fetch($id, $user);
if ($id > 0)
{
$contact->fetch($id, $user);
/* /*
* Actions * Actions
@ -73,18 +75,21 @@ if ($action == 'dolibarr2ldap')
$db->rollback(); $db->rollback();
} }
} }
}
/* /*
* View * View
*/ */
$form = new Form($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db); if ($id > 0)
{
$head = contact_prepare_head($contact); $head = contact_prepare_head($contact);
dol_fiche_head($head, 'ldap', $title, 0, 'contact'); dol_fiche_head($head, 'ldap', $title, 0, 'contact');
@ -207,10 +212,9 @@ else
print '</table>'; print '</table>';
}
$db->close(); $db->close();
llxFooter(); llxFooter();
?>

View File

@ -38,14 +38,16 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db); $object = new Contact($db);
$result = $object->fetch($id, $user);
if ($id > 0)
{
/* /*
* Action * Action
*/ */
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
{ {
$ret = $object->fetch($id);
// Note: Correct date should be completed with location to have exact GM time of birth. // Note: Correct date should be completed with location to have exact GM time of birth.
$object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
$object->birthday_alert = $_POST["birthday_alert"]; $object->birthday_alert = $_POST["birthday_alert"];
@ -61,22 +63,22 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
$error = $object->error; $error = $object->error;
} }
} }
}
/* /*
* View * View
*/ */
$form = new Form($db);
$now=dol_now(); $now=dol_now();
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db); if ($id > 0)
{
$object->fetch($id, $user);
$head = contact_prepare_head($object); $head = contact_prepare_head($object);
dol_fiche_head($head, 'perso', $title, 0, 'contact'); dol_fiche_head($head, 'perso', $title, 0, 'contact');
@ -244,9 +246,9 @@ if ($action != 'edit')
print "</div>"; print "</div>";
} }
} }
}
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -35,6 +35,9 @@ $id = GETPOST('id', 'int');
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db); $contact = new Contact($db);
if ($id > 0)
{
$result=$contact->fetch($id); $result=$contact->fetch($id);
$physicalperson=1; $physicalperson=1;
@ -100,5 +103,4 @@ header("Connection: close");
header("Content-Type: text/x-vcard; name=\"".$filename."\""); header("Content-Type: text/x-vcard; name=\"".$filename."\"");
print $output; print $output;
}
?>

View File

@ -134,9 +134,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
} }
// Financial // Financial
$tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled)), $tmpentry = array(
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire)), 'enabled' => (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->facture->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->don->enabled) || !empty($conf->tax->enabled) || !empty($conf->margin->enabled)),
'module'=>'comptabilite|accounting|facture|deplacement|don|tax'); 'perms' => (!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->plancompte->lire) || !empty($user->rights->facture->lire) || !empty($user->rights->deplacement->lire) || !empty($user->rights->don->lire) || !empty($user->rights->tax->charges->lire) || !empty($user->rights->margins->liretous)),
'module' => 'comptabilite|accounting|facture|deplacement|don|tax'
);
$showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode) if ($showmode)
{ {

View File

@ -40,6 +40,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('infothirdparty')); $hookmanager->initHooks(array('infothirdparty'));
$soc = new Societe($db);
/* /*
@ -59,8 +60,10 @@ $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->e
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url); llxHeader('',$langs->trans("ThirdParty"),$help_url);
$soc = new Societe($db); if ($socid > 0)
$soc->fetch($socid); {
$result = $soc->fetch($socid);
$soc->info($socid); $soc->info($socid);
/* /*
@ -71,15 +74,13 @@ $head = societe_prepare_head($soc);
dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company'); dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company');
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($soc); dol_print_object_info($soc);
print '</td></tr></table>'; print '</td></tr></table>';
print '</div>'; dol_fiche_end();
}
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -999,6 +999,7 @@ else
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
print $object->showOptionals($extrafields,'edit'); print $object->showOptionals($extrafields,'edit');
@ -1407,6 +1408,7 @@ else
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
print $object->showOptionals($extrafields,'edit'); print $object->showOptionals($extrafields,'edit');