diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 50e3b1e97be..8cfd5f202d5 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -50,9 +50,12 @@ function shipping_prepare_head($object) { // delivery link $object->fetchObjectLinked($object->id,$object->element); - if (! empty($object->linkedObjectsIds['delivery'][0])) // If there is a delivery + if (count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery { - $head[$h][0] = DOL_URL_ROOT."/livraison/card.php?id=".$object->linkedObjectsIds['delivery'][0]; + // Take first one element of array + $tmp = reset($object->linkedObjectsIds['delivery']); + + $head[$h][0] = DOL_URL_ROOT."/livraison/card.php?id=".$tmp; $head[$h][1] = $langs->trans("DeliveryCard"); $head[$h][2] = 'delivery'; $h++; @@ -302,7 +305,8 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $expedition->id=$objp->sendingid; $expedition->fetchObjectLinked($expedition->id,$expedition->element); //var_dump($expedition->linkedObjects); - $receiving=(! empty($expedition->linkedObjects['delivery'][0])?$expedition->linkedObjects['delivery'][0]:''); + $receiving=''; + if (count($expedition->linkedObjects['delivery']) > 0) $receiving=reset($expedition->linkedObjects['delivery']); // Take first link if (! empty($receiving)) { diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 2aa81102fa8..b2bc41220c3 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -77,7 +77,11 @@ class modMargin extends DolibarrModules $this->langfiles = array("margins"); // Constants - $this->const = array(); // List of particular constants to add when module is enabled + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1), + // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) + // ); + $this->const = array(0=>array('MARGIN_TYPE','chaine','1','Rule for margin calculation by default',0,'current',0)); // List of particular constants to add when module is enabled // New pages on tabs $this->tabs = array( diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 2ab7a8aa54f..5d5b327deaf 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -51,7 +51,7 @@ class modOpenSurvey extends DolibarrModules // Family can be 'crm','financial','hr','projects','product','technic','other' // It is used to group modules in module setup page - $this->family = "projects"; + $this->family = "portal"; $this->module_position = 40; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3136e5a79b7..e565d015a93 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -338,7 +338,7 @@ if (empty($reshook)) $result = $object->create_delivery($user); if ($result > 0) { - header("Location: ".DOL_URL_ROOT.'/livraison/card.php?id='.$result); + header("Location: ".DOL_URL_ROOT.'/livraison/card.php?action=create_delivery&id='.$result); exit; } else @@ -529,7 +529,7 @@ if ($action == 'create2') $action=''; $id=''; $ref=''; } -// Mode creation +// Mode creation. TODO This part seems to not be used at all. Receipt record is created by the action "create_delivery" not from a form. if ($action == 'create') { $expe = new Expedition($db); @@ -1583,7 +1583,8 @@ else if ($id || $ref) } // This is just to generate a delivery receipt - if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery'][0])) + //var_dump($object->linkedObjectsIds['delivery']); + if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0) { print 'id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").''; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 30607201e73..9ad2108519a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -789,9 +789,9 @@ class Expedition extends CommonObject /** - * Cree un bon de livraison a partir de l'expedition + * Create a delivery receipt from a shipment * - * @param User $user Utilisateur + * @param User $user User * @return int <0 if KO, >=0 if OK */ function create_delivery($user) diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index 8b7066adc09..f18ed1ea80f 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -37,7 +37,7 @@ print load_fiche_titre($langs->trans('RelatedShippings'), '', '');
| ';
print ' ';
@@ -204,14 +202,13 @@ if (! empty($conf->ficheinter->enabled))
}
-//print ' | ';
print ' ';
$max=5;
/*
- * Last modified orders
+ * Last modified interventions
*/
$sql = "SELECT f.rowid, f.ref, f.fk_statut, f.date_valid as datec, f.tms as datem,";
@@ -281,16 +278,17 @@ else dol_print_error($db);
/*
- * Orders to process
+ * interventions to process
*/
-if (! empty($conf->commande->enabled))
+/*
+if (! empty($conf->fichinter->enabled))
{
$sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
- $sql.= " AND f.entity IN (".getEntity('commande', 1).")";
+ $sql.= " AND f.entity IN (".getEntity('fichinter', 1).")";
$sql.= " AND f.fk_statut = 1";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@@ -303,7 +301,7 @@ if (! empty($conf->commande->enabled))
print '
| ||||||