| ' . $langs->trans('Type') . ' | ';
- print '' . "\n";
+
+ print '';
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
{
// Deposit
- print '| ';
- print '';
- print ' | ';
+ print '';
+ $tmp=' ';
print '';
- $desc = $form->textwithpicto($langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1);
- print ' | ' . $desc . ' | ';
- if (($origin == 'propal') || ($origin == 'commande')) {
+
+ $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
+ print '| ';
+ print $desc;
+ print ' | ';
+ if (($origin == 'propal') || ($origin == 'commande'))
+ {
print '';
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1);
@@ -2113,44 +2118,41 @@ if ($action == 'create')
print ' | ' . $langs->trans('Value') . ':';
}
print ' | ';
- print ' ' . "\n";
+
+ print '';
}
if ($socid > 0)
{
if (! empty($conf->global->INVOICE_USE_SITUATION))
{
- // First situation invoice
- print '| ';
- print '';
- print ' | ';
- $desc = $form->textwithpicto($langs->trans("InvoiceFirstSituationAsk"), $langs->transnoentities("InvoiceFirstSituationDesc"), 1);
- print $desc;
- print ' | ' . "\n";
+ // First situation invoice
+ print '';
- // Next situation invoice
- $opt = $form->load_situation_invoices(GETPOST('originid'), $socid);
- print '| ';
- print '' . $langs->trans('NoSituations') . '' || (GETPOST('origin') && GETPOST('origin') != 'facture')) print 'disabled';
- print '>';
- print ' | ';
- $text = $langs->trans("InvoiceSituationAsk") . ' ';
- $text .= '';
- $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceSituationDesc"), 1);
- print $desc;
- print ' | ' . "\n";
+ // Next situation invoice
+ $opt = $form->load_situation_invoices(GETPOST('originid'), $socid);
+ print '';
}
// Replacement
- print '| ';
- print '';
- print ' | ';
+ print ' | ' . "\n";
+ print '';
}
else
{
- print '| ';
- print '';
- print ' | ';
- $text = $langs->trans("InvoiceReplacement") . ' ';
+ print ' | ' . "\n";
+ print '';
}
if (empty($origin))
@@ -2191,12 +2192,10 @@ if ($action == 'create')
if ($socid > 0)
{
// Credit note
- print '| ';
- print '';
- print ' | ';
+ print '';
+ $tmp=' ';
// Show credit note options only if we checked credit note
print '';
- $text = $langs->transnoentities("InvoiceAvoirAsk") . ' ';
+ $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' ';
// $text.=' ';
$text .= ' ';
- $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1);
+ $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
print $desc;
print ' ';
@@ -2233,22 +2232,22 @@ if ($action == 'create')
print ' 0 ? 'checked':'').' /> ";
print ' ';
- print ' | ' . "\n";
+ print '';
}
else
{
- print '| ';
- print '';
- print ' | ';
- $text = $langs->trans("InvoiceAvoir") . ' ';
+ print ' | ' . "\n";
+ print '' . "\n";
}
}
- print '
';
+ print ' ';
+
print ' | ';
if ($socid > 0)
@@ -2293,12 +2292,15 @@ if ($action == 'create')
print '';
// Project
- if (! empty($conf->projet->enabled) && $socid > 0) {
- $formproject = new FormProjets($db);
+ if (! empty($conf->projet->enabled) && $socid > 0)
+ {
+ $projectid = GETPOST('projectid')?GETPOST('projectid'):0;
+ if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load('projects');
print '| ' . $langs->trans('Project') . ' | ';
- $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
+ $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
+ print ' id).'">' . $langs->trans("AddProject") . '';
print ' | ';
}
@@ -2320,7 +2322,7 @@ if ($action == 'create')
print $object->showOptionals($extrafields, 'edit');
}
- // Modele PDF
+ // Template to use by default
print '| ' . $langs->trans('Model') . ' | ';
print '';
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
@@ -2337,7 +2339,7 @@ if ($action == 'create')
{
$note_public = $objectsrc->note_public;
}
- $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
+ $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
// Private note
@@ -2351,7 +2353,7 @@ if ($action == 'create')
{
$note_private = $objectsrc->note_private;
}
- $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
+ $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
// print '
print ' | ';
@@ -2418,7 +2420,9 @@ if ($action == 'create')
print '| ' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ' | ' . price($objectsrc->total_localtax2) . " | ";
}
print '| ' . $langs->trans('TotalTTC') . ' | ' . price($objectsrc->total_ttc) . " | ";
- } else {
+ }
+ else
+ {
// Show deprecated optional form to add product line here
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) {
print '| ';
@@ -3486,50 +3490,50 @@ if ($action == 'create')
// Show global modifiers
if (! empty($conf->global->INVOICE_US_SITUATION))
{
- if ($object->situation_cycle_ref && $object->statut == 0) {
- print ' | ';
- print ' \n";
- if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
- print ' | ';
+ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
+ print ' | ';
+ }
+ print '';
+ print '| | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print '% | ';
+ print ' | ';
+ print ' ';
+ print '';
}
- print '';
- print '| | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print '% | ';
- print ' | ';
- print ' ';
- print '';
- }
}
// Show object lines
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index b7ea6bd798b..791f01d5932 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -39,6 +39,7 @@ $ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha');
$backtopage=GETPOST('backtopage','alpha');
$cancel=GETPOST('cancel','alpha');
+$status=GETPOST('status','int');
if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && ! $_POST["cancel"])) accessforbidden();
@@ -139,6 +140,7 @@ if (empty($reshook))
$object->datec=dol_now();
$object->date_start=$date_start;
$object->date_end=$date_end;
+ $object->statuts = $status;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@@ -167,8 +169,16 @@ if (empty($reshook))
{
$db->commit();
- header("Location:card.php?id=".$object->id);
- exit;
+ if ($backtopage)
+ {
+ header("Location: ".$backtopage.'&projectid='.$object->id);
+ exit;
+ }
+ else
+ {
+ header("Location:card.php?id=".$object->id);
+ exit;
+ }
}
else
{
@@ -444,6 +454,15 @@ if ($action == 'create' && $user->rights->projet->creer)
else print $text;
print '';
+ // Status
+ if ($status != '')
+ {
+ print '| '.$langs->trans("Status").' | ';
+ print '';
+ print $object->LibStatut($status, 4);
+ print ' | ';
+ }
+
// Public
print '| '.$langs->trans("Visibility").' | ';
$array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 8d3e9f39a08..ff005dd088f 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -125,12 +125,12 @@ class Project extends CommonObject
$sql.= ", '" . $this->db->escape($this->description) . "'";
$sql.= ", " . ($this->socid > 0 ? $this->socid : "null");
$sql.= ", " . $user->id;
- $sql.= ", 0";
+ $sql.= ", ".(is_numeric($this->statuts) ? $this->statuts : '0');
$sql.= ", " . ($this->public ? 1 : 0);
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", " . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
$sql.= ", " . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
- $sql.= ", " . ($this->budget_amount != ''?price2num($this->budget_amount):'null');
+ $sql.= ", " . ($this->budget_amount != '' ? price2num($this->budget_amount) : 'null');
$sql.= ", ".$conf->entity;
$sql.= ")";
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 2a63e558801..93bd5a09d9a 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -448,6 +448,10 @@ textarea.centpercent {
#formuserfile_link {
margin-left: 1px;
}
+.listofinvoicetype {
+ height: 28px;
+ vertical-align: middle;
+}
/* Style to move picto into left of button */
/*
| |