commit
ebd64d5e57
@ -1513,7 +1513,6 @@ class Contact extends CommonObject
|
||||
$this->country_code = 'FR';
|
||||
$this->country = 'France';
|
||||
$this->email = 'specimen@specimen.com';
|
||||
$this->skype = 'tom.hanson';
|
||||
$this->socialnetworks = array(
|
||||
'skype' => 'tom.hanson',
|
||||
);
|
||||
|
||||
@ -984,14 +984,12 @@ class Ldap
|
||||
// Define filter
|
||||
if (!empty($activefilter))
|
||||
{
|
||||
if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter)
|
||||
{
|
||||
if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) {
|
||||
$filter = '('.$this->filter.')';
|
||||
} elseif (((string) $activefilter == 'member') && $this->filter)
|
||||
{
|
||||
} elseif (((string) $activefilter == 'member') && $this->filter) {
|
||||
$filter = '('.$this->filtermember.')';
|
||||
} else // If this->filter is empty, make fiter on * (all)
|
||||
{
|
||||
} else {
|
||||
// If this->filter is empty, make fiter on * (all)
|
||||
$filter = '('.$useridentifier.'=*)';
|
||||
}
|
||||
} else {
|
||||
@ -1070,6 +1068,7 @@ class Ldap
|
||||
*/
|
||||
public function littleEndian($hex)
|
||||
{
|
||||
$result = '';
|
||||
for ($x = dol_strlen($hex) - 2; $x >= 0; $x = $x - 2) {
|
||||
$result .= substr($hex, $x, 2);
|
||||
}
|
||||
|
||||
@ -308,11 +308,9 @@ class RssParser
|
||||
$items = array();
|
||||
|
||||
// Save description entries
|
||||
if ($rss->_format == 'rss')
|
||||
{
|
||||
if ($rss->_format == 'rss') {
|
||||
//var_dump($rss);
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
||||
if (!empty($rss->channel->language)) $this->_language = (string) $rss->channel->language;
|
||||
if (!empty($rss->channel->generator)) $this->_generator = (string) $rss->channel->generator;
|
||||
if (!empty($rss->channel->copyright)) $this->_copyright = (string) $rss->channel->copyright;
|
||||
@ -336,8 +334,7 @@ class RssParser
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) $items = $rss->channel->item; // With simplexml
|
||||
else $items = $rss->items; // With xmlparse
|
||||
//var_dump($items);exit;
|
||||
} elseif ($rss->_format == 'atom')
|
||||
{
|
||||
} elseif ($rss->_format == 'atom') {
|
||||
//var_dump($rss);
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
@ -370,15 +367,11 @@ class RssParser
|
||||
$i = 0;
|
||||
|
||||
// Loop on each record
|
||||
if (is_array($items))
|
||||
{
|
||||
foreach ($items as $item)
|
||||
{
|
||||
if (is_array($items)) {
|
||||
foreach ($items as $item) {
|
||||
//var_dump($item);exit;
|
||||
if ($rss->_format == 'rss')
|
||||
{
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
if ($rss->_format == 'rss') {
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
||||
$itemLink = (string) $item->link;
|
||||
$itemTitle = (string) $item->title;
|
||||
$itemDescription = (string) $item->description;
|
||||
@ -396,17 +389,13 @@ class RssParser
|
||||
|
||||
// Loop on each category
|
||||
$itemCategory = array();
|
||||
if (is_array($item->category))
|
||||
{
|
||||
foreach ($item->category as $cat)
|
||||
{
|
||||
if (is_array($item->category)) {
|
||||
foreach ($item->category as $cat) {
|
||||
$itemCategory[] = (string) $cat;
|
||||
}
|
||||
}
|
||||
} elseif ($rss->_format == 'atom')
|
||||
{
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
} elseif ($rss->_format == 'atom') {
|
||||
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
||||
$itemLink = (isset($item['link']) ? (string) $item['link'] : '');
|
||||
$itemTitle = (string) $item['title'];
|
||||
$itemDescription = $this->getAtomItemDescription($item);
|
||||
@ -421,7 +410,17 @@ class RssParser
|
||||
$itemId = (string) $item['id'];
|
||||
$itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']);
|
||||
}
|
||||
} else print 'ErrorBadFeedFormat';
|
||||
$itemCategory = array();
|
||||
} else {
|
||||
$itemCategory = array();
|
||||
$itemLink = '';
|
||||
$itemTitle = '';
|
||||
$itemDescription = '';
|
||||
$itemPubDate = '';
|
||||
$itemId = '';
|
||||
$itemAuthor = '';
|
||||
print 'ErrorBadFeedFormat';
|
||||
}
|
||||
|
||||
// Add record to result array
|
||||
$this->_rssarray[$i] = array(
|
||||
@ -431,7 +430,8 @@ class RssParser
|
||||
'pubDate'=>$itemPubDate,
|
||||
'category'=>$itemCategory,
|
||||
'id'=>$itemId,
|
||||
'author'=>$itemAuthor);
|
||||
'author'=>$itemAuthor
|
||||
);
|
||||
//var_dump($this->_rssarray);
|
||||
|
||||
$i++;
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2014-2018 Charlene Benke <charlies@patas-monkey.com>
|
||||
* Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -57,8 +58,8 @@ $langs->loadLangs(array('bills', 'companies', 'interventions'));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$contratid = GETPOST('contratid', 'int');
|
||||
$socid = (int) GETPOST('socid', 'int');
|
||||
$contratid = (int) GETPOST('contratid', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
@ -175,8 +176,7 @@ if (empty($reshook))
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
|
||||
$result = $object->setDraft($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
@ -187,8 +187,7 @@ if (empty($reshook))
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||
if (!empty($newlang))
|
||||
{
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
@ -200,14 +199,13 @@ if (empty($reshook))
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'add' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
} elseif ($action == 'add' && $user->rights->ficheinter->creer) {
|
||||
$object->socid = $socid;
|
||||
$object->duration = GETPOST('duration', 'int');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->fk_contrat = GETPOST('contratid', 'int');
|
||||
$object->duration = (int) GETPOST('duration', 'int');
|
||||
$object->fk_project = (int) GETPOST('projectid', 'int');
|
||||
$object->fk_contrat = (int) GETPOST('contratid', 'int');
|
||||
$object->author = $user->id;
|
||||
$object->description = GETPOST('description', 'restricthtml');
|
||||
$object->description = GETPOST('description', 'restricthtml');
|
||||
$object->ref = $ref;
|
||||
$object->model_pdf = GETPOST('model', 'alpha');
|
||||
$object->note_private = GETPOST('note_private', 'restricthtml');
|
||||
@ -409,13 +407,12 @@ if (empty($reshook))
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty"));
|
||||
$action = 'create';
|
||||
}
|
||||
} elseif ($action == 'update' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
} elseif ($action == 'update' && $user->rights->ficheinter->creer) {
|
||||
$object->socid = $socid;
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->fk_contrat = GETPOST('contratid', 'int');
|
||||
$object->fk_project = (int) GETPOST('projectid', 'int');
|
||||
$object->fk_contrat = (int) GETPOST('contratid', 'int');
|
||||
$object->author = $user->id;
|
||||
$object->description = GETPOST('description', 'restricthtml');
|
||||
$object->description = GETPOST('description', 'restricthtml');
|
||||
$object->ref = $ref;
|
||||
|
||||
$result = $object->update($user);
|
||||
@ -520,8 +517,7 @@ if (empty($reshook))
|
||||
elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$result = $object->setStatut(2);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
} else {
|
||||
|
||||
@ -95,7 +95,10 @@ class Fichinter extends CommonObject
|
||||
*/
|
||||
protected $table_ref_field = 'ref';
|
||||
|
||||
public $socid; // Id client
|
||||
/**
|
||||
* @var int Thirdparty Id
|
||||
*/
|
||||
public $socid;
|
||||
|
||||
public $author;
|
||||
|
||||
@ -118,7 +121,14 @@ class Fichinter extends CommonObject
|
||||
*/
|
||||
public $datem;
|
||||
|
||||
/**
|
||||
* @var int duration
|
||||
*/
|
||||
public $duration;
|
||||
|
||||
/**
|
||||
* @var int status
|
||||
*/
|
||||
public $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate
|
||||
|
||||
/**
|
||||
@ -127,17 +137,23 @@ class Fichinter extends CommonObject
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int Contract ID
|
||||
*/
|
||||
public $fk_contrat = 0;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int Project ID
|
||||
*/
|
||||
public $fk_project = 0;
|
||||
|
||||
/**
|
||||
* @var array extraparams
|
||||
*/
|
||||
public $extraparams = array();
|
||||
|
||||
/**
|
||||
* @var array lines
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
/**
|
||||
@ -328,8 +344,7 @@ class Fichinter extends CommonObject
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
} else {
|
||||
|
||||
@ -53,6 +53,9 @@ class FichinterRec extends Fichinter
|
||||
*/
|
||||
public $picto = 'intervention';
|
||||
|
||||
/**
|
||||
* @var string title
|
||||
*/
|
||||
public $title;
|
||||
public $number;
|
||||
public $date;
|
||||
@ -60,14 +63,28 @@ class FichinterRec extends Fichinter
|
||||
public $remise;
|
||||
public $tva;
|
||||
public $total;
|
||||
public $db_table;
|
||||
|
||||
/**
|
||||
* @var int Proposal Id
|
||||
*/
|
||||
public $propalid;
|
||||
|
||||
public $date_last_gen;
|
||||
public $date_when;
|
||||
|
||||
/**
|
||||
* @var int number of generation done
|
||||
*/
|
||||
public $nb_gen_done;
|
||||
|
||||
/**
|
||||
* @var int number of maximum generation
|
||||
*/
|
||||
public $nb_gen_max;
|
||||
|
||||
/**
|
||||
* int rank
|
||||
*/
|
||||
public $rang;
|
||||
public $special_code;
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) {
|
||||
} else {
|
||||
$labelp = $langs->trans("SellingPrice")." ".$i;
|
||||
}
|
||||
$arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>40);
|
||||
$arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>floatval('40.'.sprintf('%03s', $i)));
|
||||
$arraypricelevel[$i] = array($i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -49,7 +49,9 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'bills', 'companies', 'other'));
|
||||
|
||||
$mesg = ''; $error = 0; $errors = array();
|
||||
$mesg = '';
|
||||
$error = 0;
|
||||
$errors = array();
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -474,8 +476,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete_all_price_by_qty')
|
||||
{
|
||||
if ($action == 'delete_all_price_by_qty') {
|
||||
$priceid = GETPOST('priceid', 'int');
|
||||
if (!empty($rowid)) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price_by_qty";
|
||||
@ -483,7 +484,7 @@ if (empty($reshook))
|
||||
|
||||
$result = $db->query($sql);
|
||||
} else {
|
||||
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null, 'errors');
|
||||
setEventMessages(('delete_price_by_qty'.$langs->transnoentities('MissingIds')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -93,18 +93,18 @@ if (empty($reshook))
|
||||
// Ajout entrepot
|
||||
if ($action == 'add' && $user->rights->stock->creer)
|
||||
{
|
||||
$object->ref = GETPOST("ref");
|
||||
$object->fk_parent = GETPOST("fk_parent");
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->description = GETPOST("desc");
|
||||
$object->ref = (string) GETPOST("ref", "alpha");
|
||||
$object->fk_parent = (int) GETPOST("fk_parent", "int");
|
||||
$object->label = (string) GETPOST("libelle", "alpha");
|
||||
$object->description = (string) GETPOST("desc", "alpha");
|
||||
$object->statut = GETPOST("statut");
|
||||
$object->lieu = GETPOST("lieu");
|
||||
$object->address = GETPOST("address");
|
||||
$object->zip = GETPOST("zipcode");
|
||||
$object->town = GETPOST("town");
|
||||
$object->lieu = (string) GETPOST("lieu", "alpha");
|
||||
$object->address = (string) GETPOST("address", "alpha");
|
||||
$object->zip = (string) GETPOST("zipcode", "alpha");
|
||||
$object->town = (string) GETPOST("town", "alpha");
|
||||
$object->country_id = GETPOST("country_id");
|
||||
$object->phone = GETPOST("phone");
|
||||
$object->fax = GETPOST("fax");
|
||||
$object->phone = (string) GETPOST("phone", "alpha");
|
||||
$object->fax = (string) GETPOST("fax", "alpha");
|
||||
|
||||
if (!empty($object->label)) {
|
||||
// Fill array 'array_options' with data from add form
|
||||
|
||||
Loading…
Reference in New Issue
Block a user