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)) if (empty($reshook))
{ {
fieldList($fieldlist,$obj,$tabname[$id],'add'); fieldListJournal($fieldlist,$obj,$tabname[$id],'add');
} }
print '<td colspan="4" align="right">'; print '<td colspan="4" align="right">';
@ -595,7 +595,7 @@ if ($id)
$error=$hookmanager->error; $errors=$hookmanager->errors; $error=$hookmanager->error; $errors=$hookmanager->errors;
// Show fields // 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 '<td align="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">'; 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 * @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 * @return void
*/ */
function fieldList($fieldlist, $obj='', $tabname='', $context='') function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
global $form, $mysoc; global $form, $mysoc;

View File

@ -354,7 +354,7 @@ class AccountancyCategory
} }
if ($thirdparty_code != 'nofilter') 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); dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG);

View File

@ -76,6 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
*/ */
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user; global $conf, $db, $langs, $user;
global $form; global $form;
@ -114,14 +115,14 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
if ($action == 'list') 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 $limit Limit number of responses
* @param int $offset Offset for first response * @param int $offset Offset for first response

View File

@ -1762,7 +1762,7 @@ else
/* Already in tab Agenda/Events /* Already in tab Agenda/Events
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'member', $socid); $somethingshown = $formactions->showactions($object, 'member', $socid, 1);
*/ */
print '</div></div></div>'; 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'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid); $somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
*/ */
print '</div></div></div>'; 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'; 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
*/ */
class Dolistore extends DolistoreModel class Dolistore
{ {
// params // params
public $start // beginning of pagination public $start // beginning of pagination
@ -173,6 +38,11 @@ class Dolistore extends DolistoreModel
, $lang // the integer representing the lang in the store , $lang // the integer representing the lang in the store
, $debug_api; // usefull if no dialog , $debug_api; // usefull if no dialog
/**
* Constructor
*
* @param array $options
*/
function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
{ {
global $conf, $langs; 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() function get_previous_url()
{ {
$param_array = array(); $param_array = array();

View File

@ -115,7 +115,9 @@ div.divsearchfield {
tr.app { tr.app {
height:250px; height:250px;
} }
tr.app td {
border-bottom: 1px solid #888;
}
div#newsDoli.tabBar { div#newsDoli.tabBar {
margin-top: 50px; margin-top: 50px;
margin-right: 30px; margin-right: 30px;
@ -225,6 +227,7 @@ tr.NotCompatible:hover{
} }
#listing-content{ #listing-content{
width: 75%; width: 75%;
float: right;
} }
} }
span.details{ 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) 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> <form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
<div class="tabBar">
<form method="POST" id="searchFormList" action="<?php echo $dolistore->url ?>">
<input type="hidden" name="mode" value="marketplace" /> <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> <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>
<div class="divsearchfield"> <div class="divsearchfield">
<input class="button butAction searchDolistore" value="<?php echo $langs->trans('Rechercher') ?>" type="submit"> <input class="button" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button butActionDelete" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Tout afficher') ?></a> <a class="button" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
</div><br><br><br style="clear: both">
&nbsp;
</div>
<div class="divsearchfield right">
<?php
print $previouslink;
print $nextlink;
?>
</div>
</form> </form>
</div>
<?php
print '</div></div>';
print '<div class="clearboth"></div>';
?>
<div id="category-tree-left"> <div id="category-tree-left">
<ul class="tree"> <ul class="tree">
<?php echo $dolistore->get_categories(); ?> <?php echo $dolistore->get_categories(); ?>
</ul> </ul>
</div> </div>
<div id="listing-content"> <div id="listing-content">
<table summary="list_of_modules" id="list_of_modules" class="liste" width="100%"> <table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
<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>
<tbody id="listOfModules"> <tbody id="listOfModules">
<?php echo $dolistore->get_products($categorie); ?> <?php echo $dolistore->get_products($categorie); ?>
</tbody> </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> </table>
</div> </div>

View File

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

View File

@ -670,7 +670,7 @@ if ($action == 'create')
} }
// Title // 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 // Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked':'').'></td></tr>'; 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 $filter Other filter
* @param string $sortfield Sort on this field * @param string $sortfield Sort on this field
* @param string $sortorder ASC or DESC * @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 * @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; global $conf, $langs;
@ -879,6 +880,7 @@ class ActionComm extends CommonObject
} }
if (! empty($filter)) $sql.= $filter; if (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder); if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
if ($limit) $sql.=$db->plimit($limit);
dol_syslog(get_class()."::getActions", LOG_DEBUG); dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']); $sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
} }
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) { 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) { 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) { 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']!='') { 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']!='') { 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'])."')"; $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 // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'propal', $socid); $somethingshown = $formactions->showactions($object, 'propal', $socid, 1);
print '</div></div></div>'; print '</div></div></div>';
} }

View File

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

View File

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

View File

@ -75,6 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/ */
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user; global $conf, $db, $langs, $user;
global $form; global $form;
@ -113,14 +114,14 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
if ($action == 'list') 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 $limit Limit number of responses
* @param int $offset Offset for first response * @param int $offset Offset for first response

View File

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

View File

@ -155,16 +155,18 @@ class FormActions
* @param int $socid socid of user * @param int $socid socid of user
* @param int $forceshowtitle Show title even if there is no actions to show * @param int $forceshowtitle Show title even if there is no actions to show
* @param string $morecss More css on table * @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 * @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 $langs,$conf,$user;
global $bc; global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; 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'); if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
$num = count($listofactions); $num = count($listofactions);
@ -177,12 +179,15 @@ class FormActions
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal'); elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder'); elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_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 == 'shipping') $title=$langs->trans('ActionsOnShipping');
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter'); 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.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>'; $buttontoaddnewevent.= '</a>';
print load_fiche_titre($title, $buttontoaddnewevent, ''); 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('Ref', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Action', $_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('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('By', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"'); print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"');
print '</tr>'; print '</tr>';
@ -205,8 +210,11 @@ class FormActions
$userstatic = new User($this->db); $userstatic = new User($this->db);
$cursorevent = 0;
foreach($listofactions as $action) foreach($listofactions as $action)
{ {
if ($max && $cursorevent >= $max) break;
$ref=$action->getNomUrl(1,-1); $ref=$action->getNomUrl(1,-1);
$label=$action->getNomUrl(0,38); $label=$action->getNomUrl(0,38);
@ -226,7 +234,7 @@ class FormActions
} }
print $action->type; print $action->type;
print '</td>'; print '</td>';
print '<td>'.dol_print_date($action->datep,'dayhour'); print '<td align="center">'.dol_print_date($action->datep,'dayhour');
if ($action->datef) if ($action->datef)
{ {
$tmpa=dol_getdate($action->datep); $tmpa=dol_getdate($action->datep);
@ -254,7 +262,15 @@ class FormActions
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
$cursorevent++;
} }
if ($max && $num > $max)
{
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("More").'...</td></tr>';
}
print '</table>'; print '</table>';
print '</div>'; print '</div>';
} }

View File

@ -510,8 +510,6 @@ class FormWebsite
{ {
if ($lines[$i]->fk_parent == $parent) 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 //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 // Break on a new project
@ -1119,7 +1117,7 @@ class FormWebsite
$emptybox=new ModeleBoxes($db); $emptybox=new ModeleBoxes($db);
$boxlista.="\n<!-- Box left container -->\n"; $boxlista ="\n<!-- Box left container -->\n";
$boxlista.='<div id="left" class="connectedSortable">'."\n"; $boxlista.='<div id="left" class="connectedSortable">'."\n";
// Define $box_max_lines // Define $box_max_lines
@ -1152,7 +1150,7 @@ class FormWebsite
$boxlista.= "</div>\n"; $boxlista.= "</div>\n";
$boxlista.= "<!-- End box left container -->\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"; $boxlistb.= '<div id="right" class="connectedSortable">'."\n";
$ii=0; $ii=0;

View File

@ -1808,6 +1808,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
$module='ficheinter'; $module='ficheinter';
$subelement='fichinter'; $subelement='fichinter';
} }
if ($objecttype == 'task') {
$classpath = 'projet/class';
$module='projet';
$subelement='task';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;

View File

@ -103,10 +103,10 @@ function showOnlinePaymentUrl($type,$ref)
$langs->load("paybox"); $langs->load("paybox");
$servicename='Online'; $servicename='Online';
$out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url=getOnlinePaymentUrl(0,$type,$ref); $url = getOnlinePaymentUrl(0,$type,$ref);
$out.='<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">'; $out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out.=ajax_autoselect("onlinepaymenturl", 0); $out.= ajax_autoselect("onlinepaymenturl", 0);
return $out; return $out;
} }
@ -126,6 +126,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
global $conf; global $conf;
$ref=str_replace(' ','',$ref); $ref=str_replace(' ','',$ref);
$out='';
if ($type == 'free') if ($type == 'free')
{ {
@ -210,7 +211,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
} }
// For multicompany // 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; return $out;
} }

View File

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

View File

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

View File

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

View File

@ -2732,7 +2732,8 @@ elseif (! empty($object->id))
print '</form>'; print '</form>';
print "<br>"; print "<br>";
} }
if ($action != 'makeorder')
if ($action != 'makeorder')
{ {
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
@ -2791,7 +2792,7 @@ if ($action != 'makeorder')
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $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 // List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; /*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',0);*/ $somethingshown = $formactions->showactions($object,'project',0);*/
// List of todo actions // List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode); //show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);

View File

@ -2815,7 +2815,7 @@ else
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $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 '</div></div></div>';
//print '</td></tr></table>'; //print '</td></tr></table>';

View File

@ -409,7 +409,7 @@ if ($result > 0)
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $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 '</div></div></div>';
//print '</td></tr></table>'; //print '</td></tr></table>';

View File

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

View File

@ -410,6 +410,7 @@ ActionRunningNotStarted=To start
ActionRunningShort=In progress ActionRunningShort=In progress
ActionDoneShort=Finished ActionDoneShort=Finished
ActionUncomplete=Uncomplete ActionUncomplete=Uncomplete
LatestLinkedEvents=Latest %s linked events
CompanyFoundation=Company/Organisation CompanyFoundation=Company/Organisation
ContactsForCompany=Contacts for this third party ContactsForCompany=Contacts for this third party
ContactsAddressesForCompany=Contacts/addresses 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; $this->db=$db;
if (is_array($conf->modules)) 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 $filter Filter
* @param string $option Options * @param string $option Options
* @return int Nb of recipients * @return int Nb of recipients or -1 if KO
*/ */
function getNbOfRecipients($filter=1,$option='') 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 != ''"); $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 ($a < 0) return -1;
if ($option == '') return $a; return $a;
return ($a+$b);
} }
} }

View File

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

View File

@ -74,6 +74,7 @@ class ActionsCardProduct
*/ */
function assign_values(&$action, $id=0, $ref='') function assign_values(&$action, $id=0, $ref='')
{ {
global $limit, $offset, $sortfield, $sortorder;
global $conf, $langs, $user, $mysoc, $canvas; global $conf, $langs, $user, $mysoc, $canvas;
global $form, $formproduct; global $form, $formproduct;
@ -250,7 +251,7 @@ class ActionsCardProduct
if ($action == 'list') 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 $limit Limit number of responses
* @param int $offset Offset for first response * @param int $offset Offset for first response

View File

@ -73,6 +73,7 @@ class ActionsCardService
*/ */
function assign_values(&$action, $id=0, $ref='') function assign_values(&$action, $id=0, $ref='')
{ {
global $limit, $offset, $sortfield, $sortorder;
global $conf, $langs, $user, $mysoc, $canvas; global $conf, $langs, $user, $mysoc, $canvas;
global $form, $formproduct; global $form, $formproduct;
@ -229,7 +230,7 @@ class ActionsCardService
if ($action == 'list') 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 $limit Limit number of responses
* @param int $offset Offset for first response * @param int $offset Offset for first response

View File

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

View File

@ -3750,7 +3750,7 @@ class Product extends CommonObject
$sql.= " WHERE w.entity IN (".getEntity('stock').")"; $sql.= " WHERE w.entity IN (".getEntity('stock').")";
$sql.= " AND w.rowid = ps.fk_entrepot"; $sql.= " AND w.rowid = ps.fk_entrepot";
$sql.= " AND ps.fk_product = ".$this->id; $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); dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
$result = $this->db->query($sql); $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 // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid); $somethingshown = $formactions->showactions($object, 'order', $socid, 1);
print '</div></div></div>'; print '</div></div></div>';
} }

View File

@ -1198,6 +1198,10 @@ elseif ($object->id > 0)
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; 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>'; print '</div></div></div>';
} }

View File

@ -1902,8 +1902,8 @@ class TaskComment extends CommonObject
$sql.= ", ".(!empty($this->import_key)?"'".$this->import_key."'":"null"); $sql.= ", ".(!empty($this->import_key)?"'".$this->import_key."'":"null");
$sql.= ")"; $sql.= ")";
var_dump($this->db); //var_dump($this->db);
echo $sql; //echo $sql;
$this->db->begin(); $this->db->begin();
@ -2006,14 +2006,14 @@ class TaskComment extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
function update($user=null, $notrigger=0) function update(User $user, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
// Clean parameters // Clean parameters
if (isset($this->fk_task)) $this->fk_project=trim($this->fk_task); if (isset($this->fk_task)) $this->fk_project=(int) trim($this->fk_task);
if (isset($this->fk_user)) $this->fk_project=trim($this->fk_user); if (isset($this->fk_user)) $this->fk_user=(int) trim($this->fk_user);
if (isset($this->description)) $this->description=trim($this->description); if (isset($this->description)) $this->description=trim($this->description);

View File

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

View File

@ -926,7 +926,7 @@ if ($source == 'contractline')
{ {
$amount=$contractline->total_ttc; $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); $product=new Product($db);
$result=$product->fetch($contractline->fk_product); $result=$product->fetch($contractline->fk_product);

View File

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

View File

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

View File

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