add new rule

This commit is contained in:
Frédéric FRANCE 2020-05-21 02:02:54 +02:00
parent a25ed0e041
commit e5fc928fda
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
138 changed files with 880 additions and 1742 deletions

View File

@ -60,8 +60,7 @@ if ($action == 'update')
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($db->lasterror(), null, 'errors'); setEventMessages($db->lasterror(), null, 'errors');
} }

View File

@ -69,8 +69,7 @@ if (!empty($keyforcontent))
$langs->load("errors"); $langs->load("errors");
print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent); print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent);
} }
else else {
{
if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent)) if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent))
{ {
print $conf->global->$keyforcontent; print $conf->global->$keyforcontent;
@ -115,8 +114,7 @@ if (!empty($keyforcontent))
print '<div>'; print '<div>';
llxFooter(); llxFooter();
} }
else else {
{
if (preg_match('/^\//', $conf->global->EXTERNALSITE_URL) || preg_match('/^http/i', $conf->global->EXTERNALSITE_URL)) if (preg_match('/^\//', $conf->global->EXTERNALSITE_URL) || preg_match('/^http/i', $conf->global->EXTERNALSITE_URL))
{ {
print " print "
@ -151,8 +149,7 @@ else
</html> </html>
"; ";
} }
else else {
{
llxHeader(); llxHeader();
print '<div class="framecontent" style="height: '.($_SESSION['dol_screenheight'] - 90).'px">'; print '<div class="framecontent" style="height: '.($_SESSION['dol_screenheight'] - 90).'px">';
print $conf->global->EXTERNALSITE_URL; print $conf->global->EXTERNALSITE_URL;

View File

@ -130,15 +130,13 @@ if ($result)
$i++; $i++;
} }
} }
else else {
{
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
print '</table>'; print '</table>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -261,8 +261,7 @@ class Establishment extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
@ -287,8 +286,7 @@ class Establishment extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -389,8 +387,7 @@ class Establishment extends CommonObject
} }
$this->db->free($result); $this->db->free($result);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }
@ -418,8 +415,7 @@ class Establishment extends CommonObject
} }
$this->db->free($result); $this->db->free($result);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }

View File

@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
header("Location: ../admin/admin_establishment.php"); header("Location: ../admin/admin_establishment.php");
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -101,18 +100,15 @@ elseif ($action == 'add')
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else {
{
$action = 'create'; $action = 'create';
} }
} }
else else {
{
header("Location: ../admin/admin_establishment.php"); header("Location: ../admin/admin_establishment.php");
exit; exit;
} }
@ -148,8 +144,7 @@ elseif ($action == 'update')
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']);
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }

View File

@ -242,8 +242,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read)
$i++; $i++;
} }
} }
else else {
{
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
print '</table>'; print '</table>';
@ -315,8 +314,7 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
$i++; $i++;
} }
} }
else else {
{
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
print '</table>'; print '</table>';

View File

@ -119,8 +119,7 @@ if ($action == 'add')
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $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'); else header("Location: ".DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1');
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -262,7 +260,7 @@ $formfile = new FormFile($db);
if ($action == 'create') // Create. Seems to no be used if ($action == 'create') // Create. Seems to no be used
{ {
} }
else // View else // View
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
@ -453,8 +451,7 @@ else // View
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
else else {
{
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : '&nbsp;'; print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : '&nbsp;';
} }
print '</td>'; print '</td>';
@ -476,8 +473,7 @@ else // View
{ {
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); 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 $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>'; 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; $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); $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) : ''; 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>"; print "<td>";
if ($object->lines[$i]->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service'); if ($object->lines[$i]->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service');
else $text = img_object($langs->trans('Product'), 'product'); 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.'&amp;expid='.$object->origin_id.'&amp;action=delete&amp;backtopage='.urlencode(DOL_URL_ROOT.'/expedition/card.php?id='.$object->origin_id).'">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;expid='.$object->origin_id.'&amp;action=delete&amp;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.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
} }
} }
@ -720,14 +713,12 @@ else // View
print '</td></tr></table>'; print '</td></tr></table>';
} }
else else {
{
/* Expedition non trouvee */ /* Expedition non trouvee */
print "Expedition inexistante ou acces refuse"; print "Expedition inexistante ou acces refuse";
} }
} }
else else {
{
/* Expedition non trouvee */ /* Expedition non trouvee */
print "Expedition inexistante ou acces refuse"; print "Expedition inexistante ou acces refuse";
} }

View File

@ -216,24 +216,21 @@ class Livraison extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$error++; $error++;
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
$this->db->rollback(); $this->db->rollback();
return -3; return -3;
} }
} }
else else {
{
$error++; $error++;
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else {
{
$error++; $error++;
$this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror;
$this->db->rollback(); $this->db->rollback();
@ -345,15 +342,13 @@ class Livraison extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = 'Delivery with id '.$id.' not found sql='.$sql; $this->error = 'Delivery with id '.$id.' not found sql='.$sql;
dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR);
return -2; return -2;
} }
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
@ -400,8 +395,7 @@ class Livraison extends CommonObject
{ {
$numref = $objMod->livraison_get_num($soc, $this); $numref = $objMod->livraison_get_num($soc, $this);
} }
else else {
{
$numref = $this->ref; $numref = $this->ref;
} }
$this->newref = dol_sanitizeFileName($numref); $this->newref = dol_sanitizeFileName($numref);
@ -501,16 +495,14 @@ class Livraison extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} }
} }
} }
else else {
{
$this->error = "Non autorise"; $this->error = "Non autorise";
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
return -1; return -1;
@ -634,8 +626,7 @@ class Livraison extends CommonObject
return 1; return 1;
} }
else else {
{
return 0; return 0;
} }
} }
@ -705,22 +696,19 @@ class Livraison extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -3; return -3;
} }
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -991,8 +979,7 @@ class Livraison extends CommonObject
{ {
$array[$i]['qty'] = $objSourceLine->qty - $row[1]; $array[$i]['qty'] = $objSourceLine->qty - $row[1];
} }
else else {
{
$array[$i]['qty'] = $objSourceLine->qty; $array[$i]['qty'] = $objSourceLine->qty;
} }
@ -1010,8 +997,7 @@ class Livraison extends CommonObject
} }
return $array; return $array;
} }
else else {
{
$this->error = $this->db->error()." - sql=$sqlSourceLine"; $this->error = $this->db->error()." - sql=$sqlSourceLine";
return -1; return -1;
} }
@ -1041,14 +1027,12 @@ class Livraison extends CommonObject
$this->date_delivery = $date_livraison; $this->date_delivery = $date_livraison;
return 1; return 1;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
} }
else else {
{
return -2; return -2;
} }
} }

View File

@ -69,8 +69,7 @@ if (empty($reshook))
{ {
setEventMessages($langs->trans('LoanPaid'), null, 'mesgs'); setEventMessages($langs->trans('LoanPaid'), null, 'mesgs');
} }
else else {
{
setEventMessages($loan->error, null, 'errors'); setEventMessages($loan->error, null, 'errors');
} }
} }
@ -86,8 +85,7 @@ if (empty($reshook))
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
else else {
{
setEventMessages($loan->error, null, 'errors'); setEventMessages($loan->error, null, 'errors');
} }
} }
@ -154,8 +152,7 @@ if (empty($reshook))
} }
} }
} }
else else {
{
header("Location: index.php"); header("Location: index.php");
exit(); exit();
} }
@ -177,8 +174,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
$action = 'edit'; $action = 'edit';
} }
else else {
{
$object->datestart = $datestart; $object->datestart = $datestart;
$object->dateend = $dateend; $object->dateend = $dateend;
$object->capital = $capital; $object->capital = $capital;
@ -202,14 +198,12 @@ if (empty($reshook))
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit; exit;
} }
else else {
{
$error++; $error++;
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else {
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit; 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 $form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant
print '</td></tr>'; print '</td></tr>';
} }
else else {
{
print '<tr><td>'.$langs->trans("Account").'</td><td>'; print '<tr><td>'.$langs->trans("Account").'</td><td>';
print $langs->trans("NoBankAccountDefined"); print $langs->trans("NoBankAccountDefined");
print '</td></tr>'; print '</td></tr>';
@ -484,8 +477,7 @@ if ($id > 0)
print '<input name="capital" size="10" value="'.$object->capital.'"></td></tr>'; print '<input name="capital" size="10" value="'.$object->capital.'"></td></tr>';
print '</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>'; 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 '<input name="insurance_amount" size="10" value="'.$object->insurance_amount.'"></td></tr>';
print '</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>'; 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); print $form->selectDate($object->datestart, 'start', 0, 0, 0, 'update', 1, 0);
} }
else else {
{
print dol_print_date($object->datestart, "day"); print dol_print_date($object->datestart, "day");
} }
print "</td></tr>"; print "</td></tr>";
@ -521,8 +511,7 @@ if ($id > 0)
{ {
print $form->selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0); print $form->selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0);
} }
else else {
{
print dol_print_date($object->dateend, "day"); print dol_print_date($object->dateend, "day");
} }
print "</td></tr>"; print "</td></tr>";
@ -534,8 +523,7 @@ if ($id > 0)
{ {
print '<input name="nbterm" size="4" value="'.$object->nbterm.'">'; print '<input name="nbterm" size="4" value="'.$object->nbterm.'">';
} }
else else {
{
print $object->nbterm; print $object->nbterm;
} }
print '</td></tr>'; print '</td></tr>';
@ -547,8 +535,7 @@ if ($id > 0)
{ {
print '<input name="rate" size="4" value="'.$object->rate.'">%'; print '<input name="rate" size="4" value="'.$object->rate.'">%';
} }
else else {
{
print price($object->rate).'%'; print price($object->rate).'%';
} }
print '</td></tr>'; print '</td></tr>';
@ -565,14 +552,12 @@ if ($id > 0)
{ {
print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1); 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 '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
} }
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="nowrap">'; print '<td class="nowrap">';
print $langs->trans("LoanAccountancyCapitalCode"); print $langs->trans("LoanAccountancyCapitalCode");
print '</td><td>'; print '</td><td>';
@ -603,14 +588,12 @@ if ($id > 0)
{ {
print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1); 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 '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
} }
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="nowrap">'; print '<td class="nowrap">';
print $langs->trans("LoanAccountancyInsuranceCode"); print $langs->trans("LoanAccountancyInsuranceCode");
print '</td><td>'; print '</td><td>';
@ -641,14 +624,12 @@ if ($id > 0)
{ {
print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1); 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 '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
} }
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="nowrap">'; print '<td class="nowrap">';
print $langs->trans("LoanAccountancyInterestCode"); print $langs->trans("LoanAccountancyInterestCode");
print '</td><td>'; print '</td><td>';
@ -743,8 +724,7 @@ if ($id > 0)
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -805,8 +785,7 @@ if ($id > 0)
} }
} }
} }
else else {
{
// Loan not found // Loan not found
dol_print_error('', $object->error); dol_print_error('', $object->error);
} }

View File

@ -161,14 +161,12 @@ class Loan extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
$this->db->free($resql); $this->db->free($resql);
return 0; return 0;
} }
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
@ -259,8 +257,7 @@ class Loan extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -330,8 +327,7 @@ class Loan extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -376,8 +372,7 @@ class Loan extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -572,8 +567,7 @@ class Loan extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return $amount; return $amount;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
@ -619,14 +613,12 @@ class Loan extends CommonObject
$this->db->free($result); $this->db->free($result);
return 1; return 1;
} }
else else {
{
$this->db->free($result); $this->db->free($result);
return 0; return 0;
} }
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }

View File

@ -171,8 +171,7 @@ class LoanSchedule extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan");
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -184,8 +183,7 @@ class LoanSchedule extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -258,8 +256,7 @@ class LoanSchedule extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -322,8 +319,7 @@ class LoanSchedule extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -364,8 +360,7 @@ class LoanSchedule extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -451,8 +446,7 @@ class LoanSchedule extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }

View File

@ -166,8 +166,7 @@ class PaymentLoan extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan");
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -179,8 +178,7 @@ class PaymentLoan extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -255,8 +253,7 @@ class PaymentLoan extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -327,8 +324,7 @@ class PaymentLoan extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -380,8 +376,7 @@ class PaymentLoan extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -460,8 +455,7 @@ class PaymentLoan extends CommonObject
if ($result <= 0) dol_print_error($this->db); if ($result <= 0) dol_print_error($this->db);
} }
} }
else else {
{
$this->error = $acc->error; $this->error = $acc->error;
$error++; $error++;
} }
@ -471,8 +465,7 @@ class PaymentLoan extends CommonObject
{ {
return 1; return 1;
} }
else else {
{
return -1; return -1;
} }
} }
@ -497,8 +490,7 @@ class PaymentLoan extends CommonObject
$this->fk_bank = $id_bank; $this->fk_bank = $id_bank;
return 1; return 1;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return 0; return 0;
} }

View File

@ -159,8 +159,7 @@ if ($object->id)
$param = '&id='.$object->id; $param = '&id='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} }
else else {
{
print $langs->trans("ErrorUnknown"); print $langs->trans("ErrorUnknown");
} }

View File

@ -121,8 +121,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
if ($limit) $sql .= $db->plimit($limit + 1, $offset); if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -262,8 +261,7 @@ if ($resql)
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del
header("Location: ".DOL_URL_ROOT."/loan/list.php"); header("Location: ".DOL_URL_ROOT."/loan/list.php");
exit; exit;
} }
else else {
{
setEventMessages($payment->error, $payment->errors, 'errors'); setEventMessages($payment->error, $payment->errors, 'errors');
$db->rollback(); $db->rollback();
} }
@ -102,8 +101,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri
header('Location: card.php?id='.$payment->id); header('Location: card.php?id='.$payment->id);
exit; exit;
} }
else else {
{
setEventMessages($payment->error, $payment->errors, 'errors'); setEventMessages($payment->error, $payment->errors, 'errors');
$db->rollback(); $db->rollback();
} }
@ -255,8 +253,7 @@ if ($resql)
print "</table>\n"; print "</table>\n";
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); 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.'&amp;action=delete">'.$langs->trans('Delete').'</a>'; print '<a class="butActionDelete" href="card.php?id='.$id.'&amp;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>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
} }
} }

View File

@ -170,8 +170,7 @@ if ($action == 'add_payment')
header('Location: '.$loc); header('Location: '.$loc);
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -291,8 +290,7 @@ if ($action == 'create')
{ {
print '<td class="left" valign="center">'.dol_print_date($loan->datestart, 'day').'</td>'; print '<td class="left" valign="center">'.dol_print_date($loan->datestart, 'day').'</td>';
} }
else else {
{
print '<td class="center" valign="center"><b>!!!</b></td>'; 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.'">'; print $langs->trans("LoanCapital").': <input type="text" size="8" name="amount_capital" value="'.$amount_capital.'">';
} }
else else {
{
print '-'; print '-';
} }
print '<br>'; print '<br>';
@ -316,8 +313,7 @@ if ($action == 'create')
{ {
print $langs->trans("Insurance").': <input type="text" size="8" name="amount_insurance" value="'.$amount_insurance.'">'; print $langs->trans("Insurance").': <input type="text" size="8" name="amount_insurance" value="'.$amount_insurance.'">';
} }
else else {
{
print '-'; print '-';
} }
print '<br>'; print '<br>';
@ -325,8 +321,7 @@ if ($action == 'create')
{ {
print $langs->trans("Interest").': <input type="text" size="8" name="amount_interest" value="'.$amount_interest.'">'; print $langs->trans("Interest").': <input type="text" size="8" name="amount_interest" value="'.$amount_interest.'">';
} }
else else {
{
print '-'; print '-';
} }
print "</td>"; print "</td>";

View File

@ -291,15 +291,13 @@ class MailmanSpip
$mydb->close($result); $mydb->close($result);
return 1; return 1;
} }
else else {
{
// nous n'avons pas de reponse => n'existe pas // nous n'avons pas de reponse => n'existe pas
$mydb->close($result); $mydb->close($result);
return 0; return 0;
} }
} }
else else {
{
$this->error = $mydb->lasterror(); $this->error = $mydb->lasterror();
$mydb->close(); $mydb->close();
} }
@ -378,8 +376,7 @@ class MailmanSpip
} }
return count($lists); return count($lists);
} }
else else {
{
$this->error = "ADHERENT_MAILMAN_URL not defined"; $this->error = "ADHERENT_MAILMAN_URL not defined";
return -1; return -1;
} }
@ -452,8 +449,7 @@ class MailmanSpip
} }
return count($lists); return count($lists);
} }
else else {
{
$this->error = "ADHERENT_MAILMAN_UNSUB_URL not defined"; $this->error = "ADHERENT_MAILMAN_UNSUB_URL not defined";
return -1; return -1;
} }

View File

@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -62,8 +61,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -74,8 +72,7 @@ if ($action == 'remises')
{ {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -86,8 +83,7 @@ if ($action == 'typemarges')
{ {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -98,8 +94,7 @@ if ($action == 'contact')
{ {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -167,14 +162,12 @@ if (!empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('DISPLAY_MARGIN_RATES'); print ajax_constantonoff('DISPLAY_MARGIN_RATES');
} }
else else {
{
if (empty($conf->global->DISPLAY_MARGIN_RATES)) 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>'; 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>'; 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'); print ajax_constantonoff('DISPLAY_MARK_RATES');
} }
else else {
{
if (empty($conf->global->DISPLAY_MARK_RATES)) 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>'; 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>'; 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'); print ajax_constantonoff('ForceBuyingPriceIfNull');
} }
else else {
{
if (empty($conf->global->ForceBuyingPriceIfNull)) if (empty($conf->global->ForceBuyingPriceIfNull))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ForceBuyingPriceIfNull">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; 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>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ForceBuyingPriceIfNull">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
} }

View File

@ -48,8 +48,7 @@ if (!$sortfield)
{ {
if ($agentid > 0) if ($agentid > 0)
$sortfield = "s.nom"; $sortfield = "s.nom";
else else $sortfield = "u.lastname";
$sortfield = "u.lastname";
} }
$startdate = $enddate = ''; $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)"; $sql .= " AND (d.product_type = 0 OR d.product_type = 1)";
if (!empty($conf->global->AGENT_CONTACT_TYPE)) 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))"; $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 else $sql .= " AND sc.fk_user = u.rowid";
$sql .= " AND sc.fk_user = u.rowid";
$sql .= " AND f.fk_statut NOT IN (".implode(', ', $invoice_status_except_list).")"; $sql .= " AND f.fk_statut NOT IN (".implode(', ', $invoice_status_except_list).")";
$sql .= ' AND s.entity IN ('.getEntity('societe').')'; $sql .= ' AND s.entity IN ('.getEntity('societe').')';
$sql .= " AND d.fk_facture = f.rowid"; $sql .= " AND d.fk_facture = f.rowid";
if ($agentid > 0) { if ($agentid > 0) {
if (!empty($conf->global->AGENT_CONTACT_TYPE)) 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."))"; $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 else $sql .= " AND sc.fk_user = ".$agentid;
$sql .= " AND sc.fk_user = ".$agentid;
} }
if (!empty($startdate)) if (!empty($startdate))
$sql .= " AND f.datef >= '".$db->idate($startdate)."'"; $sql .= " AND f.datef >= '".$db->idate($startdate)."'";
@ -205,7 +202,7 @@ if ($result)
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
$labelcostprice = 'BuyingPrice'; $labelcostprice = 'BuyingPrice';
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = ''; $moreforfilter = '';
@ -217,8 +214,7 @@ if ($result)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if ($agentid > 0) if ($agentid > 0)
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
else else print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
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("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_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 "</table>";
print '</div>'; print '</div>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
$db->free($result); $db->free($result);

View File

@ -222,7 +222,7 @@ if ($result) {
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
$labelcostprice = 'BuyingPrice'; $labelcostprice = 'BuyingPrice';
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = ''; $moreforfilter = '';

View File

@ -126,8 +126,7 @@ if (!$sortfield)
$sortfield = "f.datef"; $sortfield = "f.datef";
$sortorder = "DESC"; $sortorder = "DESC";
} }
else else {
{
$sortfield = "s.nom"; $sortfield = "s.nom";
$sortorder = "ASC"; $sortorder = "ASC";
} }
@ -255,7 +254,7 @@ if ($result)
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
$labelcostprice = 'BuyingPrice'; $labelcostprice = 'BuyingPrice';
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = ''; $moreforfilter = '';
@ -269,8 +268,7 @@ if ($result)
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&amp;socid=".$socid, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&amp;socid=".$socid, '', $sortfield, $sortorder);
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&amp;socid=".$socid, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&amp;socid=".$socid, 'align="center"', $sortfield, $sortorder);
} }
else else print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&amp;socid=".$socid, '', $sortfield, $sortorder);
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&amp;socid=".$socid, '', $sortfield, $sortorder);
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&amp;socid=".$socid, 'align="right"', $sortfield, $sortorder);
@ -298,8 +296,7 @@ if ($result)
$marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : '';
$markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : '';
} }
else else {
{
$marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
$markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
} }
@ -353,8 +350,7 @@ if ($result)
print '<tr class="liste_total">'; print '<tr class="liste_total">';
if ($client) if ($client)
print '<td colspan=2>'; print '<td colspan=2>';
else else print '<td>';
print '<td>';
print $langs->trans('TotalMargin')."</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_vente, null, null, null, null, $rounding)."</td>\n";
print "<td class=\"right\">".price($cumul_achat, 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 "</table>";
print '</div>'; print '</div>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
$db->free($result); $db->free($result);

View File

@ -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); $paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100);
} }
else else {
{
$paht_ret = $paht; $paht_ret = $paht;
} }
} }
else else {
{
$paht_ret = $paht; $paht_ret = $paht;
} }
@ -147,8 +145,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
// calcul marge // calcul marge
if ($pu_ht_remise < 0) if ($pu_ht_remise < 0)
$marge = -1 * (abs($pu_ht_remise) - $paht_ret); $marge = -1 * (abs($pu_ht_remise) - $paht_ret);
else else $marge = $pu_ht_remise - $paht_ret;
$marge = $pu_ht_remise - $paht_ret;
// calcul taux marge // calcul taux marge
if ($paht_ret != 0) if ($paht_ret != 0)

View File

@ -62,8 +62,7 @@ if (!$sortfield)
$sortfield = "f.datef"; $sortfield = "f.datef";
$sortorder = "DESC"; $sortorder = "DESC";
} }
else else {
{
$sortfield = "p.ref"; $sortfield = "p.ref";
$sortorder = "ASC"; $sortorder = "ASC";
} }
@ -226,7 +225,7 @@ if ($result)
//var_dump($conf->global->MARGIN_TYPE); //var_dump($conf->global->MARGIN_TYPE);
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
$labelcostprice = 'BuyingPrice'; $labelcostprice = 'BuyingPrice';
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = ''; $moreforfilter = '';
@ -240,8 +239,7 @@ if ($result)
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&amp;id=".$id, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&amp;id=".$id, '', $sortfield, $sortorder);
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&amp;id=".$id, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&amp;id=".$id, 'align="center"', $sortfield, $sortorder);
} }
else else {
{
print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&amp;id=".$id, '', $sortfield, $sortorder); print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&amp;id=".$id, '', $sortfield, $sortorder);
} }
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&amp;id=".$id, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&amp;id=".$id, 'align="right"', $sortfield, $sortorder);
@ -270,8 +268,7 @@ if ($result)
$marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : '';
$markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : '';
} }
else else {
{
$marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $marginRate = ($pa != 0) ? (100 * $marge / $pa) : '';
$markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : '';
} }
@ -298,8 +295,7 @@ if ($result)
$text = $product_static->getNomUrl(1); $text = $product_static->getNomUrl(1);
print $text .= ' - '.$objp->label; print $text .= ' - '.$objp->label;
} }
else else {
{
print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts"); print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts");
} }
print "</td>\n"; print "</td>\n";
@ -330,8 +326,7 @@ if ($result)
print '<tr class="liste_total">'; print '<tr class="liste_total">';
if ($id > 0) if ($id > 0)
print '<td colspan=2>'; print '<td colspan=2>';
else else print '<td>';
print '<td>';
print $langs->trans('TotalMargin')."</td>"; print $langs->trans('TotalMargin')."</td>";
print "<td class=\"right\">".price(price2num($cumul_vente, 'MT'))."</td>\n"; print "<td class=\"right\">".price(price2num($cumul_vente, 'MT'))."</td>\n";
print "<td class=\"right\">".price(price2num($cumul_achat, 'MT'))."</td>\n"; print "<td class=\"right\">".price(price2num($cumul_achat, 'MT'))."</td>\n";
@ -345,8 +340,7 @@ if ($result)
print "</table>"; print "</table>";
print '</div>'; print '</div>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
$db->free($result); $db->free($result);

View File

@ -230,8 +230,7 @@ if ($id > 0 || !empty($ref))
$marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : '';
$markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : '';
} }
else else {
{
$marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : '';
$markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : '';
} }

View File

@ -236,8 +236,7 @@ if ($socid > 0)
$marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : '';
$markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : '';
} }
else else {
{
$marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : '';
$markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : '';
} }
@ -255,8 +254,7 @@ if ($socid > 0)
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print "</table>"; print "</table>";
@ -265,8 +263,7 @@ if ($socid > 0)
print '<br>'; print '<br>';
$db->free($result); $db->free($result);
} }
else else {
{
dol_print_error('', 'Parameter socid not defined'); dol_print_error('', 'Parameter socid not defined');
} }

View File

@ -50,7 +50,6 @@ if ($result > 0)
unset($object->db); unset($object->db);
echo json_encode($object); echo json_encode($object);
} }
else else {
{
echo 'Failed to load category with id='.$idbom; echo 'Failed to load category with id='.$idbom;
} }

View File

@ -763,15 +763,13 @@ class Mo extends CommonObject
{ {
return $numref; return $numref;
} }
else else {
{
$this->error = $obj->error; $this->error = $obj->error;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return ""; return "";
} }
} }
else else {
{
print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined"); print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined");
return ""; return "";
} }
@ -817,8 +815,7 @@ class Mo extends CommonObject
$this->fetch_product(); $this->fetch_product();
$num = $this->getNextNumRef($this->product); $num = $this->getNextNumRef($this->product);
} }
else else {
{
$num = $this->ref; $num = $this->ref;
} }
$this->newref = $num; $this->newref = $num;
@ -900,8 +897,7 @@ class Mo extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1146,8 +1142,7 @@ class Mo extends CommonObject
$this->db->free($result); $this->db->free($result);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }
@ -1181,8 +1176,7 @@ class Mo extends CommonObject
$this->errors = $this->errors; $this->errors = $this->errors;
return $result; return $result;
} }
else else {
{
$this->lines = $result; $this->lines = $result;
return $this->lines; return $this->lines;
} }
@ -1329,8 +1323,7 @@ class Mo extends CommonObject
$this->tpl['label'] .= $productstatic->getNomUrl(1); $this->tpl['label'] .= $productstatic->getNomUrl(1);
//$this->tpl['label'].= ' - '.$productstatic->label; //$this->tpl['label'].= ' - '.$productstatic->label;
} }
else else {
{
// If origin MRP line is not a product, but another MRP // If origin MRP line is not a product, but another MRP
// TODO // TODO
} }

View File

@ -137,8 +137,7 @@ if ($conf->use_javascript_ajax)
print "<br>"; print "<br>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -196,8 +195,7 @@ if ($resql)
print "</table></div>"; print "</table></div>";
print "<br>"; print "<br>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -249,8 +247,7 @@ if ($resql)
print "</table></div>"; print "</table></div>";
print "<br>"; print "<br>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -49,8 +49,7 @@ if (GETPOST('actioncode', 'array'))
$actioncode = GETPOST('actioncode', 'array', 3); $actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0'; 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)); $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'); $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>'; 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>'; print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
} }
} }

View File

@ -193,8 +193,7 @@ if (empty($reshook))
$object->generateDocument($model, $outputlangs, 0, 0, 0); $object->generateDocument($model, $outputlangs, 0, 0, 0);
} }
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); 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.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;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"; 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>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
} }
else else {
{
$langs->load("errors"); $langs->load("errors");
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>'; 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"; 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"; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
} }
} }

View File

@ -184,8 +184,7 @@ if ($object->id)
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} }
else else {
{
accessforbidden('', 0, 1); accessforbidden('', 0, 1);
} }

View File

@ -280,8 +280,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
if ($limit) $sql .= $db->plimit($limit + 1, $offset); if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -790,8 +790,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="center nowraponall">'; print '<td class="center nowraponall">';
if ($productlot->id > 0) if ($productlot->id > 0)
print $productlot->getNomUrl(1); print $productlot->getNomUrl(1);
else 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 $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>'; print '</td>';
} }
if (!empty($arrayfields['pl.eatby']['checked'])) { if (!empty($arrayfields['pl.eatby']['checked'])) {

View File

@ -407,8 +407,7 @@ if (empty($reshook))
$object->generateDocument($model, $outputlangs, 0, 0, 0); $object->generateDocument($model, $outputlangs, 0, 0, 0);
} }
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); 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>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
} }
else else {
{
$langs->load("errors"); $langs->load("errors");
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>'; print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
} }

View File

@ -410,8 +410,7 @@ class MultiCurrency extends CommonObject
$this->rate = $currencyRate; $this->rate = $currencyRate;
return 1; return 1;
} }
else else {
{
$this->rate = null; $this->rate = null;
$this->errors = $currencyRate->errors; $this->errors = $currencyRate->errors;
return -1; return -1;
@ -533,8 +532,7 @@ class MultiCurrency extends CommonObject
$resql = $db->query($sql1.$sql2.$sql3); $resql = $db->query($sql1.$sql2.$sql3);
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate); 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)) if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE))
{ {
$resql = $db->query($sql1.$sql3); $resql = $db->query($sql1.$sql3);
@ -669,8 +667,7 @@ class MultiCurrency extends CommonObject
return 1; return 1;
} }
else else {
{
dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING); dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING);
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors'); setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');

View File

@ -252,8 +252,7 @@ if ($action == 'edit')
$doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
$doleditor->Create(0, ''); $doleditor->Create(0, '');
} }
else else {
{
print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true));
} }
print '</td></tr>'; print '</td></tr>';
@ -309,8 +308,7 @@ print '</td></tr>';
// Expire date // Expire date
print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">'; 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); 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'); 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")); 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>"; print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))." <br>";
} }
} }
else else {
{
print $langs->trans("NoCommentYet").'<br>'; print $langs->trans("NoCommentYet").'<br>';
} }

View File

@ -200,8 +200,7 @@ class Opensurveysondage extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
@ -263,8 +262,7 @@ class Opensurveysondage extends CommonObject
$this->date_m = $this->db->jdate($obj->tls); $this->date_m = $this->db->jdate($obj->tls);
$ret = 1; $ret = 1;
} }
else else {
{
$sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey); $sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey);
$this->error = 'Fetch no poll found for '.$sondage; $this->error = 'Fetch no poll found for '.$sondage;
dol_syslog($this->error, LOG_ERR); dol_syslog($this->error, LOG_ERR);
@ -273,8 +271,7 @@ class Opensurveysondage extends CommonObject
$this->db->free($resql); $this->db->free($resql);
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
$ret = -1; $ret = -1;
} }
@ -343,8 +340,7 @@ class Opensurveysondage extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -409,8 +405,7 @@ class Opensurveysondage extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@ -114,8 +114,7 @@ if ($resql)
$input .= 'KO;'; $input .= 'KO;';
$somme[$k]++; $somme[$k]++;
} }
else else {
{
$input .= ';'; $input .= ';';
} }
} }

View File

@ -191,8 +191,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -94,8 +94,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
$error++; $error++;
} }
else else {
{
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)';
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -262,8 +261,7 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D")
$adresseadmin = $object->mail_admin; $adresseadmin = $object->mail_admin;
} }
else else {
{
$erreur_ajout_date = "yes"; $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 '<input type="submit" class="button" name="retoursondage" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '<br><br>'."\n"; print '<br><br>'."\n";
} }
else else {
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db); $formother = new FormOther($db);
@ -753,8 +750,7 @@ if ($object->format == "D")
print '</tr>'."\n"; print '</tr>'."\n";
} }
} }
else else {
{
// Show titles // Show titles
print '<tr>'."\n"; print '<tr>'."\n";
print '<td></td>'."\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 //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs
if ($compteur == $ligneamodifier) if ($compteur == $ligneamodifier)
{ {
@ -869,8 +864,7 @@ while ($compteur < $num)
print '</td>'."\n"; print '</td>'."\n";
} }
} }
else else {
{
for ($i = 0; $i < $nbcolonnes; $i++) for ($i = 0; $i < $nbcolonnes; $i++)
{ {
$car = substr($ensemblereponses, $i, 1); $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').')' : ''); $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i], '%A').')' : '');
} }
} }
else else {
{
$tmps = explode('@', $toutsujet[$i]); $tmps = explode('@', $toutsujet[$i]);
$meilleursujet .= dol_htmlentities($tmps[0]); $meilleursujet .= dol_htmlentities($tmps[0]);
} }

View File

@ -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'); $motmois = dol_print_date(mktime(0, 0, 0, $_SESSION["mois"], 10), '%B');
} }
else else {
{
$motmois = dol_print_date(dol_now(), '%B'); $motmois = dol_print_date(dol_now(), '%B');
} }

View File

@ -89,8 +89,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
$testdate = true; $testdate = true;
$_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc');
} }
else else {
{
$testdate = true; $testdate = true;
$_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc');
//$testdate = false; //$testdate = false;
@ -193,8 +192,7 @@ if (GETPOST('choix_sondage'))
print '<input type="hidden" name="choix_sondage" value="'.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")).')">'; 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 // Show image to selecte between date survey or other survey
print '<br><table>'."\n"; print '<br><table>'."\n";
print '<tr><td>'.$langs->trans("CreateSurveyDate").'</td><td></td> '."\n"; print '<tr><td>'.$langs->trans("CreateSurveyDate").'</td><td></td> '."\n";

View File

@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }

View File

@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -96,8 +95,7 @@ if ($action == "setlive")
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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 '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=1">'; print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
} }

View File

@ -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))
{ {
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$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">' : ''); $out .= '&securekey='.($mode ? '<font color="#666666">' : '');
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + order_ref)"; 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); 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))
{ {
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$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">' : ''); $out .= '&securekey='.($mode ? '<font color="#666666">' : '');
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; 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); 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))
{ {
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$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">' : ''); $out .= '&securekey='.($mode ? '<font color="#666666">' : '');
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; 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); 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))
{ {
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$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">' : ''); $out .= '&securekey='.($mode ? '<font color="#666666">' : '');
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + member_ref)"; 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); 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); header("Location: ".$payPalURL);
exit; exit;
} }
else else {
{
//Display a user friendly Error on the page using any of the following error information returned by PayPal //Display a user friendly Error on the page using any of the following error information returned by PayPal
$ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
$ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); $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"; $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('SetExpressCheckoutAPICallFailed')."<br>\n";
$mesg .= $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n"; $mesg .= $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n";
$mesg .= $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."<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 $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."&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory)
} }
$nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType); $nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType);
@ -597,8 +590,7 @@ function hash_call($methodName, $nvpStr)
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} }
else else {
{
$API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Endpoint = "https://api-3t.paypal.com/nvp";
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; $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. //Execute the Error handling module to display errors.
} }
else else {
{
//closing the curl //closing the curl
curl_close($ch); curl_close($ch);
} }

View File

@ -53,8 +53,7 @@ if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha'
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} }
else else {
{
$API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Endpoint = "https://api-3t.paypal.com/nvp";
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
} }

View File

@ -74,8 +74,7 @@ if ($action == 'setconst' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null); setEventMessages($langs->trans("SetupSaved"), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -94,8 +93,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null); setEventMessages($langs->trans("SetupSaved"), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -162,8 +160,7 @@ if ($mode == 'setup' && $user->admin)
{ {
print $langs->trans("IsTokenGenerated"); print $langs->trans("IsTokenGenerated");
} }
else else {
{
print $langs->trans($key['varname']); print $langs->trans($key['varname']);
} }
print '</td>'; print '</td>';
@ -197,8 +194,7 @@ if ($mode == 'setup' && $user->admin)
$tokenobj = null; $tokenobj = null;
// Dolibarr storage // Dolibarr storage
$storage = new DoliStorage($db, $conf); $storage = new DoliStorage($db, $conf);
try try {
{
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE); $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
} }
catch (Exception $e) catch (Exception $e)
@ -268,14 +264,12 @@ if ($mode == 'config' && $user->admin)
{ {
print ajax_constantonoff($printer->active); print ajax_constantonoff($printer->active);
} }
else else {
{
if (empty($conf->global->{$printer->conf})) if (empty($conf->global->{$printer->conf}))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;varname='.$printer->active.'&amp;value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;varname='.$printer->active.'&amp;value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;varname='.$printer->active.'&amp;value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=setvalue&amp;varname='.$printer->active.'&amp;value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
} }

View File

@ -86,8 +86,7 @@ $morehtml .= '</SELECT>';
$morehtml .= '<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">'; $morehtml .= '<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">';
if ($mine) $tooltiphelp = $langs->trans("MyTasksDesc"); if ($mine) $tooltiphelp = $langs->trans("MyTasksDesc");
else else {
{
if ($user->rights->projet->all->lire && !$socid) $tooltiphelp = $langs->trans("TasksDesc"); if ($user->rights->projet->all->lire && !$socid) $tooltiphelp = $langs->trans("TasksDesc");
else $tooltiphelp = $langs->trans("TasksPublicDesc"); else $tooltiphelp = $langs->trans("TasksPublicDesc");
} }
@ -171,8 +170,7 @@ if ($resql)
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
@ -228,8 +226,7 @@ if ($resql)
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
@ -340,8 +337,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_MONTH))
} }
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
@ -392,8 +388,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_YEAR))
} }
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
@ -581,8 +576,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }

View File

@ -100,8 +100,7 @@ elseif ($search_usertoprocessid > 0)
$usertoprocess->fetch($search_usertoprocessid); $usertoprocess->fetch($search_usertoprocessid);
$search_usertoprocessid = $usertoprocess->id; $search_usertoprocessid = $usertoprocess->id;
} }
else else {
{
$usertoprocess = new User($db); $usertoprocess = new User($db);
} }
@ -194,8 +193,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$result = $object->fetch($taskid, $ref); $result = $object->fetch($taskid, $ref);
if ($result < 0) $error++; if ($result < 0) $error++;
} }
else else {
{
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
$error++; $error++;
} }
@ -232,8 +230,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
} }
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -247,8 +244,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); 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_datehour = dol_mktime(GETPOST($key."hour"), GETPOST($key."min"), 0, $monthofday, $dayofday, $yearofday);
$object->timespent_withhour = 1; $object->timespent_withhour = 1;
} }
else else {
{
$object->timespent_datehour = dol_mktime(12, 0, 0, $monthofday, $dayofday, $yearofday); $object->timespent_datehour = dol_mktime(12, 0, 0, $monthofday, $dayofday, $yearofday);
} }
$object->timespent_date = $object->timespent_datehour; $object->timespent_date = $object->timespent_datehour;
@ -316,8 +311,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
{ {
$result = $object->addTimeSpent($user); $result = $object->addTimeSpent($user);
} }
else else {
{
setEventMessages("ErrorBadDate", null, 'errors'); setEventMessages("ErrorBadDate", null, 'errors');
$error++; $error++;
break; break;
@ -340,8 +334,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
exit; exit;
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
} }
} }
@ -466,8 +459,7 @@ dol_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'task');
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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 (empty($usertoprocess->id) || $usertoprocess->id < 0)
{ {
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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>'; print $langs->trans("OnlyYourTaskAreVisible").'<br>';
} }
else else {
{
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>'; print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
} }
print '</div>'; print '</div>';
@ -789,8 +780,7 @@ if (count($tasksarray) > 0)
</tr>'; </tr>';
} }
} }
else else {
{
print '<tr><td colspan="14"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>'; print '<tr><td colspan="14"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -103,8 +103,7 @@ elseif ($search_usertoprocessid > 0)
$usertoprocess->fetch($search_usertoprocessid); $usertoprocess->fetch($search_usertoprocessid);
$search_usertoprocessid = $usertoprocess->id; $search_usertoprocessid = $usertoprocess->id;
} }
else else {
{
$usertoprocess = new User($db); $usertoprocess = new User($db);
} }
@ -150,8 +149,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$result = $object->fetch($taskid, $ref); $result = $object->fetch($taskid, $ref);
if ($result < 0) $error++; if ($result < 0) $error++;
} }
else else {
{
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
$error++; $error++;
} }
@ -189,8 +187,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
} }
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -204,8 +201,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -226,8 +222,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
{ {
setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
} }
else else {
{
foreach ($timetoadd as $taskid => $value) // Loop on each task foreach ($timetoadd as $taskid => $value) // Loop on each task
{ {
$updateoftaskdone = 0; $updateoftaskdone = 0;
@ -389,8 +384,7 @@ dol_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, 'task');
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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 (empty($usertoprocess->id) || $usertoprocess->id < 0)
{ {
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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>'; print $langs->trans("OnlyYourTaskAreVisible").'<br>';
} }
else else {
{
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>'; print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
} }
print '</div>'; print '</div>';
@ -610,8 +603,7 @@ if (count($tasksarray) > 0)
</tr>'; </tr>';
} }
} }
else else {
{
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>'; print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -111,8 +111,7 @@ elseif ($search_usertoprocessid > 0)
$usertoprocess->fetch($search_usertoprocessid); $usertoprocess->fetch($search_usertoprocessid);
$search_usertoprocessid = $usertoprocess->id; $search_usertoprocessid = $usertoprocess->id;
} }
else else {
{
$usertoprocess = new User($db); $usertoprocess = new User($db);
} }
@ -206,8 +205,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$result = $object->fetch($taskid, $ref); $result = $object->fetch($taskid, $ref);
if ($result < 0) $error++; if ($result < 0) $error++;
} }
else else {
{
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
$error++; $error++;
} }
@ -245,8 +243,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
} }
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -260,8 +257,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings');
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); 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'); setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors');
} }
else else {
{
foreach ($timetoadd as $taskid => $value) // Loop on each task foreach ($timetoadd as $taskid => $value) // Loop on each task
{ {
$updateoftaskdone = 0; $updateoftaskdone = 0;
@ -482,8 +477,7 @@ dol_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'task');
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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 (empty($usertoprocess->id) || $usertoprocess->id < 0)
{ {
if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'<br>'; 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>'; print $langs->trans("OnlyYourTaskAreVisible").'<br>';
} }
else else {
{
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>'; print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
} }
print '</div>'; print '</div>';
@ -838,8 +831,7 @@ if (count($tasksarray) > 0)
</tr>'; </tr>';
} }
} }
else else {
{
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>'; print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -83,8 +82,7 @@ if ($action == 'updateMaskTask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($obj->error, $obj->errors, 'errors'); setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project_task&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($obj->error, $obj->errors, 'errors'); setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -385,8 +379,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -405,8 +398,7 @@ foreach ($dirmodels as $reldir)
{ {
$htmltooltip .= $nextval.'<br>'; $htmltooltip .= $nextval.'<br>';
} }
else else {
{
$htmltooltip .= $langs->trans($module->error).'<br>'; $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'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodtask&amp;value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodtask&amp;value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -506,8 +497,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
{ {
$htmltooltip .= $nextval.'<br>'; $htmltooltip .= $nextval.'<br>';
} }
else else {
{
$htmltooltip .= $langs->trans($module->error).'<br>'; $htmltooltip .= $langs->trans($module->error).'<br>';
} }
} }
@ -556,8 +546,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -625,8 +614,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print "</td>"; print "</td>";
} }
else else {
{
print "<td class=\"center\">\n"; print "<td class=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -638,8 +626,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; 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>'; 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 img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -713,8 +699,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -782,8 +767,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
print '</a>'; print '</a>';
print "</td>"; print "</td>";
} }
else else {
{
print "<td class=\"center\">\n"; print "<td class=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -795,8 +779,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; 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>'; 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 img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -863,8 +845,7 @@ if (!$conf->use_javascript_ajax)
print $langs->trans("NotAvailableWhenAjaxDisabled"); print $langs->trans("NotAvailableWhenAjaxDisabled");
print "</td>"; print "</td>";
} }
else else {
{
print '<td width="60" class="right">'; print '<td width="60" class="right">';
$arrval = array('0'=>$langs->trans("No"), $arrval = array('0'=>$langs->trans("No"),
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',

View File

@ -103,8 +103,7 @@ if (empty($reshook))
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
else else {
{
dol_syslog($object->error, LOG_DEBUG); dol_syslog($object->error, LOG_DEBUG);
setEventMessages($langs->trans("CantRemoveProject", $langs->transnoentitiesnoconv("ProjectOverview")), null, 'errors'); setEventMessages($langs->trans("CantRemoveProject", $langs->transnoentitiesnoconv("ProjectOverview")), null, 'errors');
} }
@ -184,8 +183,7 @@ if (empty($reshook))
$error++; $error++;
} }
} }
else else {
{
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans($object->error), null, 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
$error++; $error++;
@ -213,21 +211,18 @@ if (empty($reshook))
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
else else {
{
header("Location:card.php?id=".$object->id); header("Location:card.php?id=".$object->id);
exit; exit;
} }
} }
else else {
{
$db->rollback(); $db->rollback();
$action = 'create'; $action = 'create';
} }
} }
else else {
{
$action = 'create'; $action = 'create';
} }
} }
@ -335,8 +330,7 @@ if (empty($reshook))
$db->rollback(); $db->rollback();
$action = 'edit'; $action = 'edit';
} }
else else {
{
$db->commit(); $db->commit();
if (GETPOST('socid', 'int') > 0) $object->fetch_thirdparty(GETPOST('socid', 'int')); 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); $ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) if ($ret)
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
else else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
$action = ''; $action = '';
} }
} }
@ -421,8 +414,7 @@ if (empty($reshook))
header("Location: list.php?restore_lastsearch_values=1"); header("Location: list.php?restore_lastsearch_values=1");
exit; exit;
} }
else else {
{
dol_syslog($object->error, LOG_DEBUG); dol_syslog($object->error, LOG_DEBUG);
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -443,8 +435,7 @@ if (empty($reshook))
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
else else {
{
// Load new object // Load new object
$newobject = new Project($db); $newobject = new Project($db);
$newobject->fetch($result); $newobject->fetch($result);
@ -704,8 +695,7 @@ if ($action == 'create' && $user->rights->projet->creer)
print ' &nbsp; &nbsp; '; print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
} }
else else {
{
print ' &nbsp; &nbsp; '; print ' &nbsp; &nbsp; ';
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">'; 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>'; print '</table>';
} }
else else {
{
dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
// Project card // Project card
@ -1240,8 +1229,7 @@ elseif ($object->id > 0)
{ {
print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'; print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Modify').'</a>'; 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>'; 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>'; 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.'&amp;action=close">'.$langs->trans("Close").'</a>'; print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=close">'.$langs->trans("Close").'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Close').'</a>'; 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.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>'; print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('ReOpen').'</a>'; 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>'; 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>'; 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.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="card.php?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Delete').'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Delete').'</a>';
} }
} }
@ -1419,8 +1402,7 @@ elseif ($object->id > 0)
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
} }
else else {
{
print $langs->trans("RecordNotFound"); print $langs->trans("RecordNotFound");
} }

View File

@ -453,8 +453,7 @@ class Projects extends DolibarrApi
{ {
return $this->get($id); return $this->get($id);
} }
else else {
{
throw new RestException(500, $this->project->error); throw new RestException(500, $this->project->error);
} }
} }

View File

@ -451,8 +451,7 @@ class Tasks extends DolibarrApi
{ {
return $this->get($id); return $this->get($id);
} }
else else {
{
throw new RestException(500, $this->task->error); throw new RestException(500, $this->task->error);
} }
} }

View File

@ -307,8 +307,7 @@ class Project extends CommonObject
// End call triggers // End call triggers
} }
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errno = $this->db->lasterrno(); $this->errno = $this->db->lasterrno();
$error++; $error++;
@ -334,8 +333,7 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
return $ret; return $ret;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -442,14 +440,12 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
$result = 1; $result = 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$result = -1; $result = -1;
} }
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
$this->db->rollback(); $this->db->rollback();
@ -457,15 +453,13 @@ class Project extends CommonObject
{ {
$result = -4; $result = -4;
} }
else else {
{
$result = -2; $result = -2;
} }
dol_syslog(get_class($this)."::update error ".$result." ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::update error ".$result." ".$this->error, LOG_ERR);
} }
} }
else else {
{
dol_syslog(get_class($this)."::update ref null"); dol_syslog(get_class($this)."::update ref null");
$result = -1; $result = -1;
} }
@ -554,8 +548,7 @@ class Project extends CommonObject
return 0; return 0;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; 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.")"; $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).")"; $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)"; $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 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)"; $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)"; $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 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 array even if empty*/
return $elements; return $elements;
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }
@ -807,8 +798,7 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
foreach ($this->errors as $errmsg) foreach ($this->errors as $errmsg)
{ {
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
@ -901,16 +891,14 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$this->error = join(',', $this->errors); $this->error = join(',', $this->errors);
dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR);
return -1; return -1;
} }
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
@ -961,16 +949,14 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$this->error = join(',', $this->errors); $this->error = join(',', $this->errors);
dol_syslog(get_class($this)."::setClose ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::setClose ".$this->error, LOG_ERR);
return -1; return -1;
} }
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
@ -1077,8 +1063,7 @@ class Project extends CommonObject
{ {
$url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id;
} }
else else {
{
$url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
} }
// Add param to save lastsearch_values or not // Add param to save lastsearch_values or not
@ -1199,8 +1184,7 @@ class Project extends CommonObject
{ {
$userAccess = 1; $userAccess = 1;
} }
else else {
{
foreach (array('internal', 'external') as $source) foreach (array('internal', 'external') as $source)
{ {
$userRole = $this->liste_contact(4, $source); $userRole = $this->liste_contact(4, $source);
@ -1272,7 +1256,7 @@ class Project extends CommonObject
$resql = $this->db->query($sql2); $resql = $this->db->query($sql2);
if ($resql) if ($resql)
{ {
while($obj = $this->db->fetch_object($resql)) while ($obj = $this->db->fetch_object($resql))
{ {
$listofprojectcontacttype[$obj->rowid]=$obj->code; $listofprojectcontacttype[$obj->rowid]=$obj->code;
} }
@ -1325,8 +1309,7 @@ class Project extends CommonObject
return $result; return $result;
} }
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
@ -1434,8 +1417,7 @@ class Project extends CommonObject
$clone_project->note_private = ''; $clone_project->note_private = '';
$clone_project->note_public = ''; $clone_project->note_public = '';
} }
else else {
{
$this->db->begin(); $this->db->begin();
$res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public'); $res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public');
if ($res < 0) if ($res < 0)
@ -1444,8 +1426,7 @@ class Project extends CommonObject
$error++; $error++;
$this->db->rollback(); $this->db->rollback();
} }
else else {
{
$this->db->commit(); $this->db->commit();
} }
@ -1457,8 +1438,7 @@ class Project extends CommonObject
$error++; $error++;
$this->db->rollback(); $this->db->rollback();
} }
else else {
{
$this->db->commit(); $this->db->commit();
} }
} }
@ -1482,8 +1462,7 @@ class Project extends CommonObject
$this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
$error++; $error++;
} }
else else {
{
if ($clone_project->error != '') if ($clone_project->error != '')
{ {
$this->error .= $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'; $this->error .= $langs->trans('ErrorInternalErrorDetected').':dol_mkdir';
$error++; $error++;
} }
@ -1546,8 +1524,7 @@ class Project extends CommonObject
$this->error .= $result_clone->error; $this->error .= $result_clone->error;
$error++; $error++;
} }
else else {
{
$new_task_id = $result_clone; $new_task_id = $result_clone;
$taskstatic->fetch($tasktoclone->id); $taskstatic->fetch($tasktoclone->id);
@ -1586,8 +1563,7 @@ class Project extends CommonObject
$this->db->commit(); $this->db->commit();
return $clone_project_id; return $clone_project_id;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR);
return -1; return -1;
@ -1681,8 +1657,7 @@ class Project extends CommonObject
$sql .= " SET fk_project=".$this->id; $sql .= " SET fk_project=".$this->id;
$sql .= " WHERE id=".$elementSelectId; $sql .= " WHERE id=".$elementSelectId;
} }
else else {
{
$sql .= " SET fk_projet=".$this->id; $sql .= " SET fk_projet=".$this->id;
$sql .= " WHERE rowid=".$elementSelectId; $sql .= " WHERE rowid=".$elementSelectId;
} }
@ -1716,8 +1691,7 @@ class Project extends CommonObject
{ {
$sql .= " SET fk_project=NULL"; $sql .= " SET fk_project=NULL";
$sql .= " WHERE id=".$elementSelectId; $sql .= " WHERE id=".$elementSelectId;
} else } else {
{
$sql .= " SET ".$projectfield."=NULL"; $sql .= " SET ".$projectfield."=NULL";
$sql .= " WHERE rowid=".$elementSelectId; $sql .= " WHERE rowid=".$elementSelectId;
} }
@ -1809,8 +1783,7 @@ class Project extends CommonObject
$this->weekWorkLoad[$day] = $obj->task_duration; $this->weekWorkLoad[$day] = $obj->task_duration;
$this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
} }
else else {
{
$this->weekWorkLoad[$day] += $obj->task_duration; $this->weekWorkLoad[$day] += $obj->task_duration;
$this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
} }
@ -1820,8 +1793,7 @@ class Project extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1; return -1;
@ -1876,8 +1848,7 @@ class Project extends CommonObject
$this->monthWorkLoad[$week_number] = $obj->task_duration; $this->monthWorkLoad[$week_number] = $obj->task_duration;
$this->monthWorkLoadPerTask[$week_number][$obj->fk_task] = $obj->task_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_task] = $obj->task_duration;
} }
else else {
{
$this->monthWorkLoad[$week_number] += $obj->task_duration; $this->monthWorkLoad[$week_number] += $obj->task_duration;
$this->monthWorkLoadPerTask[$week_number][$obj->fk_task] += $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); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1; return -1;
@ -1958,8 +1928,7 @@ class Project extends CommonObject
return $response; return $response;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
@ -2017,8 +1986,7 @@ class Project extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
@ -2085,8 +2053,7 @@ class Project extends CommonObject
$this->db->free($result); $this->db->free($result);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }

View File

@ -93,8 +93,7 @@ class ProjectStats extends Stats
$row[0] $row[0]
); );
} }
else else $other += $row[1];
$other += $row[1];
$i++; $i++;
} }
if ($num > $limit) if ($num > $limit)
@ -282,8 +281,7 @@ class ProjectStats extends Stats
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $filedate; $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."); 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."."); dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate.".");
$data = json_decode(file_get_contents($newpathofdestfile), true); $data = json_decode(file_get_contents($newpathofdestfile), true);
} }
else else {
{
$year = $startyear; $year = $startyear;
while ($year <= $endyear) while ($year <= $endyear)
{ {

View File

@ -226,8 +226,7 @@ class Task extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
@ -329,8 +328,7 @@ class Task extends CommonObject
return 0; return 0;
} }
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -440,8 +438,7 @@ class Task extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -544,8 +541,7 @@ class Task extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
//Delete associated link file //Delete associated link file
if ($conf->projet->dir_output) if ($conf->projet->dir_output)
{ {
@ -590,8 +586,7 @@ class Task extends CommonObject
dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG); dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
else else {
{
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($obj) $ret = $obj->nb; if ($obj) $ret = $obj->nb;
$this->db->free($resql); $this->db->free($resql);
@ -601,8 +596,7 @@ class Task extends CommonObject
{ {
return $ret; return $ret;
} }
else else {
{
return -1; return -1;
} }
} }
@ -624,8 +618,7 @@ class Task extends CommonObject
dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG); dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
else else {
{
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($obj) $ret = $obj->nb; if ($obj) $ret = $obj->nb;
$this->db->free($resql); $this->db->free($resql);
@ -635,8 +628,7 @@ class Task extends CommonObject
{ {
return $ret; return $ret;
} }
else else {
{
return -1; return -1;
} }
} }
@ -817,8 +809,7 @@ class Task extends CommonObject
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec2"; $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec2";
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2"; $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"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
if ($includebilltime) if ($includebilltime)
{ {
@ -975,8 +966,7 @@ class Task extends CommonObject
} }
$this->db->free($resql); $this->db->free($resql);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
@ -1055,8 +1045,7 @@ class Task extends CommonObject
} }
$this->db->free($resql); $this->db->free($resql);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
@ -1080,7 +1069,7 @@ class Task extends CommonObject
while ($i < $num) while ($i < $num)
{ {
if ($source == 'thirdparty') $contactAlreadySelected[$i] = $tab[$i]['socid']; if ($source == 'thirdparty') $contactAlreadySelected[$i] = $tab[$i]['socid'];
else $contactAlreadySelected[$i] = $tab[$i]['id']; else $contactAlreadySelected[$i] = $tab[$i]['id'];
$i++; $i++;
} }
return $contactAlreadySelected; return $contactAlreadySelected;
@ -1148,8 +1137,7 @@ class Task extends CommonObject
// End call triggers // End call triggers
} }
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$ret = -1; $ret = -1;
} }
@ -1185,8 +1173,7 @@ class Task extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
} }
return $ret; return $ret;
@ -1247,8 +1234,7 @@ class Task extends CommonObject
$this->db->free($resql); $this->db->free($resql);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
return $result; return $result;
@ -1304,8 +1290,7 @@ class Task extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return $result; return $result;
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
return $result; return $result;
} }
@ -1357,8 +1342,7 @@ class Task extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -1444,8 +1428,7 @@ class Task extends CommonObject
$this->db->free($resql); $this->db->free($resql);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
@ -1511,8 +1494,7 @@ class Task extends CommonObject
} }
else $ret = 1; else $ret = 1;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
$ret = -1; $ret = -1;
@ -1583,8 +1565,7 @@ class Task extends CommonObject
{ {
$result = 0; $result = 0;
} }
else else {
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$result = -2; $result = -2;
} }
@ -1601,8 +1582,7 @@ class Task extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -1715,8 +1695,7 @@ class Task extends CommonObject
$clone_task->note_private = ''; $clone_task->note_private = '';
$clone_task->note_public = ''; $clone_task->note_public = '';
} }
else else {
{
$this->db->begin(); $this->db->begin();
$res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public'); $res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public');
if ($res < 0) if ($res < 0)
@ -1725,8 +1704,7 @@ class Task extends CommonObject
$error++; $error++;
$this->db->rollback(); $this->db->rollback();
} }
else else {
{
$this->db->commit(); $this->db->commit();
} }
@ -1738,8 +1716,7 @@ class Task extends CommonObject
$error++; $error++;
$this->db->rollback(); $this->db->rollback();
} }
else else {
{
$this->db->commit(); $this->db->commit();
} }
} }
@ -1759,8 +1736,7 @@ class Task extends CommonObject
$projectstatic->fetch($project_id); $projectstatic->fetch($project_id);
$clone_project_ref = $projectstatic->ref; $clone_project_ref = $projectstatic->ref;
} }
else else {
{
$clone_project_ref = $ori_project_ref; $clone_project_ref = $ori_project_ref;
} }
@ -1808,8 +1784,7 @@ class Task extends CommonObject
$this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
$error++; $error++;
} }
else else {
{
if ($clone_task->error != '') if ($clone_task->error != '')
{ {
$this->error .= $clone_task->error; $this->error .= $clone_task->error;
@ -1834,8 +1809,7 @@ class Task extends CommonObject
$this->db->commit(); $this->db->commit();
return $clone_task_id; return $clone_task_id;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR);
return -1; return -1;
@ -2039,8 +2013,7 @@ class Task extends CommonObject
return $response; return $response;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
@ -2088,8 +2061,7 @@ class Task extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;

View File

@ -83,8 +83,7 @@ class TaskStats extends Stats
$row[0] $row[0]
); );
} }
else else $other += $row[1];
$other += $row[1];
$i++; $i++;
} }
if ($num > $limit) if ($num > $limit)

View File

@ -123,8 +123,7 @@ print '<table class="border centpercent">';
// Visibility // Visibility
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
if ($object->public) print $langs->trans('SharedProject'); if ($object->public) print $langs->trans('SharedProject');
else else print $langs->trans('PrivateProject');
print $langs->trans('PrivateProject');
print '</td></tr>'; print '</td></tr>';
// Date start - end // Date start - end

View File

@ -74,15 +74,13 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else {
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -95,8 +93,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
{ {
$result = $object->swapContactStatus(GETPOST('ligne', 'int')); $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -112,8 +109,7 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr
header("Location: contact.php?id=".$object->id); header("Location: contact.php?id=".$object->id);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }

View File

@ -158,8 +158,7 @@ if ($object->id > 0)
$permtoedit = ($userWrite > 0); $permtoedit = ($userWrite > 0);
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} }
else else {
{
dol_print_error('', 'NoRecordFound'); dol_print_error('', 'NoRecordFound');
} }

View File

@ -528,24 +528,24 @@ $listofreferent = array(
// Change rules for benefit calculation // Change rules for benefit calculation
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) { if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) {
foreach($listofreferent as $key => $element) { foreach ($listofreferent as $key => $element) {
if ($listofreferent[$key]['margin'] == 'add') { if ($listofreferent[$key]['margin'] == 'add') {
unset($listofreferent[$key]['margin']); unset($listofreferent[$key]['margin']);
} }
} }
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN); $newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN);
foreach($newelementforplusmargin as $value) { foreach ($newelementforplusmargin as $value) {
$listofreferent[$value]['margin']='add'; $listofreferent[$value]['margin']='add';
} }
} }
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) { if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) {
foreach($listofreferent as $key => $element) { foreach ($listofreferent as $key => $element) {
if ($listofreferent[$key]['margin'] == 'add') { if ($listofreferent[$key]['margin'] == 'add') {
unset($listofreferent[$key]['margin']); unset($listofreferent[$key]['margin']);
} }
} }
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN); $newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN);
foreach($newelementforplusmargin as $value) { foreach ($newelementforplusmargin as $value) {
$listofreferent[$value]['margin']='minus'; $listofreferent[$value]['margin']='minus';
} }
} }
@ -686,8 +686,7 @@ foreach ($listofreferent as $key => $value)
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee); $tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'], 'MT'); $total_ht_by_line = price2num($tmp['amount'], 'MT');
} }
else else {
{
$tmp = $element->getSumOfAmount('', $dates, $datee); $tmp = $element->getSumOfAmount('', $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'], 'MT'); $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(); if (method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty();
} }
else else {
{
$expensereport = new ExpenseReport($db); $expensereport = new ExpenseReport($db);
$expensereport->fetch($element->fk_expensereport); $expensereport->fetch($element->fk_expensereport);
} }
@ -1000,8 +998,7 @@ foreach ($listofreferent as $key => $value)
{ {
print $expensereport->getNomUrl(1); print $expensereport->getNomUrl(1);
} }
else else {
{
// Show ref with link // Show ref with link
if ($element instanceof Task) 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 == '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 == '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 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, ... $date = $element->date; // invoice, ...
if (empty($date)) $date = $element->date_contrat; if (empty($date)) $date = $element->date_contrat;
if (empty($date)) $date = $element->datev; if (empty($date)) $date = $element->datev;
@ -1145,14 +1141,12 @@ foreach ($listofreferent as $key => $value)
$warning = $langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency); $warning = $langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency);
} }
} }
else else {
{
$othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled"));
} }
} }
elseif ($key == 'loan') $total_ht_by_line = $element->capital; elseif ($key == 'loan') $total_ht_by_line = $element->capital;
else else {
{
$total_ht_by_line = $element->total_ht; $total_ht_by_line = $element->total_ht;
} }
@ -1193,14 +1187,12 @@ foreach ($listofreferent as $key => $value)
$defaultvat = get_default_tva($mysoc, $mysoc); $defaultvat = get_default_tva($mysoc, $mysoc);
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT'); $total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT');
} }
else else {
{
$othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled"));
} }
} }
elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment(); elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment();
else else {
{
$total_ttc_by_line = $element->total_ttc; $total_ttc_by_line = $element->total_ttc;
} }
@ -1248,8 +1240,7 @@ foreach ($listofreferent as $key => $value)
{ {
print $element->getLibStatut(3); print $element->getLibStatut(3);
} }
else else {
{
print $element->getLibStatut(5); print $element->getLibStatut(5);
} }
print '</td>'; print '</td>';
@ -1324,8 +1315,7 @@ foreach ($listofreferent as $key => $value)
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
else else {
{
if (!is_array($elementarray)) // error if (!is_array($elementarray)) // error
{ {
print $elementarray; print $elementarray;

View File

@ -196,8 +196,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
{ {
$parent = '-'.$project_id; $parent = '-'.$project_id;
} }
else else {
{
$parent = $task["task_parent_alternate_id"]; $parent = $task["task_parent_alternate_id"];
//$parent = $task["task_parent"]; //$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=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]);
$link = ''; $link = '';
} }
else else {
{
$link = DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"]; $link = DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"];
} }

View File

@ -380,14 +380,12 @@ if (count($tasksarray) > 0)
print '</div>'; print '</div>';
} }
else else {
{
$langs->load("admin"); $langs->load("admin");
print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled"); print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled");
} }
} }
else else {
{
print '<div class="opacitymedium">'.$langs->trans("NoTasks").'</div>'; print '<div class="opacitymedium">'.$langs->trans("NoTasks").'</div>';
} }

View File

@ -99,8 +99,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
print "<br>"; print "<br>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }

View File

@ -89,8 +89,7 @@ $morehtml .= '<input type="submit" class="button" name="refresh" value="'.$langs
$morehtml .= '</form>'; $morehtml .= '</form>';
if ($mine) $tooltiphelp = $langs->trans("MyProjectsDesc"); if ($mine) $tooltiphelp = $langs->trans("MyProjectsDesc");
else else {
{
if (!empty($user->rights->projet->all->lire) && !$socid) $tooltiphelp = $langs->trans("ProjectsDesc"); if (!empty($user->rights->projet->all->lire) && !$socid) $tooltiphelp = $langs->trans("ProjectsDesc");
else $tooltiphelp = $langs->trans("ProjectsPublicDesc"); else $tooltiphelp = $langs->trans("ProjectsPublicDesc");
} }
@ -328,8 +327,7 @@ if ($resql)
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
} }
else else {
{
print $langs->trans("OthersNotLinkedToThirdParty"); print $langs->trans("OthersNotLinkedToThirdParty");
} }
print '</td>'; print '</td>';
@ -354,8 +352,7 @@ if ($resql)
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
print "</table>"; print "</table>";

View File

@ -53,8 +53,7 @@ if (GETPOST('actioncode', 'array'))
$actioncode = GETPOST('actioncode', 'array', 3); $actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0'; 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)); $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'); $search_agenda_label = GETPOST('search_agenda_label');

View File

@ -234,8 +234,7 @@ if (empty($reshook))
setEventMessages($langs->trans("DontHaveTheValidateStatus", $objecttmp->ref), null, 'warnings'); setEventMessages($langs->trans("DontHaveTheValidateStatus", $objecttmp->ref), null, 'warnings');
} }
} }
else else {
{
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++; $error++;
break; break;
@ -248,8 +247,7 @@ if (empty($reshook))
else setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs');
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -459,8 +457,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
// Show description of content // Show description of content
$texthelp = ''; $texthelp = '';
if ($search_project_user == $user->id) $texthelp .= $langs->trans("MyProjectsDesc"); if ($search_project_user == $user->id) $texthelp .= $langs->trans("MyProjectsDesc");
else else {
{
if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("ProjectsDesc"); if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("ProjectsDesc");
else $texthelp .= $langs->trans("ProjectsPublicDesc"); else $texthelp .= $langs->trans("ProjectsPublicDesc");
} }
@ -753,8 +750,7 @@ while ($i < min($num, $limit))
{ {
print $socstatic->getNomUrl(1); print $socstatic->getNomUrl(1);
} }
else else {
{
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';
@ -795,8 +791,7 @@ while ($i < min($num, $limit))
} }
//else print $langs->trans("NoSalesRepresentativeAffected"); //else print $langs->trans("NoSalesRepresentativeAffected");
} }
else else {
{
print '&nbsp'; print '&nbsp';
} }
print '</td>'; print '</td>';

View File

@ -274,16 +274,14 @@ if ($action == 'createtask' && $user->rights->projet->creer)
{ {
$result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal'); $result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal');
} }
else else {
{
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("projects"); $langs->load("projects");
setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings'); setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings');
$duplicate_code_error = true; $duplicate_code_error = true;
} }
else else {
{
setEventMessages($task->error, $task->errors, 'errors'); setEventMessages($task->error, $task->errors, 'errors');
} }
$action = 'create'; $action = 'create';
@ -306,8 +304,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
$id = $projectid; $id = $projectid;
} }
} }
else else {
{
if (!empty($backtopage)) if (!empty($backtopage))
{ {
header("Location: ".$backtopage); header("Location: ".$backtopage);
@ -508,8 +505,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print $langs->trans("WarningProjectClosed"); print $langs->trans("WarningProjectClosed");
print '</div>'; print '</div>';
} }
else else {
{
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="createtask">'; 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); print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref);
} }
else else {
{
print $defaultref; print $defaultref;
} }
print '<input type="hidden" name="taskref" value="'.($_POST["ref"] ? $_POST["ref"] : $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'); print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
} }
else else {
{
print $langs->trans("NoUserAssignedToTheProject"); print $langs->trans("NoUserAssignedToTheProject");
} }
print '</td></tr>'; print '</td></tr>';
@ -812,8 +806,7 @@ elseif ($id > 0 || !empty($ref))
$j = 0; $level = 0; $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); $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; $colspan = 10;
if ($object->usage_bill_time) $colspan += 2; if ($object->usage_bill_time) $colspan += 2;
print '<tr class="oddeven nobottom"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoTasks").'</span></td></tr>'; 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'); cleanCorruptedTree($db, 'projet_task', 'fk_task_parent');
} }
} }
else else {
{
if ($nboftaskshown < count($tasksarray) && !GETPOST('search_user_id', 'int')) if ($nboftaskshown < count($tasksarray) && !GETPOST('search_user_id', 'int'))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -75,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject))
{ {
$id = $objectsarray[0]->id; $id = $objectsarray[0]->id;
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
} }
} }

View File

@ -69,8 +69,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
{ {
dol_print_error($db, $projectstatic->error, $projectstatic->errors); dol_print_error($db, $projectstatic->error, $projectstatic->errors);
} }
else else {
{
$contactsofproject = $projectstatic->getListContactId('internal'); $contactsofproject = $projectstatic->getListContactId('internal');
foreach ($contactsofproject as $key => $val) 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")); $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' : '')); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
exit; exit;
} }
else else {
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -110,8 +106,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
{ {
$result = $object->swapContactStatus(GETPOST('ligne')); $result = $object->swapContactStatus(GETPOST('ligne'));
} }
else else {
{
dol_print_error($db); 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' : '')); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -143,8 +137,7 @@ if (!empty($project_ref) && !empty($withproject))
{ {
$id = $tasksarray[0]->id; $id = $tasksarray[0]->id;
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
exit; exit;
} }
@ -546,8 +539,7 @@ if ($id > 0 || !empty($ref))
} }
print "</table>"; print "</table>";
} }
else else {
{
print "ErrorRecordNotFound"; print "ErrorRecordNotFound";
} }
} }

View File

@ -80,8 +80,7 @@ if (!empty($project_ref) && !empty($withproject))
$id = $tasksarray[0]->id; $id = $tasksarray[0]->id;
$object->fetch($id); $object->fetch($id);
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
exit; exit;
} }
@ -104,8 +103,7 @@ if ($id > 0 || !empty($ref))
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -319,8 +317,7 @@ if ($object->id > 0)
$relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/';
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} }
else else {
{
header('Location: index.php'); header('Location: index.php');
exit; exit;
} }

View File

@ -437,8 +437,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
// Show description of content // Show description of content
$texthelp = ''; $texthelp = '';
if ($search_task_user == $user->id) $texthelp .= $langs->trans("MyTasksDesc"); if ($search_task_user == $user->id) $texthelp .= $langs->trans("MyTasksDesc");
else else {
{
if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("TasksOnProjectsDesc"); if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("TasksOnProjectsDesc");
else $texthelp .= $langs->trans("TasksOnProjectsPublicDesc"); else $texthelp .= $langs->trans("TasksOnProjectsPublicDesc");
} }
@ -754,8 +753,7 @@ while ($i < min($num, $limit))
$socstatic->name = $obj->name; $socstatic->name = $obj->name;
print $socstatic->getNomUrl(1); print $socstatic->getNomUrl(1);
} }
else else {
{
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';
@ -857,8 +855,7 @@ while ($i < min($num, $limit))
$totalarray['val']['t.tobill'] += $obj->tobill; $totalarray['val']['t.tobill'] += $obj->tobill;
$totalarray['totaltobill'] += $obj->tobill; $totalarray['totaltobill'] += $obj->tobill;
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
} }
print '</td>'; print '</td>';
@ -876,8 +873,7 @@ while ($i < min($num, $limit))
$totalarray['val']['t.billed'] += $obj->billed; $totalarray['val']['t.billed'] += $obj->billed;
$totalarray['totalbilled'] += $obj->billed; $totalarray['totalbilled'] += $obj->billed;
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
} }
print '</td>'; print '</td>';

View File

@ -58,8 +58,7 @@ if ($id > 0 || !empty($ref))
$object->project = clone $projectstatic; $object->project = clone $projectstatic;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -76,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject))
$id = $tasksarray[0]->id; $id = $tasksarray[0]->id;
$object->fetch($id); $object->fetch($id);
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode));
} }
} }

View File

@ -114,8 +114,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer)
} }
} }
} }
else else {
{
$action = 'edit'; $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' : '')); header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }
@ -150,8 +148,7 @@ if (!empty($project_ref) && !empty($withproject))
{ {
$id = $tasksarray[0]->id; $id = $tasksarray[0]->id;
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); 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>'; print '</form>';
} }
else else {
{
/* /*
* Fiche tache en mode visu * 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.'&amp;action=edit&amp;withproject='.$withproject.'">'.$langs->trans('Modify').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit&amp;withproject='.$withproject.'">'.$langs->trans('Modify').'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Modify').'</a>'; 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.'&amp;action=delete&amp;withproject='.$withproject.'">'.$langs->trans('Delete').'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=delete&amp;withproject='.$withproject.'">'.$langs->trans('Delete').'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>'; 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>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
} }

View File

@ -155,16 +155,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
{ {
$object->fetch($id, $ref); $object->fetch($id, $ref);
} }
else else {
{
if (!GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0) if (!GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0)
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors');
$action = 'createtime'; $action = 'createtime';
$error++; $error++;
} }
else else {
{
$object->fetch(GETPOST('taskid', 'int')); $object->fetch(GETPOST('taskid', 'int'));
} }
} }
@ -179,8 +177,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
$action = 'createtime'; $action = 'createtime';
$error++; $error++;
} }
else else {
{
$object->timespent_note = $_POST["timespent_note"]; $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 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 $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_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
$object->timespent_withhour = 1; $object->timespent_withhour = 1;
} }
else else {
{
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
} }
$object->timespent_fk_user = $_POST["userid"]; $object->timespent_fk_user = $_POST["userid"];
@ -200,16 +196,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
{ {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans($object->error), null, 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
$error++; $error++;
} }
} }
} }
} }
else else {
{
if (empty($id)) $action = 'createtime'; if (empty($id)) $action = 'createtime';
else $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_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
$object->timespent_withhour = 1; $object->timespent_withhour = 1;
} }
else else {
{
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
} }
$object->timespent_fk_user = $_POST["userid_line"]; $object->timespent_fk_user = $_POST["userid_line"];
@ -255,14 +248,12 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
{ {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans($object->error), null, 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
$error++; $error++;
} }
} }
else else {
{
$object->fetch($id, $ref); $object->fetch($id, $ref);
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) // 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_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
$object->timespent_withhour = 1; $object->timespent_withhour = 1;
} }
else else {
{
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
} }
$object->timespent_fk_user = $_POST["userid_line"]; $object->timespent_fk_user = $_POST["userid_line"];
@ -287,15 +277,13 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
{ {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans($object->error), null, 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
$error++; $error++;
} }
} }
} }
else else {
{
$action = ''; $action = '';
} }
} }
@ -313,8 +301,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->l
$error++; $error++;
$action = ''; $action = '';
} }
else else {
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
} }
} }
@ -329,8 +316,7 @@ if (!empty($project_ref) && !empty($withproject))
{ {
$id = $tasksarray[0]->id; $id = $tasksarray[0]->id;
} }
else else {
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
exit; exit;
} }
@ -368,8 +354,7 @@ if ($action == 'confirm_generateinvoice')
{ {
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; 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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -408,8 +393,7 @@ if ($action == 'confirm_generateinvoice')
$localtax1 = $dataforprice['localtax1']; $localtax1 = $dataforprice['localtax1'];
$localtax2 = $dataforprice['localtax2']; $localtax2 = $dataforprice['localtax2'];
} }
else else {
{
$pu_ht = 0; $pu_ht = 0;
$txtva = get_default_tva($mysoc, $projectstatic->thirdparty); $txtva = get_default_tva($mysoc, $projectstatic->thirdparty);
$localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1); $localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1);
@ -570,8 +554,7 @@ if ($action == 'confirm_generateinvoice')
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -760,14 +743,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); $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); $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' : ''); $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); $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; $linktocreatetimeBtnStatus = -2;
$linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject"); $linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject");
} }
@ -1070,8 +1052,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $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); 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"; print '<!-- List of time spent for project -->'."\n";
$title = $langs->trans("ListTaskTimeForTask"); $title = $langs->trans("ListTaskTimeForTask");
@ -1112,8 +1092,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
} }
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -1172,8 +1151,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
if ($projectstatic->public) $contactsofproject = array(); 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'); 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) { if ($nboftasks) {
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); 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 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 dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
} }
print '</td>'; 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, ''); $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->id = $task_time->fk_task;
$tasktmp->ref = $task_time->ref; $tasktmp->ref = $task_time->ref;
$tasktmp->label = $task_time->label; $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'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
} }
} }
else else {
{
$userstatic->id = $task_time->fk_user; $userstatic->id = $task_time->fk_user;
$userstatic->lastname = $task_time->lastname; $userstatic->lastname = $task_time->lastname;
$userstatic->firstname = $task_time->firstname; $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>'; print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
} }
else else {
{
print dol_nl2br($task_time->note); print dol_nl2br($task_time->note);
} }
print '</td>'; 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 '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
} }
else else {
{
print convertSecondToTime($task_time->task_duration, 'allhourmin'); print convertSecondToTime($task_time->task_duration, 'allhourmin');
} }
print '</td>'; print '</td>';
@ -1479,13 +1452,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print $tmpinvoice->getNomUrl(1); print $tmpinvoice->getNomUrl(1);
} }
} }
else else {
{
print $langs->trans("No"); print $langs->trans("No");
} }
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; 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 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 dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
} }
print '</td>'; print '</td>';
@ -1619,8 +1589,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
} }
} }
else else {
{
$userstatic->id = $task_time->fk_user; $userstatic->id = $task_time->fk_user;
$userstatic->lastname = $task_time->lastname; $userstatic->lastname = $task_time->lastname;
$userstatic->firstname = $task_time->firstname; $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>'; print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
} }
else else {
{
print dol_nl2br($task_time->note); print dol_nl2br($task_time->note);
} }
print '</td>'; 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 '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
} }
else else {
{
print convertSecondToTime($task_time->task_duration, 'allhourmin'); print convertSecondToTime($task_time->task_duration, 'allhourmin');
} }
print '</td>'; 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 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 dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
} }
print '</td>'; print '</td>';
@ -1767,8 +1733,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
} }
} }
else else {
{
$userstatic->id = $task_time->fk_user; $userstatic->id = $task_time->fk_user;
$userstatic->lastname = $task_time->lastname; $userstatic->lastname = $task_time->lastname;
$userstatic->firstname = $task_time->firstname; $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>'; 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 dol_nl2br($task_time->note);
} }
print '</td>'; print '</td>';
@ -1807,8 +1771,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '<input type="hidden" name="old_duration_2" value="0">'; print '<input type="hidden" name="old_duration_2" value="0">';
print $form->select_duration('new_duration_2', 0, 0, 'text'); print $form->select_duration('new_duration_2', 0, 0, 'text');
} }
else else {
{
print convertSecondToTime($task_time->task_duration, 'allhourmin'); print convertSecondToTime($task_time->task_duration, 'allhourmin');
} }
print '</td>'; print '</td>';

View File

@ -189,8 +189,7 @@ if ($format == 'ical' || $format == 'vcal')
//header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); //header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit; exit;
} }
else else {
{
print 'Error '.$agenda->error; print 'Error '.$agenda->error;
exit; exit;
@ -227,8 +226,7 @@ if ($format == 'rss')
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit; exit;
} }
else else {
{
print 'Error '.$agenda->error; print 'Error '.$agenda->error;
exit; exit;

View File

@ -91,8 +91,7 @@ if ($result < 0)
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
exit; exit;
} }
else else {
{
if (empty($user->id)) if (empty($user->id))
{ {
echo " User login:".$userlogin." do not exists"; 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); dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
exit(-1); exit(-1);
} }
else else {
{
if ($result == 0) if ($result == 0)
{ {
echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n"; 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); dol_syslog("cron_run_jobs.php::run_jobs Error".$cronjob->error, LOG_ERR);
$nbofjobslaunchedko++; $nbofjobslaunchedko++;
} }
else else {
{
$nbofjobslaunchedok++; $nbofjobslaunchedok++;
} }
@ -226,8 +223,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0))
echo " - reprogrammed\n"; echo " - reprogrammed\n";
} }
else else {
{
echo " - not qualified\n"; 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')); 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"; echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok + $nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO";
} }
else else {
{
echo "Result: No active jobs found."; echo "Result: No active jobs found.";
} }

View File

@ -144,8 +144,7 @@ foreach ($modulesdir as $dir)
if ($modName) if ($modName)
{ {
try try {
{
include_once $dir.$file; include_once $dir.$file;
$objMod = new $modName($db); $objMod = new $modName($db);
@ -153,8 +152,7 @@ foreach ($modulesdir as $dir)
{ {
$j = $objMod->numero; $j = $objMod->numero;
} }
else else {
{
$j = 1000 + $i; $j = 1000 + $i;
} }
@ -381,8 +379,7 @@ foreach ($demoprofiles as $profilearray)
print "\n".'<!-- Module '.$modulekeyname.' hidden and always checked -->'; print "\n".'<!-- Module '.$modulekeyname.' hidden and always checked -->';
print '<input type="hidden" name="'.$modulekeyname.'" value="1">'; print '<input type="hidden" name="'.$modulekeyname.'" value="1">';
} }
else else {
{
$modulo = ($j % $nbcolsmod); $modulo = ($j % $nbcolsmod);
//if ($modulo == 0) print '<tr>'; //if ($modulo == 0) print '<tr>';
print '<!-- id='.$val->numero.' -->'; print '<!-- id='.$val->numero.' -->';
@ -435,8 +432,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIEN
print '</script>'."\n"; print '</script>'."\n";
print '</div>'."\n"; print '</div>'."\n";
} }
else else {
{
print '<!-- google js advert tag disabled with jmobile -->'."\n"; print '<!-- google js advert tag disabled with jmobile -->'."\n";
} }
} }

View File

@ -88,8 +88,7 @@ if ($resql)
{ {
print "<td>".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."</td>\n"; print "<td>".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."</td>\n";
} }
else else {
{
print "<td>Anonyme Anonyme</td>\n"; print "<td>Anonyme Anonyme</td>\n";
} }
print "<td>".dol_print_date($db->jdate($objp->datedon))."</td>\n"; print "<td>".dol_print_date($db->jdate($objp->datedon))."</td>\n";
@ -99,13 +98,11 @@ if ($resql)
} }
print "</table>"; print "</table>";
} }
else else {
{
print "Aucun don publique"; print "Aucun don publique";
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -391,8 +391,7 @@ if ($action == 'add')
{ {
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} }
else else {
{
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); $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)); $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} }
else else {
{
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); $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)); $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} }
else else {
{
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); $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)); $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} }
else else {
{
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); $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"); dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment");
exit; exit;
} }
@ -458,8 +453,7 @@ if ($action == 'add')
if (!empty($entity)) $urlback .= '&entity='.$entity; if (!empty($entity)) $urlback .= '&entity='.$entity;
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
} }
else else {
{
$error++; $error++;
$errmsg .= join('<br>', $adh->errors); $errmsg .= join('<br>', $adh->errors);
} }
@ -472,8 +466,7 @@ if ($action == 'add')
Header("Location: ".$urlback); Header("Location: ".$urlback);
exit; exit;
} }
else else {
{
$db->rollback(); $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 $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
else else {
{
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
print '<input type="hidden" id="type" name="type" value="'.$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 $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
else else {
{
print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
print '<input type="hidden" id="morphy" name="morphy" value="'.$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.'">'; 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="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.'">'; print '<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
} }

View File

@ -85,8 +85,7 @@ if ($id > 0)
{ {
print $langs->trans("ErrorThisMemberIsNotPublic"); print $langs->trans("ErrorThisMemberIsNotPublic");
} }
else else {
{
print '<table class="public_border" cellspacing="0" width="100%" cellpadding="3">'; 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"; print '<tr><td width="15%">'.$langs->trans("Type").'</td><td class="valeur">'.$object->type."</td></tr>\n";

View File

@ -153,8 +153,7 @@ if ($result)
print $form->showphoto('memberphoto', $objp, 64); print $form->showphoto('memberphoto', $objp, 64);
print '</td>'."\n"; print '</td>'."\n";
} }
else else {
{
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
} }
print "</tr>"; print "</tr>";
@ -162,8 +161,7 @@ if ($result)
} }
print "</table>"; print "</table>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -39,8 +39,7 @@ if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml'
print 'Sorry, it seems your internet connexion is off.<br>'; print 'Sorry, it seems your internet connexion is off.<br>';
print 'You need to be connected to network to use this software.<br>'; print 'You need to be connected to network to use this software.<br>';
} }
else else {
{
$langs->load("error"); $langs->load("error");
$langs->load("other"); $langs->load("other");

View File

@ -236,8 +236,7 @@ if ($source == 'proposal')
$mesg = $proposal->error; $mesg = $proposal->error;
$error++; $error++;
} }
else else {
{
$result = $proposal->fetch_thirdparty($proposal->socid); $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 if ($found && !$error) // We are in a management option and no error
{ {
} }
else else {
{
dol_print_error_email('ERRORNEWONLINESIGN'); dol_print_error_email('ERRORNEWONLINESIGN');
} }
} }
else else {
{
// Print // Print
} }

View File

@ -133,8 +133,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
$error++; $error++;
} }
else else {
{
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)';
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -173,8 +172,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
else dol_print_error($db); else dol_print_error($db);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors');
} }
} }
@ -392,8 +390,7 @@ if ($object->format == "D")
print '</tr>'."\n"; print '</tr>'."\n";
} }
} }
else else {
{
//display of survey topics //display of survey topics
print '<tr>'."\n"; print '<tr>'."\n";
print '<td></td>'."\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 //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs
if ($compteur == $ligneamodifier) if ($compteur == $ligneamodifier)
{ {
@ -509,8 +505,7 @@ while ($compteur < $num)
print '</td>'."\n"; print '</td>'."\n";
} }
} }
else else {
{
for ($i = 0; $i < $nbcolonnes; $i++) for ($i = 0; $i < $nbcolonnes; $i++)
{ {
$car = substr($ensemblereponses, $i, 1); $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').')'; $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')';
} }
} }
else else {
{
$tmps = explode('@', $toutsujet[$i]); $tmps = explode('@', $toutsujet[$i]);
$meilleursujet .= dol_htmlentities($tmps[0]); $meilleursujet .= dol_htmlentities($tmps[0]);
} }

View File

@ -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 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 $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
} }
else else {
{
$token = $conf->global->PAYMENT_SECURITY_TOKEN; $token = $conf->global->PAYMENT_SECURITY_TOKEN;
} }
if ($SECUREKEY != $token) if ($SECUREKEY != $token)
@ -371,8 +370,7 @@ if ($action == 'dopayment')
if ($paymentmethod == 'stripe') if ($paymentmethod == 'stripe')
{ {
if (GETPOST('newamount', 'alpha')) $amount = price2num(GETPOST('newamount', 'alpha'), 'MT'); if (GETPOST('newamount', 'alpha')) $amount = price2num(GETPOST('newamount', 'alpha'), 'MT');
else else {
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
$action = ''; $action = '';
} }
@ -469,8 +467,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
setEventMessages('Failed to create card record', null, 'errors'); setEventMessages('Failed to create card record', null, 'errors');
$action = ''; $action = '';
} }
else else {
{
if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG;
if (!empty($dol_id)) $metadata["dol_id"] = $dol_id; if (!empty($dol_id)) $metadata["dol_id"] = $dol_id;
if (!empty($dol_type)) $metadata["dol_type"] = $dol_type; 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; $vatcleaned = $vatnumber ? $vatnumber : null;
/*$taxinfo = array('type'=>'vat'); /*$taxinfo = array('type'=>'vat');
@ -670,8 +666,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
setEventMessages($paymentintent->status, null, 'errors'); setEventMessages($paymentintent->status, null, 'errors');
$action = ''; $action = '';
} }
else else {
{
// TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // 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. // 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'); //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); header("Location: ".$urlko);
exit; exit;
} }
else else {
{
header("Location: ".$urlok); header("Location: ".$urlok);
exit; exit;
} }
@ -914,8 +908,7 @@ if ($source == 'order')
$mesg = $order->error; $mesg = $order->error;
$error++; $error++;
} }
else else {
{
$result = $order->fetch_thirdparty($order->socid); $result = $order->fetch_thirdparty($order->socid);
} }
$object = $order; $object = $order;
@ -1009,8 +1002,7 @@ if ($source == 'order')
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n"; print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n"; print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
} }
else else {
{
print '<!-- Shipping address not complete, so we don t use it -->'."\n"; 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"; 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; $mesg = $invoice->error;
$error++; $error++;
} }
else else {
{
$result = $invoice->fetch_thirdparty($invoice->socid); $result = $invoice->fetch_thirdparty($invoice->socid);
} }
$object = $invoice; $object = $invoice;
@ -1103,8 +1094,7 @@ if ($source == 'invoice')
print '<input type="hidden" name="newamount" value="'.$amount.'">'; print '<input type="hidden" name="newamount" value="'.$amount.'">';
} }
} }
else else {
{
print '<b>'.price($object->total_ttc, 1, $langs).'</b>'; print '<b>'.price($object->total_ttc, 1, $langs).'</b>';
} }
// Currency // Currency
@ -1139,8 +1129,7 @@ if ($source == 'invoice')
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n"; print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n"; print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
} }
else else {
{
print '<!-- Shipping address not complete, so we don t use it -->'."\n"; 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"; 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; $mesg = $contractline->error;
$error++; $error++;
} }
else else {
{
if ($contractline->fk_contrat > 0) if ($contractline->fk_contrat > 0)
{ {
$result = $contract->fetch($contractline->fk_contrat); $result = $contract->fetch($contractline->fk_contrat);
@ -1177,14 +1165,12 @@ if ($source == 'contractline')
{ {
$result = $contract->fetch_thirdparty($contract->socid); $result = $contract->fetch_thirdparty($contract->socid);
} }
else else {
{
$mesg = $contract->error; $mesg = $contract->error;
$error++; $error++;
} }
} }
else else {
{
$mesg = 'ErrorRecordNotFound'; $mesg = 'ErrorRecordNotFound';
$error++; $error++;
} }
@ -1207,8 +1193,7 @@ if ($source == 'contractline')
$pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level];
$price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level];
} }
else else {
{
$pu_ht = $product->price; $pu_ht = $product->price;
$pu_ttc = $product->price_ttc; $pu_ttc = $product->price_ttc;
$price_base_type = $product->price_base_type; $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")); $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")); $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]; $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="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n"; print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
} }
else else {
{
print '<!-- Shipping address not complete, so we don t use it -->'."\n"; 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"; 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; $mesg = $member->error;
$error++; $error++;
} }
else else {
{
$member->fetch_thirdparty(); $member->fetch_thirdparty();
$subscription = new Subscription($db); $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="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n"; print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
} }
else else {
{
print '<!-- Shipping address not complete, so we don t use it -->'."\n"; 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"; 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; $mesg = $don->error;
$error++; $error++;
} }
else else {
{
$don->fetch_thirdparty(); $don->fetch_thirdparty();
} }
$object = $don; $object = $don;
@ -1668,8 +1648,7 @@ if ($source == 'donation')
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n"; print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n"; print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
} }
else else {
{
print '<!-- Shipping address not complete, so we don t use it -->'."\n"; 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"; 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>'; print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("DonationPaid").'</span>';
} }
else else {
{
// Membership can be paid and we still allow to make renewal // Membership can be paid and we still allow to make renewal
if ($source == 'membersubscription' && $object->datefin > dol_now()) if ($source == 'membersubscription' && $object->datefin > dol_now())
{ {
@ -1796,13 +1774,11 @@ if ($action != 'dopayment')
} }
} }
} }
else else {
{
dol_print_error_email('ERRORNEWPAYMENT'); dol_print_error_email('ERRORNEWPAYMENT');
} }
} }
else else {
{
// Print // Print
} }
@ -1940,8 +1916,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
{ {
print '<center>'.$langs->trans("Error").'</center>'; print '<center>'.$langs->trans("Error").'</center>';
} }
else else {
{
print '<input type="hidden" name="paymentintent_id" value="'.$paymentintent->id.'">'; print '<input type="hidden" name="paymentintent_id" value="'.$paymentintent->id.'">';
//$_SESSION["paymentintent_id"] = $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"); $langs->load("errors");
print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error'); print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error');
} }
else else {
{
print '<!-- JS Code for Stripe components -->'; print '<!-- JS Code for Stripe components -->';
print '<script src="https://js.stripe.com/v3/"></script>'."\n"; print '<script src="https://js.stripe.com/v3/"></script>'."\n";
print '<!-- urllogofull = '.$urllogofull.' -->'."\n"; print '<!-- urllogofull = '.$urllogofull.' -->'."\n";
@ -2173,7 +2147,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
<?php <?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 // 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 <?php
} }
else // Ask credit card with 3DS test else // Ask credit card with 3DS test
{ {
?> ?>
/* Use 3DS source */ /* Use 3DS source */

View File

@ -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'); dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used');
exit; exit;
} }
else else {
{
dol_syslog("paymentmethod=".$paymentmethod); 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'); dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
} }
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, '_payment');
} }
} }

View File

@ -222,8 +222,7 @@ if (!empty($conf->paypal->enabled))
// Nothing to do // Nothing to do
dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment'); 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'); dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment');
} }
@ -251,8 +250,7 @@ if (!empty($conf->paypal->enabled))
$ispaymentok = true; $ispaymentok = true;
} }
else else {
{
dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment'); 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 //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"]); $ErrorSeverityCode = urldecode($resArray2["L_SEVERITYCODE0"]);
} }
} }
else else {
{
dol_print_error('', 'Session expired'); dol_print_error('', 'Session expired');
} }
} }
else else {
{
dol_print_error('', '$PAYPALTOKEN not defined'); dol_print_error('', '$PAYPALTOKEN not defined');
} }
} }
@ -420,8 +416,7 @@ if ($ispaymentok)
$postactionmessages[] = $errmsg; $postactionmessages[] = $errmsg;
$ispostactionok = -1; $ispostactionok = -1;
} }
else else {
{
$postactionmessages[] = 'Subscription created'; $postactionmessages[] = 'Subscription created';
$ispostactionok = 1; $ispostactionok = 1;
} }
@ -443,8 +438,7 @@ if ($ispaymentok)
$postactionmessages = array_merge($postactionmessages, $object->errors); $postactionmessages = array_merge($postactionmessages, $object->errors);
$ispostactionok = -1; $ispostactionok = -1;
} }
else else {
{
if ($option == 'bankviainvoice') if ($option == 'bankviainvoice')
{ {
$postactionmessages[] = 'Invoice, payment and bank record created'; $postactionmessages[] = 'Invoice, payment and bank record created';
@ -523,8 +517,7 @@ if ($ispaymentok)
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
@ -590,8 +583,7 @@ if ($ispaymentok)
$postactionmessages[] = $errmsg; $postactionmessages[] = $errmsg;
$ispostactionok = -1; $ispostactionok = -1;
} }
else else {
{
if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)';
else $postactionmessages[] = 'Email sent to member (without any attached document)'; 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.'; $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; $ispostactionok = -1;
} }
} }
else else {
{
$postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found'; $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found';
$ispostactionok = -1; $ispostactionok = -1;
} }
@ -648,8 +638,7 @@ if ($ispaymentok)
{ {
$paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id $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 $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'; $postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
@ -672,8 +661,7 @@ if ($ispaymentok)
$ispostactionok = -1; $ispostactionok = -1;
$error++; $error++;
} }
else else {
{
$postactionmessages[] = 'Payment created'; $postactionmessages[] = 'Payment created';
$ispostactionok = 1; $ispostactionok = 1;
} }
@ -697,14 +685,12 @@ if ($ispaymentok)
$ispostactionok = -1; $ispostactionok = -1;
$error++; $error++;
} }
else else {
{
$postactionmessages[] = 'Bank transaction of payment created'; $postactionmessages[] = 'Bank transaction of payment created';
$ispostactionok = 1; $ispostactionok = 1;
} }
} }
else else {
{
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
$ispostactionok = -1; $ispostactionok = -1;
$error++; $error++;
@ -715,25 +701,21 @@ if ($ispaymentok)
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $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.'; $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; $ispostactionok = -1;
} }
} }
else else {
{
$postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found';
$ispostactionok = -1; $ispostactionok = -1;
} }
} }
else else {
{
// Nothing done // Nothing done
} }
} }
@ -811,8 +793,7 @@ if ($ispaymentok)
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n"; //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
$content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n"; $content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
} }
else else {
{
$content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n"; $content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n";
} }
$content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; $content .= $companylangs->transnoentities("PostActionAfterPayment").' : ';
@ -825,8 +806,7 @@ if ($ispaymentok)
{ {
$content .= $companylangs->transnoentitiesnoconv("None"); $content .= $companylangs->transnoentitiesnoconv("None");
} }
else else {
{
$topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); $topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')');
$content .= '<font color="red">'.$companylangs->transnoentitiesnoconv("Error").'</font>'; $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, '_payment');
//dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); //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, '_payment');
//dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0); //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0);
} }
} }
} }
else else {
{
// Get on url call // Get on url call
$onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN;
$payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID; $payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID;
@ -952,8 +930,7 @@ else
{ {
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
} }
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, '_payment');
} }
} }

View File

@ -49,8 +49,7 @@ if (isset($_GET['connect']))
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else {
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;
@ -63,8 +62,7 @@ else {
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else {
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;

View File

@ -49,8 +49,7 @@ if (isset($_GET['connect']))
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else {
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;
@ -63,8 +62,7 @@ else {
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else {
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;
@ -189,8 +187,7 @@ if ($event->type == 'payout.created') {
http_response_code(200); // PHP 5.4 or greater http_response_code(200); // PHP 5.4 or greater
return 1; return 1;
} }
else else {
{
$error++; $error++;
http_response_code(500); // PHP 5.4 or greater http_response_code(500); // PHP 5.4 or greater
return -1; return -1;
@ -270,8 +267,7 @@ elseif ($event->type == 'payout.paid') {
http_response_code(200); // PHP 5.4 or greater http_response_code(200); // PHP 5.4 or greater
return 1; return 1;
} }
else else {
{
$error++; $error++;
http_response_code(500); // PHP 5.4 or greater http_response_code(500); // PHP 5.4 or greater
return -1; return -1;
@ -344,8 +340,7 @@ elseif ($event->type == 'payment_method.attached') {
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -381,8 +376,7 @@ elseif ($event->type == 'payment_method.updated') {
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }

View File

@ -46,8 +46,7 @@ if (empty($usedolheader))
<?php <?php
} }
else else {
{
$arraycss = array(); $arraycss = array();
$arrayjs = array(); $arrayjs = array();
/* /*

View File

@ -188,8 +188,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
{ {
$action = 'presend'; $action = 'presend';
} }
else else {
{
$action = ''; $action = '';
} }
} }
@ -373,8 +372,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation'); print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation');
$object->viewTicketMessages(false, true, $object->dao); $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>'; print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.'">'.$langs->trans('Back').'</a></div>';
} }
} else { } else {

View File

@ -106,8 +106,7 @@ if (empty($pageid))
} }
} }
} }
else else {
{
if ($object->fk_default_home > 0) if ($object->fk_default_home > 0)
{ {
$result = $objectpage->fetch($object->fk_default_home); $result = $objectpage->fetch($object->fk_default_home);
@ -165,8 +164,7 @@ if ($pageid == 'css') // No more used ?
header('Cache-Control: no-cache'); header('Cache-Control: no-cache');
$original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/styles.css.php'; $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'; $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/page'.$pageid.'.tpl.php';
} }

View File

@ -78,8 +78,7 @@ if (empty($pageid))
$object->fetch($websiteid); $object->fetch($websiteid);
$website = $object->ref; $website = $object->ref;
} }
else else {
{
$object->fetch(0, $website); $object->fetch(0, $website);
} }

View File

@ -233,8 +233,7 @@ if (empty($reshook))
if ($object->origin == "supplierorder") if ($object->origin == "supplierorder")
$classname = 'CommandeFournisseur'; $classname = 'CommandeFournisseur';
else else $classname = ucfirst($object->origin);
$classname = ucfirst($object->origin);
$objectsrc = new $classname($db); $objectsrc = new $classname($db);
$objectsrc->fetch($object->origin_id); $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'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToReceive").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$error++; $error++;
} }
@ -366,8 +364,7 @@ if (empty($reshook))
header("Location: card.php?id=".$object->id); header("Location: card.php?id=".$object->id);
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
$_GET["commande_id"] = GETPOST('commande_id', 'int'); $_GET["commande_id"] = GETPOST('commande_id', 'int');
$action = 'create'; $action = 'create';
@ -388,8 +385,7 @@ if (empty($reshook))
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans($object->error), null, 'errors'); setEventMessages($langs->trans($object->error), null, 'errors');
} }
else else {
{
// Define output language // Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
@ -418,8 +414,7 @@ if (empty($reshook))
header("Location: ".DOL_URL_ROOT.'/reception/index.php'); header("Location: ".DOL_URL_ROOT.'/reception/index.php');
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -567,8 +562,7 @@ if (empty($reshook))
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit(); exit();
} }
else else {
{
setEventMessages($line->error, $line->errors, 'errors'); setEventMessages($line->error, $line->errors, 'errors');
} }
} }
@ -667,8 +661,7 @@ if (empty($reshook))
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $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 header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition
exit(); exit();
} }
@ -1049,8 +1042,7 @@ if ($action == 'create')
print '</td>'; print '</td>';
} }
else else {
{
print "<td>"; print "<td>";
if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); if ($type == 1) $text = img_object($langs->trans('Service'), 'service');
else $text = img_object($langs->trans('Product'), 'product'); else $text = img_object($langs->trans('Product'), 'product');
@ -1089,8 +1081,7 @@ if ($action == 'create')
{ {
$quantityToBeDelivered = 0; $quantityToBeDelivered = 0;
} }
else else {
{
$quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty'];
} }
$warehouse_id = $dispatchLines[$indiceAsked]['ent']; $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); print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0, 0, $line->fk_product, '', 1);
} }
} }
else else {
{
print $langs->trans("Service"); print $langs->trans("Service");
} }
print '</td>'; print '</td>';
@ -1195,8 +1185,7 @@ if ($action == 'create')
print '<br>'; print '<br>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -1247,8 +1236,7 @@ elseif ($id || $ref)
{ {
$numref = $object->getNextNumRef($soc); $numref = $object->getNextNumRef($soc);
} }
else else {
{
$numref = $object->ref; $numref = $object->ref;
} }
@ -1413,8 +1401,7 @@ elseif ($id || $ref)
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
else else {
{
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : '&nbsp;'; print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : '&nbsp;';
} }
print '</td>'; print '</td>';
@ -1437,8 +1424,7 @@ elseif ($id || $ref)
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">'; print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
print '</form>'; print '</form>';
} }
else else {
{
print $object->trueWeight; print $object->trueWeight;
print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; 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 ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
print '</form>'; print '</form>';
} }
else else {
{
print $object->trueHeight; print $object->trueHeight;
print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; 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 '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
else else {
{
if ($object->shipping_method_id > 0) if ($object->shipping_method_id > 0)
{ {
// Get code using getLabelFromKey // Get code using getLabelFromKey
@ -1585,8 +1569,7 @@ elseif ($id || $ref)
{ {
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); 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 $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>'; print '</td></tr>';
@ -1640,8 +1623,7 @@ elseif ($id || $ref)
{ {
print $langs->trans("QtyToReceive").' - '; print $langs->trans("QtyToReceive").' - ';
} }
else else {
{
print $langs->trans("QtyReceived").' - '; print $langs->trans("QtyReceived").' - ';
} }
if (!empty($conf->stock->enabled)) if (!empty($conf->stock->enabled))
@ -1654,14 +1636,12 @@ elseif ($id || $ref)
} }
print '</td>'; print '</td>';
} }
else else {
{
if ($object->statut <= 1) if ($object->statut <= 1)
{ {
print '<td class="center">'.$langs->trans("QtyToReceive").'</td>'; print '<td class="center">'.$langs->trans("QtyToReceive").'</td>';
} }
else else {
{
print '<td class="center">'.$langs->trans("QtyReceived").'</td>'; print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
} }
if (!empty($conf->stock->enabled)) if (!empty($conf->stock->enabled))
@ -1769,8 +1749,7 @@ elseif ($id || $ref)
$prod->fetch($lines[$i]->fk_product); $prod->fetch($lines[$i]->fk_product);
$label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label;
} }
else else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
$label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
print '<td>'; print '<td>';
@ -1785,8 +1764,7 @@ elseif ($id || $ref)
} }
print "</td>\n"; print "</td>\n";
} }
else else {
{
print "<td>"; print "<td>";
if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service');
else $text = img_object($langs->trans('Product'), 'product'); 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>'; 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>'; print '<td style="white-space: pre-wrap;max-width: 200px;" >'.$lines[$i]->comment.'</td>';
} }
@ -1873,8 +1850,7 @@ elseif ($id || $ref)
} }
print '</tr>'; print '</tr>';
} }
else else {
{
print '<!-- case edit 2 -->'; print '<!-- case edit 2 -->';
print '<tr>'; print '<tr>';
// Qty to receive or received // Qty to receive or received
@ -1888,8 +1864,7 @@ elseif ($id || $ref)
} }
print '</table></td>'; print '</table></td>';
} }
else else {
{
// Qty to receive or received // Qty to receive or received
print '<td class="center">'.$lines[$i]->qty.'</td>'; 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); print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
} }
else else {
{
print $langs->trans("NA"); print $langs->trans("NA");
} }
print '</td>'; print '</td>';
@ -1988,8 +1962,7 @@ elseif ($id || $ref)
{ {
print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked);
} }
else else {
{
print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); 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.'&amp;action=valid">'.$langs->trans("Validate").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid">'.$langs->trans("Validate").'</a>';
} }
else else {
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>'; 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.'&amp;action=reopen">'.$langs->trans("ClassifyUnbilled").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ClassifyUnbilled").'</a>';
} }
else else {
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>';
} }
} }

View File

@ -179,14 +179,12 @@ class Reception extends CommonObject
{ {
return $numref; return $numref;
} }
else else {
{
dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error);
return ""; return "";
} }
} }
else else {
{
print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined"); print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined");
return ""; return "";
} }
@ -325,8 +323,7 @@ class Reception extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
foreach ($this->errors as $errmsg) foreach ($this->errors as $errmsg)
{ {
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
@ -336,16 +333,14 @@ class Reception extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
else else {
{
$error++; $error++;
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else {
{
$error++; $error++;
$this->error = $this->db->error()." - sql=$sql"; $this->error = $this->db->error()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
@ -473,15 +468,13 @@ class Reception extends CommonObject
return 1; return 1;
} }
else else {
{
dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR); dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR);
$this->error = 'Delivery with id '.$id.' not found'; $this->error = 'Delivery with id '.$id.' not found';
return 0; return 0;
} }
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
@ -602,8 +595,7 @@ class Reception extends CommonObject
break; break;
} }
} }
else else {
{
// line with batch detail // 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. // 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->db->rollback();
$this->error = $this->db->error(); $this->error = $this->db->error();
return -2; return -2;
@ -694,8 +685,7 @@ class Reception extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
foreach ($this->errors as $errmsg) foreach ($this->errors as $errmsg)
{ {
dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR); dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR);
@ -867,8 +857,7 @@ class Reception extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; 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 $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(); $error++; $this->errors[] = "Error ".$this->db->lasterror();
} }
} }
@ -1000,35 +988,30 @@ class Reception extends CommonObject
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -3; return -3;
} }
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else {
{
$this->error = $this->db->lasterror()." - sql=$sql"; $this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1274,14 +1257,12 @@ class Reception extends CommonObject
$this->date_delivery = $date_livraison; $this->date_delivery = $date_livraison;
return 1; return 1;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
} }
else else {
{
return -2; 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'])."')"; $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); $resql = $this->db->query($sql);
} }
else else {
{
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
$sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= " code='".$this->db->escape($this->update['code'])."'";
$sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'";
@ -1442,8 +1422,7 @@ class Reception extends CommonObject
$url = str_replace('{TRACKID}', $value, $tracking); $url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value ? $value : 'url').'</a>', $url, $url); $this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value ? $value : 'url').'</a>', $url, $url);
} }
else else {
{
$this->tracking_url = $value; $this->tracking_url = $value;
} }
} }
@ -1545,8 +1524,7 @@ class Reception extends CommonObject
$error++; break; $error++; break;
} }
} }
else else {
{
// line with batch detail // 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 // 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(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -1576,8 +1553,7 @@ class Reception extends CommonObject
} }
} }
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
$error++; $error++;
} }
@ -1587,8 +1563,7 @@ class Reception extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1633,8 +1608,7 @@ class Reception extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1710,8 +1684,7 @@ class Reception extends CommonObject
$error++; break; $error++; break;
} }
} }
else else {
{
// line with batch detail // 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 // 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(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -1755,8 +1727,7 @@ class Reception extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -1846,8 +1817,7 @@ class Reception extends CommonObject
break; break;
} }
} }
else else {
{
// line with batch detail // 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 // 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(); $this->error = $this->db->lasterror();
$error++; $error++;
} }
@ -1912,8 +1881,7 @@ class Reception extends CommonObject
return -1; return -1;
} }
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;

View File

@ -91,8 +91,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer)
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else {
{
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");

View File

@ -279,15 +279,13 @@ if (empty($reshook))
$result = $object->insert_discount($discountid); $result = $object->insert_discount($discountid);
//$result=$discount->link_to_invoice($lineid,$id); //$result=$discount->link_to_invoice($lineid,$id);
} }
else else {
{
setEventMessages($discount->error, $discount->errors, 'errors'); setEventMessages($discount->error, $discount->errors, 'errors');
$error++; $error++;
break; break;
} }
} }
else else {
{
// Positive line // Positive line
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
// Date start // Date start
@ -335,8 +333,7 @@ if (empty($reshook))
{ {
$lineid = $result; $lineid = $result;
} }
else else {
{
$lineid = 0; $lineid = 0;
$error++; $error++;
break; break;
@ -391,8 +388,7 @@ if (empty($reshook))
$db->commit(); $db->commit();
setEventMessage($langs->trans('BillCreated', $nb_bills_created)); setEventMessage($langs->trans('BillCreated', $nb_bills_created));
} }
else else {
{
$db->rollback(); $db->rollback();
$action = 'create'; $action = 'create';
$_GET["origin"] = $_POST["origin"]; $_GET["origin"] = $_POST["origin"];
@ -585,8 +581,7 @@ if ($resql)
print $form->selectyesno('validate_invoices', 0, 1, 1); print $form->selectyesno('validate_invoices', 0, 1, 1);
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
} }
else else {
{
print $form->selectyesno('validate_invoices', 0, 1); print $form->selectyesno('validate_invoices', 0, 1);
} }
print '</td>'; print '</td>';
@ -937,8 +932,7 @@ if ($resql)
print '</form>'; print '</form>';
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

Some files were not shown because too many files have changed in this diff Show More