Merge pull request #12186 from frederic34/scopeindent

clean indent
This commit is contained in:
Laurent Destailleur 2019-10-20 12:39:57 +02:00 committed by GitHub
commit b61b73b34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
130 changed files with 2136 additions and 2205 deletions

View File

@ -180,8 +180,6 @@ if ($massaction == 'ventil') {
} }
$msg.='</div>'; $msg.='</div>';
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>'; $msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
//} else {
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
} }
} }

View File

@ -161,8 +161,6 @@ if ($massaction == 'ventil') {
} }
$msg.='</div>'; $msg.='</div>';
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>'; $msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
//} else {
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
} }
} }

View File

@ -294,7 +294,6 @@ if ($action == 'writebookkeeping') {
if (! $errorforline) if (! $errorforline)
{ {
foreach ($tabttc[$key] as $k => $mt) { foreach ($tabttc[$key] as $k => $mt) {
//if ($mt) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"]; $bookkeeping->date_lim_reglement = $val["datereg"];
@ -341,7 +340,6 @@ if ($action == 'writebookkeeping') {
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
} }
} }
//}
} }
} }
@ -349,7 +347,6 @@ if ($action == 'writebookkeeping') {
if (! $errorforline) if (! $errorforline)
{ {
foreach ($tabht[$key] as $k => $mt) { foreach ($tabht[$key] as $k => $mt) {
//if ($mt) {
// get compte id and label // get compte id and label
if ($accountingaccount->fetch(null, $k, true)) { if ($accountingaccount->fetch(null, $k, true)) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
@ -396,7 +393,6 @@ if ($action == 'writebookkeeping') {
} }
} }
} }
//}
} }
} }
@ -865,7 +861,6 @@ if (empty($action) || $action == 'view') {
// Third party // Third party
foreach ($tabttc[$key] as $k => $mt) { foreach ($tabttc[$key] as $k => $mt) {
//if ($mt) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<!-- Thirdparty -->"; print "<!-- Thirdparty -->";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
@ -892,7 +887,6 @@ if (empty($action) || $action == 'view') {
print '<td class="right nowraponall">'. ($mt < 0 ? price(- $mt) : '') . "</td>"; print '<td class="right nowraponall">'. ($mt < 0 ? price(- $mt) : '') . "</td>";
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print "</tr>"; print "</tr>";
//}
} }
// Product / Service // Product / Service
@ -900,7 +894,6 @@ if (empty($action) || $action == 'view') {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k, true); $accountingaccount->fetch(null, $k, true);
//if ($mt) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<!-- Product -->"; print "<!-- Product -->";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
@ -923,7 +916,6 @@ if (empty($action) || $action == 'view') {
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>"; print "</tr>";
//}
} }
// VAT // VAT

View File

@ -124,7 +124,7 @@ if ($in_bookkeeping == 'already')
if ($in_bookkeeping == 'notyet') if ($in_bookkeeping == 'notyet')
{ {
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account // $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account
} }
$sql .= " ORDER BY f.datef"; $sql .= " ORDER BY f.datef";
//print $sql; //print $sql;
@ -305,7 +305,6 @@ if ($action == 'writebookkeeping') {
if (! $errorforline) if (! $errorforline)
{ {
foreach ($tabttc[$key] as $k => $mt) { foreach ($tabttc[$key] as $k => $mt) {
//if ($mt) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"]; $bookkeeping->date_lim_reglement = $val["datereg"];
@ -352,7 +351,6 @@ if ($action == 'writebookkeeping') {
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
} }
} }
//}
} }
} }
@ -360,7 +358,6 @@ if ($action == 'writebookkeeping') {
if (! $errorforline) if (! $errorforline)
{ {
foreach ($tabht[$key] as $k => $mt) { foreach ($tabht[$key] as $k => $mt) {
//if ($mt) {
// get compte id and label // get compte id and label
if ($accountingaccount->fetch(null, $k, true)) { if ($accountingaccount->fetch(null, $k, true)) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
@ -407,7 +404,6 @@ if ($action == 'writebookkeeping') {
} }
} }
} }
//}
} }
} }
@ -801,7 +797,6 @@ if (empty($action) || $action == 'view') {
// Third party // Third party
foreach ($tabttc[$key] as $k => $mt) foreach ($tabttc[$key] as $k => $mt)
{ {
//if ($mt) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<!-- Thirdparty -->"; print "<!-- Thirdparty -->";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
@ -828,7 +823,6 @@ if (empty($action) || $action == 'view') {
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>"; print "</tr>";
//}
} }
// Product / Service // Product / Service
@ -837,7 +831,6 @@ if (empty($action) || $action == 'view') {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k, true); $accountingaccount->fetch(null, $k, true);
//if ($mt) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<!-- Product -->"; print "<!-- Product -->";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
@ -860,7 +853,6 @@ if (empty($action) || $action == 'view') {
print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>"; print '<td class="right nowraponall">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print "</tr>"; print "</tr>";
//}
} }
// VAT // VAT

View File

@ -184,8 +184,6 @@ if ($massaction == 'ventil') {
} }
$msg.='</div>'; $msg.='</div>';
$msg.= '<div>' . $langs->trans("EndProcessing") . '</div>'; $msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
//} else {
// setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
} }
} }

View File

@ -26,17 +26,12 @@ if (empty($conf) || ! is_object($conf))
$contact = $GLOBALS['objcanvas']->control->object; $contact = $GLOBALS['objcanvas']->control->object;
?> echo "<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->\n";
echo $this->control->tpl['showhead'];
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
<?php echo $this->control->tpl['showhead']; ?>
<?php
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
?> if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?>
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
<table class="border allwidth"> <table class="border allwidth">
@ -121,29 +116,28 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
</table> </table>
<?php echo $this->control->tpl['showend']; ?> <?php echo $this->control->tpl['showend'];
<?php if (empty($user->societe_id)) { ?> if (empty($user->societe_id)) {
<div class="tabsAction"> echo '<div class="tabsAction">';
<?php if ($user->rights->adherent->creer) { ?> if ($user->rights->adherent->creer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a> echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
<?php } ?> }
<?php if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { ?> if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a> echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
<?php } ?> }
<?php if ($user->rights->adherent->supprimer) { ?> if ($user->rights->adherent->supprimer) {
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a> echo '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
<?php } ?> }
</div><br> echo '</div><br>';
<?php } }
echo $this->control->tpl['actionstodo']; echo $this->control->tpl['actionstodo'];
echo $this->control->tpl['actionsdone']; echo $this->control->tpl['actionsdone'];
?>
<!-- END PHP TEMPLATE --> echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -868,15 +868,15 @@ else
} }
if (!empty($socid)) { if (!empty($socid)) {
$object = new Societe($db); $object = new Societe($db);
if ($socid > 0) $object->fetch($socid); if ($socid > 0) $object->fetch($socid);
if (! ($object->id > 0)) if (! ($object->id > 0))
{ {
$langs->load("errors"); $langs->load("errors");
print($langs->trans('ErrorRecordNotFound')); print($langs->trans('ErrorRecordNotFound'));
exit; exit;
} }
} }
$adht = new AdherentType($db); $adht = new AdherentType($db);

View File

@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?> echo "<!-- BEGIN PHP TEMPLATE -->\n";
<!-- BEGIN PHP TEMPLATE -->
<?php
global $user; global $user;
@ -39,22 +35,20 @@ $langs->load("members");
$total=0; $total=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
?> echo '<tr class="oddeven">';
<tr class="oddeven" > echo '<td>'.$langs->trans("Subscription").'</td>';
<td><?php echo $langs->trans("Subscription"); ?></td> echo '<td>'.$objectlink->getNomUrl(1).'</td>';
<td><?php echo $objectlink->getNomUrl(1); ?></td> echo '<td class="center"></td>';
<td class="center"></td> echo '<td class="center">'.dol_print_date($objectlink->dateh, 'day').'</td>';
<td class="center"><?php echo dol_print_date($objectlink->dateh, 'day'); ?></td> echo '<td class="right">';
<td class="right"><?php
if ($user->rights->adherent->lire) { if ($user->rights->adherent->lire) {
$total = $total + $objectlink->amount; $total = $total + $objectlink->amount;
echo price($objectlink->amount); echo price($objectlink->amount);
} ?></td> }
<td class="right"></td> echo '</td>';
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> echo '<td class="right"></td>';
</tr> echo '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
<?php echo '</tr>';
} }
?>
<!-- END PHP TEMPLATE --> echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -163,7 +163,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
// Add logic to show/hide buttons // Add logic to show/hide buttons
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery("#updateconst").hide(); jQuery("#updateconst").hide();
@ -181,7 +181,7 @@ jQuery(document).ready(function() {
}); });
}); });
</script> </script>
<?php <?php
} }
print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup');

View File

@ -554,14 +554,14 @@ if ($id == 11)
$elementList = array( $elementList = array(
'' => '', '' => '',
'societe' => $langs->trans('ThirdParty'), 'societe' => $langs->trans('ThirdParty'),
// 'proposal' => $langs->trans('Proposal'), // 'proposal' => $langs->trans('Proposal'),
// 'order' => $langs->trans('Order'), // 'order' => $langs->trans('Order'),
// 'invoice' => $langs->trans('Bill'), // 'invoice' => $langs->trans('Bill'),
'supplier_proposal' => $langs->trans('SupplierProposal'), 'supplier_proposal' => $langs->trans('SupplierProposal'),
'order_supplier' => $langs->trans('SupplierOrder'), 'order_supplier' => $langs->trans('SupplierOrder'),
'invoice_supplier' => $langs->trans('SupplierBill'), 'invoice_supplier' => $langs->trans('SupplierBill'),
// 'intervention' => $langs->trans('InterventionCard'), // 'intervention' => $langs->trans('InterventionCard'),
// 'contract' => $langs->trans('Contract'), // 'contract' => $langs->trans('Contract'),
'project' => $langs->trans('Project'), 'project' => $langs->trans('Project'),
'project_task' => $langs->trans('Task'), 'project_task' => $langs->trans('Task'),
'agenda' => $langs->trans('Agenda'), 'agenda' => $langs->trans('Agenda'),
@ -571,7 +571,7 @@ if ($id == 11)
'commande' => $langs->trans('Order'), 'commande' => $langs->trans('Order'),
'facture' => $langs->trans('Bill'), 'facture' => $langs->trans('Bill'),
'fichinter' => $langs->trans('InterventionCard'), 'fichinter' => $langs->trans('InterventionCard'),
'contrat' => $langs->trans('Contract') 'contrat' => $langs->trans('Contract'),
); );
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
@ -636,8 +636,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
) )
) ) {
{
$ok=0; $ok=0;
$fieldnamekey=$listfield[$f]; $fieldnamekey=$listfield[$f];
// We take translate key of field // We take translate key of field

View File

@ -423,17 +423,20 @@ class PrestaShopWebservice
*/ */
public function delete($options) public function delete($options)
{ {
if (isset($options['url'])) if (isset($options['url'])) {
$url = $options['url']; $url = $options['url'];
elseif (isset($options['resource']) && isset($options['id'])) } elseif (isset($options['resource']) && isset($options['id'])) {
if (is_array($options['id'])) if (is_array($options['id']))
$url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']'; $url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']';
else else
$url = $this->url.'/api/'.$options['resource'].'/'.$options['id']; $url = $this->url.'/api/'.$options['resource'].'/'.$options['id'];
if (isset($options['id_shop'])) }
if (isset($options['id_shop'])) {
$url .= '&id_shop='.$options['id_shop']; $url .= '&id_shop='.$options['id_shop'];
if (isset($options['id_group_shop'])) }
if (isset($options['id_group_shop'])) {
$url .= '&id_group_shop='.$options['id_group_shop']; $url .= '&id_group_shop='.$options['id_group_shop'];
}
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE')); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE'));
self::checkStatusCode($request['status_code']);// check the response validity self::checkStatusCode($request['status_code']);// check the response validity
return true; return true;

View File

@ -32,8 +32,8 @@ class Dolistore
* beginning of pagination * beginning of pagination
* @var int * @var int
*/ */
public $start; public $start;
/** /**
* end of pagination * end of pagination
* @var int * @var int

View File

@ -79,7 +79,7 @@ if ($action == 'add' || GETPOST("modify"))
if ($_POST["modify"]) if ($_POST["modify"])
{ {
// Supprime boite box_external_rss de definition des boites // Supprime boite box_external_rss de definition des boites
/* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def"; /* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def";
$sql.= " SET name = '".$boxlabel."'"; $sql.= " SET name = '".$boxlabel."'";
$sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["norss"]." %'"; $sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["norss"]." %'";
@ -89,7 +89,7 @@ if ($action == 'add' || GETPOST("modify"))
dol_print_error($db,"sql=$sql"); dol_print_error($db,"sql=$sql");
exit; exit;
} }
*/ */
} }
else else
{ {

View File

@ -207,8 +207,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
} }
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha'); $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
$conf->entity);
if (!$res > 0) { if (!$res > 0) {
$error++; $error++;
@ -221,8 +220,7 @@ $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ?
} }
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') { } elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
$conf->entity);
if (!$res > 0) { if (!$res > 0) {
$error++; $error++;
@ -235,8 +233,7 @@ $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ?
} }
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') { } elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
$conf->entity);
if (!$res > 0) { if (!$res > 0) {
$error++; $error++;

View File

@ -300,8 +300,14 @@ print '</div>';
print '<br>'; print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
{ dol_fiche_end();
// End of page
llxFooter();
$db->close();
exit;
}
/* /*
* Documents models for Holidays * Documents models for Holidays
*/ */
@ -518,7 +524,7 @@ print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
}
dol_fiche_end(); dol_fiche_end();

View File

@ -327,7 +327,7 @@ if (empty($reshook))
$i++; $i++;
} }
$sql.= " WHERE ".$rowidcol." = '".$rowid."'"; $sql.= " WHERE ".$rowidcol." = '".$rowid."'";
//print $sql;exit; //print $sql;exit;
dol_syslog("actionmodify", LOG_DEBUG); dol_syslog("actionmodify", LOG_DEBUG);
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -926,11 +926,9 @@ if ($mode == 'marketplace')
<?php <?php
print $previouslink; print $previouslink;
print $nextlink; print $nextlink;
?> print '</div>';
</div> print '</form>';
</form>
<?php
print '</div></div>'; print '</div></div>';
print '<div class="clearboth"></div>'; print '<div class="clearboth"></div>';

View File

@ -113,12 +113,12 @@ print '<td>'.$langs->trans("DeStockOnBill").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->facture->enabled)) if (! empty($conf->facture->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL'); print ajax_constantonoff('STOCK_CALCULATE_ON_BILL');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL); print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
} }
} }
else else
{ {
@ -133,12 +133,12 @@ print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER'); print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER); print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
} }
} }
else else
{ {
@ -155,12 +155,12 @@ print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->expedition->enabled)) if (! empty($conf->expedition->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT'); print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
} }
} }
else else
{ {
@ -175,12 +175,12 @@ print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->expedition->enabled)) if (! empty($conf->expedition->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE'); print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE); print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
} }
} }
else else
{ {
@ -215,12 +215,12 @@ print '<td>'.$langs->trans("ReStockOnBill").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->fournisseur->enabled)) if (! empty($conf->fournisseur->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL'); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL); print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
} }
} }
else else
{ {
@ -236,12 +236,12 @@ print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->fournisseur->enabled)) if (! empty($conf->fournisseur->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER); print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
} }
} }
else else
{ {
@ -256,27 +256,27 @@ if (!empty($conf->reception->enabled))
print '<td>'.$langs->trans("StockOnReception").'</td>'; print '<td>'.$langs->trans("StockOnReception").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION); print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
$found++; $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockOnReceptionOnClosing").'</td>'; print '<td>'.$langs->trans("StockOnReceptionOnClosing").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE); print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
$found++; $found++;
} }
@ -287,12 +287,12 @@ else
print '<td class="right">'; print '<td class="right">';
if (! empty($conf->fournisseur->enabled)) if (! empty($conf->fournisseur->enabled))
{ {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
} }
} }
else else
{ {
@ -339,12 +339,12 @@ if($conf->invoice->enabled)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE); print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
@ -354,12 +354,12 @@ if($conf->order->enabled)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER); print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
@ -369,12 +369,12 @@ if($conf->expedition->enabled)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT); print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
@ -383,14 +383,17 @@ print '</table>';
print '<br>'; print '<br>';
$virtualdiffersfromphysical=0; $virtualdiffersfromphysical=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) if (
! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
) $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. ) {
$virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs.
}
if ($virtualdiffersfromphysical) if ($virtualdiffersfromphysical)
{ {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print "<td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."</td>\n"; print "<td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
print '<td class="right">'.$langs->trans("Status").'</td>'."\n"; print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
@ -398,12 +401,12 @@ print '<tr class="liste_titre">';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseVirtualStockByDefault").'</td>'; print '<td>'.$langs->trans("UseVirtualStockByDefault").'</td>';
print '<td class="right">'; print '<td class="right">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK); print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK);
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
print '</table>'; print '</table>';
@ -504,7 +507,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT); print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT);
} }
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
} }
@ -512,8 +514,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page. If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS) if ($conf->global->PRODUIT_SOUSPRODUITS)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("IndependantSubProductStock").'</td>'; print '<td>'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td class="right">'; print '<td class="right">';

View File

@ -94,10 +94,10 @@ if ($db->type == 'pgsql')
{ {
// Check option standard_conforming_strings is on // Check option standard_conforming_strings is on
$paramarray=$db->getServerParametersValues('standard_conforming_strings'); $paramarray=$db->getServerParametersValues('standard_conforming_strings');
// if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) // if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1)
// { // {
// $langs->load("errors"); // $langs->load("errors");
// } // }
} }
print '<br>'; print '<br>';

View File

@ -111,13 +111,15 @@ jQuery(document).ready(function() {
} }
}); });
<?php
if (in_array($type, array('mysql', 'mysqli'))) print 'jQuery("#radio_dump_mysql").click();';
if (in_array($type, array('pgsql'))) print 'jQuery("#radio_dump_postgresql").click();';
?>
});
</script>
<?php <?php
if (in_array($type, array('mysql', 'mysqli'))) {
print 'jQuery("#radio_dump_mysql").click();';
}
if (in_array($type, array('pgsql'))) {
print 'jQuery("#radio_dump_postgresql").click();';
}
print "});\n";
print "</script>\n";
print load_fiche_titre($langs->trans("Backup"), '', 'title_setup'); print load_fiche_titre($langs->trans("Backup"), '', 'title_setup');
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup'); //print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
@ -127,24 +129,17 @@ print $langs->trans("BackupDesc", DOL_DATA_ROOT);
print '</div>'; print '</div>';
print '<br>'; print '<br>';
?> print "<!-- Dump of a server -->\n";
print '<form method="post" action="export.php" name="dump">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="export_type" value="server" />';
print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>';
<!-- Dump of a server -->
<form method="post" action="export.php" name="dump"><input type="hidden"
name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input
type="hidden" name="export_type" value="server" />
<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>
<?php
print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'<br>'; print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'<br>';
//print $langs->trans("BackupDescY").'<br>'; //print $langs->trans("BackupDescY").'<br>';
print '<br>'; print '<br>';
?>
<div id="backupdatabaseleft" class="fichehalfleft" > print '<div id="backupdatabaseleft" class="fichehalfleft" >';
<?php
print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard"));
@ -155,54 +150,40 @@ print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr '.$bc[false].'><td style="padding-left: 8px">'; print '<tr '.$bc[false].'><td style="padding-left: 8px">';
?> print '<table class="centpercent">';
<table class="centpercent"> print '<tr>';
<tr> print '<td class="tdtop">';
<td class="tdtop">
<div id="div_container_exportoptions"> print '<div id="div_container_exportoptions">';
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend> print '<fieldset id="exportoptions"><legend>'.$langs->trans("ExportMethod").'</legend>';
<?php if (in_array($type, array('mysql', 'mysqli'))) {
if (in_array($type, array('mysql', 'mysqli'))) print '<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" />';
{ print '<label for="radio_dump_mysql">MySQL Dump (mysqldump)</label>';
?> print '</div>';
<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" /> print '<br>';
<label for="radio_dump_mysql">MySQL Dump (mysqldump)</label> print '<div class="formelementrow"><input type="radio" name="what" value="mysqlnobin" id="radio_dump_mysql_nobin" />';
</div> print '<label for="radio_dump_mysql">MySQL Dump (php) '.img_warning($langs->trans('BackupPHPWarning')).'</label>';
<br> print '</div>';
<div class="formelementrow"><input type="radio" name="what" value="mysqlnobin" id="radio_dump_mysql_nobin" /> } elseif (in_array($type, array('pgsql'))) {
<label for="radio_dump_mysql">MySQL Dump (php) <?php print img_warning($langs->trans('BackupPHPWarning')) ?></label> print '<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />';
</div> print '<label for="radio_dump_postgresql">PostgreSQL Dump (pg_dump)</label>';
<?php print '</div>';
} } else {
elseif (in_array($type, array('pgsql')))
{
?>
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
<label for="radio_dump_postgresql">PostgreSQL Dump (pg_dump)</label>
</div>
<?php
}
else
{
print 'No method available with database '.$label; print 'No method available with database '.$label;
} }
?> print '</fieldset>';
</fieldset> print '</div>';
</div>
</td> print '</td>';
<td class="tdtop"> print '<td class="tdtop">';
<div id="div_container_sub_exportoptions"> print '<div id="div_container_sub_exportoptions">';
<?php if (in_array($type, array('mysql', 'mysqli'))) {
if (in_array($type, array('mysql', 'mysqli'))) print "<!-- Fieldset mysqldump -->\n";
{ print '<fieldset id="mysql_options"><legend>'.$langs->trans("MySqlExportParameters").'</legend>';
?> <!-- Fieldset mysqldump -->
<fieldset id="mysql_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
<div class="formelementrow"><?php echo $langs->trans("FullPathToMysqldumpCommand"); print '<div class="formelementrow">'.$langs->trans("FullPathToMysqldumpCommand");
if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP))
{ {
$fullpathofmysqldump=$db->getPathOfDump(); $fullpathofmysqldump=$db->getPathOfDump();
@ -211,219 +192,254 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
{ {
$fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP; $fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP;
} }
?><br> print '<br>';
<input type="text" name="mysqldump" style="width: 80%" print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'" /></div>';
value="<?php echo $fullpathofmysqldump; ?>" /></div>
<br> print '<br>';
<fieldset><legend><?php echo $langs->trans("ExportOptions"); ?></legend> print '<fieldset><legend>'.$langs->trans("ExportOptions").'</legend>';
<div class="formelementrow"><input type="checkbox" print '<div class="formelementrow">';
name="use_transaction" value="yes" id="checkbox_use_transaction" /> <label print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" />';
for="checkbox_use_transaction"> <?php echo $langs->trans("UseTransactionnalMode"); ?></label> print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
</div> print '</div>';
<?php if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?> if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
<div class="formelementrow"><input type="checkbox" name="disable_fk" print '<div class="formelementrow">';
value="yes" id="checkbox_disable_fk" checked /> <label print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked />';
for="checkbox_disable_fk"> <?php echo $langs->trans("CommandsToDisableForeignKeysForImport"); ?> <?php print img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')); ?></label> print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
</div> print '</div>';
<?php } ?>
<label for="select_sql_compat"> <?php echo $langs->trans("ExportCompatibility"); ?></label>
<select name="sql_compat" id="select_sql_compat" class="flat">
<option value="NONE" selected>NONE</option>
<option value="ANSI">ANSI</option>
<option value="DB2">DB2</option>
<option value="MAXDB">MAXDB</option>
<option value="MYSQL323">MYSQL323</option>
<option value="MYSQL40">MYSQL40</option>
<option value="MSSQL">MSSQL</option>
<option value="ORACLE">ORACLE</option>
<option value="POSTGRESQL">POSTGRESQL</option>
</select> <br>
<!-- <input type="checkbox" name="drop_database" value="yes"
id="checkbox_drop_database" /> <label for="checkbox_drop_database"><?php echo $langs->trans("AddDropDatabase"); ?></label>
-->
</fieldset>
<br>
<fieldset><legend> <input type="checkbox" name="sql_structure"
value="structure" id="checkbox_sql_structure" checked /> <label
for="checkbox_sql_structure"> <?php echo $langs->trans('ExportStructure') ?></label> </legend> <input
type="checkbox" name="drop"<?php echo ((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':''; ?> id="checkbox_dump_drop" /> <label
for="checkbox_dump_drop"><?php echo $langs->trans("AddDropTable"); ?></label><br>
</fieldset>
<br>
<fieldset><legend> <input type="checkbox" name="sql_data" value="data"
id="checkbox_sql_data" checked /> <label for="checkbox_sql_data">
<?php echo $langs->trans("Datas"); ?></label> </legend> <input
type="checkbox" name="showcolumns" value="yes"
id="checkbox_dump_showcolumns" checked /> <label
for="checkbox_dump_showcolumns"> <?php echo $langs->trans("NameColumn"); ?></label><br>
<input type="checkbox" name="extended_ins" value="yes"
id="checkbox_dump_extended_ins" checked /> <label
for="checkbox_dump_extended_ins"> <?php echo $langs->trans("ExtendedInsert"); ?></label><br>
<input type="checkbox" name="disable-add-locks" value="no"
id="checkbox_dump_disable-add-locks" /> <label
for="checkbox_dump_disable-add-locks"> <?php echo $langs->trans("NoLockBeforeInsert"); ?></label><br>
<input type="checkbox" name="delayed" value="yes"
id="checkbox_dump_delayed" /> <label for="checkbox_dump_delayed"> <?php echo $langs->trans("DelayedInsert"); ?></label><br>
<input type="checkbox" name="sql_ignore" value="yes"
id="checkbox_dump_ignore" /> <label for="checkbox_dump_ignore"> <?php echo $langs->trans("IgnoreDuplicateRecords"); ?></label><br>
<input type="checkbox" name="hexforbinary" value="yes"
id="checkbox_hexforbinary" checked /> <label
for="checkbox_hexforbinary"> <?php echo $langs->trans("EncodeBinariesInHexa"); ?></label><br>
<input type="checkbox" name="charset_utf8" value="yes"
id="checkbox_charset_utf8" checked disabled /> <label
for="checkbox_charset_utf8"> <?php echo $langs->trans("UTF8"); ?></label><br>
</fieldset>
</fieldset>
<!-- Fieldset mysql_nobin -->
<fieldset id="mysql_nobin_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
<fieldset>
<legend><?php echo $langs->trans("ExportOptions"); ?></legend>
<div class="formelementrow"><input type="checkbox"
name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" /> <label
for="checkbox_use_transaction"> <?php echo $langs->trans("UseTransactionnalMode"); ?></label>
</div>
<?php if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?>
<div class="formelementrow"><input type="checkbox" name="nobin_disable_fk"
value="yes" id="checkbox_disable_fk" checked /> <label
for="checkbox_disable_fk"> <?php echo $langs->trans("CommandsToDisableForeignKeysForImport"); ?> <?php print img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')); ?></label>
</div>
<?php } ?>
</fieldset>
<br>
<fieldset><legend><?php echo $langs->trans('ExportStructure') ?></legend> <input
type="checkbox" name="nobin_drop"<?php echo ((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':''; ?> id="checkbox_dump_drop" /> <label
for="checkbox_dump_drop"><?php echo $langs->trans("AddDropTable"); ?></label><br>
</fieldset>
<br>
<fieldset>
<legend><?php echo $langs->trans("Datas"); ?></legend>
<input type="checkbox" name="nobin_nolocks" value="no"
id="checkbox_dump_disable-add-locks" /> <label
for="checkbox_dump_disable-add-locks"> <?php echo $langs->trans("NoLockBeforeInsert"); ?></label><br>
<input type="checkbox" name="nobin_delayed" value="yes"
id="checkbox_dump_delayed" /> <label for="checkbox_dump_delayed"> <?php echo $langs->trans("DelayedInsert"); ?></label><br>
<input type="checkbox" name="nobin_sql_ignore" value="yes"
id="checkbox_dump_ignore" /> <label for="checkbox_dump_ignore"> <?php echo $langs->trans("IgnoreDuplicateRecords"); ?></label><br>
<input type="checkbox" name="nobin_charset_utf8" value="yes"
id="checkbox_charset_utf8" checked disabled /> <label
for="checkbox_charset_utf8"> <?php echo $langs->trans("UTF8"); ?></label><br>
</fieldset>
</fieldset>
<?php
} }
if (in_array($type, array('pgsql'))) print '<label for="select_sql_compat">'.$langs->trans("ExportCompatibility").'</label>';
{
?> <!-- Fieldset pg_dump -->
<fieldset id="postgresql_options"><legend><?php echo $langs->trans("PostgreSqlExportParameters"); ?></legend>
<div class="formelementrow"><?php echo $langs->trans("FullPathToPostgreSQLdumpCommand"); print '<select name="sql_compat" id="select_sql_compat" class="flat">';
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) print '<option value="NONE" selected>NONE</option>';
{ print '<option value="ANSI">ANSI</option>';
print '<option value="DB2">DB2</option>';
print '<option value="MAXDB">MAXDB</option>';
print '<option value="MYSQL323">MYSQL323</option>';
print '<option value="MYSQL40">MYSQL40</option>';
print '<option value="MSSQL">MSSQL</option>';
print '<option value="ORACLE">ORACLE</option>';
print '<option value="POSTGRESQL">POSTGRESQL</option>';
print '</select>';
print '<br>';
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
print '-->';
print '</fieldset>';
print '<br>';
print '<fieldset>';
print '<legend>';
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
print '</legend>';
print '<input type="checkbox" name="drop"'.((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':''.' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>';
print '</fieldset>';
print '<br>';
print '<fieldset>';
print '<legend>';
print '<input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" checked />';
print '<label for="checkbox_sql_data">'.$langs->trans("Datas").'</label>';
print '</legend>';
print '<input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" checked />';
print '<label for="checkbox_dump_showcolumns">'.$langs->trans("NameColumn").'</label>';
print '<br>';
print '<input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" checked />';
print '<label for="checkbox_dump_extended_ins">'.$langs->trans("ExtendedInsert").'</label>';
print '<br>';
print '<input type="checkbox" name="disable-add-locks" value="no" id="checkbox_dump_disable-add-locks" />';
print '<label for="checkbox_dump_disable-add-locks">'.$langs->trans("NoLockBeforeInsert").'</label>';
print '<br>';
print '<input type="checkbox" name="delayed" value="yes" id="checkbox_dump_delayed" />';
print '<label for="checkbox_dump_delayed">'.$langs->trans("DelayedInsert").'</label>';
print '<br>';
print '<input type="checkbox" name="sql_ignore" value="yes" id="checkbox_dump_ignore" />';
print '<label for="checkbox_dump_ignore">'.$langs->trans("IgnoreDuplicateRecords").'</label>';
print '<br>';
print '<input type="checkbox" name="hexforbinary" value="yes" id="checkbox_hexforbinary" checked />';
print '<label for="checkbox_hexforbinary">'.$langs->trans("EncodeBinariesInHexa").'</label>';
print '<br>';
print '<input type="checkbox" name="charset_utf8" value="yes" id="checkbox_charset_utf8" checked disabled />';
print '<label for="checkbox_charset_utf8">'.$langs->trans("UTF8").'</label>';
print '<br>';
print '</fieldset>';
print '</fieldset>';
print "<!-- Fieldset mysql_nobin -->\n";
print '<fieldset id="mysql_nobin_options">';
print '<legend>'.$langs->trans("MySqlExportParameters").'</legend>';
print '<fieldset>';
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
print '<div class="formelementrow">';
print '<input type="checkbox" name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" />';
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
print '</div>';
if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
print '<div class="formelementrow">';
print '<input type="checkbox" name="nobin_disable_fk" value="yes" id="checkbox_disable_fk" checked />';
print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
print '</div>';
}
print '</fieldset>';
print '<br>';
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
print '<input type="checkbox" name="nobin_drop"'.((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':''.' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>';
print '</fieldset>';
print '<br>';
print '<fieldset>';
print '<legend>'.$langs->trans("Datas").'</legend>';
print '<input type="checkbox" name="nobin_nolocks" value="no" id="checkbox_dump_disable-add-locks" />';
print '<label for="checkbox_dump_disable-add-locks">'.$langs->trans("NoLockBeforeInsert").'</label>';
print '<br>';
print '<input type="checkbox" name="nobin_delayed" value="yes" id="checkbox_dump_delayed" />';
print '<label for="checkbox_dump_delayed">'.$langs->trans("DelayedInsert").'</label>';
print '<br>';
print '<input type="checkbox" name="nobin_sql_ignore" value="yes" id="checkbox_dump_ignore" />';
print '<label for="checkbox_dump_ignore">'.$langs->trans("IgnoreDuplicateRecords").'</label>';
print '<br>';
print '<input type="checkbox" name="nobin_charset_utf8" value="yes" id="checkbox_charset_utf8" checked disabled />';
print '<label for="checkbox_charset_utf8">'.$langs->trans("UTF8").'</label>';
print '<br>';
print '</fieldset>';
print '</fieldset>';
}
if (in_array($type, array('pgsql'))) {
print "<!-- Fieldset pg_dump -->\n";
print '<fieldset id="postgresql_options"><legend>'.$langs->trans("PostgreSqlExportParameters").'</legend>';
print '<div class="formelementrow">'.$langs->trans("FullPathToPostgreSQLdumpCommand");
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) {
$fullpathofpgdump=$db->getPathOfDump(); $fullpathofpgdump=$db->getPathOfDump();
} }
else else
{ {
$fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP; $fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
} }
?><br> print '<br>';
<input type="text" name="postgresqldump" style="width: 80%" print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" /></div>';
value="<?php echo $fullpathofpgdump; ?>" /></div>
print '<br>';
print '<fieldset>';
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
print '<label for="select_sql_compat">'.$langs->trans("ExportCompatibility").'</label>';
print '<select name="sql_compat" id="select_sql_compat" class="flat">';
print '<option value="POSTGRESQL" selected>POSTGRESQL</option>';
print '<option value="ANSI">ANSI</option>';
print '</select>';
print '<br>';
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
print '-->';
print '</fieldset>';
print '<br>';
print '<fieldset>';
print '<legend>';
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
print '</legend>';
print '</fieldset>';
print '<br>';
print '<fieldset>';
print '<legend>';
print '<input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" checked />';
print '<label for="checkbox_sql_data">'.$langs->trans("Datas").'</label>';
print '</legend>';
print '<input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" checked />';
print '<label for="checkbox_dump_showcolumns">'.$langs->trans("NameColumn").'</label>';
print '<br>';
print '</fieldset>';
print '</fieldset>';
}
print '</div>';
print '</td>';
print '</tr>';
print '</table>';
<br> print '<!--<fieldset>';
<fieldset><legend><?php echo $langs->trans("ExportOptions"); ?></legend> print '<legend>'.$langs->trans("Destination").'</legend> -->';
<label for="select_sql_compat"> <?php echo $langs->trans("ExportCompatibility"); ?></label> print '<br>';
<select name="sql_compat" id="select_sql_compat" class="flat"> print '<label for="filename_template">'.$langs->trans("FileNameToGenerate").'</label>';
<option value="POSTGRESQL" selected>POSTGRESQL</option> print '<br>';
<option value="ANSI">ANSI</option>
</select><br>
<!-- <input type="checkbox" name="drop_database" value="yes"
id="checkbox_drop_database" /> <label for="checkbox_drop_database"><?php echo $langs->trans("AddDropDatabase"); ?></label>
-->
</fieldset>
<br>
<fieldset><legend> <input type="checkbox" name="sql_structure"
value="structure" id="checkbox_sql_structure" checked /> <label
for="checkbox_sql_structure"> <?php echo $langs->trans('ExportStructure') ?></label> </legend></fieldset>
<br>
<fieldset><legend> <input type="checkbox" name="sql_data" value="data"
id="checkbox_sql_data" checked /> <label for="checkbox_sql_data">
<?php echo $langs->trans("Datas"); ?></label> </legend> <input
type="checkbox" name="showcolumns" value="yes"
id="checkbox_dump_showcolumns" checked /> <label
for="checkbox_dump_showcolumns"> <?php echo $langs->trans("NameColumn"); ?></label><br>
</fieldset>
</fieldset>
<?php
}
?>
</div>
</td>
</tr>
</table>
<!--<fieldset>
<legend><?php echo $langs->trans("Destination"); ?></legend> -->
<br>
<label for="filename_template"> <?php echo $langs->trans("FileNameToGenerate"); ?></label><br>
<input type="text" name="filename_template" style="width: 90%"
id="filename_template"
value="<?php
$prefix='dump'; $prefix='dump';
$ext='.sql'; $ext='.sql';
if (in_array($type, array('mysql', 'mysqli'))) { $prefix='mysqldump'; $ext='sql'; } if (in_array($type, array('mysql', 'mysqli'))) {
//if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='dump'; } $prefix='mysqldump';
if (in_array($type, array('pgsql'))) { $prefix='pg_dump'; $ext='sql'; } $ext='sql';
}
//if ($label == 'PostgreSQL') {
// $prefix='pg_dump';
// $ext='dump';
//}
if (in_array($type, array('pgsql'))) {
$prefix='pg_dump';
$ext='sql';
}
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext; $file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
echo $file; print '<input type="text" name="filename_template" style="width: 90%" id="filename_template" value="'.$file.'" />';
?>" /> <br> print '<br>';
<br> print '<br>';
<?php
// Define compressions array // Define compressions array
$compression=array(); $compression=array();
if (in_array($type, array('mysql', 'mysqli'))) if (in_array($type, array('mysql', 'mysqli'))) {
{ $compression['none'] = array(
$compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); 'function' => '',
$compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); 'id' => 'radio_compression_none',
// $compression['zip']= array('function' => 'dol_compress', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip")); // Not open source format. Must implement dol_compress function 'label' => $langs->trans("None")
$compression['bz'] = array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2")); );
$compression['gz'] = array(
'function' => 'gzopen',
'id' => 'radio_compression_gzip',
'label' => $langs->trans("Gzip")
);
// Not open source format. Must implement dol_compress function
// $compression['zip']= array(
// 'function' => 'dol_compress',
// 'id' => 'radio_compression_zip',
// 'label' => $langs->trans("FormatZip")
// );
$compression['bz'] = array(
'function' => 'bzopen',
'id' => 'radio_compression_bzip',
'label' => $langs->trans("Bzip2")
);
} }
else else
{ {
$compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("Default")); $compression['none'] = array(
$compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); 'function' => '',
'id' => 'radio_compression_none',
'label' => $langs->trans("Default")
);
$compression['gz'] = array(
'function' => 'gzopen',
'id' => 'radio_compression_gzip',
'label' => $langs->trans("Gzip")
);
} }
// Show compression choices // Show compression choices
@ -434,13 +450,14 @@ print $langs->trans("Compression").': &nbsp; ';
foreach($compression as $key => $val) foreach($compression as $key => $val)
{ {
if (! $val['function'] || function_exists($val['function'])) // Enabled export format if (! $val['function'] || function_exists($val['function'])) {
{ // Enabled export format
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>'; print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>'; print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
} }
else // Disabled export format else
{ {
// Disabled export format
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>'; print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>'; print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
print ' ('.$langs->trans("NotAvailable").')'; print ' ('.$langs->trans("NotAvailable").')';
@ -451,17 +468,15 @@ foreach($compression as $key => $val)
print '</div>'; print '</div>';
print "\n"; print "\n";
?><!--</fieldset>--> <!-- End destination --> print "<!--</fieldset>--> <!-- End destination -->\n";
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo">';
print '<input type="hidden" name="page_y" value="'.GETPOST('page_y', 'int').'">';
print '<br>';
print '<br>';
<br>
<div class="center">
<input type="submit" class="button reposition" value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo">
<input type="hidden" name="page_y" value="<?php echo GETPOST('page_y', 'int'); ?>">
<br>
<br>
<?php
if (! empty($_SESSION["commandbackuplastdone"])) if (! empty($_SESSION["commandbackuplastdone"]))
{ {
print '<br><b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n"; print '<br><b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
@ -491,71 +506,51 @@ if (! empty($_SESSION["commandbackuptorun"]))
$_SESSION["commandbackuptorun"]=''; $_SESSION["commandbackuptorun"]='';
$_SESSION["commandbackupresult"]=''; $_SESSION["commandbackupresult"]='';
} }
?>
</div> <!-- end div center button --> print "</div> <!-- end div center button -->\n";
<?php
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print "</div> <!-- end div fichehalfleft -->\n";
?>
</div> <!-- end div fichehalfleft -->
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;"> print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
<div class="ficheaddleft"> print '<div class="ficheaddleft">';
<?php
$filearray=dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1); $filearray=dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles")); $result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
print '<br>'; print '<br>';
?>
print '</div>';
print '</div>';
print '</form>';
print '</fieldset>';
</div> print "<br>\n";
</div> print "<!-- Dump of a server -->\n";
</form>
</fieldset>
<br> print '<form method="post" action="export_files.php" name="dump">';
<!-- Dump of a server --> print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="export_type" value="server" />';
<form method="post" action="export_files.php" name="dump"> print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="export_type" value="server" />
<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>
<?php
print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'<br>'; print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'<br>';
print $langs->trans("BackupDescX").'<br><br>'; print $langs->trans("BackupDescX").'<br><br>';
?> print '<div id="backupfilesleft" class="fichehalfleft">';
<div id="backupfilesleft" class="fichehalfleft">
<?php
print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard"));
?>
<label for="zipfilename_template"> <?php echo $langs->trans("FileNameToGenerate"); ?></label><br> print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
<input type="text" name="zipfilename_template" style="width: 90%"
id="zipfilename_template"
value="<?php
$prefix='documents'; $prefix='documents';
$ext='zip'; $ext='zip';
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext; $file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
echo $file; print '<input type="text" name="zipfilename_template" style="width: 90%" id="zipfilename_template" value="'.$file.'" /> <br>';
?>" /> <br> print '<br>';
<br>
<?php
// Show compression choices // Show compression choices
print '<div class="formelementrow">'; print '<div class="formelementrow">';
print "\n"; print "\n";
@ -584,32 +579,26 @@ foreach($filecompression as $key => $val)
print '</div>'; print '</div>';
print "\n"; print "\n";
?> print '<br>';
<br> print '<div class="center">';
<div class="center"><input type="submit" class="button reposition" print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo" /><br>';
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br> print '<br>';
<br> print '</div>';
</div>
</div> print '</div>';
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;"> print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
<div class="ficheaddleft"> print '<div class="ficheaddleft">';
<?php
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1); $filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles")); $result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
print '<br>'; print '<br>';
?>
print '</div>';
print '</div>';
</div> print '</fieldset>';
</div> print '</form>';
</fieldset>
</form>
<?php
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -131,11 +131,9 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'<br><br>';
<?php <?php
if (in_array($type, array('mysql', 'mysqli'))) if (in_array($type, array('mysql', 'mysqli')))
{ {
?> print '<fieldset id="mysql_options">';
<fieldset id="mysql_options"> print '<legend>'.$langs->trans('RestoreMySQL').'</legend>';
<legend><?php echo $langs->trans('RestoreMySQL') ?></legend> print '<div class="formelementrow centpercent">';
<div class="formelementrow centpercent">
<?php
// Parameteres execution // Parameteres execution
$command=$db->getPathOfRestore(); $command=$db->getPathOfRestore();
if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command
@ -157,20 +155,18 @@ if (in_array($type, array('mysql', 'mysqli')))
print '<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans("ImportMySqlCommand", $command, ($showpass?$paramclear:$paramcrypted)).'</textarea><br>'; print '<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans("ImportMySqlCommand", $command, ($showpass?$paramclear:$paramcrypted)).'</textarea><br>';
print ajax_autoselect('restorecommand'); print ajax_autoselect('restorecommand');
if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&amp;radio_dump=mysql_options">'.$langs->trans("UnHidePassword").'</a>'; if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) {
print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&amp;radio_dump=mysql_options">'.$langs->trans("UnHidePassword").'</a>';
}
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&amp;radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>'; //else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&amp;radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
?> print '</div>';
</div> print '</fieldset>';
</fieldset>
<?php
} }
elseif (in_array($type, array('pgsql'))) elseif (in_array($type, array('pgsql')))
{ {
?> print '<fieldset id="postgresql_options">';
<fieldset id="postgresql_options"> print '<legend>Restore PostgreSQL</legend>';
<legend>Restore PostgreSQL</legend> print '<div class="formelementrow">';
<div class="formelementrow">
<?php
// Parameteres execution // Parameteres execution
$command=$db->getPathOfRestore(); $command=$db->getPathOfRestore();
if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command
@ -198,20 +194,16 @@ elseif (in_array($type, array('pgsql')))
print ajax_autoselect('restorecommand'); print ajax_autoselect('restorecommand');
//if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&amp;radio_dump=postgresql_options">'.$langs->trans("UnHidePassword").'</a>'; //if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&amp;radio_dump=postgresql_options">'.$langs->trans("UnHidePassword").'</a>';
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&amp;radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>'; //else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&amp;radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
?> print '</div>';
</div> print '</fieldset>';
</fieldset>
<?php
} }
?>
</div> print '</div>';
</td></tr></table> print '</td></tr></table>';
</fieldset> print '</fieldset>';
<?php
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -290,7 +290,7 @@ foreach ($dirmodels as $reldir)
// Info // Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.= '<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf') if ($module->type == 'pdf')
{ {
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;

View File

@ -539,7 +539,9 @@ class Setup extends DolibarrApi
$sql.= " WHERE t.active = ".$active; $sql.= " WHERE t.active = ".$active;
if (!empty($multicurrency)) { if (!empty($multicurrency)) {
$sql.= " AND m.entity IN (".getEntity('multicurrency').")"; $sql.= " AND m.entity IN (".getEntity('multicurrency').")";
if (!empty($multicurrency) && $multicurrency != 2) $sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)"; if (!empty($multicurrency) && $multicurrency != 2) {
$sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)";
}
} }
// Add sql filters // Add sql filters

View File

@ -574,7 +574,7 @@ jQuery(document).ready(function () {
if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL))
{ {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$.ajax({ $.ajax({
@ -592,7 +592,7 @@ if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->globa
}); });
</script> </script>
<?php <?php
} }
if (GETPOST('withtab', 'alpha')) if (GETPOST('withtab', 'alpha'))

View File

@ -47,22 +47,20 @@ $colspan = 3; // Columns: total ht + col edit + col delete
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($this->db); $objectline = new BOMLine($this->db);
?>
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
<?php
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines); $nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) { if ($nolinesbefore) {
?> print '<tr class="liste_titre'.($nolinesbefore?'':' liste_titre_add_').' nodrag nodrop">';
<tr class="liste_titre<?php echo ($nolinesbefore?'':' liste_titre_add_') ?> nodrag nodrop"> if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> print '<td class="linecolnum center"></td>';
<td class="linecolnum center"></td> }
<?php } ?> print '<td class="linecoldescription minwidth500imp">';
<td class="linecoldescription minwidth500imp"> print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans('AddNewLine').'</span>';
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> // echo $langs->trans("FreeZone");
</td> print '</td>';
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td> print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
<?php
if ($conf->global->PRODUCT_USE_UNITS) if ($conf->global->PRODUCT_USE_UNITS)
{ {
print '<td class="linecoluseunit left">'; print '<td class="linecoluseunit left">';
@ -70,31 +68,25 @@ if ($nolinesbefore) {
print $langs->trans('Unit'); print $langs->trans('Unit');
print '</span></td>'; print '</span></td>';
} }
?> print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
<td class="linecollost right"><?php echo $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')); ?></td> print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>';
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td> print '</tr>';
</tr>
<?php
} }
?> print '<tr class="pair nodrag nodrop nohoverpair'.($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'.'">';
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>"> $coldisplay=0;
<?php
$coldisplay=0;
// Adds a line numbering column // Adds a line numbering column
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$coldisplay++; $coldisplay++;
echo '<td class="nobottom linecolnum center"></td>'; echo '<td class="nobottom linecolnum center"></td>';
} }
$coldisplay++; $coldisplay++;
?> print '<td class="nobottom linecoldescription minwidth500imp">';
<td class="nobottom linecoldescription minwidth500imp">
<?php // Predefined product/service
// Predefined product/service if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
{
if ($forceall >= 0 && $freelines) echo '<br>'; if ($forceall >= 0 && $freelines) echo '<br>';
echo '<span class="prod_entry_mode_predef">'; echo '<span class="prod_entry_mode_predef">';
$filtertype=''; $filtertype='';
@ -112,34 +104,32 @@ if ($nolinesbefore) {
} }
echo '</span>'; echo '</span>';
} }
$coldisplay++; $coldisplay++;
?> print '<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1).'">';
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1); ?>"> print '</td>';
</td> if($conf->global->PRODUCT_USE_UNITS)
<?php {
if($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++; $coldisplay++;
print '<td class="nobottom linecoluseunit left">'; print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units"); print $form->selectUnits($line->fk_unit, "units");
print '</td>'; print '</td>';
} }
$coldisplay++; $coldisplay++;
?>
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo (GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1); ?>"></td>
<?php
$coldisplay+=$colspan; print '<td class="nobottom nowrap linecollost right">';
?> print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1).'">';
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"> print '</td>';
<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
</td>
</tr> $coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
print '<input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline" id="addline">';
print '</td>';
print '</tr>';
<?php
if (is_object($objectline)) { if (is_object($objectline)) {
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }

View File

@ -49,22 +49,19 @@ $colspan = 3; // Columns: total ht + col edit + col delete
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($this->db); $objectline = new BOMLine($this->db);
?>
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
<?php
$coldisplay=0; $coldisplay=0;
?> print '<tr class="oddeven tredited">';
<tr class="oddeven tredited"> // Adds a line numbering column
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
// Adds a line numbering column print '<td class="linecolnum center">'.($i+1).'</td>';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php }
$coldisplay++; $coldisplay++;
?> }
$coldisplay++;
?>
<td> <td>
<div id="line_<?php echo $line->id; ?>"></div> <div id="line_<?php echo $line->id; ?>"></div>
@ -74,72 +71,66 @@ $coldisplay=0;
<input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>"> <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
<input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>"> <input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
<?php <?php
// Predefined product/service // Predefined product/service
if ($line->fk_product > 0) { if ($line->fk_product > 0) {
$tmpproduct = new Product($object->db); $tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product); $tmpproduct->fetch($line->fk_product);
print $tmpproduct->getNomUrl(1); print $tmpproduct->getNomUrl(1);
} }
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
$reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); $reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
} }
?> print '</td>';
</td>
<?php /*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines {
{
$coldisplay++; $coldisplay++;
?> ?>
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td> <td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
<?php <?php
*/ */
$coldisplay++; $coldisplay++;
?>
<td class="nobottom linecolqty right"> print '<td class="nobottom linecolqty right">';
<?php if (($line->info_bits & 2) != 2) { if (($line->info_bits & 2) != 2) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">'; print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">';
} }
?> print '</td>';
</td>
<?php if ($conf->global->PRODUCT_USE_UNITS)
if($conf->global->PRODUCT_USE_UNITS) {
{
$coldisplay++; $coldisplay++;
print '<td class="nobottom linecoluseunit left">'; print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units"); print $form->selectUnits($line->fk_unit, "units");
print '</td>'; print '</td>';
} }
$coldisplay++; $coldisplay++;
?> print '<td class="nobottom nowrap linecollost right">';
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo $line->efficiency; ?>"></td> print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
<?php
$coldisplay+=$colspan; $coldisplay+=$colspan;
?> print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=$colspan; ?> $coldisplay+=$colspan;
<input type="submit" class="button" id="savelinebutton" name="save" value="<?php echo $langs->trans("Save"); ?>"><br> print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
<input type="submit" class="button" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> print '<br>';
</td> print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
</tr> print '</td>';
print '</tr>';
<?php
if (is_object($objectline)) { if (is_object($objectline)) {
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }
?>
<!-- END PHP TEMPLATE objectline_edit.tpl.php --> print "<!-- END PHP TEMPLATE objectline_edit.tpl.php -->\n";

View File

@ -39,9 +39,7 @@ if (empty($object) || ! is_object($object))
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
?> print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->
<?php
// Title line // Title line
print "<thead>\n"; print "<thead>\n";
@ -79,6 +77,5 @@ if ($action == 'selectlines')
print "</tr>\n"; print "</tr>\n";
print "</thead>\n"; print "</thead>\n";
?>
<!-- END PHP TEMPLATE objectline_title.tpl.php --> print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";

View File

@ -59,100 +59,93 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($object->db); $objectline = new BOMLine($object->db);
?> $coldisplay=0;
<?php $coldisplay=0; ?> print "<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->\n";
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php --> print '<tr id="row-'.$line->id.'" class="drag drop oddeven" '.$domData.' >';
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> > if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> print '<td class="linecolnum center">'.($i+1).'</td>';
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> $coldisplay++;
<?php } ?> }
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> print '<td class="linecoldescription minwidth300imp">';
<?php print '<div id="line_'.$line->id.'"></div>';
$tmpproduct = new Product($object->db); $coldisplay++;
$tmpproduct->fetch($line->fk_product); $tmpproduct = new Product($object->db);
print $tmpproduct->getNomUrl(1); $tmpproduct->fetch($line->fk_product);
?> print $tmpproduct->getNomUrl(1);
</td> print '</td>';
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> print '<td class="linecolqty nowrap right">';
<?php $coldisplay++;
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
?> print '</td>';
</td>
<?php if($conf->global->PRODUCT_USE_UNITS)
if($conf->global->PRODUCT_USE_UNITS) {
{
print '<td class="linecoluseunit nowrap left">'; print '<td class="linecoluseunit nowrap left">';
$label = $line->getLabelOfUnit('short'); $label = $line->getLabelOfUnit('short');
if ($label !== '') { if ($label !== '') {
print $langs->trans($label); print $langs->trans($label);
} }
print '</td>'; print '</td>';
}
print '<td class="linecolqty nowrap right">';
$coldisplay++;
echo $line->efficiency;
print '</td>';
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) {
print '<td class="linecoledit center">';
$coldisplay++;
if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id.'">'.img_edit().'</a>';
} }
?> print '</td>';
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php
echo $line->efficiency;
?>
</td>
<?php
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) { ?> print '<td class="linecoldelete center">';
<td class="linecoledit center"><?php $coldisplay++; ?> $coldisplay++;
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> if (($line->fk_prev_id == null ) && empty($disableremove)) {
<?php } else { ?> //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
<?php echo img_edit(); ?>
</a>
<?php } ?>
</td>
<td class="linecoldelete center"><?php $coldisplay++; ?>
<?php
if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=deleteline&amp;lineid=' . $line->id . '">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=deleteline&amp;lineid=' . $line->id . '">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
?> print '</td>';
</td>
<?php if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) { ?> print '<td class="linecolmove tdlineupdown center">';
<td class="linecolmove tdlineupdown center"><?php $coldisplay++; ?> $coldisplay++;
<?php if ($i > 0) { ?> if ($i > 0) {
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>"> print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id.'">';
<?php echo img_up('default', 0, 'imgupforline'); ?> echo img_up('default', 0, 'imgupforline');
</a> print '</a>';
<?php } ?>
<?php if ($i < $num-1) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php echo img_down('default', 0, 'imgdownforline'); ?>
</a>
<?php } ?>
</td>
<?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php
} }
if ($i < $num-1) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id.'">';
echo img_down('default', 0, 'imgdownforline');
print '</a>';
}
print '</td>';
} else {
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'></td>';
$coldisplay++;
}
} else {
print '<td colspan="3"></td>';
$coldisplay=$coldisplay+3;
}
if($action == 'selectlines'){ ?> if ($action == 'selectlines') {
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> print '<td class="linecolcheck center">';
<?php } ?> print '<input type="checkbox" class="linecheckbox" name="line_checkbox['.($i+1).']" value="'.$line->id.'" >';
print '</td>';
}
</tr> print '</tr>';
<?php
//Line extrafield //Line extrafield
if (!empty($extrafields)) if (!empty($extrafields))
{ {
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }
?>
<!-- END PHP TEMPLATE objectline_view.tpl.php --> print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";

View File

@ -44,8 +44,9 @@ require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
if (! empty($conf->propal->enabled)) if (! empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
}
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';

View File

@ -164,9 +164,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -127,9 +127,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -84,9 +84,10 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -97,9 +97,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -18,17 +18,12 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
?> print "<!-- BEGIN PHP TEMPLATE -->\n";
<!-- BEGIN PHP TEMPLATE -->
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -41,54 +36,48 @@ $langs->load("orders");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> echo '<tr class="'.$trclass.'" >';
<tr class="<?php echo $trclass; ?>" > echo '<td class="linkedcol-element" >'.$langs->trans("CustomerOrder");
<td class="linkedcol-element" ><?php echo $langs->trans("CustomerOrder"); ?> if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?> print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
</td> }
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td> echo '</td>';
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td> echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> echo '<td class="linkedcol-ref" align="center">'.$objectlink->ref_client.'</td>';
<td class="linkedcol-amount right"><?php echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> }
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> echo '</td>';
<td class="linkedcol-action right"> echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
<?php echo '<td class="linkedcol-action right">';
// For now, shipments must stay linked to order, so link is not deletable // For now, shipments must stay linked to order, so link is not deletable
if($object->element != 'shipping') { if($object->element != 'shipping') {
?> echo '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
<?php
} }
?> echo '</td>';
</td> echo "</tr>\n";
</tr>
<?php
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1) {
{ echo '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
?> echo '<td>'.$langs->trans("Total").'</td>';
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>"> echo '<td></td>';
<td><?php echo $langs->trans("Total"); ?></td> echo '<td class="center"></td>';
<td></td> echo '<td class="center"></td>';
<td class="center"></td> echo '<td class="right">'.price($total).'</td>';
<td class="center"></td> echo '<td class="right"></td>';
<td class="right"><?php echo price($total); ?></td> echo '<td class="right"></td>';
<td class="right"></td> echo "</tr>\n";
<td class="right"></td>
</tr>
<?php
} }
?>
<!-- END PHP TEMPLATE --> echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -155,8 +155,8 @@ $type='directory';
// This test if file exists should be useless. We keep it to find bug more easily // This test if file exists should be useless. We keep it to find bug more easily
if (! dol_is_dir($upload_dir)) if (! dol_is_dir($upload_dir))
{ {
// dol_mkdir($upload_dir); //dol_mkdir($upload_dir);
/* $langs->load("install"); /*$langs->load("install");
dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir)); dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir));
exit;*/ exit;*/
} }

View File

@ -318,7 +318,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
else else
{ {
//issue the CKEditor Callback //issue the CKEditor Callback
SendCKEditorResults( SendCKEditorResults(
$CKEcallback, $CKEcallback,
$sFileUrl, $sFileUrl,
($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful') ($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful')

View File

@ -140,5 +140,5 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
time_js_next_test += time_auto_update; time_js_next_test += time_auto_update;
console.log('Updated time_js_next_test. New value is '+time_js_next_test); console.log('Updated time_js_next_test. New value is '+time_js_next_test);
} }
<?php <?php
} }

View File

@ -47,13 +47,13 @@ function bank_prepare_head(Account $object)
$head[$h][2] = 'journal'; $head[$h][2] = 'journal';
$h++; $h++;
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1) // if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
// { // {
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id; $head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id;
$head[$h][1] = $langs->trans("PlannedTransactions"); $head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash'; $head[$h][2] = 'cash';
$h++; $h++;
// } // }
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id; $head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting"); $head[$h][1] = $langs->trans("IOMonthlyReporting");

View File

@ -876,7 +876,7 @@ function dol_string_unaccent($str)
else else
{ {
// See http://www.ascii-code.com/ // See http://www.ascii-code.com/
$string = strtr( $string = strtr(
$str, $str,
"\xC0\xC1\xC2\xC3\xC4\xC5\xC7 "\xC0\xC1\xC2\xC3\xC4\xC5\xC7
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1 \xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
@ -5867,7 +5867,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution, // Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
// this will include signature content first and then replace var found into content of signature // this will include signature content first and then replace var found into content of signature
$signature = $user->signature; $signature = $user->signature;
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '') '__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '')
) )
); );
@ -5877,7 +5877,7 @@ $substitutionarray=array_merge($substitutionarray, array(
$substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : ''); $substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '');
} }
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_ID__' => (string) $user->id, '__USER_ID__' => (string) $user->id,
'__USER_LOGIN__' => (string) $user->login, '__USER_LOGIN__' => (string) $user->login,
'__USER_LASTNAME__' => (string) $user->lastname, '__USER_LASTNAME__' => (string) $user->lastname,
@ -5890,7 +5890,7 @@ $substitutionarray=array_merge($substitutionarray, array(
} }
if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc)) if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc))
{ {
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email, '__MYCOMPANY_EMAIL__' => $mysoc->email,
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1, '__MYCOMPANY_PROFID1__' => $mysoc->idprof1,

View File

@ -320,7 +320,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
fwrite($fichier, $form); fwrite($fichier, $form);
$form='<description><![CDATA['.$desc.'.]]></description>'."\n". $form='<description><![CDATA['.$desc.'.]]></description>'."\n".
// '<language>fr</language>'."\n". // '<language>fr</language>'."\n".
'<copyright>Dolibarr</copyright>'."\n". '<copyright>Dolibarr</copyright>'."\n".
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n". '<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
'<generator>Dolibarr</generator>'."\n"; '<generator>Dolibarr</generator>'."\n";

View File

@ -177,13 +177,13 @@ class InterfaceLogevents extends DolibarrTriggers
} }
// If not found // If not found
/* /*
else else
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action."); dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
return 0; return 0;
} }
*/ */
// Add more information into desc from the context property // Add more information into desc from the context property
if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit']; if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit'];

View File

@ -181,7 +181,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'CONTACT_MODIFY': case 'CONTACT_MODIFY':
case 'CONTACT_DELETE': case 'CONTACT_DELETE':
case 'CONTACT_ENABLEDISABLE': case 'CONTACT_ENABLEDISABLE':
break;
// Products // Products
// case 'PRODUCT_CREATE': // case 'PRODUCT_CREATE':
// case 'PRODUCT_MODIFY': // case 'PRODUCT_MODIFY':
@ -221,7 +221,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'LINEORDER_INSERT': case 'LINEORDER_INSERT':
case 'LINEORDER_UPDATE': case 'LINEORDER_UPDATE':
case 'LINEORDER_DELETE': case 'LINEORDER_DELETE':
break;
// Supplier orders // Supplier orders
// case 'ORDER_SUPPLIER_CREATE': // case 'ORDER_SUPPLIER_CREATE':
// case 'ORDER_SUPPLIER_CLONE': // case 'ORDER_SUPPLIER_CLONE':

View File

@ -673,7 +673,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
//'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php', //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php',
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
//'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php' //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php',
); );
foreach($filetogenerate as $srcfile => $destfile) foreach($filetogenerate as $srcfile => $destfile)
@ -714,34 +714,47 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
} }
// Regenerate left menu entry in descriptor for $objectname // Regenerate left menu entry in descriptor for $objectname
$stringtoadd=" $stringtoadd = "
\t\t\$this->menu[\$r++]=array( \$this->menu[\$r++]=array(
'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry 'fk_menu'=>'fk_mainmenu=mymodule',
// This is a Left menu entry
'type'=>'left',
'titre'=>'List MyObject', 'titre'=>'List MyObject',
'mainmenu'=>'mymodule', 'mainmenu'=>'mymodule',
'leftmenu'=>'mymodule_myobject', 'leftmenu'=>'mymodule_myobject',
'url'=>'/mymodule/myobject_list.php', 'url'=>'/mymodule/myobject_list.php',
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'mymodule@mymodule',
'position'=>1100+\$r, 'position'=>1100+\$r,
'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'enabled'=>'\$conf->mymodule->enabled',
// Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'perms'=>'1',
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both // 0=Menu for internal users, 1=external users, 2=both
\t\t\$this->menu[\$r++]=array( 'user'=>2,
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode );
'type'=>'left', // This is a Left menu entry \$this->menu[\$r++]=array(
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject',
// This is a Left menu entry
'type'=>'left',
'titre'=>'New MyObject', 'titre'=>'New MyObject',
'mainmenu'=>'mymodule', 'mainmenu'=>'mymodule',
'leftmenu'=>'mymodule_myobject', 'leftmenu'=>'mymodule_myobject',
'url'=>'/mymodule/myobject_card.php?action=create', 'url'=>'/mymodule/myobject_card.php?action=create',
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'mymodule@mymodule',
'position'=>1100+\$r, 'position'=>1100+\$r,
'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'enabled'=>'\$conf->mymodule->enabled',
// Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'perms'=>'1',
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both // 0=Menu for internal users, 1=external users, 2=both
"; 'user'=>2
);\n";
$stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd); $stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd);
$stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd); $stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd);
$stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd); $stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd);
@ -892,7 +905,8 @@ if ($dirins && $action == 'addproperty' && !empty($module) && ! empty($tabobj))
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'), 'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'),
'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'), 'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'),
'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha')); 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha')
);
if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval'])) if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval']))
{ {

View File

@ -69,14 +69,14 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
), ),
// Geckodriver does not keep the session at the moment?! // Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work // XPath selectors also don't seem to work
// array( //array(
// 'browser' => 'Mozilla Firefox on Linux', // 'browser' => 'Mozilla Firefox on Linux',
// 'browserName' => 'firefox', // 'browserName' => 'firefox',
// 'sessionStrategy' => 'shared', // 'sessionStrategy' => 'shared',
// 'desiredCapabilities' => array( // 'desiredCapabilities' => array(
// 'marionette' => true // 'marionette' => true,
// ) // ),
// ) //)
); );
/** /**
@ -224,7 +224,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
{ {
$this->url('/custom/mymodule/admin/about.php'); $this->url('/custom/mymodule/admin/about.php');
$this->authenticate(); $this->authenticate();
return $this->assertEquals( return $this->assertEquals(
'Dolibarr Module Template (aka My Module)', 'Dolibarr Module Template (aka My Module)',
$this->byTag('h1')->text(), $this->byTag('h1')->text(),
"Readme title" "Readme title"
@ -254,7 +254,7 @@ return $this->assertEquals(
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( return $this->assertContains(
'interface_99_modMyModule_MyModuleTriggers.class.php', 'interface_99_modMyModule_MyModuleTriggers.class.php',
$this->byTag('body')->text(), $this->byTag('body')->text(),
"Trigger declared" "Trigger declared"
@ -271,7 +271,7 @@ return $this->assertContains(
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( return $this->assertContains(
'tick.png', 'tick.png',
$this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'), $this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'),
"Trigger enabled" "Trigger enabled"

View File

@ -113,7 +113,7 @@ dol_fiche_head('');
<tr><td><?php echo $langs->trans("SellingPrice"); ?></td> <tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
<td><input name="price" size="10" value="<?php echo $object->price; ?>"> <td><input name="price" size="10" value="<?php echo $object->price; ?>">
<?php echo $object->price_base_type; ?> <?php echo $object->price_base_type; ?>
</td></tr> </td></tr>
<tr><td><?php echo $langs->trans("MinPrice"); ?></td> <tr><td><?php echo $langs->trans("MinPrice"); ?></td>
@ -121,7 +121,7 @@ dol_fiche_head('');
</td></tr> </td></tr>
<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td> <tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
<?php echo $object->tva_tx; ?> <?php echo $object->tva_tx; ?>
</td></tr> </td></tr>
</table> </table>

View File

@ -57,7 +57,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
<?php if ($object->photos) { ?> <?php if ($object->photos) { ?>
<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>"> <td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
<?php echo $object->photos; ?> <?php echo $object->photos; ?>
</td> </td>
<?php } ?> <?php } ?>

View File

@ -85,7 +85,7 @@ dol_fiche_head('');
<tr><td><?php echo $langs->trans("SellingPrice"); ?></td> <tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
<td><input name="price" size="10" value="<?php echo $object->price; ?>"> <td><input name="price" size="10" value="<?php echo $object->price; ?>">
<?php echo $object->price_base_type; ?> <?php echo $object->price_base_type; ?>
</td></tr> </td></tr>
<tr><td><?php echo $langs->trans("MinPrice"); ?></td> <tr><td><?php echo $langs->trans("MinPrice"); ?></td>
@ -93,7 +93,7 @@ dol_fiche_head('');
</td></tr> </td></tr>
<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td> <tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
<?php echo $object->tva_tx; ?> <?php echo $object->tva_tx; ?>
</td></tr> </td></tr>
</table> </table>

View File

@ -57,7 +57,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
<?php if ($object->photos) { ?> <?php if ($object->photos) { ?>
<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>"> <td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
<?php echo $object->photos; ?> <?php echo $object->photos; ?>
</td> </td>
<?php } ?> <?php } ?>

View File

@ -6,8 +6,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get', 'alpha'); $get = GETPOST('get', 'alpha');
$put = GETPOST('put', 'alpha'); $put = GETPOST('put', 'alpha');
switch ($put) switch ($put)
{ {
case 'qty': case 'qty':
if (empty($user->rights->stock->creer)) { echo -1; exit; } if (empty($user->rights->stock->creer)) { echo -1; exit; }
@ -47,4 +47,4 @@ $put = GETPOST('put', 'alpha');
} }
break; break;
} }

View File

@ -68,8 +68,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref)) {
$ret = $object->fetch($id, $ref); $ret = $object->fetch($id, $ref);
// if ($ret > 0) // if ($ret > 0)
// $ret = $object->fetch_thirdparty(); // $ret = $object->fetch_thirdparty();
if ($ret <= 0) { if ($ret <= 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';

View File

@ -369,7 +369,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) if (empty($reshook))
{ {
/*TODO if ($user->rights->stock->lire) /*TODO if ($user->rights->stock->lire)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n"; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
} }
@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n"; print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
} }
*/ */
} }
print '</div>'."\n"; print '</div>'."\n";

View File

@ -492,7 +492,7 @@ if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alph
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',
@ -511,7 +511,7 @@ print_barre_liste(
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',

View File

@ -66,8 +66,8 @@ if (empty($conf) || ! is_object($conf)) {
// Warehouse or product // Warehouse or product
print '<tr>'; print '<tr>';
if ($object->element == 'product') if ($object->element == 'product')
{ {
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
print '<td>'; print '<td>';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
@ -76,9 +76,9 @@ if (empty($conf) || ! is_object($conf)) {
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>'; print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
print '</select>'; print '</select>';
print '</td>'; print '</td>';
} }
if ($object->element == 'stock') if ($object->element == 'stock')
{ {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>'; print '<td>';
print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
@ -87,7 +87,7 @@ if (empty($conf) || ! is_object($conf)) {
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>'; print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
print '</select>'; print '</select>';
print '</td>'; print '</td>';
} }
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>'; print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
print '<td><input name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>'; print '<td><input name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>';
print '</tr>'; print '</tr>';
@ -96,21 +96,21 @@ if (empty($conf) || ! is_object($conf)) {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("UnitPurchaseValue").'</td>'; print '<td>'.$langs->trans("UnitPurchaseValue").'</td>';
print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>'; print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
{ {
print '<td>'.$langs->trans('Project').'</td>'; print '<td>'.$langs->trans('Project').'</td>';
print '<td>'; print '<td>';
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300'); $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>'; print '</td>';
} }
print '</tr>'; print '</tr>';
// Serial / Eat-by date // Serial / Eat-by date
if (! empty($conf->productbatch->enabled) && if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch()) (($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock')) || ($object->element == 'stock'))
) )
{ {
print '<tr>'; print '<tr>';
print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">'; print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">'; print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">';
@ -126,7 +126,7 @@ if (empty($conf) || ! is_object($conf)) {
print $form->selectDate($sellbyselected, 'sellby', '', '', 1, ""); print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Label of mouvement of id of inventory // Label of mouvement of id of inventory
$valformovementlabel=((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref)); $valformovementlabel=((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));

View File

@ -40,8 +40,8 @@ if (empty($conf) || ! is_object($conf)) {
$pdluo = new Productbatch($db); $pdluo = new Productbatch($db);
if ($pdluoid > 0) if ($pdluoid > 0)
{ {
$result=$pdluo->fetch($pdluoid); $result=$pdluo->fetch($pdluoid);
if ($result > 0) if ($result > 0)
{ {
@ -51,7 +51,7 @@ if (empty($conf) || ! is_object($conf)) {
{ {
dol_print_error($db, $pdluo->error, $pdluo->errors); dol_print_error($db, $pdluo->error, $pdluo->errors);
} }
} }
print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic'); print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
@ -62,28 +62,28 @@ if (empty($conf) || ! is_object($conf)) {
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="transfert_stock">'; print '<input type="hidden" name="action" value="transfert_stock">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($pdluoid) if ($pdluoid)
{ {
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">'; print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Source warehouse or product // Source warehouse or product
print '<tr>'; print '<tr>';
if ($object->element == 'product') if ($object->element == 'product')
{ {
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
print '<td>'; print '<td>';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1); print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
print '</td>'; print '</td>';
} }
if ($object->element == 'stock') if ($object->element == 'stock')
{ {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>'; print '<td>';
print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print '</td>'; print '</td>';
} }
print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>'; print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>';
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
@ -92,11 +92,11 @@ if (empty($conf) || ! is_object($conf)) {
print '</tr>'; print '</tr>';
// Serial / Eat-by date // Serial / Eat-by date
if (! empty($conf->productbatch->enabled) && if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch()) (($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock')) || ($object->element == 'stock'))
) )
{ {
print '<tr>'; print '<tr>';
print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">'; print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
if ($pdluoid > 0) if ($pdluoid > 0)
@ -120,7 +120,7 @@ if (empty($conf) || ! is_object($conf)) {
print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Label // Label
$valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref)); $valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref));

View File

@ -108,7 +108,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
unset($data1); unset($data1);
if ($nocolor) if ($nocolor)
$px->SetDataColor(array ( $px->SetDataColor(array (
array ( array (
220, 220,
220, 220,

View File

@ -645,7 +645,7 @@ elseif ($id > 0 || ! empty($ref))
print '<br>'; print '<br>';
// Link to create task // Link to create task
$linktocreatetaskParam = array(); $linktocreatetaskParam = array();
$linktocreatetaskUserRight = false; $linktocreatetaskUserRight = false;
if ($user->rights->projet->all->creer || $user->rights->projet->creer) { if ($user->rights->projet->all->creer || $user->rights->projet->creer) {

View File

@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
/* /*
* Lines of contacts * Lines of contacts
*/ */
/* /*
// Contacts lines (modules that overwrite templates must declare this into descriptor) // Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir) foreach($dirtpls as $reldir)
@ -364,7 +364,7 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php'); $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break; if ($res) break;
} }
*/ */
/* /*
* Add a new contact line * Add a new contact line

View File

@ -173,7 +173,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
* @depends testBonPrelevementOther * @depends testBonPrelevementOther
* The depends says test is run only if previous is ok * The depends says test is run only if previous is ok
*/ */
/* public function testBonPrelevementDelete($id) /* public function testBonPrelevementDelete($id)
{ {
global $conf,$user,$langs,$db; global $conf,$user,$langs,$db;
$conf=$this->savconf; $conf=$this->savconf;
@ -189,5 +189,5 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
return $result; return $result;
} }
*/ */
} }

View File

@ -265,7 +265,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
public function testExportPersonalizedWithFilter() public function testExportPersonalizedWithFilter()
{ {
global $conf,$user,$langs,$db; global $conf,$user,$langs,$db;
/* /*
$sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f"; $sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f";
$objexport=new Export($db); $objexport=new Export($db);
@ -303,7 +303,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql); $result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql);
$expectedresult=1; $expectedresult=1;
$this->assertEquals($expectedresult,$result); $this->assertEquals($expectedresult,$result);
*/ */
return true; return true;
} }

View File

@ -67,14 +67,14 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
), ),
// Geckodriver does not keep the session at the moment?! // Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work // XPath selectors also don't seem to work
// array( //array(
// 'browser' => 'Mozilla Firefox on Linux', // 'browser' => 'Mozilla Firefox on Linux',
// 'browserName' => 'firefox', // 'browserName' => 'firefox',
// 'sessionStrategy' => 'shared', // 'sessionStrategy' => 'shared',
// 'desiredCapabilities' => array( // 'desiredCapabilities' => array(
// 'marionette' => true // 'marionette' => true
// ) // )
// ) //)
); );
/** /**