mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
add new rule
This commit is contained in:
parent
a25ed0e041
commit
e5fc928fda
|
|
@ -60,8 +60,7 @@ if ($action == 'update')
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@ if (!empty($keyforcontent))
|
|||
$langs->load("errors");
|
||||
print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent))
|
||||
{
|
||||
print $conf->global->$keyforcontent;
|
||||
|
|
@ -115,8 +114,7 @@ if (!empty($keyforcontent))
|
|||
print '<div>';
|
||||
llxFooter();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (preg_match('/^\//', $conf->global->EXTERNALSITE_URL) || preg_match('/^http/i', $conf->global->EXTERNALSITE_URL))
|
||||
{
|
||||
print "
|
||||
|
|
@ -151,8 +149,7 @@ else
|
|||
</html>
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
llxHeader();
|
||||
print '<div class="framecontent" style="height: '.($_SESSION['dol_screenheight'] - 90).'px">';
|
||||
print $conf->global->EXTERNALSITE_URL;
|
||||
|
|
|
|||
|
|
@ -130,15 +130,13 @@ if ($result)
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,8 +261,7 @@ class Establishment extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -287,8 +286,7 @@ class Establishment extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -389,8 +387,7 @@ class Establishment extends CommonObject
|
|||
}
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
|
@ -418,8 +415,7 @@ class Establishment extends CommonObject
|
|||
}
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
|
|||
header("Location: ../admin/admin_establishment.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -101,18 +100,15 @@ elseif ($action == 'add')
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ../admin/admin_establishment.php");
|
||||
exit;
|
||||
}
|
||||
|
|
@ -148,8 +144,7 @@ elseif ($action == 'update')
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,8 +242,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
|
@ -315,8 +314,7 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -119,8 +119,7 @@ if ($action == 'add')
|
|||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
|
||||
|
|
@ -167,8 +166,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio
|
|||
else header("Location: ".DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -262,7 +260,7 @@ $formfile = new FormFile($db);
|
|||
if ($action == 'create') // Create. Seems to no be used
|
||||
{
|
||||
}
|
||||
else // View
|
||||
else // View
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
|
|
@ -453,8 +451,7 @@ else // View
|
|||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -476,8 +473,7 @@ else // View
|
|||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -575,8 +571,7 @@ else // View
|
|||
|
||||
$label = (!empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $object->lines[$i]->product_label;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : $object->lines[$i]->product_label);
|
||||
}
|
||||
|
||||
|
|
@ -597,8 +592,7 @@ else // View
|
|||
print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '<br>'.dol_htmlentitiesbr($object->lines[$i]->description) : '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td>";
|
||||
if ($object->lines[$i]->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service');
|
||||
else $text = img_object($langs->trans('Product'), 'product');
|
||||
|
|
@ -675,8 +669,7 @@ else // View
|
|||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&expid='.$object->origin_id.'&action=delete&backtopage='.urlencode(DOL_URL_ROOT.'/expedition/card.php?id='.$object->origin_id).'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -720,14 +713,12 @@ else // View
|
|||
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* Expedition non trouvee */
|
||||
print "Expedition inexistante ou acces refuse";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* Expedition non trouvee */
|
||||
print "Expedition inexistante ou acces refuse";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,24 +216,21 @@ class Livraison extends CommonObject
|
|||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
|
||||
$this->db->rollback();
|
||||
|
|
@ -345,15 +342,13 @@ class Livraison extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = 'Delivery with id '.$id.' not found sql='.$sql;
|
||||
dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -400,8 +395,7 @@ class Livraison extends CommonObject
|
|||
{
|
||||
$numref = $objMod->livraison_get_num($soc, $this);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$numref = $this->ref;
|
||||
}
|
||||
$this->newref = dol_sanitizeFileName($numref);
|
||||
|
|
@ -501,16 +495,14 @@ class Livraison extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Non autorise";
|
||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
|
|
@ -634,8 +626,7 @@ class Livraison extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -705,22 +696,19 @@ class Livraison extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -991,8 +979,7 @@ class Livraison extends CommonObject
|
|||
{
|
||||
$array[$i]['qty'] = $objSourceLine->qty - $row[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$array[$i]['qty'] = $objSourceLine->qty;
|
||||
}
|
||||
|
||||
|
|
@ -1010,8 +997,7 @@ class Livraison extends CommonObject
|
|||
}
|
||||
return $array;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error()." - sql=$sqlSourceLine";
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1041,14 +1027,12 @@ class Livraison extends CommonObject
|
|||
$this->date_delivery = $date_livraison;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@ if (empty($reshook))
|
|||
{
|
||||
setEventMessages($langs->trans('LoanPaid'), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -86,8 +85,7 @@ if (empty($reshook))
|
|||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -154,8 +152,7 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
|
@ -177,8 +174,7 @@ if (empty($reshook))
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->datestart = $datestart;
|
||||
$object->dateend = $dateend;
|
||||
$object->capital = $capital;
|
||||
|
|
@ -202,14 +198,12 @@ if (empty($reshook))
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
|
|
@ -275,8 +269,7 @@ if ($action == 'create')
|
|||
$form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td>'.$langs->trans("Account").'</td><td>';
|
||||
print $langs->trans("NoBankAccountDefined");
|
||||
print '</td></tr>';
|
||||
|
|
@ -484,8 +477,7 @@ if ($id > 0)
|
|||
print '<input name="capital" size="10" value="'.$object->capital.'"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("LoanCapital").'</td><td>'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
|
|
@ -496,8 +488,7 @@ if ($id > 0)
|
|||
print '<input name="insurance_amount" size="10" value="'.$object->insurance_amount.'"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Insurance").'</td><td>'.price($object->insurance_amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
|
|
@ -508,8 +499,7 @@ if ($id > 0)
|
|||
{
|
||||
print $form->selectDate($object->datestart, 'start', 0, 0, 0, 'update', 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date($object->datestart, "day");
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
|
@ -521,8 +511,7 @@ if ($id > 0)
|
|||
{
|
||||
print $form->selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date($object->dateend, "day");
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
|
@ -534,8 +523,7 @@ if ($id > 0)
|
|||
{
|
||||
print '<input name="nbterm" size="4" value="'.$object->nbterm.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->nbterm;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -547,8 +535,7 @@ if ($id > 0)
|
|||
{
|
||||
print '<input name="rate" size="4" value="'.$object->rate.'">%';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print price($object->rate).'%';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -565,14 +552,12 @@ if ($id > 0)
|
|||
{
|
||||
print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print '</td><td>';
|
||||
|
|
@ -603,14 +588,12 @@ if ($id > 0)
|
|||
{
|
||||
print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
|
|
@ -641,14 +624,12 @@ if ($id > 0)
|
|||
{
|
||||
print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyInterestCode");
|
||||
print '</td><td>';
|
||||
|
|
@ -743,8 +724,7 @@ if ($id > 0)
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -805,8 +785,7 @@ if ($id > 0)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Loan not found
|
||||
dol_print_error('', $object->error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,14 +161,12 @@ class Loan extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->free($resql);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -259,8 +257,7 @@ class Loan extends CommonObject
|
|||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -330,8 +327,7 @@ class Loan extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -376,8 +372,7 @@ class Loan extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -572,8 +567,7 @@ class Loan extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return $amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -619,14 +613,12 @@ class Loan extends CommonObject
|
|||
$this->db->free($result);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->free($result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,8 +171,7 @@ class LoanSchedule extends CommonObject
|
|||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -184,8 +183,7 @@ class LoanSchedule extends CommonObject
|
|||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -258,8 +256,7 @@ class LoanSchedule extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -322,8 +319,7 @@ class LoanSchedule extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -364,8 +360,7 @@ class LoanSchedule extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -451,8 +446,7 @@ class LoanSchedule extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,8 +166,7 @@ class PaymentLoan extends CommonObject
|
|||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -179,8 +178,7 @@ class PaymentLoan extends CommonObject
|
|||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
@ -255,8 +253,7 @@ class PaymentLoan extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -327,8 +324,7 @@ class PaymentLoan extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -380,8 +376,7 @@ class PaymentLoan extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -460,8 +455,7 @@ class PaymentLoan extends CommonObject
|
|||
if ($result <= 0) dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $acc->error;
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -471,8 +465,7 @@ class PaymentLoan extends CommonObject
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -497,8 +490,7 @@ class PaymentLoan extends CommonObject
|
|||
$this->fk_bank = $id_bank;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,8 +159,7 @@ if ($object->id)
|
|||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,8 +121,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
|
|||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
|
@ -262,8 +261,7 @@ if ($resql)
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del
|
|||
header("Location: ".DOL_URL_ROOT."/loan/list.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
|
|
@ -102,8 +101,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri
|
|||
header('Location: card.php?id='.$payment->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
|
|
@ -255,8 +253,7 @@ if ($resql)
|
|||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -287,8 +284,7 @@ if (empty($action) && !empty($user->rights->loan->delete))
|
|||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,8 +170,7 @@ if ($action == 'add_payment')
|
|||
header('Location: '.$loc);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -291,8 +290,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<td class="left" valign="center">'.dol_print_date($loan->datestart, 'day').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="center" valign="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
|
|
@ -307,8 +305,7 @@ if ($action == 'create')
|
|||
{
|
||||
print $langs->trans("LoanCapital").': <input type="text" size="8" name="amount_capital" value="'.$amount_capital.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '-';
|
||||
}
|
||||
print '<br>';
|
||||
|
|
@ -316,8 +313,7 @@ if ($action == 'create')
|
|||
{
|
||||
print $langs->trans("Insurance").': <input type="text" size="8" name="amount_insurance" value="'.$amount_insurance.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '-';
|
||||
}
|
||||
print '<br>';
|
||||
|
|
@ -325,8 +321,7 @@ if ($action == 'create')
|
|||
{
|
||||
print $langs->trans("Interest").': <input type="text" size="8" name="amount_interest" value="'.$amount_interest.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '-';
|
||||
}
|
||||
print "</td>";
|
||||
|
|
|
|||
|
|
@ -291,15 +291,13 @@ class MailmanSpip
|
|||
$mydb->close($result);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// nous n'avons pas de reponse => n'existe pas
|
||||
$mydb->close($result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $mydb->lasterror();
|
||||
$mydb->close();
|
||||
}
|
||||
|
|
@ -378,8 +376,7 @@ class MailmanSpip
|
|||
}
|
||||
return count($lists);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "ADHERENT_MAILMAN_URL not defined";
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -452,8 +449,7 @@ class MailmanSpip
|
|||
}
|
||||
return count($lists);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "ADHERENT_MAILMAN_UNSUB_URL not defined";
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
|||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -62,8 +61,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
|||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -74,8 +72,7 @@ if ($action == 'remises')
|
|||
{
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -86,8 +83,7 @@ if ($action == 'typemarges')
|
|||
{
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -98,8 +94,7 @@ if ($action == 'contact')
|
|||
{
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -167,14 +162,12 @@ if (!empty($conf->use_javascript_ajax))
|
|||
{
|
||||
print ajax_constantonoff('DISPLAY_MARGIN_RATES');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_DISPLAY_MARGIN_RATES">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_DISPLAY_MARGIN_RATES">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -190,14 +183,12 @@ if (!empty($conf->use_javascript_ajax))
|
|||
{
|
||||
print ajax_constantonoff('DISPLAY_MARK_RATES');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($conf->global->DISPLAY_MARK_RATES))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_DISPLAY_MARK_RATES">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_DISPLAY_MARK_RATES">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -213,14 +204,12 @@ if (!empty($conf->use_javascript_ajax))
|
|||
{
|
||||
print ajax_constantonoff('ForceBuyingPriceIfNull');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($conf->global->ForceBuyingPriceIfNull))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ForceBuyingPriceIfNull">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ForceBuyingPriceIfNull">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ if (!$sortfield)
|
|||
{
|
||||
if ($agentid > 0)
|
||||
$sortfield = "s.nom";
|
||||
else
|
||||
$sortfield = "u.lastname";
|
||||
else $sortfield = "u.lastname";
|
||||
}
|
||||
|
||||
$startdate = $enddate = '';
|
||||
|
|
@ -156,16 +155,14 @@ $sql .= " AND sc.fk_soc = f.fk_soc";
|
|||
$sql .= " AND (d.product_type = 0 OR d.product_type = 1)";
|
||||
if (!empty($conf->global->AGENT_CONTACT_TYPE))
|
||||
$sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
|
||||
else
|
||||
$sql .= " AND sc.fk_user = u.rowid";
|
||||
else $sql .= " AND sc.fk_user = u.rowid";
|
||||
$sql .= " AND f.fk_statut NOT IN (".implode(', ', $invoice_status_except_list).")";
|
||||
$sql .= ' AND s.entity IN ('.getEntity('societe').')';
|
||||
$sql .= " AND d.fk_facture = f.rowid";
|
||||
if ($agentid > 0) {
|
||||
if (!empty($conf->global->AGENT_CONTACT_TYPE))
|
||||
$sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))";
|
||||
else
|
||||
$sql .= " AND sc.fk_user = ".$agentid;
|
||||
else $sql .= " AND sc.fk_user = ".$agentid;
|
||||
}
|
||||
if (!empty($startdate))
|
||||
$sql .= " AND f.datef >= '".$db->idate($startdate)."'";
|
||||
|
|
@ -205,7 +202,7 @@ if ($result)
|
|||
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
$labelcostprice = 'BuyingPrice';
|
||||
else // value is 'costprice' or 'pmp'
|
||||
else // value is 'costprice' or 'pmp'
|
||||
$labelcostprice = 'CostPrice';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
@ -217,8 +214,7 @@ if ($result)
|
|||
print '<tr class="liste_titre">';
|
||||
if ($agentid > 0)
|
||||
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
else
|
||||
print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
|
||||
else print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
|
||||
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
|
|
@ -308,8 +304,7 @@ if ($result)
|
|||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ if ($result) {
|
|||
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
$labelcostprice = 'BuyingPrice';
|
||||
else // value is 'costprice' or 'pmp'
|
||||
else // value is 'costprice' or 'pmp'
|
||||
$labelcostprice = 'CostPrice';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
|
|||
|
|
@ -126,8 +126,7 @@ if (!$sortfield)
|
|||
$sortfield = "f.datef";
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sortfield = "s.nom";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
|
@ -255,7 +254,7 @@ if ($result)
|
|||
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
$labelcostprice = 'BuyingPrice';
|
||||
else // value is 'costprice' or 'pmp'
|
||||
else // value is 'costprice' or 'pmp'
|
||||
$labelcostprice = 'CostPrice';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
@ -269,8 +268,7 @@ if ($result)
|
|||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&socid=".$socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&socid=".$socid, 'align="center"', $sortfield, $sortorder);
|
||||
}
|
||||
else
|
||||
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder);
|
||||
else print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
|
|
@ -298,8 +296,7 @@ if ($result)
|
|||
$marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : '';
|
||||
$markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
|
||||
$markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
|
||||
}
|
||||
|
|
@ -353,8 +350,7 @@ if ($result)
|
|||
print '<tr class="liste_total">';
|
||||
if ($client)
|
||||
print '<td colspan=2>';
|
||||
else
|
||||
print '<td>';
|
||||
else print '<td>';
|
||||
print $langs->trans('TotalMargin')."</td>";
|
||||
print "<td class=\"right\">".price($cumul_vente, null, null, null, null, $rounding)."</td>\n";
|
||||
print "<td class=\"right\">".price($cumul_achat, null, null, null, null, $rounding)."</td>\n";
|
||||
|
|
@ -368,8 +364,7 @@ if ($result)
|
|||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
|
|
|
|||
|
|
@ -128,13 +128,11 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
|
|||
{
|
||||
$paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$paht_ret = $paht;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$paht_ret = $paht;
|
||||
}
|
||||
|
||||
|
|
@ -147,8 +145,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
|
|||
// calcul marge
|
||||
if ($pu_ht_remise < 0)
|
||||
$marge = -1 * (abs($pu_ht_remise) - $paht_ret);
|
||||
else
|
||||
$marge = $pu_ht_remise - $paht_ret;
|
||||
else $marge = $pu_ht_remise - $paht_ret;
|
||||
|
||||
// calcul taux marge
|
||||
if ($paht_ret != 0)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,7 @@ if (!$sortfield)
|
|||
$sortfield = "f.datef";
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sortfield = "p.ref";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
|
@ -226,7 +225,7 @@ if ($result)
|
|||
//var_dump($conf->global->MARGIN_TYPE);
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
$labelcostprice = 'BuyingPrice';
|
||||
else // value is 'costprice' or 'pmp'
|
||||
else // value is 'costprice' or 'pmp'
|
||||
$labelcostprice = 'CostPrice';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
|
@ -240,8 +239,7 @@ if ($result)
|
|||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&id=".$id, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$id, 'align="center"', $sortfield, $sortorder);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&id=".$id, '', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$id, 'align="right"', $sortfield, $sortorder);
|
||||
|
|
@ -270,8 +268,7 @@ if ($result)
|
|||
$marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : '';
|
||||
$markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
|
||||
$markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
|
||||
}
|
||||
|
|
@ -298,8 +295,7 @@ if ($result)
|
|||
$text = $product_static->getNomUrl(1);
|
||||
print $text .= ' - '.$objp->label;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts");
|
||||
}
|
||||
print "</td>\n";
|
||||
|
|
@ -330,8 +326,7 @@ if ($result)
|
|||
print '<tr class="liste_total">';
|
||||
if ($id > 0)
|
||||
print '<td colspan=2>';
|
||||
else
|
||||
print '<td>';
|
||||
else print '<td>';
|
||||
print $langs->trans('TotalMargin')."</td>";
|
||||
print "<td class=\"right\">".price(price2num($cumul_vente, 'MT'))."</td>\n";
|
||||
print "<td class=\"right\">".price(price2num($cumul_achat, 'MT'))."</td>\n";
|
||||
|
|
@ -345,8 +340,7 @@ if ($result)
|
|||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
|
|
|
|||
|
|
@ -230,8 +230,7 @@ if ($id > 0 || !empty($ref))
|
|||
$marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : '';
|
||||
$markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : '';
|
||||
$markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,8 +236,7 @@ if ($socid > 0)
|
|||
$marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : '';
|
||||
$markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : '';
|
||||
$markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : '';
|
||||
}
|
||||
|
|
@ -255,8 +254,7 @@ if ($socid > 0)
|
|||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
|
@ -265,8 +263,7 @@ if ($socid > 0)
|
|||
print '<br>';
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error('', 'Parameter socid not defined');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ if ($result > 0)
|
|||
unset($object->db);
|
||||
echo json_encode($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo 'Failed to load category with id='.$idbom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,15 +763,13 @@ class Mo extends CommonObject
|
|||
{
|
||||
return $numref;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $obj->error;
|
||||
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined");
|
||||
return "";
|
||||
}
|
||||
|
|
@ -817,8 +815,7 @@ class Mo extends CommonObject
|
|||
$this->fetch_product();
|
||||
$num = $this->getNextNumRef($this->product);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$num = $this->ref;
|
||||
}
|
||||
$this->newref = $num;
|
||||
|
|
@ -900,8 +897,7 @@ class Mo extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1146,8 +1142,7 @@ class Mo extends CommonObject
|
|||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
|
@ -1181,8 +1176,7 @@ class Mo extends CommonObject
|
|||
$this->errors = $this->errors;
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->lines = $result;
|
||||
return $this->lines;
|
||||
}
|
||||
|
|
@ -1329,8 +1323,7 @@ class Mo extends CommonObject
|
|||
$this->tpl['label'] .= $productstatic->getNomUrl(1);
|
||||
//$this->tpl['label'].= ' - '.$productstatic->label;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// If origin MRP line is not a product, but another MRP
|
||||
// TODO
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,8 +137,7 @@ if ($conf->use_javascript_ajax)
|
|||
|
||||
print "<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -196,8 +195,7 @@ if ($resql)
|
|||
print "</table></div>";
|
||||
print "<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -249,8 +247,7 @@ if ($resql)
|
|||
print "</table></div>";
|
||||
print "<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ if (GETPOST('actioncode', 'array'))
|
|||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
|
@ -217,8 +216,7 @@ if ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,8 +193,7 @@ if (empty($reshook))
|
|||
$object->generateDocument($model, $outputlangs, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -625,8 +624,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -640,8 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("errors");
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
|
@ -676,8 +673,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,8 +184,7 @@ if ($object->id)
|
|||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -280,8 +280,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
|
|||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
|
|
|||
|
|
@ -790,8 +790,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<td class="center nowraponall">';
|
||||
if ($productlot->id > 0)
|
||||
print $productlot->getNomUrl(1);
|
||||
else
|
||||
print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement.
|
||||
else print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement.
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['pl.eatby']['checked'])) {
|
||||
|
|
|
|||
|
|
@ -407,8 +407,7 @@ if (empty($reshook))
|
|||
$object->generateDocument($model, $outputlangs, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -593,8 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("errors");
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,8 +410,7 @@ class MultiCurrency extends CommonObject
|
|||
$this->rate = $currencyRate;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->rate = null;
|
||||
$this->errors = $currencyRate->errors;
|
||||
return -1;
|
||||
|
|
@ -533,8 +532,7 @@ class MultiCurrency extends CommonObject
|
|||
$resql = $db->query($sql1.$sql2.$sql3);
|
||||
|
||||
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE))
|
||||
{
|
||||
$resql = $db->query($sql1.$sql3);
|
||||
|
|
@ -669,8 +667,7 @@ class MultiCurrency extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING);
|
||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
||||
|
||||
|
|
|
|||
|
|
@ -252,8 +252,7 @@ if ($action == 'edit')
|
|||
$doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
|
||||
$doleditor->Create(0, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -309,8 +308,7 @@ print '</td></tr>';
|
|||
// Expire date
|
||||
print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">';
|
||||
if ($action == 'edit') print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0);
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date($object->date_fin, 'day');
|
||||
if ($object->date_fin && $object->date_fin < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) print img_warning($langs->trans("Expired"));
|
||||
}
|
||||
|
|
@ -410,8 +408,7 @@ if ($comments) {
|
|||
print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))." <br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("NoCommentYet").'<br>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,8 +200,7 @@ class Opensurveysondage extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
|
|
@ -263,8 +262,7 @@ class Opensurveysondage extends CommonObject
|
|||
$this->date_m = $this->db->jdate($obj->tls);
|
||||
$ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey);
|
||||
$this->error = 'Fetch no poll found for '.$sondage;
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
|
|
@ -273,8 +271,7 @@ class Opensurveysondage extends CommonObject
|
|||
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
$ret = -1;
|
||||
}
|
||||
|
|
@ -343,8 +340,7 @@ class Opensurveysondage extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -409,8 +405,7 @@ class Opensurveysondage extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,8 +114,7 @@ if ($resql)
|
|||
$input .= 'KO;';
|
||||
$somme[$k]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$input .= ';';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,8 +191,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
|||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
|
|
|||
|
|
@ -94,8 +94,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
|
|||
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)';
|
||||
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')";
|
||||
$resql = $db->query($sql);
|
||||
|
|
@ -262,8 +261,7 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D")
|
|||
|
||||
$adresseadmin = $object->mail_admin;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$erreur_ajout_date = "yes";
|
||||
}
|
||||
}
|
||||
|
|
@ -536,8 +534,7 @@ if (GETPOST('ajoutsujet'))
|
|||
print '<input type="submit" class="button" name="retoursondage" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '<br><br>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
$formother = new FormOther($db);
|
||||
|
|
@ -753,8 +750,7 @@ if ($object->format == "D")
|
|||
print '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Show titles
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
|
@ -841,8 +837,7 @@ while ($compteur < $num)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs
|
||||
if ($compteur == $ligneamodifier)
|
||||
{
|
||||
|
|
@ -869,8 +864,7 @@ while ($compteur < $num)
|
|||
print '</td>'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
for ($i = 0; $i < $nbcolonnes; $i++)
|
||||
{
|
||||
$car = substr($ensemblereponses, $i, 1);
|
||||
|
|
@ -1065,8 +1059,7 @@ for ($i = 0; $i < $nbcolonnes; $i++)
|
|||
$meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i], '%A').')' : '');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$tmps = explode('@', $toutsujet[$i]);
|
||||
$meilleursujet .= dol_htmlentities($tmps[0]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,8 +320,7 @@ if (is_integer($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"]
|
|||
{
|
||||
$motmois = dol_print_date(mktime(0, 0, 0, $_SESSION["mois"], 10), '%B');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$motmois = dol_print_date(dol_now(), '%B');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
|
|||
$testdate = true;
|
||||
$_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$testdate = true;
|
||||
$_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc');
|
||||
//$testdate = false;
|
||||
|
|
@ -193,8 +192,7 @@ if (GETPOST('choix_sondage'))
|
|||
print '<input type="hidden" name="choix_sondage" value="'.GETPOST('choix_sondage').'">';
|
||||
print '<br><input type="submit" class="button" name="submit" value="'.$langs->trans("CreatePoll").' ('.(GETPOST('choix_sondage') == 'date' ? $langs->trans("TypeDate") : $langs->trans("TypeClassic")).')">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Show image to selecte between date survey or other survey
|
||||
print '<br><table>'."\n";
|
||||
print '<tr><td>'.$langs->trans("CreateSurveyDate").'</td><td></td> '."\n";
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
|
@ -96,8 +95,7 @@ if ($action == "setlive")
|
|||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -152,8 +150,7 @@ if (empty($conf->global->PAYPAL_API_SANDBOX))
|
|||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
|||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + order_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
|
|
@ -130,8 +129,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
|||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + invoice_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
|
|
@ -148,8 +146,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
|||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + contractline_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
|
|
@ -166,8 +163,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
|||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + member_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
|
|
@ -264,8 +260,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
|
|||
header("Location: ".$payPalURL);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//Display a user friendly Error on the page using any of the following error information returned by PayPal
|
||||
$ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
|
||||
$ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
|
||||
|
|
@ -276,8 +271,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
|
|||
{
|
||||
$mesg .= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State).<br>Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS).<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$mesg = $langs->trans('SetExpressCheckoutAPICallFailed')."<br>\n";
|
||||
$mesg .= $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n";
|
||||
$mesg .= $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."<br>\n";
|
||||
|
|
@ -352,8 +346,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
|
|||
{
|
||||
$nvpstr = $nvpstr."&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$nvpstr = $nvpstr."&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory)
|
||||
}
|
||||
$nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType);
|
||||
|
|
@ -597,8 +590,7 @@ function hash_call($methodName, $nvpStr)
|
|||
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
|
||||
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$API_Endpoint = "https://api-3t.paypal.com/nvp";
|
||||
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
|
||||
}
|
||||
|
|
@ -677,8 +669,7 @@ function hash_call($methodName, $nvpStr)
|
|||
|
||||
//Execute the Error handling module to display errors.
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//closing the curl
|
||||
curl_close($ch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha'
|
|||
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
|
||||
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$API_Endpoint = "https://api-3t.paypal.com/nvp";
|
||||
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ if ($action == 'setconst' && $user->admin)
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
|
@ -94,8 +93,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
|
@ -162,8 +160,7 @@ if ($mode == 'setup' && $user->admin)
|
|||
{
|
||||
print $langs->trans("IsTokenGenerated");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans($key['varname']);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -197,8 +194,7 @@ if ($mode == 'setup' && $user->admin)
|
|||
$tokenobj = null;
|
||||
// Dolibarr storage
|
||||
$storage = new DoliStorage($db, $conf);
|
||||
try
|
||||
{
|
||||
try {
|
||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
||||
}
|
||||
catch (Exception $e)
|
||||
|
|
@ -268,14 +264,12 @@ if ($mode == 'config' && $user->admin)
|
|||
{
|
||||
print ajax_constantonoff($printer->active);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($conf->global->{$printer->conf}))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&varname='.$printer->active.'&value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&varname='.$printer->active.'&value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ $morehtml .= '</SELECT>';
|
|||
$morehtml .= '<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">';
|
||||
|
||||
if ($mine) $tooltiphelp = $langs->trans("MyTasksDesc");
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($user->rights->projet->all->lire && !$socid) $tooltiphelp = $langs->trans("TasksDesc");
|
||||
else $tooltiphelp = $langs->trans("TasksPublicDesc");
|
||||
}
|
||||
|
|
@ -171,8 +170,7 @@ if ($resql)
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
|
|
@ -228,8 +226,7 @@ if ($resql)
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
|
|
@ -340,8 +337,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_MONTH))
|
|||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
|
|
@ -392,8 +388,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_YEAR))
|
|||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
|
|
@ -581,8 +576,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ elseif ($search_usertoprocessid > 0)
|
|||
$usertoprocess->fetch($search_usertoprocessid);
|
||||
$search_usertoprocessid = $usertoprocess->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$usertoprocess = new User($db);
|
||||
}
|
||||
|
||||
|
|
@ -194,8 +193,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$result = $object->fetch($taskid, $ref);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -232,8 +230,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -247,8 +244,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -306,8 +302,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
|
|||
$object->timespent_datehour = dol_mktime(GETPOST($key."hour"), GETPOST($key."min"), 0, $monthofday, $dayofday, $yearofday);
|
||||
$object->timespent_withhour = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->timespent_datehour = dol_mktime(12, 0, 0, $monthofday, $dayofday, $yearofday);
|
||||
}
|
||||
$object->timespent_date = $object->timespent_datehour;
|
||||
|
|
@ -316,8 +311,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
|
|||
{
|
||||
$result = $object->addTimeSpent($user);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages("ErrorBadDate", null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
|
|
@ -340,8 +334,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
|
|||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -466,8 +459,7 @@ dol_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'task');
|
|||
// Show description of content
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0)
|
||||
{
|
||||
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -478,8 +470,7 @@ if ($mine || ($usertoprocess->id == $user->id))
|
|||
{
|
||||
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
|
@ -789,8 +780,7 @@ if (count($tasksarray) > 0)
|
|||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td colspan="14"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
|
|
|||
|
|
@ -103,8 +103,7 @@ elseif ($search_usertoprocessid > 0)
|
|||
$usertoprocess->fetch($search_usertoprocessid);
|
||||
$search_usertoprocessid = $usertoprocess->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$usertoprocess = new User($db);
|
||||
}
|
||||
|
||||
|
|
@ -150,8 +149,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$result = $object->fetch($taskid, $ref);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -189,8 +187,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -204,8 +201,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -226,8 +222,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
|
|||
{
|
||||
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($timetoadd as $taskid => $value) // Loop on each task
|
||||
{
|
||||
$updateoftaskdone = 0;
|
||||
|
|
@ -389,8 +384,7 @@ dol_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, 'task');
|
|||
// Show description of content
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0)
|
||||
{
|
||||
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -401,8 +395,7 @@ if ($mine || ($usertoprocess->id == $user->id))
|
|||
{
|
||||
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
|
@ -610,8 +603,7 @@ if (count($tasksarray) > 0)
|
|||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
|
|
|||
|
|
@ -111,8 +111,7 @@ elseif ($search_usertoprocessid > 0)
|
|||
$usertoprocess->fetch($search_usertoprocessid);
|
||||
$search_usertoprocessid = $usertoprocess->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$usertoprocess = new User($db);
|
||||
}
|
||||
|
||||
|
|
@ -206,8 +205,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$result = $object->fetch($taskid, $ref);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -245,8 +243,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -260,8 +257,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
|
|||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -282,8 +278,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
|
|||
{
|
||||
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($timetoadd as $taskid => $value) // Loop on each task
|
||||
{
|
||||
$updateoftaskdone = 0;
|
||||
|
|
@ -482,8 +477,7 @@ dol_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'task');
|
|||
// Show description of content
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($usertoprocess->id) || $usertoprocess->id < 0)
|
||||
{
|
||||
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>';
|
||||
|
|
@ -494,8 +488,7 @@ if ($mine || ($usertoprocess->id == $user->id))
|
|||
{
|
||||
print $langs->trans("OnlyYourTaskAreVisible").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
|
@ -838,8 +831,7 @@ if (count($tasksarray) > 0)
|
|||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ if ($action == 'updateMask')
|
|||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -83,8 +82,7 @@ if ($action == 'updateMaskTask')
|
|||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -121,14 +119,12 @@ elseif ($action == 'specimen')
|
|||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
|
|
@ -166,14 +162,12 @@ elseif ($action == 'specimentask')
|
|||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project_task&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
|
|
@ -385,8 +379,7 @@ foreach ($dirmodels as $reldir)
|
|||
{
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -405,8 +398,7 @@ foreach ($dirmodels as $reldir)
|
|||
{
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
|
@ -486,8 +478,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
{
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodtask&value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -506,8 +497,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
{
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
|
@ -556,8 +546,7 @@ if ($resql)
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -625,8 +614,7 @@ foreach ($dirmodels as $reldir)
|
|||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td class=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
|
|
@ -638,8 +626,7 @@ foreach ($dirmodels as $reldir)
|
|||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -664,8 +651,7 @@ foreach ($dirmodels as $reldir)
|
|||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -713,8 +699,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -782,8 +767,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td class=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
|
|
@ -795,8 +779,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -821,8 +804,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimentask&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -863,8 +845,7 @@ if (!$conf->use_javascript_ajax)
|
|||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td width="60" class="right">';
|
||||
$arrval = array('0'=>$langs->trans("No"),
|
||||
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
|
||||
|
|
|
|||
|
|
@ -103,8 +103,7 @@ if (empty($reshook))
|
|||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog($object->error, LOG_DEBUG);
|
||||
setEventMessages($langs->trans("CantRemoveProject", $langs->transnoentitiesnoconv("ProjectOverview")), null, 'errors');
|
||||
}
|
||||
|
|
@ -184,8 +183,7 @@ if (empty($reshook))
|
|||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$error++;
|
||||
|
|
@ -213,21 +211,18 @@ if (empty($reshook))
|
|||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location:card.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
|
|
@ -335,8 +330,7 @@ if (empty($reshook))
|
|||
$db->rollback();
|
||||
$action = 'edit';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->commit();
|
||||
|
||||
if (GETPOST('socid', 'int') > 0) $object->fetch_thirdparty(GETPOST('socid', 'int'));
|
||||
|
|
@ -377,8 +371,7 @@ if (empty($reshook))
|
|||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||
if ($ret)
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
else
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -421,8 +414,7 @@ if (empty($reshook))
|
|||
header("Location: list.php?restore_lastsearch_values=1");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog($object->error, LOG_DEBUG);
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
@ -443,8 +435,7 @@ if (empty($reshook))
|
|||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Load new object
|
||||
$newobject = new Project($db);
|
||||
$newobject->fetch($result);
|
||||
|
|
@ -704,8 +695,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
}
|
||||
|
|
@ -985,8 +975,7 @@ elseif ($object->id > 0)
|
|||
|
||||
print '</table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
|
||||
|
||||
// Project card
|
||||
|
|
@ -1240,8 +1229,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1253,8 +1241,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Validate').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1266,8 +1253,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=close">'.$langs->trans("Close").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Close').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1279,8 +1265,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ReOpen').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1347,8 +1332,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=clone">'.$langs->trans('ToClone').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ToClone').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1360,8 +1344,7 @@ elseif ($object->id > 0)
|
|||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1419,8 +1402,7 @@ elseif ($object->id > 0)
|
|||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("RecordNotFound");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -453,8 +453,7 @@ class Projects extends DolibarrApi
|
|||
{
|
||||
return $this->get($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
throw new RestException(500, $this->project->error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,8 +451,7 @@ class Tasks extends DolibarrApi
|
|||
{
|
||||
return $this->get($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
throw new RestException(500, $this->task->error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,8 +307,7 @@ class Project extends CommonObject
|
|||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errno = $this->db->lasterrno();
|
||||
$error++;
|
||||
|
|
@ -334,8 +333,7 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -442,14 +440,12 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
$result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$result = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
|
|
@ -457,15 +453,13 @@ class Project extends CommonObject
|
|||
{
|
||||
$result = -4;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = -2;
|
||||
}
|
||||
dol_syslog(get_class($this)."::update error ".$result." ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog(get_class($this)."::update ref null");
|
||||
$result = -1;
|
||||
}
|
||||
|
|
@ -554,8 +548,7 @@ class Project extends CommonObject
|
|||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -606,12 +599,11 @@ class Project extends CommonObject
|
|||
{
|
||||
$sql = 'SELECT l.rowid, l.fk_user_author as fk_user FROM '.MAIN_DB_PREFIX."loan as l WHERE l.entity IN (".getEntity('loan').") AND l.fk_projet IN (".$ids.")";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$ids.") AND entity IN (".getEntity($type).")";
|
||||
}
|
||||
|
||||
if($dates > 0 && $type == 'loan'){
|
||||
if ($dates > 0 && $type == 'loan'){
|
||||
$sql .= " AND (dateend > '".$this->db->idate($dates)."' OR dateend IS NULL)";
|
||||
}
|
||||
elseif ($dates > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
|
|
@ -621,7 +613,7 @@ class Project extends CommonObject
|
|||
$sql .= " AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)";
|
||||
}
|
||||
|
||||
if($datee > 0 && $type == 'loan'){
|
||||
if ($datee > 0 && $type == 'loan'){
|
||||
$sql .= " AND (datestart < '".$this->db->idate($datee)."' OR datestart IS NULL)";
|
||||
}
|
||||
elseif ($datee > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
|
|
@ -655,8 +647,7 @@ class Project extends CommonObject
|
|||
/* Return array even if empty*/
|
||||
return $elements;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
|
@ -807,8 +798,7 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
|
|
@ -901,16 +891,14 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$this->error = join(',', $this->errors);
|
||||
dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
|
|
@ -961,16 +949,14 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$this->error = join(',', $this->errors);
|
||||
dol_syslog(get_class($this)."::setClose ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
|
|
@ -1077,8 +1063,7 @@ class Project extends CommonObject
|
|||
{
|
||||
$url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
|
||||
}
|
||||
// Add param to save lastsearch_values or not
|
||||
|
|
@ -1199,8 +1184,7 @@ class Project extends CommonObject
|
|||
{
|
||||
$userAccess = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach (array('internal', 'external') as $source)
|
||||
{
|
||||
$userRole = $this->liste_contact(4, $source);
|
||||
|
|
@ -1272,7 +1256,7 @@ class Project extends CommonObject
|
|||
$resql = $this->db->query($sql2);
|
||||
if ($resql)
|
||||
{
|
||||
while($obj = $this->db->fetch_object($resql))
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$listofprojectcontacttype[$obj->rowid]=$obj->code;
|
||||
}
|
||||
|
|
@ -1325,8 +1309,7 @@ class Project extends CommonObject
|
|||
return $result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
|
@ -1434,8 +1417,7 @@ class Project extends CommonObject
|
|||
$clone_project->note_private = '';
|
||||
$clone_project->note_public = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->begin();
|
||||
$res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public');
|
||||
if ($res < 0)
|
||||
|
|
@ -1444,8 +1426,7 @@ class Project extends CommonObject
|
|||
$error++;
|
||||
$this->db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
|
|
@ -1457,8 +1438,7 @@ class Project extends CommonObject
|
|||
$error++;
|
||||
$this->db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
}
|
||||
}
|
||||
|
|
@ -1482,8 +1462,7 @@ class Project extends CommonObject
|
|||
$this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($clone_project->error != '')
|
||||
{
|
||||
$this->error .= $clone_project->error;
|
||||
|
|
@ -1515,8 +1494,7 @@ class Project extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error .= $langs->trans('ErrorInternalErrorDetected').':dol_mkdir';
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1546,8 +1524,7 @@ class Project extends CommonObject
|
|||
$this->error .= $result_clone->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$new_task_id = $result_clone;
|
||||
$taskstatic->fetch($tasktoclone->id);
|
||||
|
||||
|
|
@ -1586,8 +1563,7 @@ class Project extends CommonObject
|
|||
$this->db->commit();
|
||||
return $clone_project_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
|
|
@ -1681,8 +1657,7 @@ class Project extends CommonObject
|
|||
$sql .= " SET fk_project=".$this->id;
|
||||
$sql .= " WHERE id=".$elementSelectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " SET fk_projet=".$this->id;
|
||||
$sql .= " WHERE rowid=".$elementSelectId;
|
||||
}
|
||||
|
|
@ -1716,8 +1691,7 @@ class Project extends CommonObject
|
|||
{
|
||||
$sql .= " SET fk_project=NULL";
|
||||
$sql .= " WHERE id=".$elementSelectId;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
$sql .= " SET ".$projectfield."=NULL";
|
||||
$sql .= " WHERE rowid=".$elementSelectId;
|
||||
}
|
||||
|
|
@ -1809,8 +1783,7 @@ class Project extends CommonObject
|
|||
$this->weekWorkLoad[$day] = $obj->task_duration;
|
||||
$this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->weekWorkLoad[$day] += $obj->task_duration;
|
||||
$this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
|
||||
}
|
||||
|
|
@ -1820,8 +1793,7 @@ class Project extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
|
|
@ -1876,8 +1848,7 @@ class Project extends CommonObject
|
|||
$this->monthWorkLoad[$week_number] = $obj->task_duration;
|
||||
$this->monthWorkLoadPerTask[$week_number][$obj->fk_task] = $obj->task_duration;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->monthWorkLoad[$week_number] += $obj->task_duration;
|
||||
$this->monthWorkLoadPerTask[$week_number][$obj->fk_task] += $obj->task_duration;
|
||||
}
|
||||
|
|
@ -1887,8 +1858,7 @@ class Project extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
|
|
@ -1958,8 +1928,7 @@ class Project extends CommonObject
|
|||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2017,8 +1986,7 @@ class Project extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
|
|
@ -2085,8 +2053,7 @@ class Project extends CommonObject
|
|||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,7 @@ class ProjectStats extends Stats
|
|||
$row[0]
|
||||
);
|
||||
}
|
||||
else
|
||||
$other += $row[1];
|
||||
else $other += $row[1];
|
||||
$i++;
|
||||
}
|
||||
if ($num > $limit)
|
||||
|
|
@ -282,8 +281,7 @@ class ProjectStats extends Stats
|
|||
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
|
||||
}
|
||||
}
|
||||
|
|
@ -294,8 +292,7 @@ class ProjectStats extends Stats
|
|||
dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate.".");
|
||||
$data = json_decode(file_get_contents($newpathofdestfile), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$year = $startyear;
|
||||
while ($year <= $endyear)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -226,8 +226,7 @@ class Task extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
|
|
@ -329,8 +328,7 @@ class Task extends CommonObject
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -440,8 +438,7 @@ class Task extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -544,8 +541,7 @@ class Task extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//Delete associated link file
|
||||
if ($conf->projet->dir_output)
|
||||
{
|
||||
|
|
@ -590,8 +586,7 @@ class Task extends CommonObject
|
|||
dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
else
|
||||
{
|
||||
else {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) $ret = $obj->nb;
|
||||
$this->db->free($resql);
|
||||
|
|
@ -601,8 +596,7 @@ class Task extends CommonObject
|
|||
{
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -624,8 +618,7 @@ class Task extends CommonObject
|
|||
dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
else
|
||||
{
|
||||
else {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) $ret = $obj->nb;
|
||||
$this->db->free($resql);
|
||||
|
|
@ -635,8 +628,7 @@ class Task extends CommonObject
|
|||
{
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -817,8 +809,7 @@ class Task extends CommonObject
|
|||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec2";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
if ($includebilltime)
|
||||
{
|
||||
|
|
@ -975,8 +966,7 @@ class Task extends CommonObject
|
|||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
|
@ -1055,8 +1045,7 @@ class Task extends CommonObject
|
|||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
|
@ -1080,7 +1069,7 @@ class Task extends CommonObject
|
|||
while ($i < $num)
|
||||
{
|
||||
if ($source == 'thirdparty') $contactAlreadySelected[$i] = $tab[$i]['socid'];
|
||||
else $contactAlreadySelected[$i] = $tab[$i]['id'];
|
||||
else $contactAlreadySelected[$i] = $tab[$i]['id'];
|
||||
$i++;
|
||||
}
|
||||
return $contactAlreadySelected;
|
||||
|
|
@ -1148,8 +1137,7 @@ class Task extends CommonObject
|
|||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$ret = -1;
|
||||
}
|
||||
|
|
@ -1185,8 +1173,7 @@ class Task extends CommonObject
|
|||
{
|
||||
$this->db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
}
|
||||
return $ret;
|
||||
|
|
@ -1247,8 +1234,7 @@ class Task extends CommonObject
|
|||
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -1304,8 +1290,7 @@ class Task extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -1357,8 +1342,7 @@ class Task extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1444,8 +1428,7 @@ class Task extends CommonObject
|
|||
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
|
|
@ -1511,8 +1494,7 @@ class Task extends CommonObject
|
|||
}
|
||||
else $ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
$ret = -1;
|
||||
|
|
@ -1583,8 +1565,7 @@ class Task extends CommonObject
|
|||
{
|
||||
$result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$result = -2;
|
||||
}
|
||||
|
|
@ -1601,8 +1582,7 @@ class Task extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -1715,8 +1695,7 @@ class Task extends CommonObject
|
|||
$clone_task->note_private = '';
|
||||
$clone_task->note_public = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->begin();
|
||||
$res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public');
|
||||
if ($res < 0)
|
||||
|
|
@ -1725,8 +1704,7 @@ class Task extends CommonObject
|
|||
$error++;
|
||||
$this->db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
|
|
@ -1738,8 +1716,7 @@ class Task extends CommonObject
|
|||
$error++;
|
||||
$this->db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
}
|
||||
}
|
||||
|
|
@ -1759,8 +1736,7 @@ class Task extends CommonObject
|
|||
$projectstatic->fetch($project_id);
|
||||
$clone_project_ref = $projectstatic->ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$clone_project_ref = $ori_project_ref;
|
||||
}
|
||||
|
||||
|
|
@ -1808,8 +1784,7 @@ class Task extends CommonObject
|
|||
$this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($clone_task->error != '')
|
||||
{
|
||||
$this->error .= $clone_task->error;
|
||||
|
|
@ -1834,8 +1809,7 @@ class Task extends CommonObject
|
|||
$this->db->commit();
|
||||
return $clone_task_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
|
|
@ -2039,8 +2013,7 @@ class Task extends CommonObject
|
|||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2088,8 +2061,7 @@ class Task extends CommonObject
|
|||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,7 @@ class TaskStats extends Stats
|
|||
$row[0]
|
||||
);
|
||||
}
|
||||
else
|
||||
$other += $row[1];
|
||||
else $other += $row[1];
|
||||
$i++;
|
||||
}
|
||||
if ($num > $limit)
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ print '<table class="border centpercent">';
|
|||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) print $langs->trans('SharedProject');
|
||||
else
|
||||
print $langs->trans('PrivateProject');
|
||||
else print $langs->trans('PrivateProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - end
|
||||
|
|
|
|||
|
|
@ -74,15 +74,13 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
|
|||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -95,8 +93,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
|
|||
{
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -112,8 +109,7 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr
|
|||
header("Location: contact.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,8 +158,7 @@ if ($object->id > 0)
|
|||
$permtoedit = ($userWrite > 0);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error('', 'NoRecordFound');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -528,24 +528,24 @@ $listofreferent = array(
|
|||
|
||||
// Change rules for benefit calculation
|
||||
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) {
|
||||
foreach($listofreferent as $key => $element) {
|
||||
foreach ($listofreferent as $key => $element) {
|
||||
if ($listofreferent[$key]['margin'] == 'add') {
|
||||
unset($listofreferent[$key]['margin']);
|
||||
}
|
||||
}
|
||||
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN);
|
||||
foreach($newelementforplusmargin as $value) {
|
||||
foreach ($newelementforplusmargin as $value) {
|
||||
$listofreferent[$value]['margin']='add';
|
||||
}
|
||||
}
|
||||
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) {
|
||||
foreach($listofreferent as $key => $element) {
|
||||
foreach ($listofreferent as $key => $element) {
|
||||
if ($listofreferent[$key]['margin'] == 'add') {
|
||||
unset($listofreferent[$key]['margin']);
|
||||
}
|
||||
}
|
||||
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN);
|
||||
foreach($newelementforplusmargin as $value) {
|
||||
foreach ($newelementforplusmargin as $value) {
|
||||
$listofreferent[$value]['margin']='minus';
|
||||
}
|
||||
}
|
||||
|
|
@ -686,8 +686,7 @@ foreach ($listofreferent as $key => $value)
|
|||
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
|
||||
$total_ht_by_line = price2num($tmp['amount'], 'MT');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$tmp = $element->getSumOfAmount('', $dates, $datee);
|
||||
$total_ht_by_line = price2num($tmp['amount'], 'MT');
|
||||
}
|
||||
|
|
@ -953,8 +952,7 @@ foreach ($listofreferent as $key => $value)
|
|||
{
|
||||
if (method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$expensereport = new ExpenseReport($db);
|
||||
$expensereport->fetch($element->fk_expensereport);
|
||||
}
|
||||
|
|
@ -1000,8 +998,7 @@ foreach ($listofreferent as $key => $value)
|
|||
{
|
||||
print $expensereport->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Show ref with link
|
||||
if ($element instanceof Task)
|
||||
{
|
||||
|
|
@ -1054,8 +1051,7 @@ foreach ($listofreferent as $key => $value)
|
|||
elseif ($tablename == 'supplier_proposal') $date = $element->date_validation; // There is no other date for this
|
||||
elseif ($tablename == 'fichinter') $date = $element->datev; // There is no other date for this
|
||||
elseif ($tablename == 'projet_task') $date = ''; // We show no date. Showing date of beginning of task make user think it is date of time consumed
|
||||
else
|
||||
{
|
||||
else {
|
||||
$date = $element->date; // invoice, ...
|
||||
if (empty($date)) $date = $element->date_contrat;
|
||||
if (empty($date)) $date = $element->datev;
|
||||
|
|
@ -1145,14 +1141,12 @@ foreach ($listofreferent as $key => $value)
|
|||
$warning = $langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled"));
|
||||
}
|
||||
}
|
||||
elseif ($key == 'loan') $total_ht_by_line = $element->capital;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$total_ht_by_line = $element->total_ht;
|
||||
}
|
||||
|
||||
|
|
@ -1193,14 +1187,12 @@ foreach ($listofreferent as $key => $value)
|
|||
$defaultvat = get_default_tva($mysoc, $mysoc);
|
||||
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled"));
|
||||
}
|
||||
}
|
||||
elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment();
|
||||
else
|
||||
{
|
||||
else {
|
||||
$total_ttc_by_line = $element->total_ttc;
|
||||
}
|
||||
|
||||
|
|
@ -1248,8 +1240,7 @@ foreach ($listofreferent as $key => $value)
|
|||
{
|
||||
print $element->getLibStatut(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $element->getLibStatut(5);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1324,8 +1315,7 @@ foreach ($listofreferent as $key => $value)
|
|||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!is_array($elementarray)) // error
|
||||
{
|
||||
print $elementarray;
|
||||
|
|
|
|||
|
|
@ -196,8 +196,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
|
|||
{
|
||||
$parent = '-'.$project_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$parent = $task["task_parent_alternate_id"];
|
||||
//$parent = $task["task_parent"];
|
||||
}
|
||||
|
|
@ -209,8 +208,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
|
|||
//$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]);
|
||||
$link = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$link = DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -380,14 +380,12 @@ if (count($tasksarray) > 0)
|
|||
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("admin");
|
||||
print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<div class="opacitymedium">'.$langs->trans("NoTasks").'</div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,8 +99,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
|||
|
||||
print "<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ $morehtml .= '<input type="submit" class="button" name="refresh" value="'.$langs
|
|||
$morehtml .= '</form>';
|
||||
|
||||
if ($mine) $tooltiphelp = $langs->trans("MyProjectsDesc");
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($user->rights->projet->all->lire) && !$socid) $tooltiphelp = $langs->trans("ProjectsDesc");
|
||||
else $tooltiphelp = $langs->trans("ProjectsPublicDesc");
|
||||
}
|
||||
|
|
@ -328,8 +327,7 @@ if ($resql)
|
|||
|
||||
print $companystatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("OthersNotLinkedToThirdParty");
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -354,8 +352,7 @@ if ($resql)
|
|||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ if (GETPOST('actioncode', 'array'))
|
|||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
|
|
|||
|
|
@ -234,8 +234,7 @@ if (empty($reshook))
|
|||
setEventMessages($langs->trans("DontHaveTheValidateStatus", $objecttmp->ref), null, 'warnings');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
|
|
@ -248,8 +247,7 @@ if (empty($reshook))
|
|||
else setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -459,8 +457,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
|||
// Show description of content
|
||||
$texthelp = '';
|
||||
if ($search_project_user == $user->id) $texthelp .= $langs->trans("MyProjectsDesc");
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("ProjectsDesc");
|
||||
else $texthelp .= $langs->trans("ProjectsPublicDesc");
|
||||
}
|
||||
|
|
@ -753,8 +750,7 @@ while ($i < min($num, $limit))
|
|||
{
|
||||
print $socstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -795,8 +791,7 @@ while ($i < min($num, $limit))
|
|||
}
|
||||
//else print $langs->trans("NoSalesRepresentativeAffected");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -274,16 +274,14 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
|||
{
|
||||
$result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("projects");
|
||||
setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings');
|
||||
$duplicate_code_error = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($task->error, $task->errors, 'errors');
|
||||
}
|
||||
$action = 'create';
|
||||
|
|
@ -306,8 +304,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
|||
$id = $projectid;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
|
|
@ -508,8 +505,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
print $langs->trans("WarningProjectClosed");
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
|
|
@ -537,8 +533,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
{
|
||||
print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $defaultref;
|
||||
}
|
||||
print '<input type="hidden" name="taskref" value="'.($_POST["ref"] ? $_POST["ref"] : $defaultref).'">';
|
||||
|
|
@ -559,8 +554,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
{
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("NoUserAssignedToTheProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -812,8 +806,7 @@ elseif ($id > 0 || !empty($ref))
|
|||
$j = 0; $level = 0;
|
||||
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$colspan = 10;
|
||||
if ($object->usage_bill_time) $colspan += 2;
|
||||
print '<tr class="oddeven nobottom"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoTasks").'</span></td></tr>';
|
||||
|
|
@ -837,8 +830,7 @@ elseif ($id > 0 || !empty($ref))
|
|||
cleanCorruptedTree($db, 'projet_task', 'fk_task_parent');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($nboftaskshown < count($tasksarray) && !GETPOST('search_user_id', 'int'))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
|
|
|||
|
|
@ -75,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
{
|
||||
$id = $objectsarray[0]->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
|
|||
{
|
||||
dol_print_error($db, $projectstatic->error, $projectstatic->errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$contactsofproject = $projectstatic->getListContactId('internal');
|
||||
foreach ($contactsofproject as $key => $val)
|
||||
{
|
||||
|
|
@ -78,8 +77,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $object->add_contact($idfortaskuser, GETPOST("type"), GETPOST("source"));
|
||||
}
|
||||
}
|
||||
|
|
@ -89,15 +87,13 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -110,8 +106,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
|
|||
{
|
||||
$result = $object->swapContactStatus(GETPOST('ligne'));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -127,8 +122,7 @@ if ($action == 'deleteline' && $user->rights->projet->creer)
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -143,8 +137,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
{
|
||||
$id = $tasksarray[0]->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
|
||||
exit;
|
||||
}
|
||||
|
|
@ -546,8 +539,7 @@ if ($id > 0 || !empty($ref))
|
|||
}
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "ErrorRecordNotFound";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
$id = $tasksarray[0]->id;
|
||||
$object->fetch($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
|
||||
exit;
|
||||
}
|
||||
|
|
@ -104,8 +103,7 @@ if ($id > 0 || !empty($ref))
|
|||
|
||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -319,8 +317,7 @@ if ($object->id > 0)
|
|||
$relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -437,8 +437,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
|||
// Show description of content
|
||||
$texthelp = '';
|
||||
if ($search_task_user == $user->id) $texthelp .= $langs->trans("MyTasksDesc");
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("TasksOnProjectsDesc");
|
||||
else $texthelp .= $langs->trans("TasksOnProjectsPublicDesc");
|
||||
}
|
||||
|
|
@ -754,8 +753,7 @@ while ($i < min($num, $limit))
|
|||
$socstatic->name = $obj->name;
|
||||
print $socstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -857,8 +855,7 @@ while ($i < min($num, $limit))
|
|||
$totalarray['val']['t.tobill'] += $obj->tobill;
|
||||
$totalarray['totaltobill'] += $obj->tobill;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -876,8 +873,7 @@ while ($i < min($num, $limit))
|
|||
$totalarray['val']['t.billed'] += $obj->billed;
|
||||
$totalarray['totalbilled'] += $obj->billed;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ if ($id > 0 || !empty($ref))
|
|||
|
||||
$object->project = clone $projectstatic;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -76,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
$id = $tasksarray[0]->id;
|
||||
$object->fetch($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,8 +114,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
|
|
@ -132,8 +131,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s
|
|||
header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
|
|
@ -150,8 +148,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
{
|
||||
$id = $tasksarray[0]->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
|
||||
}
|
||||
}
|
||||
|
|
@ -463,8 +460,7 @@ if ($id > 0 || !empty($ref))
|
|||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/*
|
||||
* Fiche tache en mode visu
|
||||
*/
|
||||
|
|
@ -606,8 +602,7 @@ if ($id > 0 || !empty($ref))
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&withproject='.$withproject.'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
|
|
@ -618,13 +613,11 @@ if ($id > 0 || !empty($ref))
|
|||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&withproject='.$withproject.'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,16 +155,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||
{
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors');
|
||||
$action = 'createtime';
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->fetch(GETPOST('taskid', 'int'));
|
||||
}
|
||||
}
|
||||
|
|
@ -179,8 +177,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||
$action = 'createtime';
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->timespent_note = $_POST["timespent_note"];
|
||||
if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
|
||||
$object->timespent_duration = $_POST["timespent_durationhour"] * 60 * 60; // We store duration in seconds
|
||||
|
|
@ -190,8 +187,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||
$object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
||||
$object->timespent_withhour = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
||||
}
|
||||
$object->timespent_fk_user = $_POST["userid"];
|
||||
|
|
@ -200,16 +196,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||
{
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($id)) $action = 'createtime';
|
||||
else $action = 'createtime';
|
||||
}
|
||||
|
|
@ -245,8 +239,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
|
|||
$object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
|
||||
$object->timespent_withhour = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
|
||||
}
|
||||
$object->timespent_fk_user = $_POST["userid_line"];
|
||||
|
|
@ -255,14 +248,12 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
|
|||
{
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->fetch($id, $ref);
|
||||
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
|
||||
|
||||
|
|
@ -276,8 +267,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
|
|||
$object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
|
||||
$object->timespent_withhour = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
|
||||
}
|
||||
$object->timespent_fk_user = $_POST["userid_line"];
|
||||
|
|
@ -287,15 +277,13 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
|
|||
{
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -313,8 +301,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->l
|
|||
$error++;
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
|
@ -329,8 +316,7 @@ if (!empty($project_ref) && !empty($withproject))
|
|||
{
|
||||
$id = $tasksarray[0]->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
|
||||
exit;
|
||||
}
|
||||
|
|
@ -368,8 +354,7 @@ if ($action == 'confirm_generateinvoice')
|
|||
{
|
||||
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
|
@ -408,8 +393,7 @@ if ($action == 'confirm_generateinvoice')
|
|||
$localtax1 = $dataforprice['localtax1'];
|
||||
$localtax2 = $dataforprice['localtax2'];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu_ht = 0;
|
||||
$txtva = get_default_tva($mysoc, $projectstatic->thirdparty);
|
||||
$localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1);
|
||||
|
|
@ -570,8 +554,7 @@ if ($action == 'confirm_generateinvoice')
|
|||
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -760,14 +743,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
|
||||
$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
|
||||
}
|
||||
else // We are on tab 'Time Spent' of task
|
||||
else // We are on tab 'Time Spent' of task
|
||||
{
|
||||
$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
|
||||
$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$linktocreatetimeBtnStatus = -2;
|
||||
$linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject");
|
||||
}
|
||||
|
|
@ -1070,8 +1052,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
|
@ -1094,8 +1075,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- List of time spent for project -->'."\n";
|
||||
|
||||
$title = $langs->trans("ListTaskTimeForTask");
|
||||
|
|
@ -1112,8 +1092,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
@ -1172,8 +1151,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
if ($projectstatic->public) $contactsofproject = array();
|
||||
print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($nboftasks) {
|
||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
|
|
@ -1335,8 +1313,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
}
|
||||
else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1353,8 +1330,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
{
|
||||
$formproject->selectTasks(-1, GETPOST('taskid', 'int') ?GETPOST('taskid', 'int') : $task_time->fk_task, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$tasktmp->id = $task_time->fk_task;
|
||||
$tasktmp->ref = $task_time->ref;
|
||||
$tasktmp->label = $task_time->label;
|
||||
|
|
@ -1395,8 +1371,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$userstatic->id = $task_time->fk_user;
|
||||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
|
|
@ -1416,8 +1391,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
{
|
||||
print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_nl2br($task_time->note);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1437,8 +1411,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
|
||||
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print convertSecondToTime($task_time->task_duration, 'allhourmin');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1479,13 +1452,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print $tmpinvoice->getNomUrl(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("No");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1569,8 +1540,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
}
|
||||
else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1619,8 +1589,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$userstatic->id = $task_time->fk_user;
|
||||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
|
|
@ -1639,8 +1608,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
{
|
||||
print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_nl2br($task_time->note);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1659,8 +1627,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
|
||||
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print convertSecondToTime($task_time->task_duration, 'allhourmin');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1717,8 +1684,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
}
|
||||
else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1767,8 +1733,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$userstatic->id = $task_time->fk_user;
|
||||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
|
|
@ -1787,8 +1752,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
{
|
||||
print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print dol_nl2br($task_time->note);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1807,8 +1771,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print '<input type="hidden" name="old_duration_2" value="0">';
|
||||
print $form->select_duration('new_duration_2', 0, 0, 'text');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print convertSecondToTime($task_time->task_duration, 'allhourmin');
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -189,8 +189,7 @@ if ($format == 'ical' || $format == 'vcal')
|
|||
//header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print 'Error '.$agenda->error;
|
||||
|
||||
exit;
|
||||
|
|
@ -227,8 +226,7 @@ if ($format == 'rss')
|
|||
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print 'Error '.$agenda->error;
|
||||
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -91,8 +91,7 @@ if ($result < 0)
|
|||
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($user->id))
|
||||
{
|
||||
echo " User login:".$userlogin." do not exists";
|
||||
|
|
@ -168,8 +167,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0))
|
|||
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($result == 0)
|
||||
{
|
||||
echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n";
|
||||
|
|
@ -207,8 +205,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0))
|
|||
dol_syslog("cron_run_jobs.php::run_jobs Error".$cronjob->error, LOG_ERR);
|
||||
$nbofjobslaunchedko++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$nbofjobslaunchedok++;
|
||||
}
|
||||
|
||||
|
|
@ -226,8 +223,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0))
|
|||
|
||||
echo " - reprogrammed\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo " - not qualified\n";
|
||||
|
||||
dol_syslog("cron_run_jobs.php job not qualified line->datenextrun:".dol_print_date($line->datenextrun, 'dayhourrfc')." line->datestart:".dol_print_date($line->datestart, 'dayhourrfc')." line->dateend:".dol_print_date($line->dateend, 'dayhourrfc')." now:".dol_print_date($now, 'dayhourrfc'));
|
||||
|
|
@ -238,8 +234,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0))
|
|||
|
||||
echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok + $nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo "Result: No active jobs found.";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,8 +144,7 @@ foreach ($modulesdir as $dir)
|
|||
|
||||
if ($modName)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
|
||||
|
|
@ -153,8 +152,7 @@ foreach ($modulesdir as $dir)
|
|||
{
|
||||
$j = $objMod->numero;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$j = 1000 + $i;
|
||||
}
|
||||
|
||||
|
|
@ -381,8 +379,7 @@ foreach ($demoprofiles as $profilearray)
|
|||
print "\n".'<!-- Module '.$modulekeyname.' hidden and always checked -->';
|
||||
print '<input type="hidden" name="'.$modulekeyname.'" value="1">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$modulo = ($j % $nbcolsmod);
|
||||
//if ($modulo == 0) print '<tr>';
|
||||
print '<!-- id='.$val->numero.' -->';
|
||||
|
|
@ -435,8 +432,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIEN
|
|||
print '</script>'."\n";
|
||||
print '</div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- google js advert tag disabled with jmobile -->'."\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ if ($resql)
|
|||
{
|
||||
print "<td>".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td>Anonyme Anonyme</td>\n";
|
||||
}
|
||||
print "<td>".dol_print_date($db->jdate($objp->datedon))."</td>\n";
|
||||
|
|
@ -99,13 +98,11 @@ if ($resql)
|
|||
}
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "Aucun don publique";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -391,8 +391,7 @@ if ($action == 'add')
|
|||
{
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
|
|
@ -408,8 +407,7 @@ if ($action == 'add')
|
|||
{
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
|
|
@ -425,8 +423,7 @@ if ($action == 'add')
|
|||
{
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
|
|
@ -442,14 +439,12 @@ if ($action == 'add')
|
|||
{
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment");
|
||||
exit;
|
||||
}
|
||||
|
|
@ -458,8 +453,7 @@ if ($action == 'add')
|
|||
if (!empty($entity)) $urlback .= '&entity='.$entity;
|
||||
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$errmsg .= join('<br>', $adh->errors);
|
||||
}
|
||||
|
|
@ -472,8 +466,7 @@ if ($action == 'add')
|
|||
Header("Location: ".$urlback);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -575,8 +568,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE))
|
|||
print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
||||
print '<input type="hidden" id="type" name="type" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
|
||||
}
|
||||
|
|
@ -589,8 +581,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY))
|
|||
print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
|
||||
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">';
|
||||
}
|
||||
|
|
@ -733,8 +724,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)
|
|||
{
|
||||
print '<input type="text" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input type="text" name="amount" id="amounthidden" class="flat amount" disabled size="6" value="'.$amount.'">';
|
||||
print '<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ if ($id > 0)
|
|||
{
|
||||
print $langs->trans("ErrorThisMemberIsNotPublic");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<table class="public_border" cellspacing="0" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Type").'</td><td class="valeur">'.$object->type."</td></tr>\n";
|
||||
|
|
|
|||
|
|
@ -153,8 +153,7 @@ if ($result)
|
|||
print $form->showphoto('memberphoto', $objp, 64);
|
||||
print '</td>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td> </td>\n";
|
||||
}
|
||||
print "</tr>";
|
||||
|
|
@ -162,8 +161,7 @@ if ($result)
|
|||
}
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml'
|
|||
print 'Sorry, it seems your internet connexion is off.<br>';
|
||||
print 'You need to be connected to network to use this software.<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("error");
|
||||
$langs->load("other");
|
||||
|
||||
|
|
|
|||
|
|
@ -236,8 +236,7 @@ if ($source == 'proposal')
|
|||
$mesg = $proposal->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $proposal->fetch_thirdparty($proposal->socid);
|
||||
}
|
||||
|
||||
|
|
@ -277,13 +276,11 @@ if ($action != 'dosign')
|
|||
if ($found && !$error) // We are in a management option and no error
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error_email('ERRORNEWONLINESIGN');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Print
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,8 +133,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
|
|||
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)';
|
||||
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')";
|
||||
$resql = $db->query($sql);
|
||||
|
|
@ -173,8 +172,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
|
|||
else dol_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -392,8 +390,7 @@ if ($object->format == "D")
|
|||
print '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//display of survey topics
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
|
@ -481,8 +478,7 @@ while ($compteur < $num)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs
|
||||
if ($compteur == $ligneamodifier)
|
||||
{
|
||||
|
|
@ -509,8 +505,7 @@ while ($compteur < $num)
|
|||
print '</td>'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
for ($i = 0; $i < $nbcolonnes; $i++)
|
||||
{
|
||||
$car = substr($ensemblereponses, $i, 1);
|
||||
|
|
@ -695,8 +690,7 @@ if ($object->allow_spy) {
|
|||
$meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$tmps = explode('@', $toutsujet[$i]);
|
||||
$meilleursujet .= dol_htmlentities($tmps[0]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,8 +211,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN))
|
|||
if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||
else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$token = $conf->global->PAYMENT_SECURITY_TOKEN;
|
||||
}
|
||||
if ($SECUREKEY != $token)
|
||||
|
|
@ -371,8 +370,7 @@ if ($action == 'dopayment')
|
|||
if ($paymentmethod == 'stripe')
|
||||
{
|
||||
if (GETPOST('newamount', 'alpha')) $amount = price2num(GETPOST('newamount', 'alpha'), 'MT');
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
|
|
@ -469,8 +467,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
|
|||
setEventMessages('Failed to create card record', null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG;
|
||||
if (!empty($dol_id)) $metadata["dol_id"] = $dol_id;
|
||||
if (!empty($dol_type)) $metadata["dol_type"] = $dol_type;
|
||||
|
|
@ -497,8 +494,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$vatcleaned = $vatnumber ? $vatnumber : null;
|
||||
|
||||
/*$taxinfo = array('type'=>'vat');
|
||||
|
|
@ -670,8 +666,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
|
|||
setEventMessages($paymentintent->status, null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method
|
||||
// Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here.
|
||||
//dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe');
|
||||
|
|
@ -701,8 +696,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
|
|||
header("Location: ".$urlko);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".$urlok);
|
||||
exit;
|
||||
}
|
||||
|
|
@ -914,8 +908,7 @@ if ($source == 'order')
|
|||
$mesg = $order->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $order->fetch_thirdparty($order->socid);
|
||||
}
|
||||
$object = $order;
|
||||
|
|
@ -1009,8 +1002,7 @@ if ($source == 'order')
|
|||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
if (is_object($order->thirdparty)) print '<input type="hidden" name="thirdparty_id" value="'.$order->thirdparty->id.'">'."\n";
|
||||
|
|
@ -1037,8 +1029,7 @@ if ($source == 'invoice')
|
|||
$mesg = $invoice->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $invoice->fetch_thirdparty($invoice->socid);
|
||||
}
|
||||
$object = $invoice;
|
||||
|
|
@ -1103,8 +1094,7 @@ if ($source == 'invoice')
|
|||
print '<input type="hidden" name="newamount" value="'.$amount.'">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<b>'.price($object->total_ttc, 1, $langs).'</b>';
|
||||
}
|
||||
// Currency
|
||||
|
|
@ -1139,8 +1129,7 @@ if ($source == 'invoice')
|
|||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
if (is_object($invoice->thirdparty)) print '<input type="hidden" name="thirdparty_id" value="'.$invoice->thirdparty->id.'">'."\n";
|
||||
|
|
@ -1168,8 +1157,7 @@ if ($source == 'contractline')
|
|||
$mesg = $contractline->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($contractline->fk_contrat > 0)
|
||||
{
|
||||
$result = $contract->fetch($contractline->fk_contrat);
|
||||
|
|
@ -1177,14 +1165,12 @@ if ($source == 'contractline')
|
|||
{
|
||||
$result = $contract->fetch_thirdparty($contract->socid);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$mesg = $contract->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$mesg = 'ErrorRecordNotFound';
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1207,8 +1193,7 @@ if ($source == 'contractline')
|
|||
$pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level];
|
||||
$price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu_ht = $product->price;
|
||||
$pu_ttc = $product->price_ttc;
|
||||
$price_base_type = $product->price_base_type;
|
||||
|
|
@ -1294,8 +1279,7 @@ if ($source == 'contractline')
|
|||
{
|
||||
$dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("DurationDays"), "w"=>$langs->trans("DurationWeeks"), "m"=>$langs->trans("DurationMonths"), "y"=>$langs->trans("DurationYears"));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("DurationDay"), "w"=>$langs->trans("DurationWeek"), "m"=>$langs->trans("DurationMonth"), "y"=>$langs->trans("DurationYear"));
|
||||
}
|
||||
$duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit];
|
||||
|
|
@ -1352,8 +1336,7 @@ if ($source == 'contractline')
|
|||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
if (is_object($contract->thirdparty)) print '<input type="hidden" name="thirdparty_id" value="'.$contract->thirdparty->id.'">'."\n";
|
||||
|
|
@ -1380,8 +1363,7 @@ if ($source == 'membersubscription')
|
|||
$mesg = $member->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$member->fetch_thirdparty();
|
||||
$subscription = new Subscription($db);
|
||||
}
|
||||
|
|
@ -1523,8 +1505,7 @@ if ($source == 'membersubscription')
|
|||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
if (is_object($member->thirdparty)) print '<input type="hidden" name="thirdparty_id" value="'.$member->thirdparty->id.'">'."\n";
|
||||
|
|
@ -1549,8 +1530,7 @@ if ($source == 'donation')
|
|||
$mesg = $don->error;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$don->fetch_thirdparty();
|
||||
}
|
||||
$object = $don;
|
||||
|
|
@ -1668,8 +1648,7 @@ if ($source == 'donation')
|
|||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
if (is_object($don->thirdparty)) print '<input type="hidden" name="thirdparty_id" value="'.$don->thirdparty->id.'">'."\n";
|
||||
|
|
@ -1705,8 +1684,7 @@ if ($action != 'dopayment')
|
|||
{
|
||||
print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("DonationPaid").'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Membership can be paid and we still allow to make renewal
|
||||
if ($source == 'membersubscription' && $object->datefin > dol_now())
|
||||
{
|
||||
|
|
@ -1796,13 +1774,11 @@ if ($action != 'dopayment')
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error_email('ERRORNEWPAYMENT');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Print
|
||||
}
|
||||
|
||||
|
|
@ -1940,8 +1916,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||
{
|
||||
print '<center>'.$langs->trans("Error").'</center>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input type="hidden" name="paymentintent_id" value="'.$paymentintent->id.'">';
|
||||
//$_SESSION["paymentintent_id"] = $paymentintent->id;
|
||||
}
|
||||
|
|
@ -1956,8 +1931,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||
$langs->load("errors");
|
||||
print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- JS Code for Stripe components -->';
|
||||
print '<script src="https://js.stripe.com/v3/"></script>'."\n";
|
||||
print '<!-- urllogofull = '.$urllogofull.' -->'."\n";
|
||||
|
|
@ -2173,7 +2147,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||
|
||||
<?php
|
||||
}
|
||||
else // Old method (not SCA ready)
|
||||
else // Old method (not SCA ready)
|
||||
{
|
||||
?>
|
||||
// Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off
|
||||
|
|
@ -2241,7 +2215,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||
});
|
||||
<?php
|
||||
}
|
||||
else // Ask credit card with 3DS test
|
||||
else // Ask credit card with 3DS test
|
||||
{
|
||||
?>
|
||||
/* Use 3DS source */
|
||||
|
|
|
|||
|
|
@ -78,8 +78,7 @@ if (empty($paymentmethod))
|
|||
dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("paymentmethod=".$paymentmethod);
|
||||
}
|
||||
|
||||
|
|
@ -187,8 +186,7 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice
|
|||
{
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,8 +222,7 @@ if (!empty($conf->paypal->enabled))
|
|||
// Nothing to do
|
||||
dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment');
|
||||
}
|
||||
|
||||
|
|
@ -251,8 +250,7 @@ if (!empty($conf->paypal->enabled))
|
|||
|
||||
$ispaymentok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment');
|
||||
|
||||
//Display a user friendly Error on the page using any of the following error information returned by PayPal
|
||||
|
|
@ -262,13 +260,11 @@ if (!empty($conf->paypal->enabled))
|
|||
$ErrorSeverityCode = urldecode($resArray2["L_SEVERITYCODE0"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error('', 'Session expired');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error('', '$PAYPALTOKEN not defined');
|
||||
}
|
||||
}
|
||||
|
|
@ -420,8 +416,7 @@ if ($ispaymentok)
|
|||
$postactionmessages[] = $errmsg;
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Subscription created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
|
|
@ -443,8 +438,7 @@ if ($ispaymentok)
|
|||
$postactionmessages = array_merge($postactionmessages, $object->errors);
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($option == 'bankviainvoice')
|
||||
{
|
||||
$postactionmessages[] = 'Invoice, payment and bank record created';
|
||||
|
|
@ -523,8 +517,7 @@ if ($ispaymentok)
|
|||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
|
|
@ -590,8 +583,7 @@ if ($ispaymentok)
|
|||
$postactionmessages[] = $errmsg;
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)';
|
||||
else $postactionmessages[] = 'Email sent to member (without any attached document)';
|
||||
|
||||
|
|
@ -600,14 +592,12 @@ if ($ispaymentok)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
|
|
@ -648,8 +638,7 @@ if ($ispaymentok)
|
|||
{
|
||||
$paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching
|
||||
|
||||
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
|
||||
|
|
@ -672,8 +661,7 @@ if ($ispaymentok)
|
|||
$ispostactionok = -1;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Payment created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
|
|
@ -697,14 +685,12 @@ if ($ispaymentok)
|
|||
$ispostactionok = -1;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Bank transaction of payment created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
|
|
@ -715,25 +701,21 @@ if ($ispaymentok)
|
|||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Nothing done
|
||||
}
|
||||
}
|
||||
|
|
@ -811,8 +793,7 @@ if ($ispaymentok)
|
|||
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
|
||||
$content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n";
|
||||
}
|
||||
$content .= $companylangs->transnoentities("PostActionAfterPayment").' : ';
|
||||
|
|
@ -825,8 +806,7 @@ if ($ispaymentok)
|
|||
{
|
||||
$content .= $companylangs->transnoentitiesnoconv("None");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')');
|
||||
$content .= '<font color="red">'.$companylangs->transnoentitiesnoconv("Error").'</font>';
|
||||
}
|
||||
|
|
@ -865,15 +845,13 @@ if ($ispaymentok)
|
|||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
//dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
//dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Get on url call
|
||||
$onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN;
|
||||
$payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID;
|
||||
|
|
@ -952,8 +930,7 @@ else
|
|||
{
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ if (isset($_GET['connect']))
|
|||
$service = 'StripeTest';
|
||||
$servicestatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = 1;
|
||||
|
|
@ -63,8 +62,7 @@ else {
|
|||
$service = 'StripeTest';
|
||||
$servicestatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = 1;
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ if (isset($_GET['connect']))
|
|||
$service = 'StripeTest';
|
||||
$servicestatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = 1;
|
||||
|
|
@ -63,8 +62,7 @@ else {
|
|||
$service = 'StripeTest';
|
||||
$servicestatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = 1;
|
||||
|
|
@ -189,8 +187,7 @@ if ($event->type == 'payout.created') {
|
|||
http_response_code(200); // PHP 5.4 or greater
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
http_response_code(500); // PHP 5.4 or greater
|
||||
return -1;
|
||||
|
|
@ -270,8 +267,7 @@ elseif ($event->type == 'payout.paid') {
|
|||
http_response_code(200); // PHP 5.4 or greater
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
http_response_code(500); // PHP 5.4 or greater
|
||||
return -1;
|
||||
|
|
@ -344,8 +340,7 @@ elseif ($event->type == 'payment_method.attached') {
|
|||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
@ -381,8 +376,7 @@ elseif ($event->type == 'payment_method.updated') {
|
|||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@ if (empty($usedolheader))
|
|||
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$arraycss = array();
|
||||
$arrayjs = array();
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -188,8 +188,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||
{
|
||||
$action = 'presend';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -373,8 +372,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation');
|
||||
$object->viewTicketMessages(false, true, $object->dao);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.'">'.$langs->trans('Back').'</a></div>';
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -106,8 +106,7 @@ if (empty($pageid))
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->fk_default_home > 0)
|
||||
{
|
||||
$result = $objectpage->fetch($object->fk_default_home);
|
||||
|
|
@ -165,8 +164,7 @@ if ($pageid == 'css') // No more used ?
|
|||
header('Cache-Control: no-cache');
|
||||
$original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/styles.css.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/page'.$pageid.'.tpl.php';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,8 +78,7 @@ if (empty($pageid))
|
|||
$object->fetch($websiteid);
|
||||
$website = $object->ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->fetch(0, $website);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,8 +233,7 @@ if (empty($reshook))
|
|||
|
||||
if ($object->origin == "supplierorder")
|
||||
$classname = 'CommandeFournisseur';
|
||||
else
|
||||
$classname = ucfirst($object->origin);
|
||||
else $classname = ucfirst($object->origin);
|
||||
$objectsrc = new $classname($db);
|
||||
$objectsrc->fetch($object->origin_id);
|
||||
|
||||
|
|
@ -354,8 +353,7 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToReceive").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -366,8 +364,7 @@ if (empty($reshook))
|
|||
header("Location: card.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
$_GET["commande_id"] = GETPOST('commande_id', 'int');
|
||||
$action = 'create';
|
||||
|
|
@ -388,8 +385,7 @@ if (empty($reshook))
|
|||
$langs->load("errors");
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
|
|
@ -418,8 +414,7 @@ if (empty($reshook))
|
|||
header("Location: ".DOL_URL_ROOT.'/reception/index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -567,8 +562,7 @@ if (empty($reshook))
|
|||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($line->error, $line->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -667,8 +661,7 @@ if (empty($reshook))
|
|||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition
|
||||
exit();
|
||||
}
|
||||
|
|
@ -1049,8 +1042,7 @@ if ($action == 'create')
|
|||
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td>";
|
||||
if ($type == 1) $text = img_object($langs->trans('Service'), 'service');
|
||||
else $text = img_object($langs->trans('Product'), 'product');
|
||||
|
|
@ -1089,8 +1081,7 @@ if ($action == 'create')
|
|||
{
|
||||
$quantityToBeDelivered = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty'];
|
||||
}
|
||||
$warehouse_id = $dispatchLines[$indiceAsked]['ent'];
|
||||
|
|
@ -1131,8 +1122,7 @@ if ($action == 'create')
|
|||
print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0, 0, $line->fk_product, '', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("Service");
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1195,8 +1185,7 @@ if ($action == 'create')
|
|||
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -1247,8 +1236,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$numref = $object->ref;
|
||||
}
|
||||
|
||||
|
|
@ -1413,8 +1401,7 @@ elseif ($id || $ref)
|
|||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1437,8 +1424,7 @@ elseif ($id || $ref)
|
|||
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->trueWeight;
|
||||
print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : '';
|
||||
}
|
||||
|
|
@ -1472,8 +1458,7 @@ elseif ($id || $ref)
|
|||
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->trueHeight;
|
||||
print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : '';
|
||||
}
|
||||
|
|
@ -1551,8 +1536,7 @@ elseif ($id || $ref)
|
|||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->shipping_method_id > 0)
|
||||
{
|
||||
// Get code using getLabelFromKey
|
||||
|
|
@ -1585,8 +1569,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -1640,8 +1623,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print $langs->trans("QtyToReceive").' - ';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("QtyReceived").' - ';
|
||||
}
|
||||
if (!empty($conf->stock->enabled))
|
||||
|
|
@ -1654,14 +1636,12 @@ elseif ($id || $ref)
|
|||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->statut <= 1)
|
||||
{
|
||||
print '<td class="center">'.$langs->trans("QtyToReceive").'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
|
||||
}
|
||||
if (!empty($conf->stock->enabled))
|
||||
|
|
@ -1769,8 +1749,7 @@ elseif ($id || $ref)
|
|||
$prod->fetch($lines[$i]->fk_product);
|
||||
$label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label;
|
||||
}
|
||||
else
|
||||
$label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
|
||||
else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
|
||||
|
||||
print '<td>';
|
||||
|
||||
|
|
@ -1785,8 +1764,7 @@ elseif ($id || $ref)
|
|||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td>";
|
||||
if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service');
|
||||
else $text = img_object($langs->trans('Product'), 'product');
|
||||
|
|
@ -1806,8 +1784,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print '<td ><textarea name="comment'.$line_id.'" id="comment'.$line_id.'" /> '.$lines[$i]->comment.'</textarea></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td style="white-space: pre-wrap;max-width: 200px;" >'.$lines[$i]->comment.'</td>';
|
||||
}
|
||||
|
||||
|
|
@ -1873,8 +1850,7 @@ elseif ($id || $ref)
|
|||
}
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- case edit 2 -->';
|
||||
print '<tr>';
|
||||
// Qty to receive or received
|
||||
|
|
@ -1888,8 +1864,7 @@ elseif ($id || $ref)
|
|||
}
|
||||
print '</table></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Qty to receive or received
|
||||
print '<td class="center">'.$lines[$i]->qty.'</td>';
|
||||
|
||||
|
|
@ -1926,8 +1901,7 @@ elseif ($id || $ref)
|
|||
|
||||
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("NA");
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1988,8 +1962,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked);
|
||||
}
|
||||
}
|
||||
|
|
@ -2027,8 +2000,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
|
@ -2045,8 +2017,7 @@ elseif ($id || $ref)
|
|||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ClassifyUnbilled").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,14 +179,12 @@ class Reception extends CommonObject
|
|||
{
|
||||
return $numref;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined");
|
||||
return "";
|
||||
}
|
||||
|
|
@ -325,8 +323,7 @@ class Reception extends CommonObject
|
|||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
||||
|
|
@ -336,16 +333,14 @@ class Reception extends CommonObject
|
|||
return -1 * $error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->error()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
|
|
@ -473,15 +468,13 @@ class Reception extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR);
|
||||
$this->error = 'Delivery with id '.$id.' not found';
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -602,8 +595,7 @@ class Reception extends CommonObject
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
||||
|
|
@ -618,8 +610,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->error();
|
||||
return -2;
|
||||
|
|
@ -694,8 +685,7 @@ class Reception extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR);
|
||||
|
|
@ -867,8 +857,7 @@ class Reception extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -922,8 +911,7 @@ class Reception extends CommonObject
|
|||
$result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
|
@ -1000,35 +988,30 @@ class Reception extends CommonObject
|
|||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1274,14 +1257,12 @@ class Reception extends CommonObject
|
|||
$this->date_delivery = $date_livraison;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
|
@ -1365,8 +1346,7 @@ class Reception extends CommonObject
|
|||
$sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')";
|
||||
$resql = $this->db->query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
||||
$sql .= " code='".$this->db->escape($this->update['code'])."'";
|
||||
$sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'";
|
||||
|
|
@ -1442,8 +1422,7 @@ class Reception extends CommonObject
|
|||
$url = str_replace('{TRACKID}', $value, $tracking);
|
||||
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value ? $value : 'url').'</a>', $url, $url);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->tracking_url = $value;
|
||||
}
|
||||
}
|
||||
|
|
@ -1545,8 +1524,7 @@ class Reception extends CommonObject
|
|||
$error++; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
|
|
@ -1560,8 +1538,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1576,8 +1553,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1587,8 +1563,7 @@ class Reception extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1633,8 +1608,7 @@ class Reception extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1710,8 +1684,7 @@ class Reception extends CommonObject
|
|||
$error++; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
|
|
@ -1724,8 +1697,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1755,8 +1727,7 @@ class Reception extends CommonObject
|
|||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1846,8 +1817,7 @@ class Reception extends CommonObject
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
|
|
@ -1860,8 +1830,7 @@ class Reception extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1912,8 +1881,7 @@ class Reception extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -91,8 +91,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer)
|
|||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
|
|
|||
|
|
@ -279,15 +279,13 @@ if (empty($reshook))
|
|||
$result = $object->insert_discount($discountid);
|
||||
//$result=$discount->link_to_invoice($lineid,$id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Positive line
|
||||
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
||||
// Date start
|
||||
|
|
@ -335,8 +333,7 @@ if (empty($reshook))
|
|||
{
|
||||
$lineid = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$lineid = 0;
|
||||
$error++;
|
||||
break;
|
||||
|
|
@ -391,8 +388,7 @@ if (empty($reshook))
|
|||
$db->commit();
|
||||
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
$action = 'create';
|
||||
$_GET["origin"] = $_POST["origin"];
|
||||
|
|
@ -585,8 +581,7 @@ if ($resql)
|
|||
print $form->selectyesno('validate_invoices', 0, 1, 1);
|
||||
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $form->selectyesno('validate_invoices', 0, 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -937,8 +932,7 @@ if ($resql)
|
|||
print '</form>';
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user