mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
Merge branch 'misc' of https://github.com/marcosgdf/dolibarr into
marcosgdf-misc Conflicts: htdocs/barcode/codeinit.php
This commit is contained in:
@@ -37,27 +37,67 @@ class ActionComm extends CommonObject
|
||||
public $table_rowid = 'id';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
/**
|
||||
* Id of the event
|
||||
* @var int
|
||||
*/
|
||||
var $id;
|
||||
|
||||
/**
|
||||
* Id of the event. Use $id as possible
|
||||
* @var int
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||
var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
|
||||
var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||
var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
||||
|
||||
var $label;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Use $label
|
||||
*/
|
||||
public $libelle;
|
||||
|
||||
var $datec; // Date creation record (datec)
|
||||
var $datem; // Date modification record (tms)
|
||||
var $author; // Object user that create action //deprecated
|
||||
var $usermod; // Object user that modified action // deprecated
|
||||
|
||||
/**
|
||||
* Object user that create action
|
||||
* @var User
|
||||
* @deprecated
|
||||
*/
|
||||
var $author;
|
||||
|
||||
/**
|
||||
* Object user that modified action
|
||||
* @var User
|
||||
* @deprecated
|
||||
*/
|
||||
var $usermod;
|
||||
var $authorid; // Id user that create action
|
||||
var $usermodid; // Id user that modified action
|
||||
|
||||
var $datep; // Date action start (datep)
|
||||
var $datef; // Date action end (datep2)
|
||||
var $durationp = -1; // -1=Unkown duration // deprecated
|
||||
|
||||
/**
|
||||
* @var int -1=Unkown duration
|
||||
* @deprecated
|
||||
*/
|
||||
var $durationp = -1;
|
||||
var $fulldayevent = 0; // 1=Event on full day
|
||||
var $punctual = 1; // Milestone // deprecated. Milestone is already event with end date = start date
|
||||
|
||||
/**
|
||||
* Milestone
|
||||
* @var int
|
||||
* @deprecated Milestone is already event with end date = start date
|
||||
*/
|
||||
var $punctual = 1;
|
||||
var $percentage; // Percentage
|
||||
var $location; // Location
|
||||
|
||||
@@ -68,14 +108,41 @@ class ActionComm extends CommonObject
|
||||
var $userassigned = array(); // Array of user ids
|
||||
var $userownerid; // Id of user owner
|
||||
var $userdoneid; // Id of user done
|
||||
var $usertodo; // Object user of owner // deprecated
|
||||
var $userdone; // Object user that did action // deprecated
|
||||
|
||||
/**
|
||||
* Object user of owner
|
||||
* @var User
|
||||
* @deprecated
|
||||
*/
|
||||
var $usertodo;
|
||||
|
||||
/**
|
||||
* Object user that did action
|
||||
* @var User
|
||||
* @deprecated
|
||||
*/
|
||||
var $userdone;
|
||||
|
||||
var $socid;
|
||||
var $contactid;
|
||||
var $societe; // Company linked to action (optional)
|
||||
var $contact; // Contact linked to action (optional)
|
||||
var $fk_project; // Id of project (optional)
|
||||
|
||||
/**
|
||||
* Company linked to action (optional)
|
||||
* @var Societe|null
|
||||
*/
|
||||
var $societe;
|
||||
|
||||
/**
|
||||
* Contact linked to action (optional)
|
||||
* @var Contact|null
|
||||
*/
|
||||
var $contact;
|
||||
|
||||
/**
|
||||
* Id of project (optional)
|
||||
* @var int
|
||||
*/
|
||||
var $fk_project;
|
||||
|
||||
// Properties for links to other objects
|
||||
var $fk_element; // Id of record
|
||||
@@ -95,8 +162,6 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->societe = new stdClass(); // deprecated
|
||||
@@ -239,7 +304,6 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
if (! is_array($val)) // For backward compatibility when val=id
|
||||
{
|
||||
$tmpid=$val;
|
||||
$val=array('id'=>$val);
|
||||
}
|
||||
|
||||
@@ -421,9 +485,7 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
function fetch_userassigned()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
||||
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
||||
$resql2=$this->db->query($sql);
|
||||
@@ -885,7 +947,7 @@ class ActionComm extends CommonObject
|
||||
* @param int $overwritepicto 1=Overwrite picto
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -1145,7 +1207,7 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
function initAsSpecimen()
|
||||
{
|
||||
global $user,$langs,$conf,$user;
|
||||
global $user;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
@@ -99,10 +99,10 @@ class CActionComm
|
||||
/**
|
||||
* Return list of event types: array(id=>label) or array(code=>label)
|
||||
*
|
||||
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
|
||||
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
|
||||
* @param string $idorcode 'id' or 'code'
|
||||
* @param string $excludetype Type to exclude
|
||||
* @param string $onlyautoornot Group list by auto events or not
|
||||
* @param int $onlyautoornot Group list by auto events or not
|
||||
* @return mixed Array of all event types if OK, <0 if KO
|
||||
*/
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
|
||||
|
||||
@@ -261,7 +261,7 @@ class ICal
|
||||
*/
|
||||
function ical_rrule($value)
|
||||
{
|
||||
$result=aray();
|
||||
$result=array();
|
||||
$rrule = explode(';',$value);
|
||||
foreach ($rrule as $line)
|
||||
{
|
||||
|
||||
@@ -1144,7 +1144,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
||||
|
||||
// Define $color (Hex string like '0088FF') and $cssclass of event
|
||||
$color=-1; $cssclass=''; $colorindex=-1;
|
||||
$color=-1; $colorindex=-1;
|
||||
if (in_array($user->id, $keysofuserassigned))
|
||||
{
|
||||
$nummytasks++; $cssclass='family_mytasks';
|
||||
|
||||
@@ -313,7 +313,7 @@ if ($resql)
|
||||
$actionstatic->id=$obj->id;
|
||||
$actionstatic->type_code=$obj->type_code;
|
||||
$actionstatic->type_label=$obj->type_label;
|
||||
$actionstatic->libelle=$obj->label;
|
||||
$actionstatic->label=$obj->label;
|
||||
print $actionstatic->getNomUrl(1,28);
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -804,7 +804,7 @@ $db->close();
|
||||
* @param int $minheight Minimum height for each event. 60px by default.
|
||||
* @param boolean $showheader Show header
|
||||
* @param array $colorsbytype Array with colors by type
|
||||
* @param string $var true or false for alternat style on tr/td
|
||||
* @param bool $var true or false for alternat style on tr/td
|
||||
* @return void
|
||||
*/
|
||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
||||
|
||||
@@ -909,7 +909,7 @@ if ($id > 0)
|
||||
// Addresses list
|
||||
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
|
||||
{
|
||||
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
||||
show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||
|
||||
@@ -434,7 +434,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
|
||||
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"), 'contract')." ".$obj->ref."</a></td>";
|
||||
print '<td>';
|
||||
$companystatic->id=$objp->rowid;
|
||||
$companystatic->name=$objp->name;
|
||||
|
||||
@@ -118,8 +118,7 @@ if ($action == 'add')
|
||||
if (GETPOST('clearlist'))
|
||||
{
|
||||
// Chargement de la classe
|
||||
$classname = "MailingTargets";
|
||||
$obj = new $classname($db);
|
||||
$obj = new MailingTargets($db);
|
||||
$obj->clear_target($id);
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
@@ -135,8 +134,7 @@ if ($action == 'delete')
|
||||
{
|
||||
if (!empty($id))
|
||||
{
|
||||
$classname = "MailingTargets";
|
||||
$obj = new $classname($db);
|
||||
$obj = new MailingTargets($db);
|
||||
$obj->update_nb($id);
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
|
||||
@@ -296,15 +296,15 @@ class Propal extends CommonObject
|
||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||
*
|
||||
* @param string $desc Description de la ligne
|
||||
* @param double $pu_ht Prix unitaire
|
||||
* @param double $qty Quantite
|
||||
* @param double $txtva Taux de tva
|
||||
* @param double $txlocaltax1 Local tax 1 rate
|
||||
* @param double $txlocaltax2 Local tax 2 rate
|
||||
* @param float $pu_ht Prix unitaire
|
||||
* @param float $qty Quantite
|
||||
* @param float $txtva Taux de tva
|
||||
* @param float $txlocaltax1 Local tax 1 rate
|
||||
* @param float $txlocaltax2 Local tax 2 rate
|
||||
* @param int $fk_product Id du produit/service predefini
|
||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param double $pu_ttc Prix unitaire TTC
|
||||
* @param float $pu_ttc Prix unitaire TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $type Type of line (product, service)
|
||||
* @param int $rang Position of line
|
||||
@@ -320,7 +320,7 @@ class Propal extends CommonObject
|
||||
*
|
||||
* @see add_product
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
|
||||
{
|
||||
global $mysoc;
|
||||
|
||||
@@ -477,14 +477,14 @@ class Propal extends CommonObject
|
||||
* Update a proposal line
|
||||
*
|
||||
* @param int $rowid Id de la ligne
|
||||
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* @param double $qty Quantity
|
||||
* @param double $remise_percent Remise effectuee sur le produit
|
||||
* @param double $txtva Taux de TVA
|
||||
* @param double $txlocaltax1 Local tax 1 rate
|
||||
* @param double $txlocaltax2 Local tax 2 rate
|
||||
* @param float $pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* @param float $qty Quantity
|
||||
* @param float $remise_percent Remise effectuee sur le produit
|
||||
* @param float $txtva Taux de TVA
|
||||
* @param float $txlocaltax1 Local tax 1 rate
|
||||
* @param float $txlocaltax2 Local tax 2 rate
|
||||
* @param string $desc Description
|
||||
* @param double $price_base_type HT ou TTC
|
||||
* @param string $price_base_type HT ou TTC
|
||||
* @param int $info_bits Miscellaneous informations
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
||||
@@ -498,9 +498,9 @@ class Propal extends CommonObject
|
||||
* @param array $array_option extrafields array
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
|
||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
|
||||
{
|
||||
global $conf,$user,$langs, $mysoc;
|
||||
global $mysoc;
|
||||
|
||||
dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
@@ -1866,8 +1866,6 @@ class Propal extends CommonObject
|
||||
*/
|
||||
function set_draft($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
|
||||
@@ -193,8 +193,6 @@ class PropaleStats extends Stats
|
||||
*/
|
||||
function getAllByProduct($year)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
|
||||
@@ -41,8 +41,6 @@ class Prospect extends Societe
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
return 0;
|
||||
@@ -56,7 +54,7 @@ class Prospect extends Societe
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf, $user;
|
||||
global $user;
|
||||
|
||||
$this->nb=array("customers" => 0,"prospects" => 0);
|
||||
$clause = "WHERE";
|
||||
|
||||
@@ -534,7 +534,7 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_print_error($db);
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user