Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-06-06 23:13:06 +02:00
commit 5c553878c7
4 changed files with 41 additions and 28 deletions

View File

@ -49,14 +49,9 @@ if (! $user->rights->facture->creer)
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='c.rowid';
if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
@ -202,14 +197,12 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
$sql.= ", '".$object->element."'";
$sql.= ")";
dol_syslog(get_class($this)."::add_object_linked sql=".$sql, LOG_DEBUG);
if ($db->query($sql))
{
$db->commit();
}
else
{
$db->rollback();
}
}
@ -528,7 +521,6 @@ else
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$sql.= $db->plimit($limit + 1,$offset);
$resql = $db->query($sql);
if ($resql)
@ -545,7 +537,7 @@ else
}
$title.=' - '.$langs->trans('StatusOrderToBillShort');
$num = $db->num_rows($resql);
print_barre_liste($title, $_GET['page'], 'liste.php','&socid='.$socid,$sortfield,$sortorder,'',$num);
print_fiche_titre($title);
$i = 0;
$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
@ -604,7 +596,7 @@ else
$var=True;
$generic_commande = new Commande($db);
while ($i < min($num,$limit))
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;

View File

@ -87,8 +87,15 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else if (! empty($ext_element))
{
dol_include_once('/'.$ext_element.'/class/actions_'.$ext_element.'.class.php');
$classname = 'Actions'.ucfirst($ext_element);
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
{
$module = $regs[1];
$subelement = $regs[2];
}
dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php');
$classname = 'Actions'.ucfirst($subelement);
$object = new $classname($db);
$ret = $object->$methodname();
if ($ret > 0) echo json_encode($object->$cachename);

View File

@ -51,6 +51,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
$field = substr($field, 8); // remove prefix val_
$type = GETPOST('type','alpha',2);
$value = ($type == 'ckeditor' ? GETPOST('value','',2) : GETPOST('value','alpha',2));
$loadmethod = GETPOST('loadmethod','alpha',2);
$savemethod = GETPOST('savemethod','alpha',2);
$savemethodname = (! empty($savemethod) ? $savemethod : 'setValueFrom');
@ -104,9 +105,9 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else if ($type == 'select')
{
$loadmethodname = 'load_cache_'.GETPOST('loadmethod','alpha');
$loadcachename = 'cache_'.GETPOST('loadmethod','alpha');
$loadviewname = 'view_'.GETPOST('loadmethod','alpha');
$loadmethodname = 'load_cache_'.$loadmethod;
$loadcachename = 'cache_'.$loadmethod;
$loadviewname = 'view_'.$loadmethod;
$form = new Form($db);
if (method_exists($form, $loadmethodname))
@ -131,8 +132,15 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else
{
dol_include_once('/'.$ext_element.'/class/actions_'.$ext_element.'.class.php');
$classname = 'Actions'.ucfirst($ext_element);
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
{
$module = $regs[1];
$subelement = $regs[2];
}
dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php');
$classname = 'Actions'.ucfirst($subelement);
$object = new $classname($db);
$ret = $object->$loadmethodname();
if ($ret > 0)

View File

@ -719,29 +719,35 @@ function activateModule($value,$withdeps=1)
if (! $ret && $withdeps)
{
if (is_array($objMod->depends) && !empty($objMod->depends))
if (is_array($objMod->depends) && ! empty($objMod->depends))
{
// Activation des modules dont le module depend
$num = count($objMod->depends);
for ($i = 0; $i < $num; $i++)
{
if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/".$objMod->depends[$i].".class.php"))
{
activateModule($objMod->depends[$i]);
}
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$objMod->depends[$i].".class.php"))
{
activateModule($objMod->depends[$i]);
}
}
}
}
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith))
if (is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))
{
// Desactivation des modules qui entrent en conflit
$num = count($objMod->conflictwith);
for ($i = 0; $i < $num; $i++)
{
if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/".$objMod->conflictwith[$i].".class.php"))
{
unActivateModule($objMod->conflictwith[$i],0);
}
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$objMod->conflictwith[$i].".class.php"))
{
unActivateModule($objMod->conflictwith[$i],0);
}
}
}
}
}