Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c2788eb427
@ -134,7 +134,13 @@ class box_task extends ModeleBoxes
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
// set cookie by js
|
||||||
|
$boxcontent.='<script>date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "'.$cookie_name.'='.$filterValue.'; expires= " + date.toGMTString() + "; path=/ "; </script>';
|
||||||
|
$this->info_box_contents[0][] = array(
|
||||||
|
'tr'=>'class="nohover"',
|
||||||
|
'td' => 'class="nohover"',
|
||||||
|
'textnoformat' => $boxcontent,
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT pt.rowid, pt.ref, pt.fk_projet, pt.fk_task_parent, pt.datec, pt.dateo, pt.datee, pt.datev, pt.label, pt.description, pt.duration_effective, pt.planned_workload, pt.progress";
|
$sql = "SELECT pt.rowid, pt.ref, pt.fk_projet, pt.fk_task_parent, pt.datec, pt.dateo, pt.datee, pt.datev, pt.label, pt.description, pt.duration_effective, pt.planned_workload, pt.progress";
|
||||||
@ -163,7 +169,7 @@ class box_task extends ModeleBoxes
|
|||||||
$sql.= $this->db->plimit($max, 0);
|
$sql.= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
$i = 0;
|
$i = 1;
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
while ($objp = $this->db->fetch_object($result)) {
|
while ($objp = $this->db->fetch_object($result)) {
|
||||||
@ -183,8 +189,12 @@ class box_task extends ModeleBoxes
|
|||||||
|
|
||||||
$label = $projectstatic->getNomUrl(1).' '.$taskstatic->getNomUrl(1).' '.dol_htmlentities($taskstatic->label);
|
$label = $projectstatic->getNomUrl(1).' '.$taskstatic->getNomUrl(1).' '.dol_htmlentities($taskstatic->label);
|
||||||
|
|
||||||
$boxcontent.= getTaskProgressView($taskstatic, $label, true, false, true);
|
$boxcontent = getTaskProgressView($taskstatic, $label, true, false, true);
|
||||||
|
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => '',
|
||||||
|
'text' => $boxcontent,
|
||||||
|
);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -192,15 +202,6 @@ class box_task extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set cookie by js
|
|
||||||
if(empty($i)){
|
|
||||||
$boxcontent.='<script >date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "'.$cookie_name.'='.$filterValue.'; expires= " + date.toGMTString() + "; path=/ "; </script>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->info_box_contents[0][] = array(
|
|
||||||
'td' => '',
|
|
||||||
'text' => $boxcontent,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -247,7 +247,12 @@ class Products extends DolibarrApi
|
|||||||
$this->product->$field = $value;
|
$this->product->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update');
|
$updatetype = false;
|
||||||
|
if ($this->product->type != $oldproduct->type && ($this->product->isProduct() || $this->product->isService())) {
|
||||||
|
$updatetype = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update', $updatetype);
|
||||||
|
|
||||||
// If price mode is 1 price per product
|
// If price mode is 1 price per product
|
||||||
if ($result > 0 && ! empty($conf->global->PRODUCT_PRICE_UNIQ)) {
|
if ($result > 0 && ! empty($conf->global->PRODUCT_PRICE_UNIQ)) {
|
||||||
|
|||||||
@ -791,9 +791,10 @@ class Product extends CommonObject
|
|||||||
* @param User $user Object user making update
|
* @param User $user Object user making update
|
||||||
* @param int $notrigger Disable triggers
|
* @param int $notrigger Disable triggers
|
||||||
* @param string $action Current action for hookmanager ('add' or 'update')
|
* @param string $action Current action for hookmanager ('add' or 'update')
|
||||||
|
* @param boolean $updatetype Update product type
|
||||||
* @return int 1 if OK, -1 if ref already exists, -2 if other error
|
* @return int 1 if OK, -1 if ref already exists, -2 if other error
|
||||||
*/
|
*/
|
||||||
public function update($id, $user, $notrigger = false, $action = 'update')
|
public function update($id, $user, $notrigger = false, $action = 'update', $updatetype = false)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $hookmanager;
|
global $langs, $conf, $hookmanager;
|
||||||
|
|
||||||
@ -939,6 +940,11 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."product";
|
||||||
$sql.= " SET label = '" . $this->db->escape($this->label) ."'";
|
$sql.= " SET label = '" . $this->db->escape($this->label) ."'";
|
||||||
|
|
||||||
|
if ($updatetype && ($this->isProduct() || $this->isService())) {
|
||||||
|
$sql.= ", fk_product_type = " . $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
$sql.= ", ref = '" . $this->db->escape($this->ref) ."'";
|
$sql.= ", ref = '" . $this->db->escape($this->ref) ."'";
|
||||||
$sql.= ", ref_ext = ".(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null");
|
$sql.= ", ref_ext = ".(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null");
|
||||||
$sql.= ", default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null");
|
$sql.= ", default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user