Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Rui Strecht 2017-09-13 14:46:57 +01:00
commit 5c81443a9f
45 changed files with 344 additions and 290 deletions

View File

@ -490,7 +490,7 @@ if ($id)
if (empty($reshook))
{
fieldList($fieldlist,$obj,$tabname[$id],'add');
fieldListJournal($fieldlist,$obj,$tabname[$id],'add');
}
print '<td colspan="4" align="right">';
@ -595,7 +595,7 @@ if ($id)
$error=$hookmanager->error; $errors=$hookmanager->errors;
// Show fields
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit');
print '<td align="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
@ -713,7 +713,7 @@ $db->close();
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
function fieldList($fieldlist, $obj='', $tabname='', $context='')
function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
global $form, $mysoc;

View File

@ -354,7 +354,7 @@ class AccountancyCategory
}
if ($thirdparty_code != 'nofilter')
{
$sql .= " AND thirdparty_code = '".$ths->db->escape($thirdparty_code)."'";
$sql .= " AND thirdparty_code = '".$this->db->escape($thirdparty_code)."'";
}
dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG);

View File

@ -76,6 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
*/
function assign_values(&$action, $id)
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -114,14 +115,14 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -1762,7 +1762,7 @@ else
/* Already in tab Agenda/Events
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'member', $socid);
$somethingshown = $formactions->showactions($object, 'member', $socid, 1);
*/
print '</div></div></div>';

View File

@ -410,7 +410,7 @@ if ($rowid && $action != 'edit')
/*
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
*/
print '</div></div></div>';

View File

@ -20,145 +20,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class.php';
/**
* Class DolistoreModel
*/
class DolistoreModel
{
function get_categories($parent = 0)
{
if (!isset($this->categories)) die('not possible');
if ($parent != 0) {
$html = '<ul>';
} else {
$html = '';
}
$nbofcateg = count($this->categories);
for ($i = 0; $i < $nbofcateg; $i++)
{
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"'
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" '
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} else {
}
}
if ($html == '<ul>') {
return '';
}
if ($parent != 0) {
return $html.'</ul>';
} else {
return $html;
}
}
function get_products()
{
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
$newapp .= '<span class="newApp">'.$langs->trans('New').'</span> ';
}
// check updated ?
if ($last_month < strtotime($product->date_upd) && $newapp == '') {
$newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> ';
}
// add image or default ?
if ($product->id_default_image != '') {
$image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'.
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.dol_buildPath('/dolistore/img/NoImageAvailable.png', 2).'" />';
}
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).'&nbsp;&euro;</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.dol_buildPath('/dolistore/img/follow.png',
2).'" /></a>';
} else {
$price = $langs->trans('Free');
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.dol_buildPath('/dolistore/img/Download-128.png',
2).'" /></a>';
}
//checking versions
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible
$version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = '';
} else {
//never compatible, module expired
$version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
} else {
//need update
$version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
<td align="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle"><a target="_blank" href="'.$this->shop_url.$product->id.'">'.$product->name->language[$this->lang].'</a><span class="details button">Details</span>'
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang].'</td>
<td class="margeCote" align="right">'.$price.'</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
}
return $html;
}
function get_previous_link($text = '<<')
{
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
function get_next_link($text = '>>')
{
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
}
/**
* Class Dolistore
*/
class Dolistore extends DolistoreModel
class Dolistore
{
// params
public $start // beginning of pagination
@ -173,6 +38,11 @@ class Dolistore extends DolistoreModel
, $lang // the integer representing the lang in the store
, $debug_api; // usefull if no dialog
/**
* Constructor
*
* @param array $options
*/
function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
{
global $conf, $langs;
@ -254,6 +124,139 @@ class Dolistore extends DolistoreModel
}
}
function get_categories($parent = 0)
{
if (!isset($this->categories)) die('not possible');
if ($parent != 0) {
$html = '<ul>';
} else {
$html = '';
}
$nbofcateg = count($this->categories);
for ($i = 0; $i < $nbofcateg; $i++)
{
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"'
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" '
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} else {
}
}
if ($html == '<ul>') {
return '';
}
if ($parent != 0) {
return $html.'</ul>';
} else {
return $html;
}
}
/**
* Return list of product formated for output
*
* @return string HTML output
*/
function get_products()
{
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
$newapp .= '<span class="newApp">'.$langs->trans('New').'</span> ';
}
// check updated ?
if ($last_month < strtotime($product->date_upd) && $newapp == '') {
$newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> ';
}
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'.
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/dolistore/img/NoImageAvailable.png" />';
}
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).'&nbsp;&euro;</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else {
$price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link.= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
}
//checking versions
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible
$version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = '';
} else {
//never compatible, module expired
$version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
} else {
//need update
$version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
<td align="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang]
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang].'</td>
<td class="margeCote" align="center">'.$price.'
</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
}
return $html;
}
function get_previous_link($text = '<<')
{
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
function get_next_link($text = '>>')
{
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
function get_previous_url()
{
$param_array = array();

View File

@ -115,7 +115,9 @@ div.divsearchfield {
tr.app {
height:250px;
}
tr.app td {
border-bottom: 1px solid #888;
}
div#newsDoli.tabBar {
margin-top: 50px;
margin-right: 30px;
@ -225,6 +227,7 @@ tr.NotCompatible:hover{
}
#listing-content{
width: 75%;
float: right;
}
}
span.details{

View File

@ -832,44 +832,50 @@ if ($mode == 'marketplace')
if (empty($conf->global->MAIN_DISABLE_DOLISTORE_SEARCH) && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span>';
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
$previouslink = $dolistore->get_previous_link();
$nextlink = $dolistore->get_next_link();
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">'
?>
<br><br>
<div class="tabBar">
<form method="POST" id="searchFormList" action="<?php echo $dolistore->url ?>">
<form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
<input type="hidden" name="mode" value="marketplace" />
<div class="divsearchfield"><?php echo $langs->trans('Mot-cle') ?>:
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
</div>
<div class="divsearchfield">
<input class="button butAction searchDolistore" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button butActionDelete" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Tout afficher') ?></a>
</div><br><br><br style="clear: both">
<input class="button" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp;
</div>
<div class="divsearchfield right">
<?php
print $previouslink;
print $nextlink;
?>
</div>
</form>
</div>
<?php
print '</div></div>';
print '<div class="clearboth"></div>';
?>
<div id="category-tree-left">
<ul class="tree">
<?php echo $dolistore->get_categories(); ?>
</ul>
</div>
<div id="listing-content">
<table summary="list_of_modules" id="list_of_modules" class="liste" width="100%">
<thead>
<tr class="liste_titre">
<td colspan="100%"><?php echo $dolistore->get_previous_link() ?> <?php echo $dolistore->get_next_link() ?> <span style="float:right"><?php echo $langs->trans('AchatTelechargement') ?></span></td>
</tr>
</thead>
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
<tbody id="listOfModules">
<?php echo $dolistore->get_products($categorie); ?>
</tbody>
<tfoot>
<tr class="liste_titre">
<td colspan="100%"><?php echo $dolistore->get_previous_link() ?> <?php echo $dolistore->get_next_link() ?> <span style="float:right"><?php echo $langs->trans('AchatTelechargement') ?></span></td>
</tr>
</tfoot>
</table>
</div>

View File

@ -1549,8 +1549,10 @@ class Categorie extends CommonObject
}
if (file_exists($dir)) {
if (is_array($file['name']) && count($file['name']) > 0) {
for($i = 0; $i <= count($file['name']); $i ++) {
if (is_array($file['name']) && count($file['name']) > 0)
{
$nbfile = count($file['name']);
for ($i = 0; $i <= $nbfile; $i ++) {
$originImage = $dir . $file['name'][$i];

View File

@ -670,7 +670,7 @@ if ($action == 'create')
}
// Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked':'').'></td></tr>';

View File

@ -860,9 +860,10 @@ class ActionComm extends CommonObject
* @param string $filter Other filter
* @param string $sortfield Sort on this field
* @param string $sortorder ASC or DESC
* @param string $limit Limit number of answers
* @return array or string Error string if KO, array with actions if OK
*/
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='')
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0)
{
global $conf, $langs;
@ -879,6 +880,7 @@ class ActionComm extends CommonObject
}
if (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
if ($limit) $sql.=$db->plimit($limit);
dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql);

View File

@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
}
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
$sqlwhere[]= " (t.fk_pays IN (".$db->escape(implode(',',$arrayquery['contact_country']))."))";
$sqlwhere[]= " (t.fk_pays IN (".$this->db->escape(implode(',',$arrayquery['contact_country']))."))";
}
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
$sqlwhere[]= " (t.statut IN (".$db->escape(implode(',',$arrayquery['contact_status']))."))";
$sqlwhere[]= " (t.statut IN (".$this->db->escape(implode(',',$arrayquery['contact_status']))."))";
}
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
$sqlwhere[]= " (t.civility IN ('".$db->escape(implode("','",$arrayquery['contact_civility']))."'))";
$sqlwhere[]= " (t.civility IN ('".$this->db->escape(implode("','",$arrayquery['contact_civility']))."'))";
}
if ($arrayquery['contact_no_email']!='') {
$sqlwhere[]= " (t.no_email='".$db->escape($arrayquery['contact_no_email'])."')";
$sqlwhere[]= " (t.no_email='".$this->db->escape($arrayquery['contact_no_email'])."')";
}
if ($arrayquery['contact_update_st_dt']!='') {
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";

View File

@ -2373,7 +2373,7 @@ if ($action == 'create')
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'propal', $socid);
$somethingshown = $formactions->showactions($object, 'propal', $socid, 1);
print '</div></div></div>';
}

View File

@ -2592,7 +2592,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1);
print '</div></div></div>';
}

View File

@ -4331,7 +4331,7 @@ else if ($id > 0 || ! empty($ref))
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
print '</div></div></div>';
}

View File

@ -75,6 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/
function assign_values(&$action, $id)
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -113,14 +114,14 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -2146,7 +2146,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'contract', $socid);
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1);
print '</div></div></div>';

View File

@ -155,16 +155,18 @@ class FormActions
* @param int $socid socid of user
* @param int $forceshowtitle Show title even if there is no actions to show
* @param string $morecss More css on table
* @param int $max Max number of record
* @param string $moreparambacktopage More param for the backtopage
* @return int <0 if KO, >=0 if OK
*/
function showactions($object,$typeelement,$socid=0,$forceshowtitle=0,$morecss='listactions')
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
{
global $langs,$conf,$user;
global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', '', '', ($max?($max+1):0));
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
$num = count($listofactions);
@ -177,12 +179,15 @@ class FormActions
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
else $title=$langs->trans("Actions");
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
else $title=$langs->trans("Actions");
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">';
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>';
print load_fiche_titre($title, $buttontoaddnewevent, '');
@ -197,7 +202,7 @@ class FormActions
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Action', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, 'align="center"');
print_liste_field_titre('By', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"');
print '</tr>';
@ -205,8 +210,11 @@ class FormActions
$userstatic = new User($this->db);
$cursorevent = 0;
foreach($listofactions as $action)
{
if ($max && $cursorevent >= $max) break;
$ref=$action->getNomUrl(1,-1);
$label=$action->getNomUrl(0,38);
@ -226,7 +234,7 @@ class FormActions
}
print $action->type;
print '</td>';
print '<td>'.dol_print_date($action->datep,'dayhour');
print '<td align="center">'.dol_print_date($action->datep,'dayhour');
if ($action->datef)
{
$tmpa=dol_getdate($action->datep);
@ -254,7 +262,15 @@ class FormActions
}
print '</td>';
print '</tr>';
$cursorevent++;
}
if ($max && $num > $max)
{
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("More").'...</td></tr>';
}
print '</table>';
print '</div>';
}

View File

@ -510,8 +510,6 @@ class FormWebsite
{
if ($lines[$i]->fk_parent == $parent)
{
$var = !$var;
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines
// Break on a new project
@ -1119,7 +1117,7 @@ class FormWebsite
$emptybox=new ModeleBoxes($db);
$boxlista.="\n<!-- Box left container -->\n";
$boxlista ="\n<!-- Box left container -->\n";
$boxlista.='<div id="left" class="connectedSortable">'."\n";
// Define $box_max_lines
@ -1152,7 +1150,7 @@ class FormWebsite
$boxlista.= "</div>\n";
$boxlista.= "<!-- End box left container -->\n";
$boxlistb.= "\n<!-- Box right container -->\n";
$boxlistb = "\n<!-- Box right container -->\n";
$boxlistb.= '<div id="right" class="connectedSortable">'."\n";
$ii=0;

View File

@ -1808,6 +1808,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
$module='ficheinter';
$subelement='fichinter';
}
if ($objecttype == 'task') {
$classpath = 'projet/class';
$module='projet';
$subelement='task';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
@ -2243,7 +2248,7 @@ function getModuleDirForApiClass($module)
/*
* Return 2 hexa code randomly
*
*
* @param $min int Between 0 and 255
* @param $max int Between 0 and 255
* @return String
@ -2254,7 +2259,7 @@ function random_color_part($min=0,$max=255) {
/*
* Return hexadecimal color randomly
*
*
* @param $min int Between 0 and 255
* @param $max int Between 0 and 255
* @return String

View File

@ -103,10 +103,10 @@ function showOnlinePaymentUrl($type,$ref)
$langs->load("paybox");
$servicename='Online';
$out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url=getOnlinePaymentUrl(0,$type,$ref);
$out.='<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out.=ajax_autoselect("onlinepaymenturl", 0);
$out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url = getOnlinePaymentUrl(0,$type,$ref);
$out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out.= ajax_autoselect("onlinepaymenturl", 0);
return $out;
}
@ -126,6 +126,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
global $conf;
$ref=str_replace(' ','',$ref);
$out='';
if ($type == 'free')
{
@ -210,7 +211,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
}
// For multicompany
$out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
return $out;
}

View File

@ -747,6 +747,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Set societeforaction.
if ($object->socid > 0) $societeforaction->fetch($object->socid);
$projectid = isset($object->fk_project)?$object->fk_project:0;
if ($object->element == 'project') $projectid = $object->id;
// Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
@ -754,7 +757,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->code = 'AC_'.$action;
$actioncomm->label = $object->actionmsg2;
$actioncomm->note = $object->actionmsg; // TODO Replace with $actioncomm->email_msgid ? $object->email_content : $object->actionmsg
$actioncomm->fk_project = isset($object->fk_project)?$object->fk_project:0;
$actioncomm->fk_project = $projectid;
$actioncomm->datep = $now;
$actioncomm->datef = $now;
$actioncomm->durationp = 0;

View File

@ -2126,7 +2126,7 @@ else if ($id || $ref)
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'shipping',$socid);
$somethingshown = $formactions->showactions($object,'shipping',$socid,1);
print '</div></div></div>';
}

View File

@ -1708,7 +1708,7 @@ else if ($id > 0 || ! empty($ref))
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'fichinter',$socid);
$somethingshown = $formactions->showactions($object,'fichinter',$socid,1);
print '</div></div></div>';
}

View File

@ -2732,7 +2732,8 @@ elseif (! empty($object->id))
print '</form>';
print "<br>";
}
if ($action != 'makeorder')
if ($action != 'makeorder')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
@ -2791,7 +2792,7 @@ if ($action != 'makeorder')
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'order_supplier',$socid,1,'listaction'.($genallowed?'largetitle':''));

View File

@ -203,7 +203,7 @@ if (!empty($object->id))
// List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',0);*/
$somethingshown = $formactions->showactions($object,'project',0);*/
// List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);

View File

@ -2815,7 +2815,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'invoice_supplier',$socid,1,'listaction'.($genallowed?'largetitle':''));
print '</div></div></div>';
//print '</td></tr></table>';

View File

@ -202,13 +202,13 @@ if ($result > 0)
}
$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/paiement.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
dol_banner_tab($object,'id',$linkback,1,'rowid','ref');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
/*print '<tr>';
@ -278,7 +278,7 @@ if ($result > 0)
print '</table>';
print '</div>';
print '<br>';
/**
@ -315,7 +315,7 @@ if ($result > 0)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
// Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
@ -341,7 +341,7 @@ if ($result > 0)
$i++;
}
}
print "</table>\n";
$db->free($resql);
@ -386,7 +386,7 @@ if ($result > 0)
}
}
print '</div>';
print '<div class="fichecenter"><div class="fichehalfleft">';
/*
@ -409,7 +409,7 @@ if ($result > 0)
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'supplier_payment',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'supplier_payment',$socid,1,'listaction'.($genallowed?'largetitle':''));
print '</div></div></div>';
//print '</td></tr></table>';

View File

@ -201,8 +201,9 @@ DOLISTOREdescriptionLong=Instead of switching on <a href="https://www.dolistore.
NewModule=New
FreeModule=Free
CompatibleUpTo=Compatible with version %s
NotCompatible=This module does not seem compatible with your Dolibarr %s, contact its editor (%s - %s).
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s, installed dolibarr %s - %s.
NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s).
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s).
SeeInMarkerPlace=See in Market place
Updated=Updated
Nouveauté=Novelty
AchatTelechargement=Buy / Download

View File

@ -410,6 +410,7 @@ ActionRunningNotStarted=To start
ActionRunningShort=In progress
ActionDoneShort=Finished
ActionUncomplete=Uncomplete
LatestLinkedEvents=Latest %s linked events
CompanyFoundation=Company/Organisation
ContactsForCompany=Contacts for this third party
ContactsAddressesForCompany=Contacts/addresses for this third party

View File

@ -42,7 +42,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
$this->db=$db;
if (is_array($conf->modules))
{
$this->enabled=in_array('mymodule',$conf->modules);
$this->enabled=in_array('mymodule',$conf->modules)?1:0;
}
}
@ -186,15 +186,14 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
*
* @param string $filter Filter
* @param string $option Options
* @return int Nb of recipients
* @return int Nb of recipients or -1 if KO
*/
function getNbOfRecipients($filter=1,$option='')
{
$a=parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''");
if ($a < 0 || $b < 0) return -1;
if ($option == '') return $a;
return ($a+$b);
if ($a < 0) return -1;
return $a;
}
}

View File

@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'myobject', $socid);
$somethingshown = $formactions->showactions($object, 'myobject', $socid, 1);
print '</div></div></div>';
}

View File

@ -74,6 +74,7 @@ class ActionsCardProduct
*/
function assign_values(&$action, $id=0, $ref='')
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $langs, $user, $mysoc, $canvas;
global $form, $formproduct;
@ -250,7 +251,7 @@ class ActionsCardProduct
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
@ -309,7 +310,7 @@ class ActionsCardProduct
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -73,6 +73,7 @@ class ActionsCardService
*/
function assign_values(&$action, $id=0, $ref='')
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $langs, $user, $mysoc, $canvas;
global $form, $formproduct;
@ -229,7 +230,7 @@ class ActionsCardService
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
@ -287,7 +288,7 @@ class ActionsCardService
}
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -115,14 +115,14 @@ class FormProduct
$sql.= " WHERE e.entity IN (".getEntity('stock').")";
if (count($warehouseStatus))
{
$sql.= " AND e.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
$sql.= " AND e.statut IN (".$this->db->escape(implode(',',$warehouseStatus)).")";
}
else
{
$sql.= " AND e.statut = 1";
}
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$db->escape(implode(',', $exclude)).')';
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')';
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent";
$sql.= " ORDER BY e.label";

View File

@ -3750,7 +3750,7 @@ class Product extends CommonObject
$sql.= " WHERE w.entity IN (".getEntity('stock').")";
$sql.= " AND w.rowid = ps.fk_entrepot";
$sql.= " AND ps.fk_product = ".$this->id;
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$this->db->escape(implode(',',$warehouseStatus)).")";
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
$result = $this->db->query($sql);

View File

@ -487,7 +487,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1);
print '</div></div></div>';
}

View File

@ -1198,6 +1198,10 @@ elseif ($object->id > 0)
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', 10);
print '</div></div></div>';
}

View File

@ -69,7 +69,7 @@ class Task extends CommonObject
var $timespent_withhour; // 1 = we entered also start hours for timesheet line
var $timespent_fk_user;
var $timespent_note;
var $comments = array();
public $oldcopy;
@ -1783,7 +1783,7 @@ class Task extends CommonObject
return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay)));
}
/**
* Return nb comments already posted
*
@ -1793,21 +1793,21 @@ class Task extends CommonObject
{
return count($this->comments);
}
/**
* Load comments linked with current task
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetchComments()
{
{
$this->comments = array();
$sql = "SELECT";
$sql.= " c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c";
$sql.= " WHERE c.fk_task = ".$this->id;
$sql.= " ORDER BY c.tms DESC";
dol_syslog(get_class($this)."::fetchComments", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
@ -1843,24 +1843,24 @@ class TaskComment extends CommonObject
public $table_element='projet_task_comment'; //!< Name of table without prefix where object is stored
public $fk_element='fk_task';
public $picto = 'task';
var $fk_task;
var $description;
var $tms;
var $datec;
var $fk_user;
var $entity;
var $import_key;
public $oldcopy;
/**
* Constructor
*
@ -1870,8 +1870,8 @@ class TaskComment extends CommonObject
{
$this->db = $db;
}
/**
* Create into database
*
@ -1882,9 +1882,9 @@ class TaskComment extends CommonObject
function create($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_comment (";
$sql.= "description";
@ -1901,20 +1901,20 @@ class TaskComment extends CommonObject
$sql.= ", ".(!empty($this->entity)?$this->entity:'1');
$sql.= ", ".(!empty($this->import_key)?"'".$this->import_key."'":"null");
$sql.= ")";
var_dump($this->db);
echo $sql;
//var_dump($this->db);
//echo $sql;
$this->db->begin();
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_comment");
if (! $notrigger)
{
// Call trigger
@ -1923,7 +1923,7 @@ class TaskComment extends CommonObject
// End call triggers
}
}
// Commit or rollback
if ($error)
{
@ -1941,8 +1941,8 @@ class TaskComment extends CommonObject
return $this->id;
}
}
/**
* Load object in memory from database
*
@ -1953,7 +1953,7 @@ class TaskComment extends CommonObject
function fetch($id)
{
global $langs;
$sql = "SELECT";
$sql.= " c.rowid,";
$sql.= " c.description,";
@ -1965,17 +1965,17 @@ class TaskComment extends CommonObject
$sql.= " c.import_key";
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c";
$sql.= " WHERE c.rowid = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$num_rows = $this->db->num_rows($resql);
if ($num_rows)
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->description = $obj->description;
$this->datec = $this->db->jdate($obj->datec);
@ -1985,9 +1985,9 @@ class TaskComment extends CommonObject
$this->entity = $obj->entity;
$this->import_key = $obj->import_key;
}
$this->db->free($resql);
if ($num_rows) return 1;
else return 0;
}
@ -1997,8 +1997,8 @@ class TaskComment extends CommonObject
return -1;
}
}
/**
* Update database
*
@ -2006,17 +2006,17 @@ class TaskComment extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <=0 if KO, >0 if OK
*/
function update($user=null, $notrigger=0)
function update(User $user, $notrigger=0)
{
global $conf, $langs;
$error=0;
// Clean parameters
if (isset($this->fk_task)) $this->fk_project=trim($this->fk_task);
if (isset($this->fk_user)) $this->fk_project=trim($this->fk_user);
if (isset($this->fk_task)) $this->fk_project=(int) trim($this->fk_task);
if (isset($this->fk_user)) $this->fk_user=(int) trim($this->fk_user);
if (isset($this->description)) $this->description=trim($this->description);
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_comment SET";
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
@ -2026,13 +2026,13 @@ class TaskComment extends CommonObject
$sql.= " entity=".(!empty($this->entity)?$this->entity:'1').",";
$sql.= " import_key=".(!empty($this->import_key)?"'".$this->import_key."'":"null");
$sql.= " WHERE rowid=".$this->id;
$this->db->begin();
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
@ -2043,7 +2043,7 @@ class TaskComment extends CommonObject
// End call triggers
}
}
// Commit or rollback
if ($error)
{
@ -2061,8 +2061,8 @@ class TaskComment extends CommonObject
return 1;
}
}
/**
* Delete task from database
*
@ -2074,17 +2074,17 @@ class TaskComment extends CommonObject
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_comment";
$sql.= " WHERE rowid=".$this->id;
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
@ -2095,7 +2095,7 @@ class TaskComment extends CommonObject
// End call triggers
}
}
// Commit or rollback
if ($error)
{

View File

@ -184,7 +184,7 @@ if (!empty($object->id))
// List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',0);*/
$somethingshown = $formactions->showactions($object,'project',0);*/
// List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);

View File

@ -588,6 +588,11 @@ if ($id > 0 || ! empty($ref))
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'task', $socid, 1, '', 10, 'withproject='.$withproject);
print '</div></div></div>';
}
}

View File

@ -926,7 +926,7 @@ if ($source == 'contractline')
{
$amount=$contractline->total_ttc;
if ($contractline->fk_product && ! empty($conf->global-PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES))
if ($contractline->fk_product && ! empty($conf->global->PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES))
{
$product=new Product($db);
$result=$product->fetch($contractline->fk_product);

View File

@ -1806,7 +1806,7 @@ if ($action == 'create')
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'supplier_proposal', $socid);
$somethingshown = $formactions->showactions($object, 'supplier_proposal', $socid, 1);
print '</div></div></div>';
}

View File

@ -2538,7 +2538,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'user', $socid);
$somethingshown = $formactions->showactions($object, 'user', $socid, 1);
print '</div></div></div>';

View File

@ -517,7 +517,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'usergroup', $socid);
$somethingshown = $formactions->showactions($object, 'usergroup', $socid, 1);
print '</div></div></div>';