';
// List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
$arrayoflabels=array();
foreach(array_keys($_Avery_Labels) as $codecards)
@@ -284,7 +284,7 @@ print '
';
-
+
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook))
{
diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php
new file mode 100644
index 00000000000..a6dadeb0e1c
--- /dev/null
+++ b/htdocs/categories/traduction.php
@@ -0,0 +1,284 @@
+
+ * Copyright (C) 2007 Rodolphe Quiedeville
+ * Copyright (C) 2010-2012 Destailleur Laurent
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ * or see http://www.gnu.org/
+ */
+
+/**
+ * \file htdocs/product/traduction.php
+ * \ingroup product
+ * \brief Page de traduction des produits
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
+
+$langs->load("categories");
+$langs->load("languages");
+
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
+$action=GETPOST('action','alpha');
+$cancel=GETPOST('cancel','alpha');
+$type=GETPOST('type');
+
+// Security check
+$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
+$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
+
+if ($id == "")
+{
+ dol_print_error('','Missing parameter id');
+ exit();
+}
+
+// Security check
+$result = restrictedArea($user, 'categorie', $id, '&category');
+
+$object = new Categorie($db);
+
+
+/*
+ * Actions
+ */
+
+// retour a l'affichage des traduction si annulation
+if ($cancel == $langs->trans("Cancel"))
+{
+ $action = '';
+}
+
+
+// Validation de l'ajout
+if ($action == 'vadd' &&
+$cancel != $langs->trans("Cancel") &&
+($user->rights->categorie->creer ))
+{
+ $object->fetch($id);
+ $current_lang = $langs->getDefaultLang();
+
+ // update de l'objet
+ if ( $_POST["forcelangprod"] == $current_lang )
+ {
+ $object->label = $_POST["libelle"];
+ $object->description = dol_htmlcleanlastbr($_POST["desc"]);
+ }
+ else
+ {
+ $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
+ $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
+ }
+
+ // sauvegarde en base
+ if ( $object->setMultiLangs() > 0 )
+ {
+ $action = '';
+ }
+ else
+ {
+ $action = 'add';
+ $mesg = '
';
/*
diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php
index 55e0d1c27b5..9a5ecd3562c 100644
--- a/htdocs/core/ajax/row.php
+++ b/htdocs/core/ajax/row.php
@@ -60,7 +60,7 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[
$row->table_element_line = $table_element_line;
$row->fk_element = $fk_element;
$row->id = $element_id;
- $result=$row->line_ajaxorder($newrowordertab);
+ $row->line_ajaxorder($newrowordertab);
// Reorder line to have position of chilren lines sharing same counter than parent lines
// This should be useless because there is no need to have children sharing same counter that parent.
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index e51e3d3288f..26ecd1247e8 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -64,7 +64,7 @@ class box_factures_fourn extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire)
{
$sql = "SELECT s.nom, s.rowid as socid,";
- $sql.= " f.rowid as facid, f.ref_supplier, f.amount,";
+ $sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.amount,";
$sql.= " f.paye, f.fk_statut,";
$sql.= ' f.datef as df,';
$sql.= ' f.datec as datec,';
@@ -102,25 +102,29 @@ class box_factures_fourn extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->ref_supplier,
+ 'text' => ($objp->ref?$objp->ref:$objp->facid),
'text2'=> $late,
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
+ $this->info_box_contents[$i][2] = array('td' => 'align="left"',
+ 'text' => $objp->ref_supplier,
+ 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
+
+ $this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
+ $this->info_box_contents[$i][4] = array('td' => 'align="left"',
'text' => $objp->nom,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
+ $this->info_box_contents[$i][5] = array('td' => 'align="right"',
'text' => dol_print_date($datec,'day'));
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
- $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
+ $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
$i++;
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index ebe2f897b77..316ee7b086a 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -61,7 +61,7 @@ class box_factures_fourn_imp extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire)
{
$sql = "SELECT s.nom, s.rowid as socid,";
- $sql.= " f.rowid as facid, f.ref_supplier, f.date_lim_reglement as datelimite,";
+ $sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
$sql.= " f.amount, f.datef as df,";
$sql.= " f.paye, f.fk_statut, f.type";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -98,25 +98,29 @@ class box_factures_fourn_imp extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->ref_supplier,
+ 'text' => ($objp->ref?$objp->ref:$objp->facid),
'text2'=> $late,
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
+ $this->info_box_contents[$i][2] = array('td' => 'align="left"',
+ 'text' => $objp->ref_supplier,
+ 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
+
+ $this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
+ $this->info_box_contents[$i][4] = array('td' => 'align="left"',
'text' => $objp->nom,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
+ $this->info_box_contents[$i][5] = array('td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'));
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
- $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
+ $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
$i++;
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 5fa752d9619..18b9cfb9b4f 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -92,11 +92,11 @@ class CMailFile
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
* @param string $addr_cc Email cc
- * @param string $addr_bcc Email bcc
- * @param int $deliveryreceipt Ask a delivery receipt
- * @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
- * @param string $errors_to Email errors
- * @param string $css Css option
+ * @param string $addr_bcc Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined)
+ * @param int $deliveryreceipt Ask a delivery receipt
+ * @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable)
+ * @param string $errors_to Email errors
+ * @param string $css Css option
*/
function __construct($subject,$to,$from,$msg,
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index af39da58cf7..1b290222a11 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -62,7 +62,7 @@ abstract class CommonDocGenerator
'myuser_fax'=>$user->office_fax,
'myuser_mobile'=>$user->user_mobile,
'myuser_email'=>$user->email,
- 'myuser_logo'=>$logotouse,
+ 'myuser_logo'=>$user->photo,
'myuser_web'=>'' // url not exist in $user object
);
}
@@ -139,7 +139,7 @@ abstract class CommonDocGenerator
{
$object->country=$outputlangs->transnoentitiesnoconv("Country".$object->country_code);
}
- if (empty($mysoc->state) && ! empty($mysoc->state_code))
+ if (empty($object->state) && ! empty($object->state_code))
{
$object->state=getState($object->state_code,0);
}
@@ -418,7 +418,7 @@ abstract class CommonDocGenerator
* @param Object $object Object with extrafields (must have $object->array_options filled)
* @param array $array_to_fill Substitution array
* @param Extrafields $extrafields Extrafields object
- * @param array_key $array_key Name of the key for return array
+ * @param string $array_key Name of the key for return array
* @param Translate $outputlangs Lang object to use for output
* @return array Substitution array
*/
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 0314bf34413..5c9d6257fb9 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -253,6 +253,7 @@ abstract class CommonInvoice extends CommonObject
}
if ($mode == 4)
{
+ $prefix='';
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('BillStatusDraft');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ba4094c2a14..3835f7cb07e 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -47,8 +47,8 @@ abstract class CommonObject
public $array_options=array();
- public $linkedObjectsIds;
- public $linkedObjects;
+ public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
+ public $linkedObjects; // Loaded by ->fetchObjectLinked
// No constructor as it is an abstract class
@@ -83,10 +83,10 @@ abstract class CommonObject
if (empty($firstname)) $firstname=$this->firstname;
$ret='';
- if ($option && $this->civilite_id)
+ if ($option && $this->civility_id)
{
- if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' ';
- else $ret.=$this->civilite_id.' ';
+ if ($langs->transnoentitiesnoconv("Civility".$this->civility_id)!="Civility".$this->civility_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civility_id).' ';
+ else $ret.=$this->civility_id.' ';
}
$ret.=dolGetFirstLastname($firstname, $lastname, $nameorder);
@@ -241,8 +241,8 @@ abstract class CommonObject
/**
* Copy contact from one element to current
*
- * @param int $objFrom Source element
- * @param int $source Nature of contact ('internal' or 'external')
+ * @param CommonObject $objFrom Source element
+ * @param string $source Nature of contact ('internal' or 'external')
* @return int >0 if OK, <0 if KO
*/
function copy_linked_contact($objFrom, $source='internal')
@@ -1718,10 +1718,10 @@ abstract class CommonObject
* @param string $sourcetype Object source type
* @param int $targetid Object target id
* @param string $targettype Object target type
- * @param string $clause OR, AND clause
+ * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
* @return void
*/
- function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
+ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
{
global $conf;
@@ -2278,7 +2278,7 @@ abstract class CommonObject
*/
function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='')
{
- global $_POST;
+ global $_POST, $conf;
$out = '';
@@ -2392,7 +2392,8 @@ abstract class CommonObject
/**
- * Function to check if an object is used by others
+ * Function to check if an object is used by others.
+ * Check is done into this->childtables. There is no check into llx_element_element.
*
* @param int $id Id of object
* @return int <0 if KO, 0 if not used, >0 if already used
@@ -2482,7 +2483,7 @@ abstract class CommonObject
$i=0;
while ($i < $num)
{
- $obj = $this->db->fetch_object($query);
+ $obj = $this->db->fetch_object($resql);
$pu_ht = $obj->pu_ht;
$qty= $obj->qty;
@@ -2692,13 +2693,12 @@ abstract class CommonObject
/**
* Show add free products/services form
* TODO Edit templates to use global variables and include them directly in controller call
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
+ * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
- * @param int $dateSelector 1=Show also date range input fields
+ * @param int $dateSelector 1=Show also date range input fields (start and end date)
* @param Societe $seller Object thirdparty who sell
* @param Societe $buyer Object thirdparty who buy
* @return void
- * @deprecated
*/
function formAddFreeProduct($dateSelector,$seller,$buyer)
{
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index e9b2728ad3f..d8dc5a65e66 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -119,6 +119,8 @@ class Conf
*/
function setValues($db)
{
+ global $conf;
+
dol_syslog(get_class($this)."::setValues");
/*
@@ -223,22 +225,6 @@ class Conf
if ($ret) $mc = new ActionsMulticompany($db);
}
- // Second or others levels object
- $this->propal->cloture = new stdClass();
- $this->propal->facturation = new stdClass();
- $this->commande->client = new stdClass();
- $this->commande->fournisseur = new stdClass();
- $this->facture->client = new stdClass();
- $this->facture->fournisseur = new stdClass();
- $this->fournisseur->commande = new stdClass();
- $this->fournisseur->facture = new stdClass();
- $this->contrat->services = new stdClass();
- $this->contrat->services->inactifs = new stdClass();
- $this->contrat->services->expires = new stdClass();
- $this->adherent->cotisation = new stdClass();
- $this->bank->rappro = new stdClass();
- $this->bank->cheque = new stdClass();
-
// Clean some variables
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_menu.php";
if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_menu.php";
diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php
index a45aaeb2423..5d3d5352626 100644
--- a/htdocs/core/class/cookie.class.php
+++ b/htdocs/core/class/cookie.class.php
@@ -34,7 +34,7 @@ class DolCookie
var $myExpire;
var $myPath;
var $myDomain;
- var $mySsecure;
+ var $mySecure;
var $cookiearray;
var $cookie;
@@ -80,7 +80,7 @@ class DolCookie
/**
* Decrypt the cookie
*
- * @return void
+ * @return string
*/
function decryptCookie()
{
@@ -144,4 +144,4 @@ class DolCookie
}
-?>
\ No newline at end of file
+?>
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index ede7615a65a..78c0add9aab 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -188,7 +188,7 @@ class DiscountAbsolute
// Check if we can remove the discount
if ($this->fk_facture_source)
{
- $sql.="SELECT COUNT(rowid) as nb";
+ $sql="SELECT COUNT(rowid) as nb";
$sql.=" FROM ".MAIN_DB_PREFIX."societe_remise_except";
$sql.=" WHERE (fk_facture_line IS NOT NULL"; // Not used as absolute simple discount
$sql.=" OR fk_facture IS NOT NULL)"; // Not used as credit note and not used as deposit
diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php
index 926f5c42b42..768741d9368 100644
--- a/htdocs/core/class/dolprintipp.class.php
+++ b/htdocs/core/class/dolprintipp.class.php
@@ -126,7 +126,7 @@ class dolprintIPP
*/
function list_jobs($module)
{
- global $conf,$db;
+ global $conf, $db, $bc;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP();
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index a980b4bef85..93cd55e31ca 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -207,16 +207,16 @@ class ExtraFields
/**
* Add description of a new optional attribute
*
- * @param string $attrname code of attribute
- * @param string $label label of attribute
- * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour', 'float')
- * @param int $pos Position of attribute
- * @param int $size Size/length of attribute
- * @param string $elementtype Element type ('member', 'product', 'company', ...)
- * @param int $unique Is field unique or not
- * @param int $required Is field required or not
- * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
- * @return int <=0 if KO, >0 if OK
+ * @param string $attrname code of attribute
+ * @param string $label label of attribute
+ * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour', 'float')
+ * @param int $pos Position of attribute
+ * @param int $size Size/length of attribute
+ * @param string $elementtype Element type ('member', 'product', 'company', ...)
+ * @param int $unique Is field unique or not
+ * @param int $required Is field required or not
+ * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
+ * @return int <=0 if KO, >0 if OK
*/
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='')
{
@@ -581,7 +581,7 @@ class ExtraFields
*/
function showInputField($key,$value,$moreparam='',$keyprefix='')
{
- global $conf,$langs;
+ global $conf,$langs,$db;
$label=$this->attribute_label[$key];
$type =$this->attribute_type[$key];
diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php
index 910ad55e0a0..b5483139fb6 100644
--- a/htdocs/core/class/fileupload.class.php
+++ b/htdocs/core/class/fileupload.class.php
@@ -558,7 +558,8 @@ class FileUpload
isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ? $upload['name'] : null),
isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ? $upload['size'] : null),
isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ? $upload['type'] : null),
- isset($upload['error']) ? $upload['error'] : null
+ isset($upload['error']) ? $upload['error'] : null,
+ 0
);
}
header('Vary: Accept');
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 0943bce1e87..0c5fe571eda 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3160,7 +3160,7 @@ class Form
*/
function form_contacts($page, $societe, $selected='', $htmlname='contactidp')
{
- global $langs;
+ global $langs, $conf;
if ($htmlname != "none")
{
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index 6d570b70880..cf23a0871a5 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -199,9 +199,9 @@ class FormAdmin
/**
* Return combo list of available menu families
*
- * @param string $selected Menu pre-selected
- * @param string $htmlname Name of html select
- * @param string $dirmenuarray Directories to scan
+ * @param string $selected Menu pre-selected
+ * @param string $htmlname Name of html select
+ * @param string[] $dirmenuarray Directories to scan
* @return void
*/
function select_menu_families($selected, $htmlname, $dirmenuarray)
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 5317d49c23c..334fb9a5d9e 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -257,8 +257,7 @@ class FormFile
*/
function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='')
{
- global $langs,$conf,$hookmanager;
- global $bc;
+ global $langs,$conf,$hookmanager,$user,$bc;
// filedir = $conf->...->dir_ouput."/".get_exdir(id)
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index a76877c9994..b2c91087916 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -58,7 +58,8 @@ class FormMail
var $withreplytoreadonly;
var $withtoreadonly;
var $withtoccreadonly;
- var $withtopicreadonly;
+ var $withtocccreadonly;
+ var $withtopicreadonly;
var $withfilereadonly;
var $withdeliveryreceipt;
var $withcancel;
@@ -95,6 +96,7 @@ class FormMail
$this->withreplytoreadonly=1;
$this->withtoreadonly=0;
$this->withtoccreadonly=0;
+ $this->withtocccreadonly=0;
$this->witherrorstoreadonly=0;
$this->withtopicreadonly=0;
$this->withfilereadonly=0;
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 916f2cbcd9a..416ee790282 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -391,7 +391,7 @@ class FormOther
$moreinfo=0;
if (! empty($conf->global->MAIN_SHOW_LOGIN))
{
- $out.=($moreinfo?' - ':' (').$obj->login;
+ $moreforfilter.=($moreinfo?' - ':' (').$obj_usr->login;
$moreinfo++;
}
if ($showstatus >= 0)
@@ -424,16 +424,17 @@ class FormOther
/**
* Return list of project and tasks
*
- * @param int $selectedtask Pre-selected task
- * @param int $projectid Project id
- * @param string $htmlname Name of html select
- * @param int $modeproject 1 to restrict on projects owned by user
- * @param int $modetask 1 to restrict on tasks associated to user
- * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
- * @param int $useempty 0=Allow empty values
+ * @param int $selectedtask Pre-selected task
+ * @param int $projectid Project id
+ * @param string $htmlname Name of html select
+ * @param int $modeproject 1 to restrict on projects owned by user
+ * @param int $modetask 1 to restrict on tasks associated to user
+ * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
+ * @param int $useempty 0=Allow empty values
+ * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
* @return void
*/
- function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0)
+ function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0)
{
global $user, $langs;
@@ -448,7 +449,7 @@ class FormOther
if ($useempty) print '';
$j=0;
$level=0;
- $this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid);
+ $this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid, $disablechildoftaskid);
print '';
}
else
@@ -458,17 +459,18 @@ class FormOther
}
/**
- * Write all lines of a project (if parent = 0)
+ * Write lines of a project (all lines of a project if parent = 0)
*
* @param int &$inc Cursor counter
- * @param int $parent Id parent
- * @param Object $lines Line object
+ * @param int $parent Id of parent task we want to see
+ * @param array $lines Array of task lines
* @param int $level Level
* @param int $selectedtask Id selected task
* @param int $selectedproject Id selected project
+ * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
* @return void
*/
- private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
+ private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0)
{
global $langs, $user, $conf;
@@ -481,12 +483,12 @@ class FormOther
{
$var = !$var;
- //var_dump($selectedtask."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);
+ //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);
// Break on a new project
- if ($parent == 0)
+ if ($parent == 0) // We are on a task at first level
{
- if ($lines[$i]->fk_project != $lastprojectid)
+ if ($lines[$i]->fk_project != $lastprojectid) // Break found on project
{
if ($i > 0 && $conf->browser->firefox) print '';
print '