Merge pull request #9322 from grandoc/new_branch_29_08_2018

New branch 29 08 2018
This commit is contained in:
Laurent Destailleur 2018-09-01 12:11:01 +02:00 committed by GitHub
commit b863b5176d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 155 additions and 98 deletions

View File

@ -58,7 +58,12 @@ class AccountancyCategory // extends CommonObject
public $id; public $id;
public $code; public $code;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $range_account; public $range_account;
public $sens; public $sens;
public $category_type; public $category_type;

View File

@ -96,7 +96,8 @@ class AccountingAccount extends CommonObject
public $fk_user_modif; public $fk_user_modif;
var $active; // duplicate with status var $active; // duplicate with status
var $status;
var $status;
/** /**

View File

@ -30,20 +30,25 @@ class AccountingJournal extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='accounting_journal'; public $element='accounting_journal';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element='accounting_journal'; public $table_element='accounting_journal';
public $fk_element = ''; public $fk_element = '';
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'generic'; public $picto = 'generic';
var $rowid; public $rowid;
public $code; public $code;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $nature; // 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new public $nature; // 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new
public $active; public $active;

View File

@ -35,22 +35,22 @@ class Asset extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'asset'; public $element = 'asset';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'asset'; public $table_element = 'asset';
/** /**
* @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/ */
public $ismultientitymanaged = 0; public $ismultientitymanaged = 0;
/** /**
* @var int Does asset support extrafields ? 0=No, 1=Yes * @var int Does asset support extrafields ? 0=No, 1=Yes
*/ */
public $isextrafieldmanaged = 1; public $isextrafieldmanaged = 1;
/** /**
* @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png
*/ */
@ -98,7 +98,12 @@ class Asset extends CommonObject
public $rowid; public $rowid;
public $ref; public $ref;
public $entity; public $entity;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $amount; public $amount;
public $fk_soc; public $fk_soc;
public $description; public $description;
@ -465,4 +470,4 @@ class Asset extends CommonObject
return 0; return 0;
} }
} }

View File

@ -6,7 +6,7 @@
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013-2016 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) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
@ -51,7 +51,7 @@ class Categorie extends CommonObject
const TYPE_USER = 'user'; const TYPE_USER = 'user';
const TYPE_PROJECT = 'project'; const TYPE_PROJECT = 'project';
const TYPE_ACCOUNT = 'bank_account'; const TYPE_ACCOUNT = 'bank_account';
const TYPE_BANK_LINE = 'bank_line'; const TYPE_BANK_LINE = 'bank_line';
public $picto = 'category'; public $picto = 'category';
@ -152,14 +152,19 @@ class Categorie extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='category'; public $element='category';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element='categorie'; public $table_element='categorie';
public $fk_parent; public $fk_parent;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $description; public $description;
/** /**
* @var string Color * @var string Color

View File

@ -66,7 +66,6 @@ $modulesdir = dolGetModulesDirs('/mailings');
$object = new Mailing($db); $object = new Mailing($db);
/* /*
* Actions * Actions
*/ */
@ -330,16 +329,14 @@ if ($object->fetch($id) >= 0)
// Si le module mailing est qualifie // Si le module mailing est qualifie
if ($qualified) if ($qualified)
{ {
$var = ! $var;
if ($allowaddtarget) if ($allowaddtarget)
{ {
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">'; print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
} }
else else
{ {
print '<div '.$bctag[$var].'>'; print '<div class="oddeven tagtr">';
} }
print '<div class="tagtd">'; print '<div class="tagtd">';

View File

@ -33,7 +33,11 @@ class BankCateg // extends CommonObject
public $picto='generic'; public $picto='generic';
public $id; public $id;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
/** /**

View File

@ -51,7 +51,12 @@ class PaymentSalary extends CommonObject
public $fk_project; public $fk_project;
public $type_payment; public $type_payment;
public $num_payment; public $num_payment;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $datesp; public $datesp;
public $dateep; public $dateep;
public $fk_bank; public $fk_bank;

View File

@ -43,22 +43,22 @@ class PaymentSocialContribution extends CommonObject
public $picto = 'payment'; public $picto = 'payment';
var $fk_charge; public $fk_charge;
var $datec=''; public $datec='';
var $tms=''; public $tms='';
var $datep=''; public $datep='';
/** /**
* @deprecated * @deprecated
* @see amount * @see amount
*/ */
var $total; public $total;
var $amount; // Total amount of payment public $amount; // Total amount of payment
var $amounts=array(); // Array of amounts public $amounts=array(); // Array of amounts
var $fk_typepaiement; public $fk_typepaiement;
var $num_paiement; public $num_paiement;
var $fk_bank; public $fk_bank;
var $fk_user_creat; public $fk_user_creat;
var $fk_user_modif; public $fk_user_modif;
/** /**
* Constructor * Constructor

View File

@ -55,13 +55,13 @@ class Contracts extends DolibarrApi
} }
/** /**
* Get properties of a contrat object * Get properties of a contract object
* *
* Return an array with contrat informations * Return an array with contract informations
* *
* @param int $id ID of contract * @param int $id ID of contract
* @return array|mixed data without useless information * @return array|mixed data without useless information
* *
* @throws RestException * @throws RestException
*/ */
function get($id) function get($id)
@ -457,7 +457,7 @@ class Contracts extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
// TODO Check the lineid $lineid is a line of ojbect // TODO Check the lineid $lineid is a line of object
$updateRes = $this->contract->deleteline($lineid, DolibarrApiAccess::$user); $updateRes = $this->contract->deleteline($lineid, DolibarrApiAccess::$user);
if ($updateRes > 0) { if ($updateRes > 0) {
@ -472,7 +472,7 @@ class Contracts extends DolibarrApi
/** /**
* Update contract general fields (won't touch lines of contract) * Update contract general fields (won't touch lines of contract)
* *
* @param int $id Id of contrat to update * @param int $id Id of contract to update
* @param array $request_data Datas * @param array $request_data Datas
* *
* @return int * @return int
@ -540,7 +540,7 @@ class Contracts extends DolibarrApi
} }
/** /**
* Validate an contract * Validate a contract
* *
* @param int $id Contract ID * @param int $id Contract ID
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers

View File

@ -241,8 +241,8 @@ class Contrat extends CommonObject
* *
* @param User $user Objet User who activate contract * @param User $user Objet User who activate contract
* @param int $line_id Id of line to activate * @param int $line_id Id of line to activate
* @param int $date Date d'ouverture * @param int $date Opening date
* @param int|string $date_end Date fin prevue * @param int|string $date_end Expected end date
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -263,7 +263,7 @@ class Contrat extends CommonObject
* *
* @param User $user Objet User who close contract * @param User $user Objet User who close contract
* @param int $line_id Id of line to close * @param int $line_id Id of line to close
* @param int $date_end Date end * @param int $date_end End date
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -525,7 +525,7 @@ class Contrat extends CommonObject
/** /**
* Unvalidate a contract * Unvalidate a contract
* *
* @param User $user Objet User * @param User $user Object User
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers * @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -567,7 +567,7 @@ class Contrat extends CommonObject
// End call triggers // End call triggers
} }
// Set new ref and define current statut // Set new ref and define current status
if (! $error) if (! $error)
{ {
$this->statut=0; $this->statut=0;
@ -665,7 +665,7 @@ class Contrat extends CommonObject
$this->db->free($resql); $this->db->free($resql);
// Retreive all extrafield // Retreive all extrafields
// fetch optionals attributes and labels // fetch optionals attributes and labels
$this->fetch_optionals(); $this->fetch_optionals();
@ -727,7 +727,7 @@ class Contrat extends CommonObject
$this->lines=array(); $this->lines=array();
$pos = 0; $pos = 0;
// Selectionne les lignes contrats liees a un produit // Selects contract lines related to a product
$sql = "SELECT p.label as product_label, p.description as product_desc, p.ref as product_ref,"; $sql = "SELECT p.label as product_label, p.description as product_desc, p.ref as product_ref,";
$sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,"; $sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,";
$sql.= " d.total_ht,"; $sql.= " d.total_ht,";
@ -761,7 +761,7 @@ class Contrat extends CommonObject
$line->id = $objp->rowid; $line->id = $objp->rowid;
$line->ref = $objp->rowid; $line->ref = $objp->rowid;
$line->fk_contrat = $objp->fk_contrat; $line->fk_contrat = $objp->fk_contrat;
$line->desc = $objp->description; // Description ligne $line->desc = $objp->description; // Description line
$line->qty = $objp->qty; $line->qty = $objp->qty;
$line->vat_src_code = $objp->vat_src_code ; $line->vat_src_code = $objp->vat_src_code ;
$line->tva_tx = $objp->tva_tx; $line->tva_tx = $objp->tva_tx;
@ -792,9 +792,9 @@ class Contrat extends CommonObject
$line->fk_unit = $objp->fk_unit; $line->fk_unit = $objp->fk_unit;
$line->ref = $objp->product_ref; // deprecated $line->ref = $objp->product_ref; // deprecated
$line->product_ref = $objp->product_ref; // Ref product $line->product_ref = $objp->product_ref; // Product Ref
$line->product_desc = $objp->product_desc; // Description product $line->product_desc = $objp->product_desc; // Product Description
$line->product_label = $objp->product_label; // Label product $line->product_label = $objp->product_label; // Product Label
$line->description = $objp->description; $line->description = $objp->description;
@ -812,7 +812,7 @@ class Contrat extends CommonObject
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); $line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
$line->date_fin_reel = $this->db->jdate($objp->date_cloture); $line->date_fin_reel = $this->db->jdate($objp->date_cloture);
// Retreive all extrafield for contract // Retreive all extrafields for contract
// fetch optionals attributes and labels // fetch optionals attributes and labels
$line->fetch_optionals(); $line->fetch_optionals();
@ -918,7 +918,7 @@ class Contrat extends CommonObject
$modCodeContract = new $module(); $modCodeContract = new $module();
if (!empty($modCodeContract->code_auto)) { if (!empty($modCodeContract->code_auto)) {
// Mise a jour ref // Update ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
@ -942,14 +942,14 @@ class Contrat extends CommonObject
} }
} }
// Insert contacts commerciaux ('SALESREPSIGN','contrat') // Insert business contacts ('SALESREPSIGN','contrat')
if (! $error) if (! $error)
{ {
$result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal'); $result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal');
if ($result < 0) $error++; if ($result < 0) $error++;
} }
// Insert contacts commerciaux ('SALESREPFOLL','contrat') // Insert business contacts ('SALESREPFOLL','contrat')
if (! $error) if (! $error)
{ {
$result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal'); $result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal');

View File

@ -36,7 +36,7 @@ class Ctyperesource
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'ctyperesource'; public $element = 'ctyperesource';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
@ -48,7 +48,12 @@ class Ctyperesource
public $lines = array(); public $lines = array();
public $code; public $code;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $active; public $active;
@ -474,12 +479,17 @@ class CtyperesourceLine
* @var int ID * @var int ID
*/ */
public $id; public $id;
/** /**
* @var mixed Sample line property 1 * @var mixed Sample line property 1
*/ */
public $code; public $code;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $active; public $active;
/** /**

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2017 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2017 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2017 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2015-2017 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -40,50 +40,53 @@ class FormMail extends Form
*/ */
public $db; public $db;
var $withform; // 1=Include HTML form tag and show submit button, 0=Do not include form tag and submit button, -1=Do not include form tag but include submit button public $withform; // 1=Include HTML form tag and show submit button, 0=Do not include form tag and submit button, -1=Do not include form tag but include submit button
var $fromname; public $fromname;
var $frommail; public $frommail;
var $replytoname; public $replytoname;
var $replytomail; public $replytomail;
var $toname; public $toname;
var $tomail; public $tomail;
var $trackid; public $trackid;
public $withsubstit; // Show substitution array
public $withfrom;
var $withsubstit; // Show substitution array
var $withfrom;
/** /**
* @var int * @var int
* @deprecated Fill withto with array before calling method. * @deprecated Fill withto with array before calling method.
* @see withto * @see withto
*/ */
public $withtosocid; public $withtosocid;
/** /**
* @var int|int[] * @var int|int[]
*/ */
public $withto; // Show recipient emails public $withto; // Show recipient emails
var $withtofree; // Show free text for recipient emails
var $withtocc;
var $withtoccc;
var $withtopic;
var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
var $withmaindocfile; // 1=Add a checkbox "Attach also main document" for mass actions (checked by default), -1=Add checkbox (not checked by default)
var $withbody;
var $withfromreadonly; public $withtofree; // Show free text for recipient emails
var $withreplytoreadonly; public $withtocc;
var $withtoreadonly; public $withtoccc;
var $withtoccreadonly; public $withtopic;
var $withtocccreadonly; public $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
var $withtopicreadonly; public $withmaindocfile; // 1=Add a checkbox "Attach also main document" for mass actions (checked by default), -1=Add checkbox (not checked by default)
var $withfilereadonly; public $withbody;
var $withdeliveryreceipt;
var $withcancel;
var $withfckeditor;
var $substit=array(); public $withfromreadonly;
var $substit_lines=array(); public $withreplytoreadonly;
var $param=array(); public $withtoreadonly;
public $withtoccreadonly;
public $withtocccreadonly;
public $withtopicreadonly;
public $withfilereadonly;
public $withdeliveryreceipt;
public $withcancel;
public $withfckeditor;
public $substit=array();
public $substit_lines=array();
public $param=array();
public $withtouser=array(); public $withtouser=array();
public $withtoccuser=array(); public $withtoccuser=array();
@ -1394,7 +1397,12 @@ class FormMail extends Form
class ModelMail class ModelMail
{ {
public $id; public $id;
public $label;
/**
* @var string proper name for given parameter
*/
public $label;
public $topic; public $topic;
public $content; public $content;
public $content_lines; public $content_lines;

View File

@ -41,7 +41,12 @@ class Link extends CommonObject
public $entity; public $entity;
public $datea; public $datea;
public $url; public $url;
/**
* @var string proper name for given parameter
*/
public $label; public $label;
public $objecttype; public $objecttype;
public $objectid; public $objectid;

View File

@ -34,13 +34,21 @@ class ModeleImports
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
public $datatoimport; public $datatoimport;
public $error=''; public $error='';
public $id; // Id of driver /**
public $label; // Label of driver * @var int id of driver
*/
public $id;
/**
* @var string proper name for given parameter
*/
public $label;
public $extension; // Extension of files imported by driver public $extension; // Extension of files imported by driver
public $version; // Version of driver public $version; // Version of driver

View File

@ -248,7 +248,6 @@ class PaymentExpenseReport extends CommonObject
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values