Merge remote-tracking branch 'upstream/4.0' into 4.0
This commit is contained in:
commit
12af0de9f1
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -618,17 +618,19 @@ class Categorie extends CommonObject
|
||||
{
|
||||
if ($this->db->num_rows($resql) > 0)
|
||||
{
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
|
||||
if (!empty($objparent->fk_parent))
|
||||
{
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->id=$objparent->fk_parent;
|
||||
$result=$cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$cat->error;
|
||||
$error++;
|
||||
$cat->id = $objparent->fk_parent;
|
||||
if (!$cat->containsObject($type, $obj->id)) {
|
||||
$result = $cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $cat->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1981,7 +1981,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer') . '</td><td align="left">';
|
||||
print '</td>';
|
||||
if ($action != 'refcustomer' && $object->brouillon)
|
||||
if ($action != 'refcustomer')
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=refcustomer&id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
@ -833,7 +833,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$loanstatic->label=$links[$key]['label'];
|
||||
}
|
||||
$loanstatic->ref=$loanstatic->label;
|
||||
$loanstatic->ref=$links[$key]['url_id'];
|
||||
print $loanstatic->getLinkUrl(1,16);
|
||||
}
|
||||
else if ($links[$key]['type']=='member')
|
||||
|
||||
@ -767,6 +767,11 @@ if (! $sall)
|
||||
$sql.= ' f.datec, f.tms,';
|
||||
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code';
|
||||
$sql.= ' ,state.code_departement, state.nom';
|
||||
|
||||
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
|
||||
{
|
||||
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -313,6 +313,7 @@ if ($action == 'update')
|
||||
$params['options'][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$result=$extrafields->update(
|
||||
GETPOST('attrname'),
|
||||
GETPOST('label'),
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José 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
|
||||
@ -79,8 +80,10 @@ class box_project extends ModeleBoxes
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
|
||||
@ -929,7 +929,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
$showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
|
||||
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
|
||||
if ($conf->browser->phone) $maxvisiblephotos=1;
|
||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',-$maxvisiblephotos,0,0,0,$width,0).'</div>';
|
||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
|
||||
else
|
||||
{
|
||||
if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
|
||||
@ -2426,9 +2426,9 @@ function img_printer($titlealt = "default", $other='')
|
||||
/**
|
||||
* Show help logo with cursor "?"
|
||||
*
|
||||
* @param string $usehelpcursor Use help cursor
|
||||
* @param string $usealttitle Text to use as alt title
|
||||
* @return string Retourne tag img
|
||||
* @param int $usehelpcursor Use help cursor
|
||||
* @param int|string $usealttitle Text to use as alt title
|
||||
* @return string Return tag img
|
||||
*/
|
||||
function img_help($usehelpcursor = 1, $usealttitle = 1)
|
||||
{
|
||||
@ -3823,7 +3823,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
||||
* @param int $idprod Id of product or 0 if not a predefined product
|
||||
* @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...)
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" order/invoice)
|
||||
* @return int <0 if KO, Vat rate if OK
|
||||
* @return float Vat rate
|
||||
* @see get_product_localtax_for_country
|
||||
*/
|
||||
function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice=0)
|
||||
@ -3973,7 +3973,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
|
||||
* @param Societe $thirdparty_buyer Objet societe acheteuse
|
||||
* @param int $idprod Id product
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice)
|
||||
* @return float Taux de tva a appliquer, -1 si ne peut etre determine
|
||||
* @return float Vat rate to use, -1 if we can't guess it
|
||||
* @see get_default_npr, get_default_localtax
|
||||
*/
|
||||
function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
|
||||
@ -4522,7 +4522,7 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
|
||||
else $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
|
||||
$a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
$nblines = floor((count($a)+1)/2);
|
||||
$nblines = (int) floor((count($a)+1)/2);
|
||||
// count possible auto line breaks
|
||||
if($maxlinesize)
|
||||
{
|
||||
|
||||
@ -454,6 +454,10 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
|
||||
}
|
||||
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
|
||||
{
|
||||
$newval = price2num($newval);
|
||||
}
|
||||
|
||||
//print 'Val to use as insert is '.$newval.'<br>';
|
||||
}
|
||||
|
||||
@ -76,7 +76,10 @@ class modFTP extends DolibarrModules
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
|
||||
// Constants
|
||||
$this->const = array(); // List of parameters
|
||||
$this->const = array(
|
||||
1=>array('FTP_CONNECT_WITH_SSL','chaine','0','Use FTPS for FTP module', 1, 'current', 1),
|
||||
2=>array('FTP_CONNECT_WITH_SFTP','chaine','0','Use SFTP for FTP module', 1, 'current', 1)
|
||||
); // List of parameters
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(); // List of boxes
|
||||
|
||||
@ -335,7 +335,8 @@ class modSociete extends DolibarrModules
|
||||
's.code_client'=>array('rule'=>'getcustomercodeifauto'),
|
||||
's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'),
|
||||
's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'),
|
||||
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto')
|
||||
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto'),
|
||||
's.capital'=>array('rule'=>'numeric')
|
||||
);
|
||||
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
|
||||
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
|
||||
|
||||
@ -38,14 +38,14 @@
|
||||
var alwayseditable = jQuery("#alwayseditable");
|
||||
var list = jQuery("#list");
|
||||
<?php
|
||||
if((GETPOST('type') != "select") && (GETPOST('type') != "sellist"))
|
||||
if((GETPOST('type') != "select") && (GETPOST('type') != "sellist"))
|
||||
{
|
||||
print 'jQuery("#value_choice").hide();';
|
||||
}
|
||||
|
||||
if (GETPOST('type') == "separate")
|
||||
{
|
||||
print "jQuery('#size, #unique, #required, #default_value').val('').prop('disabled', true);";
|
||||
print "jQuery('#size, #default_value').val('').prop('disabled', true);";
|
||||
print 'jQuery("#value_choice").hide();';
|
||||
}
|
||||
?>
|
||||
@ -56,24 +56,27 @@
|
||||
else if (type == 'int') { size.val('10').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'price') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'select') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'link') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();}
|
||||
else if (type == 'sellist') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'radio') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();}
|
||||
else if (type == 'separate') { size.val('').prop('disabled', true); unique.prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else size.val('').prop('disabled', true);
|
||||
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();}
|
||||
else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();}
|
||||
else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else { // type = string
|
||||
size.val('').prop('disabled', true);
|
||||
unique.removeAttr('disabled');
|
||||
}
|
||||
|
||||
if (type == 'separate')
|
||||
{
|
||||
alwayseditable.val('').prop('disabled', true); list.val('').prop('disabled', true);
|
||||
unique.removeAttr('checked').prop('disabled', true); required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
alwayseditable.val('').removeAttr('disabled'); list.val('').removeAttr('disabled');
|
||||
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
init_typeoffields('<?php echo GETPOST('type'); ?>');
|
||||
@ -123,14 +126,14 @@
|
||||
<!-- Default Value -->
|
||||
<tr><td><?php echo $langs->trans("DefaultValue"); ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo (GETPOST('"default_value"')?GETPOST('"default_value"'):''); ?>"></td></tr>
|
||||
<!-- Unique -->
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique" <?php echo (GETPOST('unique')?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique')?' checked':''); ?>></td></tr>
|
||||
<!-- Required -->
|
||||
<tr><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required" <?php echo (GETPOST('required')?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required')?' checked':''); ?>></td></tr>
|
||||
<!-- Always editable -->
|
||||
<tr><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable" <?php echo ((GETPOST('alwayseditable') || ! GETPOST('button'))?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable') || ! GETPOST('button'))?' checked':''); ?>></td></tr>
|
||||
<!-- Is visible or not -->
|
||||
<?php if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) { ?>
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td><td class="valeur"><input id="ishidden" type="checkbox" name="ishidden" <?php echo (GETPOST('ishidden') ?' checked' : ''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td><td class="valeur"><input id="ishidden" type="checkbox" name="ishidden"<?php echo (GETPOST('ishidden') ?' checked' : ''); ?>></td></tr>
|
||||
<?php } ?>
|
||||
<?php if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { ?>
|
||||
<!-- By default visible into list -->
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
if (GETPOST('type') == "separate")
|
||||
{
|
||||
print "jQuery('#size, #unique, #required, #default_value').val('').prop('disabled', true);";
|
||||
print "jQuery('#size, #default_value').val('').prop('disabled', true);";
|
||||
print 'jQuery("#value_choice").hide();';
|
||||
}
|
||||
?>
|
||||
@ -48,24 +48,27 @@
|
||||
else if (type == 'int') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'price') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'select') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'link') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();}
|
||||
else if (type == 'sellist') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'radio') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();}
|
||||
else if (type == 'separate') { size.val('').prop('disabled', true); unique.prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else size.val('').prop('disabled', true);
|
||||
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();}
|
||||
else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();}
|
||||
else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
|
||||
else { // type = string
|
||||
size.val('').prop('disabled', true);
|
||||
unique.removeAttr('disabled');
|
||||
}
|
||||
|
||||
if (type == 'separate')
|
||||
{
|
||||
alwayseditable.val('').prop('disabled', true); list.val('').prop('disabled', true);
|
||||
required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
alwayseditable.val('').removeAttr('disabled'); list.val('').removeAttr('disabled');
|
||||
required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
init_typeoffields(jQuery("#type").val());
|
||||
@ -174,14 +177,14 @@ else
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Unique -->
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique" <?php echo ($unique?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique?' checked':''); ?>></td></tr>
|
||||
<!-- Required -->
|
||||
<tr><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required" <?php echo ($required?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required?' checked':''); ?>></td></tr>
|
||||
<!-- Always editable -->
|
||||
<tr><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable" <?php echo ($alwayseditable?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable?' checked':''); ?>></td></tr>
|
||||
<!-- Is visible or not -->
|
||||
<?php if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) { ?>
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td><td class="valeur"><input id="ishidden" type="checkbox" name="ishidden" <?php echo ($ishidden ?' checked':''); ?>></td></tr>
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td><td class="valeur"><input id="ishidden" type="checkbox" name="ishidden"<?php echo ($ishidden ?' checked':''); ?>></td></tr>
|
||||
<?php } ?>
|
||||
<!-- By default visible into list -->
|
||||
<?php if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { ?>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.1');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.2');
|
||||
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ else
|
||||
print '<tr class="pair">';
|
||||
print '<td width="100">'.$langs->trans("Port").'</td>';
|
||||
print '<td><input type="text" name="FTP_PORT_'.($lastftpentry+1).'" value="'.GETPOST("FTP_PORT_" . ($lastftpentry+1)).'" size="64"></td>';
|
||||
print '<td>21</td>';
|
||||
print '<td>21 for pure non crypted FTP or if option FTP_CONNECT_WITH_SSL (See Home-Setup-Other) is on (FTPS)<br>22 if option FTP_CONNECT_WITH_SFTP (See Home-Setup-Other) is on (SFTP)</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
|
||||
@ -458,7 +458,7 @@ else
|
||||
|
||||
|
||||
// Construit liste des repertoires
|
||||
print '<table width="100%" class="nobordernopadding">'."\n";
|
||||
print '<table width="100%" class="noborder">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td class="liste_titre" align="left">'.$langs->trans("Content").'</td>'."\n";
|
||||
|
||||
@ -4,6 +4,7 @@ Loans=Loans
|
||||
NewLoan=New Loan
|
||||
ShowLoan=Show Loan
|
||||
PaymentLoan=Loan payment
|
||||
LoanPayment=Loan payment
|
||||
ShowLoanPayment=Show Loan Payment
|
||||
LoanCapital=Capital
|
||||
Insurance=Insurance
|
||||
|
||||
@ -505,6 +505,7 @@ ReportPeriod=Report period
|
||||
ReportDescription=Description
|
||||
Report=Report
|
||||
Keyword=Keyword
|
||||
Origin=Origin
|
||||
Legend=Legend
|
||||
Fill=Fill
|
||||
Reset=Reset
|
||||
|
||||
@ -491,7 +491,6 @@ if ($id > 0)
|
||||
print '<td align="center">'.$langs->trans("Insurance").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Interest").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LoanCapital").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -385,6 +385,7 @@ class PaymentLoan extends CommonObject
|
||||
* All payment properties must have been set first like after a call to create().
|
||||
*
|
||||
* @param User $user Object of user making payment
|
||||
* @param int $fk_loan Id of fk_loan to do link with this payment
|
||||
* @param string $mode 'payment_loan'
|
||||
* @param string $label Label to use in bank record
|
||||
* @param int $accountid Id of bank account to do link with
|
||||
@ -392,7 +393,7 @@ class PaymentLoan extends CommonObject
|
||||
* @param string $emetteur_banque Name of bank
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||
function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -445,11 +446,10 @@ class PaymentLoan extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
|
||||
//$linkaddedforthirdparty=array();
|
||||
// Add link 'loan' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
|
||||
if ($mode == 'payment_loan')
|
||||
{
|
||||
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan');
|
||||
$result=$acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan');
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -116,7 +116,7 @@ if ($action == 'add_payment')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result = $payment->addPaymentToBank($user, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', '');
|
||||
$result = $payment->addPaymentToBank($user, $chid, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', '');
|
||||
if (! $result > 0)
|
||||
{
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
@ -175,7 +175,7 @@ if ($action == 'create')
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$loan->label."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT SUM(amount_capital + amount_insurance + amount_interest) as total";
|
||||
$sql = "SELECT SUM(amount_capital) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan";
|
||||
$sql.= " WHERE fk_loan = ".$chid;
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -210,9 +210,9 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
|
||||
//print '<table width="100%">';
|
||||
|
||||
// Generation des graphs
|
||||
$dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
|
||||
if ($object->id > 0) // We are on statistics for a dedicated product
|
||||
{
|
||||
$dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
|
||||
if (! file_exists($dir.'/'.$object->id))
|
||||
{
|
||||
if (dol_mkdir($dir.'/'.$object->id) < 0)
|
||||
|
||||
@ -631,7 +631,7 @@ else
|
||||
array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false)
|
||||
);
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 280);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1239,6 +1239,9 @@ class Task extends CommonObject
|
||||
|
||||
// Load source object
|
||||
$clone_task->fetch($fromid);
|
||||
$clone_task->fetch_optionals();
|
||||
//var_dump($clone_task->array_options);exit;
|
||||
|
||||
$origin_task->fetch($fromid);
|
||||
|
||||
$defaultref='';
|
||||
|
||||
@ -150,6 +150,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
$day='';
|
||||
$month='';
|
||||
$year='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
if (empty($search_projectstatus) && $search_projectstatus == '') $search_projectstatus=1;
|
||||
|
||||
@ -221,8 +222,8 @@ $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title
|
||||
$sql.= ", s.nom as name, s.rowid as socid";
|
||||
$sql.= ", t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update";
|
||||
$sql.= ", t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut";
|
||||
// Add fields for extrafields
|
||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -170,7 +170,7 @@ $arrayfields=array(
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||
}
|
||||
@ -341,8 +341,9 @@ else dol_print_error($db);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, ";
|
||||
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
|
||||
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,";
|
||||
$sql.= " s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.fk_pays,";
|
||||
$sql.= " s.tms as date_update, s.datec as date_creation,";
|
||||
$sql.= " s.code_compta,s.code_compta_fournisseur,";
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
||||
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
@ -408,7 +409,7 @@ foreach ($search_array_options as $key => $val)
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@ -439,7 +440,6 @@ if (! $resql)
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -980,6 +980,7 @@ while ($i < min($num, $limit))
|
||||
print $s;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
||||
{
|
||||
// Prospect level
|
||||
@ -987,6 +988,7 @@ while ($i < min($num, $limit))
|
||||
print $companystatic->getLibProspLevel();
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['s.fk_stcomm']['checked']))
|
||||
{
|
||||
// Prospect status
|
||||
@ -1004,9 +1006,9 @@ while ($i < min($num, $limit))
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
print '<td';
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
|
||||
@ -1351,7 +1351,7 @@ table.login_table_securitycode tr td {
|
||||
|
||||
div.login_block {
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
text-align: <?php print $right; ?>;
|
||||
<?php print $right; ?>: 5px;
|
||||
top: 2px;
|
||||
font-weight: bold;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user