Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/tpl/objectline_create.tpl.php
	htdocs/societe/note.php
	htdocs/societe/rib.php
This commit is contained in:
Laurent Destailleur 2016-09-19 14:05:16 +02:00
commit c4c7ccc226
24 changed files with 74 additions and 34 deletions

View File

@ -207,8 +207,9 @@ if ($id > 0)
dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter"><div class="fichehalfleft">';

View File

@ -1427,7 +1427,7 @@ else
{
$total = 0;
print '<tr class="liste_titre">';
print '<tr class="liste_titre'.($cursorline?' liste_titre_add':'').'">';
print '<td>'.$langs->trans("ServiceNb",$cursorline).'</td>';
print '<td width="50" align="center">'.$langs->trans("VAT").'</td>';
print '<td width="50" align="right">'.$langs->trans("PriceUHT").'</td>';

View File

@ -4211,7 +4211,9 @@ abstract class CommonObject
$object = new $InfoFieldList[0]($this->db);
if ($value)
{
$res=$object->fetch(0,$value);
if (is_numeric($value)) $res=$object->fetch($value);
else $res=$object->fetch('',$value);
if ($res > 0) $this->array_options[$key]=$object->id;
else
{

View File

@ -1133,7 +1133,7 @@ class Form
$resql=$this->db->query($sql);
if ($resql)
{
print '<select class="flat" name="'.$htmlname.'">';
print '<select class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
$num = $this->db->num_rows($resql);
$qualifiedlines=$num;

View File

@ -168,7 +168,7 @@ class Utils
// Check type parameter
if ($type == 'auto') $type = $db->type;
if (! in_array($type, array('pgsql', 'mysql', 'mysqli')))
if (! in_array($type, array('pgsql', 'mysql', 'mysqli','mysqlnobin')))
{
$langs->load("errors");
$this->error=$langs->transnoentitiesnoconv("ErrorBadValueForParameter", $type, "Basetype");

View File

@ -56,7 +56,7 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac
$nolinesbefore=(count($this->lines) == 0);
if ($nolinesbefore) {
?>
<tr class="liste_titre nodrag nodrop">
<tr class="liste_titre<?php echo (($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add') ?> nodrag nodrop">
<td class="linecoldescription" <?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
</td>

View File

@ -132,7 +132,9 @@ if ($object->id > 0)
dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter"><div class="fichehalfleft">';

View File

@ -130,8 +130,8 @@ if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate";
$checkedtypetiers=0;
$arrayfields=array(
'cf.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplier"), 'checked'=>1, 'enabled'=>$conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER),
'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'enabled'=>$conf->global->PROJECT_SHOW_REF_INTO_LISTS),
'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplier"), 'checked'=>1, 'enabled'=>1),
'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>1),
'u.login'=>array('label'=>$langs->trans("AuthorRequest"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),

View File

@ -61,6 +61,10 @@ CREATE TABLE llx_product_lot (
ALTER TABLE llx_product_lot ADD UNIQUE INDEX uk_product_lot(fk_product, batch);
-- VPGSQL8.2 ALTER TABLE llx_product_lot ALTER COLUMN entity SET DEFAULT 1;
ALTER TABLE llx_product_lot MODIFY COLUMN entity integer DEFAULT 1;
UPDATE llx_product_lot SET entity = 1 WHERE entity IS NULL;
DROP TABLE llx_stock_serial;
ALTER TABLE llx_product ADD COLUMN note_public text;

View File

@ -23,5 +23,5 @@ CREATE TABLE llx_multicurrency_rate
date_sync datetime DEFAULT NULL,
rate double NOT NULL DEFAULT 0,
fk_multicurrency integer NOT NULL,
entity integer DEFAULT 1,
) ENGINE=innodb;
entity integer DEFAULT 1
) ENGINE=innodb;

View File

@ -91,7 +91,9 @@ if ($socid > 0)
dol_fiche_head($head, 'margin', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -48,8 +48,8 @@ $object=new Opensurveysondage($db);
$result=$object->fetch(0, $numsondage);
if ($result <= 0)
{
dol_print_error($db,$object->error);
exit;
dol_print_error($db,$object->error);
exit;
}
$expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
@ -206,7 +206,6 @@ foreach ($toutsujet as $value)
$toutsujet=str_replace("@","<br>",$toutsujet);
$toutsujet=str_replace("°","'",$toutsujet);
print '<form name="updatesurvey" action="'.$_SERVER["PHP_SELF"].'?id='.$numsondage.'" method="POST">'."\n";
print '<input type="hidden" name="action" value="update">';
@ -444,8 +443,6 @@ if ($object->allow_comments) {
print '</form>';
print '<br>';
llxFooterSurvey();
llxFooter();
$db->close();

View File

@ -228,8 +228,7 @@ class Opensurveysondage extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id_sondage = $obj->id_sondage;
//For compatibility
$this->ref = $this->id_sondage;
$this->ref = $this->id_sondage; //For compatibility
$this->commentaires = $obj->description; // deprecated
$this->description = $obj->description;

View File

@ -41,7 +41,6 @@ if (GETPOST('sondage'))
$object=new Opensurveysondage($db);
$result=$object->fetch(0,$numsondage);
if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage);
$nblignes=$object->fetch_lines();
@ -241,6 +240,16 @@ $arrayofjs=array();
$arrayofcss=array('/opensurvey/css/style.css');
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss);
if (empty($object->ref)) // For survey, id is a hex string
{
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
llxFooterSurvey();
$db->close();
exit;
}
// Define format of choices
$toutsujet=explode(",",$object->sujet);

View File

@ -81,7 +81,9 @@ if ($socid)
dol_fiche_head($head, 'agenda', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -114,7 +114,9 @@ if (! empty($socid))
dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -114,7 +114,9 @@ if (empty($socid))
$head = societe_prepare_head($object);
dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -109,7 +109,9 @@ if ($object->id)
$totalsize+=$file['size'];
}
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -73,7 +73,9 @@ if ($id > 0)
dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';

View File

@ -155,7 +155,9 @@ if ($result > 0)
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -151,7 +151,9 @@ $head = societe_prepare_head($object);
dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -81,7 +81,9 @@ if ($socid)
dol_fiche_head($head, 'project', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -285,7 +285,9 @@ if ($socid && $action != 'edit' && $action != "create")
print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1);
}
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';
@ -486,7 +488,9 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
{
dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';
@ -588,7 +592,9 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
{
dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';

View File

@ -149,7 +149,9 @@ if ($id > 0 || ! empty($ref))
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';