diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index 257f351cfca..63cb9b68257 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -102,6 +102,7 @@ class box_funnel_of_prospection extends ModeleBoxes $sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls"; $sql .= " WHERE active=1"; $sql .= " AND cls.code <> 'LOST'"; + $sql .= " AND cls.code <> 'WON'"; $sql .= $this->db->order('cls.rowid', 'ASC'); $resql = $this->db->query($sql); if ($resql) { @@ -126,9 +127,6 @@ class box_funnel_of_prospection extends ModeleBoxes case 'NEGO': $colorseriesstat[$objp->rowid] = $badgeStatus4; break; - case 'WON': - $colorseriesstat[$objp->rowid] = $badgeStatus6; - break; default: break; } @@ -152,7 +150,7 @@ class box_funnel_of_prospection extends ModeleBoxes $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_opp_status = cls.rowid"; $sql .= " AND p.fk_statut = 1"; // Opend projects only - $sql .= " AND cls.code NOT IN ('LOST')"; + $sql .= " AND cls.code NOT IN ('LOST', 'WON')"; $sql .= " GROUP BY p.fk_opp_status, cls.code"; $resql = $this->db->query($sql); @@ -236,6 +234,7 @@ class box_funnel_of_prospection extends ModeleBoxes $dolgraph->setShowPercent(1); $dolgraph->setMirrorGraphValues(true); $dolgraph->setBorderWidth(2); + $dolgraph->setBorderSkip('false'); $dolgraph->SetType(array('horizontalbars')); $dolgraph->SetHeight('200'); $dolgraph->SetWidth('600'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ef31fb50485..e65226b13d1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -167,8 +167,9 @@ abstract class CommonObject * @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties */ public $oldcopy; + /** - * @var CommonObject To store old value of a modified ref + * @var string To store old value of a modified ref */ public $oldref; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 63987d29b9a..606ad2719af 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -94,6 +94,7 @@ class DolGraph public $bgcolorgrid = array(255, 255, 255); // array(R,G,B) public $datacolor; // array(array(R,G,B),...) public $borderwidth = 1; + public $borderskip = 'start'; private $stringtoshow; // To store string to output graph into HTML page @@ -311,6 +312,18 @@ class DolGraph $this->borderwidth = $borderwidth; } + /** + * Set border skip + * + * @param int $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border, + * 'false' to not skip any border, 'true' to skip all border + * @return void + */ + public function setBorderSkip($borderskip) + { + $this->borderskip = $borderskip; + } + /** * Set tooltips labels of the graph * @@ -1483,6 +1496,7 @@ class DolGraph $this->stringtoshow .= 'borderWidth: \''.$this->borderwidth.'\', '; } $this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', '; + $this->stringtoshow .= 'borderSkipped: \'' . $this->borderskip . '\', '; $this->stringtoshow .= 'backgroundColor: \'' . $color . '\', '; if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) { $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', '; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 241e6884d26..658779b546d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1584,7 +1584,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object * @param Contact $objcon Filter on object contact to filter events on a contact * @param int $noprint Return string but does not output it - * @param string $actioncode Filter on actioncode + * @param string|string[] $actioncode Filter on actioncode * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all). * @param array $filters Filter on other fields * @param string $sortfield Sort field @@ -1810,13 +1810,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= ' AND ('; foreach ($actioncode as $key => $code) { if ($key != 0) { - $sql .= "OR ("; + $sql .= " OR "; } if (!empty($code)) { - addEventTypeSQL($sql, $code); - } - if ($key != 0) { - $sql .= ")"; + addEventTypeSQL($sql, $code, ""); } } $sql .= ')'; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bbec24b64de..bcdd89b806b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4788,8 +4788,8 @@ class Product extends CommonObject // phpcs:enable $this->db->begin(); - $sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty)'; - $sql .= " SELECT ".$toId.", fk_product_fils, qty FROM ".$this->db->prefix()."product_association"; + $sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty, incdec)'; + $sql .= " SELECT ".$toId.", fk_product_fils, qty, incdec FROM ".$this->db->prefix()."product_association"; $sql .= " WHERE fk_product_pere = ".((int) $fromId); dol_syslog(get_class($this).'::clone_association', LOG_DEBUG); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 05826f80dbc..78e4e5e0ac4 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -266,12 +266,12 @@ if (empty($reshook)) { $object->login = GETPOST("login", 'alphanohtml'); $object->api_key = GETPOST("api_key", 'alphanohtml'); $object->gender = GETPOST("gender", 'aZ09'); - $object->admin = GETPOST("admin", 'int'); + $object->admin = GETPOSTINT("admin"); $object->address = GETPOST('address', 'alphanohtml'); $object->zip = GETPOST('zipcode', 'alphanohtml'); $object->town = GETPOST('town', 'alphanohtml'); - $object->country_id = GETPOST('country_id', 'int'); - $object->state_id = GETPOST('state_id', 'int'); + $object->country_id = GETPOSTINT('country_id'); + $object->state_id = GETPOSTINT('state_id'); $object->office_phone = GETPOST("office_phone", 'alphanohtml'); $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); @@ -314,7 +314,7 @@ if (empty($reshook)) { $object->dateendvalidity = $dateendvalidity; $object->birth = $dateofbirth; - $object->fk_warehouse = GETPOST('fk_warehouse', 'int'); + $object->fk_warehouse = GETPOSTINT('fk_warehouse'); $object->lang = GETPOST('default_lang', 'aZ09'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 16a1eeddcfc..251e06f6390 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -81,6 +81,11 @@ class User extends CommonObject public $id = 0; + /** + * @var User old copy of User + */ + public $oldcopy; + /** * @var int * @deprecated diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 9a43479e2da..7718d1abccc 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -315,7 +315,7 @@ class UserBankAccount extends Account $country_code_in_EEC = getCountriesInEEC(); return in_array($this->country_code, $country_code_in_EEC); } else { - return -1; + return false; } } } diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index fd7a217c30e..9b4fe24dbc3 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -868,7 +868,7 @@ class WebsitePage extends CommonObject $now = dol_now(); - $this->fk_website = ''; + $this->fk_website = 0; $this->type_container = 'page'; $this->pageurl = 'specimen'; $this->aliasalt = 'specimenalt'; @@ -879,7 +879,7 @@ class WebsitePage extends CommonObject $this->allowed_in_frames = 1; $this->htmlheader = ''; $this->content = 'This is a html content'; - $this->status = ''; + $this->status = self::STATUS_DRAFT; $this->grabbed_from = ''; $this->date_creation = $now - (24 * 30 * 3600); $this->date_modification = $now - (24 * 7 * 3600);