Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed May 22, 2013
2 parents e9df560 + edf00db commit 9943892
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
33 changes: 33 additions & 0 deletions htdocs/admin/fichinter.php
Expand Up @@ -189,6 +189,23 @@
}
}

elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
{
$val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha');
$res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on'),'bool',0,'',$conf->entity);

if (! $res > 0) $error++;

if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}


/*
* View
Expand Down Expand Up @@ -469,6 +486,22 @@
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";

// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
if ($conf->global->FICHINTER_PRINT_PRODUCTS)
print 'checked="checked" ';
print '/>';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";

print '</form>';


Expand Down
5 changes: 5 additions & 0 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -3913,6 +3913,11 @@ function showphoto($modulepart,$object,$width=100)
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}else {
$dir=$conf->$modulepart->dir_output;
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}

if ($dir)
Expand Down
24 changes: 11 additions & 13 deletions htdocs/fichinter/fiche.php
Expand Up @@ -202,12 +202,10 @@
{
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);

if ($product_type == 1) { //only services
if ($product_type == 1 || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products
// service prédéfini
if ($lines[$i]->fk_product > 0)
{
$product_static = new Product($db);

// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
Expand All @@ -230,23 +228,23 @@
$label = $lines[$i]->product_label;
}

$product_static->type=$lines[$i]->fk_product_type;
$product_static->id=$lines[$i]->fk_product;
$product_static->ref=$lines[$i]->ref;
$product_static->libelle=$label;
$desc=$product_static->getNomUrl(0);
$desc.= ' - '.$label;
$desc = $label;
$desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')';
if ($conf->global->PRODUIT_DESC_IN_FORM)
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?'<br>'.dol_htmlentitiesbr($lines[$i]->desc):'';
}
else {
$desc = dol_htmlentitiesbr($lines[$i]->desc);
$desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')';
}
$timearray=dol_getdate(mktime());
$date_intervention=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
$duration = 3600;
if ($product_type == 1)
{ //service
$duration = 3600;
}
else
{ //product
$duration = 0;
}

$result = $object->addline(
$user,
Expand Down Expand Up @@ -1621,7 +1619,7 @@
$somethingshown=$object->showLinkedObjectBlock();

//print '</td><td valign="top" width="50%">';
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';
Expand Down
2 changes: 2 additions & 0 deletions htdocs/langs/en_US/interventions.lang
Expand Up @@ -39,3 +39,5 @@ ArcticNumRefModelDesc1=Generic number model
ArcticNumRefModelError=Failed to activate
PacificNumRefModelDesc1=Return numero with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
PacificNumRefModelError=An intervention card starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module.
PrintProductsOnFichinter=Print products on intervention card
PrintProductsOnFichinterDetails=forinterventions generated from orders
2 changes: 2 additions & 0 deletions htdocs/langs/fr_FR/interventions.lang
Expand Up @@ -52,3 +52,5 @@ PacificNumRefModelDesc1=Renvoie le numéro sous la forme %syymm-nnnn où yy est
PacificNumRefModelError=Une facture commençant par $syymm existe en base et est incompatible avec cette numérotation. Supprimez la ou renommez la pour activer ce module.
SendInterventionByMail=Envoi de la fiche d'intervention par mail
SendInterventionRef=Envoi Intervention %s
PrintProductsOnFichinter=Afficher les produits sur la fiche d'intervention
PrintProductsOnFichinterDetails=pour les interventions générées à partir des commandes

0 comments on commit 9943892

Please sign in to comment.