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 ''.$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'), '', ''); trans("Ref"); ?> trans("Date"); ?> trans("DateDeliveryPlanned"); ?> - trans("AmountHTShort"); ?> + trans(""); ?> trans("Status"); ?> @@ -53,10 +53,10 @@ foreach($linkedObjectBlock as $key => $objectlink) date_creation,'day'); ?> date_delivery,'day'); ?> rights->expedition->lire) { + /*if ($user->rights->expedition->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); - } ?> + }*/ ?> getLibStatut(3); ?> ">transnoentitiesnoconv("RemoveLink")); ?> @@ -64,15 +64,17 @@ foreach($linkedObjectBlock as $key => $objectlink) } ?> + + diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 03b217f9a91..3e629e05789 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -57,8 +57,6 @@ llxHeader("",$langs->trans("Interventions"),$help_url); print load_fiche_titre($langs->trans("InterventionsArea")); -//print ''; -//print '
'; 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 ''; print ''; - print ''; + print ''; if ($num) { @@ -350,11 +348,10 @@ if (! empty($conf->commande->enabled)) } else dol_print_error($db); } +*/ - -//print '
'.$langs->trans("OrdersToProcess").' '.$num.'
'.$langs->trans("FichinterToProcess").' '.$num.'
'; print '
'; diff --git a/htdocs/langs/en_US/deliveries.lang b/htdocs/langs/en_US/deliveries.lang index 4eb1c792b65..eab3826a2c7 100644 --- a/htdocs/langs/en_US/deliveries.lang +++ b/htdocs/langs/en_US/deliveries.lang @@ -17,6 +17,9 @@ DeleteDeliveryReceiptConfirm=Are you sure you want to delete delivery receipt trans("CreateADeliveryOrder")); @@ -538,8 +538,17 @@ else $soc->fetch($object->socid); $head=delivery_prepare_head($object); - dol_fiche_head($head, 'delivery', $langs->trans("Shipment"), 0, 'sending'); + + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head($head, 'delivery', $langs->trans("Shipment"), 0, 'sending'); + /* * Confirmation de la suppression * @@ -565,13 +574,6 @@ else * Livraison */ - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; // Shipment @@ -590,7 +592,9 @@ else // Ref print ''; - print ''; + print ''; // Client print ''; @@ -818,15 +822,13 @@ else print "
'.$langs->trans("Ref").''.$object->ref.'
'; + print $object->ref; + print '
'.$langs->trans("Customer").'
\n"; - if($object->statut == 0) // only if draft - print '
'; - + dol_fiche_end(); + + //if ($object->statut == 0) // only if draft + // print '
'; + print '
'; - - - - print "\n\n"; - + /* * Boutons actions @@ -899,6 +901,7 @@ else print '
'; + // List of existing shipment and delivery receipts if ($expedition->origin_id) { print '
'; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index faac4766337..14a83aca2f7 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -65,9 +65,9 @@ class Livraison extends CommonObject $this->products = array(); // List of short language codes for status - $this->statuts[-1] = 'StatusSendingCanceled'; - $this->statuts[0] = 'StatusSendingDraft'; - $this->statuts[1] = 'StatusSendingValidated'; + $this->statuts[-1] = 'StatusDeliveryCanceled'; + $this->statuts[0] = 'StatusDeliveryDraft'; + $this->statuts[1] = 'StatusDeliveryValidated'; } /** @@ -801,9 +801,9 @@ class Livraison extends CommonObject if ($mode==0) { - if ($statut==-1) return $langs->trans('StatusSendingCanceled'); - if ($statut==0) return $langs->trans('StatusSendingDraft'); - if ($statut==1) return $langs->trans('StatusSendingValidated'); + if ($statut==-1) return $langs->trans('StatusDeliveryCanceled'); + if ($statut==0) return $langs->trans('StatusDeliveryDraft'); + if ($statut==1) return $langs->trans('StatusDeliveryValidated'); } if ($mode==1) { @@ -813,9 +813,9 @@ class Livraison extends CommonObject } if ($mode == 4) { - if ($statut==-1) return img_picto($langs->trans('StatusSendingCanceled'),'statut5').' '.$langs->trans('StatusSendingCanceled'); - if ($statut==0) return img_picto($langs->trans('StatusSendingDraft'),'statut0').' '.$langs->trans('StatusSendingDraft'); - if ($statut==1) return img_picto($langs->trans('StatusSendingValidated'),'statut4').' '.$langs->trans('StatusSendingValidated'); + if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5').' '.$langs->trans('StatusDeliveryCanceled'); + if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0').' '.$langs->trans('StatusDeliveryDraft'); + if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4').' '.$langs->trans('StatusDeliveryValidated'); } }