Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Rui Strecht
2017-09-21 15:39:25 +01:00
67 changed files with 868 additions and 461 deletions

View File

@@ -53,12 +53,10 @@ if (! $user->rights->accounting->chartofaccount) accessforbidden();
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'sortorder');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@@ -210,7 +210,7 @@ else {
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
print "</tr>\n";
@@ -280,4 +280,4 @@ else {
llxFooter();
}
$db->close();
$db->close();

View File

@@ -45,6 +45,10 @@ if($action)
{
$db->begin();
if ($action == 'STOCK_SUPPORTS_SERVICES')
{
$res = dolibarr_set_const($db, "STOCK_SUPPORTS_SERVICES", GETPOST('STOCK_SUPPORTS_SERVICES','alpha'),'chaine',0,'',$conf->entity);
}
if ($action == 'STOCK_USERSTOCK_AUTOCREATE')
{
$res = dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", GETPOST('STOCK_USERSTOCK_AUTOCREATE','alpha'),'chaine',0,'',$conf->entity);
@@ -164,8 +168,8 @@ $found=0;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnBill").'</td>';
print '<td align="right">';
if (! empty($conf->facture->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -184,8 +188,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td align="right">';
if (! empty($conf->commande->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -206,8 +210,8 @@ $found++;
//{
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
print '<td align="right">';
if (! empty($conf->expedition->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -226,8 +230,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td align="right">';
if (! empty($conf->expedition->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -268,8 +272,8 @@ $found=0;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -289,8 +293,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -309,8 +313,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@@ -346,8 +350,8 @@ print '</tr>'."\n";
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("WarehouseAllowNegativeTransfer").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("WarehouseAllowNegativeTransfer").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_NEGATIVE_TRANSFER\">";
@@ -361,8 +365,8 @@ print "</tr>\n";
if($conf->invoice->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_INVOICE\">";
@@ -376,8 +380,8 @@ if($conf->invoice->enabled) {
if($conf->order->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_ORDER\">";
@@ -391,8 +395,8 @@ if($conf->order->enabled) {
if($conf->expedition->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT\">";
@@ -404,6 +408,9 @@ if($conf->expedition->enabled) {
}
print '</table>';
print '<br>';
$virtualdiffersfromphysical=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
@@ -411,7 +418,6 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
if ($virtualdiffersfromphysical)
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help',$langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
@@ -419,8 +425,8 @@ if ($virtualdiffersfromphysical)
print '</tr>'."\n";
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UseVirtualStockByDefault").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("UseVirtualStockByDefault").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USE_VIRTUAL_STOCK\">";
@@ -430,9 +436,70 @@ if ($virtualdiffersfromphysical)
print "</td>\n";
print "</tr>\n";
print '</table>';
print '<br>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("Other")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td class="width100" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")).'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_SUPPORTS_SERVICES\">";
print $form->selectyesno("STOCK_SUPPORTS_SERVICES",$conf->global->STOCK_SUPPORTS_SERVICES,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE\">";
print $form->selectyesno("STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE",$conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"SUPPLIER_ORDER_USE_DISPATCH_STATUS\">";
print $form->selectyesno("SUPPLIER_ORDER_USE_DISPATCH_STATUS",$conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n";
print "</td>\n</tr>\n";
}
print '</table>';
print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
@@ -484,54 +551,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '</table>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("Other")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UseDispatchStatus").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"SUPPLIER_ORDER_USE_DISPATCH_STATUS\">";
print $form->selectyesno("SUPPLIER_ORDER_USE_DISPATCH_STATUS",$conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n";
print "</td>\n</tr>\n";
}
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE\">";
print $form->selectyesno("STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE",$conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<br>';
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
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)
@@ -539,9 +558,8 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
@@ -553,8 +571,6 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
}
*/
print '</table>';
llxFooter();

View File

@@ -336,7 +336,7 @@ jQuery(document).ready(function() {
var compjsphpstring;
getjsphpurl = $.ajax({
type: "GET",
url: \''.DOL_URL_ROOT.'/core/js/datepicker.js.php\',
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
cache: false,
/* async: false, */
/* crossDomain: true,*/

View File

@@ -128,7 +128,7 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
// Show message
$message='';
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&userpassword=<strong>thepassword</strong>[&reset=1]';
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
$message.=img_picto('','object_globe.png').' '.$url;
print $message;

View File

@@ -397,7 +397,7 @@ if ($action == 'update')
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->datep = $datep;
$object->datef = $datef;
@@ -407,8 +407,6 @@ if ($action == 'update')
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->contactid = GETPOST("contactid",'int');
//$object->societe->id = $_POST["socid"]; // deprecated
//$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = GETPOST("projectid",'int');
$object->note = GETPOST("note");
$object->pnote = GETPOST("note");
@@ -869,7 +867,7 @@ if ($id > 0)
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->datep = $datep;
$object->datef = $datef;
@@ -879,8 +877,6 @@ if ($id > 0)
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->contactid = GETPOST("contactid",'int');
//$object->societe->id = $_POST["socid"]; // deprecated
//$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = GETPOST("projectid",'int');
$object->note = GETPOST("note");

View File

@@ -754,7 +754,7 @@ class ActionComm extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql.= " SET percent = '".$this->db->escape($this->percentage)."'";
if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->db->escape($this->fk_action)."'";
if ($this->type_id > 0) $sql.= ", fk_action = '".$this->db->escape($this->type_id)."'";
$sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null");
$sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null');

View File

@@ -45,13 +45,13 @@ if (! empty($conf->categorie->enabled)) {
if (! $user->rights->mailing->lire || $user->societe_id > 0)
accessforbidden();
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder)

View File

@@ -125,7 +125,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
if ($res > 0 && $newid1 > 0 && $newid2 > 0)
{
$db->commit();
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage?'&backtopage='.urlencode($backtopage):'')); // To avoid pb whith back
exit;
}
else
@@ -275,13 +275,13 @@ if ($socid > 0)
print '</table>';
print '</div>';
if ($user->rights->societe->creer)
{
print '<br>';
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
@@ -293,7 +293,7 @@ if ($socid > 0)
print '</td></tr>';
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc').'"></td></tr>';
print "</table>";
}
@@ -362,7 +362,7 @@ if ($socid > 0)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
@@ -408,14 +408,14 @@ if ($socid > 0)
if ($user->rights->societe->creer || $user->rights->facture->creer)
{
print '<td class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=split&amp;remid='.$obj->rowid.'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print ' &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=remove&amp;remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '</td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
{
$showconfirminfo['rowid']=$obj->rowid;
@@ -427,7 +427,7 @@ if ($socid > 0)
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
}
$db->free($resql);
print "</table>";
@@ -441,7 +441,7 @@ if ($socid > 0)
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage?'&backtopage='.urlencode($backtopage):''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
}
}
else
@@ -590,7 +590,7 @@ if ($socid > 0)
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table>";
}
else

View File

@@ -46,7 +46,7 @@ $toselect = GETPOST('toselect', 'array');
$search_ref=GETPOST('search_ref','alpha');
$search_label=GETPOST('search_label','alpha');
$search_number=GETPOST('search_number','alpha');
$statut=GETPOST('statut')?GETPOST('statut', 'alpha'):'opened'; // 'all' or ''='opened'
$search_status=GETPOST('search_status')?GETPOST('search_status', 'alpha'):'opened'; // 'all' or ''='opened'
$optioncss = GETPOST('optioncss','alpha');
// Security check
@@ -123,11 +123,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$statut = 'all';
$search_ref='';
$search_label='';
$search_number='';
$search_statut='';
$search_status='';
}
@@ -153,8 +152,8 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)";
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
if ($statut == 'opened') $sql.= " AND clos = 0";
if ($statut == 'closed') $sql.= " AND clos = 1";
if ($search_status == 'opened') $sql.= " AND clos = 0";
if ($search_status == 'closed') $sql.= " AND clos = 1";
if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref);
if ($search_label != '') $sql.=natural_search('b.label', $search_label);
if ($search_number != '') $sql.=natural_search('b.number', $search_number);
@@ -222,7 +221,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref != '') $param.='&search_ref='.$search_ref;
if ($search_label != '') $param.='&search_label='.$search_label;
if ($search_number != '') $param.='&search_number='.$search_number;
if ($statut != '') $param.='&statut='.$statut;
if ($search_status != '') $param.='&search_status='.$search_status;
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
@@ -377,7 +376,7 @@ if (! empty($arrayfields['b.tms']['checked']))
print '<td class="liste_titre">';
print '</td>';
}
// Statut
// Status
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td class="liste_titre center">';
@@ -385,7 +384,7 @@ if (! empty($arrayfields['b.clos']['checked']))
'opened'=>$langs->trans("Opened"),
'closed'=>$langs->trans("Closed")
);
print $form->selectarray("statut", $array, $statut, 1);
print $form->selectarray("search_status", $array, $search_status, 1);
print '</td>';
}
// Balance
@@ -584,7 +583,7 @@ foreach ($accounts as $key=>$type)
if (! $i) $totalarray['nbfield']++;
}
// Statut
// Status
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td align="center">'.$acc->getLibStatut(5).'</td>';

View File

@@ -386,7 +386,9 @@ if (empty($reshook))
else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
{
// POST[remise_id] ou POST[remise_id_for_payment]
// POST[remise_id] or POST[remise_id_for_payment]
// We use the credit to reduce amount of invoice
if (! empty($_POST["remise_id"])) {
$ret = $object->fetch($id);
if ($ret > 0) {
@@ -398,14 +400,28 @@ if (empty($reshook))
dol_print_error($db, $object->error);
}
}
if (! empty($_POST["remise_id_for_payment"])) {
// We use the credit to reduce remain to pay
if (! empty($_POST["remise_id_for_payment"]))
{
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
$discount = new DiscountAbsolute($db);
$discount->fetch($_POST["remise_id_for_payment"]);
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
setEventMessages($discount->error, $discount->errors, 'errors');
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
{
// TODO Split the discount in 2 automatically
$error++;
setEventMessages($langs->trans("ErrorDiscountLargerThanRemainToPaySplitItBefore"), null, 'errors');
}
if (! $error)
{
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
setEventMessages($discount->error, $discount->errors, 'errors');
}
}
}
@@ -890,13 +906,18 @@ if (empty($reshook))
$line->fk_facture = $object->id;
$line->fk_parent_line = $fk_parent_line;
$line->subprice =-$line->subprice; // invert price for object
$line->subprice = -$line->subprice; // invert price for object
$line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here
$line->total_ht=-$line->total_ht;
$line->total_tva=-$line->total_tva;
$line->total_ttc=-$line->total_ttc;
$line->total_localtax1=-$line->total_localtax1;
$line->total_localtax2=-$line->total_localtax2;
$line->total_ht = -$line->total_ht;
$line->total_tva = -$line->total_tva;
$line->total_ttc = -$line->total_ttc;
$line->total_localtax1 = -$line->total_localtax1;
$line->total_localtax2 = -$line->total_localtax2;
$line->multicurrency_subprice = -$line->multicurrency_subprice;
$line->multicurrency_total_ht = -$line->multicurrency_total_ht;
$line->multicurrency_total_tva = -$line->multicurrency_total_tva;
$line->multicurrency_total_ttc = -$line->multicurrency_total_ttc;
$result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked
@@ -3224,6 +3245,7 @@ else if ($id > 0 || ! empty($ref))
$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
$viewabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("ViewAvailableGlobalDiscounts") . '</a>';
print '<!-- Discounts --><tr><td>' . $langs->trans('Discounts');
print '</td><td>';
@@ -3233,7 +3255,7 @@ else if ($id > 0 || ! empty($ref))
print $langs->trans("CompanyHasNoRelativeDiscount");
// print ' ('.$addrelativediscount.')';
// Is there commercial discount or down payment available ?
// Is there is commercial discount or down payment available ?
if ($absolute_discount > 0) {
print '. ';
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@@ -3258,7 +3280,7 @@ else if ($id > 0 || ! empty($ref))
} else {
if ($absolute_creditnote > 0) // If not, link will be added later
{
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ')<br>';
else
print '. ';
@@ -3269,7 +3291,7 @@ else if ($id > 0 || ! empty($ref))
if ($absolute_creditnote > 0)
{
// If validated, we show link "add credit note to payment"
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE) {
if ($object->statut != Facture::STATUS_VALIDATED || $object->type == Facture::TYPE_CREDIT_NOTE) {
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
@@ -3280,13 +3302,13 @@ else if ($id > 0 || ! empty($ref))
// There is credit notes discounts available
if (! $absolute_discount) print '<br>';
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
$more=' ('.$addcreditnote.')';
$more=' ('.$addcreditnote. (($addcreditnote && $viewabsolutediscount) ? ' - ' : '') . $viewabsolutediscount . ')';
$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0, $more); // We allow credit note even if amount is higher
}
}
if (! $absolute_discount && ! $absolute_creditnote) {
print $langs->trans("CompanyHasNoAbsoluteDiscount");
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ')<br>';
else
print '. ';

View File

@@ -715,6 +715,9 @@ class FactureRec extends CommonInvoice
dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent = 0;
// Check parameters
if ($type < 0) return -1;

View File

@@ -1051,6 +1051,23 @@ class Facture extends CommonInvoice
else return -1;
}
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto=0)
{
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$url='eee';
return '<a href="'.$urlwithroot.'/document.php?modulepart=invoice&" target="_download" rel="noindex, nofollow">'.$this->ref.'</a>';
}
/**
* Return clicable link of object (with eventually picto)
*
@@ -1577,7 +1594,7 @@ class Facture extends CommonInvoice
$facligne->desc=$remise->description; // Description ligne
$facligne->vat_src_code=$remise->vat_src_code;
$facligne->tva_tx=$remise->tva_tx;
$facligne->subprice=-$remise->amount_ht;
$facligne->subprice = -$remise->amount_ht;
$facligne->fk_product=0; // Id produit predefini
$facligne->qty=1;
$facligne->remise_percent=0;
@@ -1600,6 +1617,11 @@ class Facture extends CommonInvoice
$facligne->total_tva = -$remise->amount_tva;
$facligne->total_ttc = -$remise->amount_ttc;
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
$lineid=$facligne->insert();
if ($lineid > 0)
{

View File

@@ -953,6 +953,7 @@ class BonPrelevement extends CommonObject
{
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
$this->id = $prev_id;
$this->ref = $ref;
}
else
{

View File

@@ -80,7 +80,7 @@ if ($action == 'create')
}
else
{
setEventMessages($langs->trans("DirectDebitOrderCreated"), null);
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
}
}

View File

@@ -145,9 +145,9 @@ if ($prev_id > 0 || $ref)
// List of invoices
$sql = "SELECT pf.rowid";
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
$sql = "SELECT pf.rowid,";
$sql.= " f.rowid as facid, f.facnumber as ref, f.total_ttc,";
$sql.= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
@@ -202,14 +202,14 @@ if ($result)
print '<tr class="liste_titre">';
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("AmountInvoice",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount_requested","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print "</tr>\n";
$var=false;
$total = 0;
$totalinvoices = 0;
$totalamount_requested = 0;
while ($i < min($num, $limit))
{
@@ -231,9 +231,12 @@ if ($result)
print $thirdpartytmp->getNomUrl(1);
print "</td>\n";
// Amount
// Amount of invoice
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
// Amount requested
print '<td align="right">'.price($obj->amount_requested)."</td>\n";
// Status of requests
print '<td align="center">';
@@ -256,7 +259,8 @@ if ($result)
print "</tr>\n";
$total += $obj->total_ttc;
$totalinvoices += $obj->total_ttc;
$totalamount_requested += $obj->amount_requested;
$i++;
}
@@ -267,8 +271,11 @@ if ($result)
print '<td>'.$langs->trans("Total").'</td>';
print '<td>&nbsp;</td>';
print '<td align="right">';
if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
print price($total);
//if ($totalinvoices != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); // It is normal to have total that differs. For an amount of invoice of 100, request to pay may be 50 only.
if ($totalamount_requested != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
print "</td>\n";
print '<td align="right">';
print price($totalamount_requested);
print "</td>\n";
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';

View File

@@ -538,11 +538,13 @@ class Contrat extends CommonObject
/**
* Load a contract from database
*
* @param int $id Id of contract to load
* @param string $ref Ref
* @return int <0 if KO, id of contract if OK
* @param int $id Id of contract to load
* @param string $ref Ref
* @param string $ref_customer Customer ref
* @param string $ref_supplier Supplier ref
* @return int <0 if KO, 0 if not found, Id of contract if OK
*/
function fetch($id,$ref='')
function fetch($id, $ref='', $ref_customer='', $ref_supplier='')
{
$sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,";
$sql.= " ref_supplier, ref_customer,";
@@ -553,12 +555,20 @@ class Contrat extends CommonObject
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, model_pdf, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
if (! $id) $sql.=" WHERE entity IN (".getEntity('contract', 0).")";
else $sql.= " WHERE rowid=".$id;
if ($ref_customer)
{
$sql.= " AND ref_customer = '".$this->db->escape($ref_customer)."'";
}
if ($ref_supplier)
{
$sql.= " AND ref_supplier = '".$this->db->escape($ref_supplier)."'";
}
if ($ref)
{
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
$sql.= " AND entity IN (".getEntity('contract', 0).")";
$sql.= " AND ref='".$this->db->escape($ref)."'";
}
else $sql.= " WHERE rowid=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -628,7 +638,7 @@ class Contrat extends CommonObject
{
dol_syslog(get_class($this)."::Fetch Erreur contrat non trouve");
$this->error="Contract not found";
return -2;
return 0;
}
}
else
@@ -2834,6 +2844,7 @@ class ContratLigne extends CommonObjectLine
if (empty($this->total_ttc)) $this->total_ttc = 0;
if (empty($this->localtax1_tx)) $this->localtax1_tx = 0;
if (empty($this->localtax2_tx)) $this->localtax2_tx = 0;
if (empty($this->remise_percent)) $this->remise_percent = 0;
// Check parameters
// Put here code to add control on parameters values

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -278,11 +278,8 @@ $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.re
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
$sql.= " typent.code,";
$sql.= " state.code_departement, state.nom";
// Add where from extra fields
foreach ($extrafields->attribute_label as $key => $val)
{
$sql .= ', ef.'.$key;
}
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook

View File

@@ -147,11 +147,11 @@ if (! $error && $massaction == 'confirm_presend')
foreach($receiver as $key=>$val)
{
// Recipient was provided from combo list
if ($val == 'thirdparty') // Id of third party
if ($val == 'thirdparty') // Id of third party or user
{
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
}
elseif ($val) // Id du contact
elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact
{
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
$sendtoid[] = $val;

View File

@@ -78,6 +78,7 @@ class DiscountAbsolute
$sql = "SELECT sr.rowid, sr.fk_soc,";
$sql.= " sr.fk_user,";
$sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx,";
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.description,";
$sql.= " sr.datec,";
$sql.= " f.facnumber as ref_facture_source";
@@ -97,9 +98,15 @@ class DiscountAbsolute
$this->id = $obj->rowid;
$this->fk_soc = $obj->fk_soc;
$this->amount_ht = $obj->amount_ht;
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
$this->tva_tx = $obj->tva_tx;
$this->fk_user = $obj->fk_user;
$this->fk_facture_line = $obj->fk_facture_line;

View File

@@ -1708,7 +1708,7 @@ class ExtraFields
if (! empty($onlykey) && $key != $onlykey) continue;
$key_type = $this->attribute_type[$key];
if($this->attribute_required[$key] && !GETPOST("options_$key",2))
if ($this->attribute_required[$key] && empty($_POST["options_".$key])) // Check if empty without GETPOST, value can be alpha, int, array, etc...
{
$nofillrequired++;
$error_field_required[] = $value;
@@ -1721,7 +1721,7 @@ class ExtraFields
}
else if (in_array($key_type,array('checkbox','chkbxlst')))
{
$value_arr=GETPOST("options_".$key);
$value_arr=GETPOST("options_".$key, 'array'); // check if an array
if (!empty($value_arr)) {
$value_key=implode($value_arr,',');
}else {
@@ -1740,7 +1740,7 @@ class ExtraFields
$object->array_options["options_".$key]=$value_key;
}
if($nofillrequired) {
if ($nofillrequired) {
$langs->load('errors');
setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required), null, 'errors');
return -1;

View File

@@ -5046,11 +5046,11 @@ class Form
else return 'BadValueForParameterTypeHour';
if ($typehour!='text') $retstring.=' '.$langs->trans('HourShort');
else $retstring.=':';
else $retstring.='<span class="hideonsmartphone">:</span>';
// Minutes
if ($minunderhours) $retstring.='<br>';
else $retstring.="&nbsp;";
else $retstring.='<span class="hideonsmartphone">&nbsp;</span>';
if ($typehour=='select' || $typehour=='textselect')
{

View File

@@ -54,6 +54,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
$langs->load("companies");
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
// Filters
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@@ -95,9 +98,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td></tr>';
}
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
// Type
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';

View File

@@ -1537,7 +1537,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
$ecmfile=new EcmFiles($db);
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($destfull));
$ecmfile->label = md5_file(dol_osencode($destfull)); // MD5 of file content
$ecmfile->fullpath_orig = $TFile['name'][$i];
$ecmfile->gen_or_uploaded = 'uploaded';
$ecmfile->description = ''; // indexed content
@@ -1648,7 +1648,7 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
}
/**
* Convert an image file into anoher format.
* Convert an image file into another format.
* This need Imagick php extension.
*
* @param string $fileinput Input file name
@@ -1656,14 +1656,19 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* @param string $fileoutput Output filename
* @return int <0 if KO, 0=Nothing done, >0 if OK
*/
function dol_convert_file($fileinput,$ext='png',$fileoutput='')
function dol_convert_file($fileinput, $ext='png', $fileoutput='')
{
global $langs;
if (class_exists('Imagick'))
{
$image=new Imagick();
$ret = $image->readImage($fileinput);
try {
$ret = $image->readImage($fileinput);
} catch(Exception $e) {
dol_syslog("Failed to read image using Imagick. Try to install package 'apt-get install ghostscript'.", LOG_WARNING);
return 0;
}
if ($ret)
{
$ret = $image->setImageFormat($ext);

View File

@@ -46,7 +46,7 @@ if (! function_exists('json_encode'))
*/
function dol_json_encode($elements)
{
dol_syslog("For better permorfance, enable the native json in your PHP", LOG_WARNING);
dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING);
$num=0;
if (is_object($elements)) // Count number of properties for an object
@@ -225,12 +225,11 @@ if (! function_exists('json_decode'))
* @param string $json Json encoded to PHP Object or Array
* @param bool $assoc False return an object, true return an array. Try to always use it with true !
* @return mixed Object or Array or false on error
* @deprecated PHP >= 5.3 supports native json_decode
* @see json_decode()
*/
function dol_json_decode($json, $assoc=false)
{
dol_syslog('dol_json_decode() is deprecated. Please update your code to use native json_decode().', LOG_WARNING);
dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING);
$comment = false;

View File

@@ -576,10 +576,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
* @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param int $preselectedday Preselected day
* @param boolean $var Var for css of lines
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @return $inc
*/
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=1, $preselectedday='', $var=false)
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable)
{
global $conf, $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
@@ -732,8 +732,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
print $tableCell;
print '</td>';
$cssonholiday='';
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
// Duration
print '<td align="right">';
print '<td align="center" class="duration'.($cssonholiday?' '.$cssonholiday:'').'">';
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
$alreadyspent='';
@@ -743,7 +748,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$tableCell='';
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
$tableCell.=' + ';
$tableCell.='<span class="hideonsmartphone"> + </span>';
//$tableCell.='&nbsp;&nbsp;&nbsp;';
$tableCell.=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
//$tableCell.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled':'').' value="'.$langs->trans("Add").'">';
@@ -783,8 +788,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$level++;
if ($lines[$i]->id > 0)
{
if ($parent == 0) projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $var);
else projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $var);
if ($parent == 0) projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $isavailable);
else projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $isavailable);
}
$level--;
}
@@ -798,7 +803,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
}
/**
* Output a task line into a perday intput mode
*
@@ -812,10 +816,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
* @param string $tasksrole Array of roles user has on task
* @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param boolean $var Var for css of lines
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @return $inc
*/
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=1, $var=false)
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable)
{
global $conf, $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
@@ -851,7 +855,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
// Break on a new project
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
{
//$var = ! $var;
$lastprojectid=$lines[$i]->fk_project;
$projectstatic->id = $lines[$i]->fk_project;
}
@@ -966,13 +969,19 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
for ($idw = 0; $idw < 7; $idw++)
{
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
$cssonholiday='';
if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
$tmparray=dol_getdate($tmpday);
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
$alreadyspent='';
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
$alttitle=$langs->trans("AddHereTimeSpentForDay",$tmparray['day'],$tmparray['mon']);
$tableCell ='<td align="center" class="hide'.$idw.'">';
$tableCell ='<td align="center" class="hide'.$idw.($cssonholiday?' '.$cssonholiday:'').'">';
if ($alreadyspent)
{
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center smallpadd" size="2" disabled id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
@@ -1008,8 +1017,8 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
$level++;
if ($lines[$i]->id > 0)
{
if ($parent == 0) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $var);
else projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $var);
if ($parent == 0) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable);
else projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable);
}
$level--;
}
@@ -1163,7 +1172,6 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
$sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount, p.dateo, p.datee";
$sql2.= " ORDER BY p.title, p.ref";
$var=true;
$resql = $db->query($sql2);
if ($resql)
{

View File

@@ -977,7 +977,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
if (! empty($conf->banque->enabled))
{
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
}
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled))
{

View File

@@ -70,7 +70,7 @@ class modCashDesk extends DolibarrModules
$this->phpmin = array(4,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module
$this->langfiles = array("cashdesk");
//$this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text')
$this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text')
//$this->warnings_activation_ext = array('FR'=>'WarningInstallationMayBecomeNotCompliantWithLaw'); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text')
// Constants

View File

@@ -49,7 +49,8 @@ print load_fiche_titre($text);
print $langs->trans("ToolsDesc").'<br><br>';
// Show logo
print '<div class="center"><div class="logo_setup"></div></div>';
llxFooter();

View File

@@ -59,24 +59,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$encoding = '';
$action=GETPOST('action','alpha');
$original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP).
$original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP).
$hashp=GETPOST('hashp','aZ09');
$modulepart=GETPOST('modulepart','alpha');
$urlsource=GETPOST('urlsource','alpha');
$entity=GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity;
// Security check
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
if (empty($modulepart)) accessforbidden('Bad link. Bad value for parameter modulepart',0,0,1);
if (empty($original_file) && empty($hashp)) accessforbidden('Bad link. Missing identification to find file (original_file or hashp)',0,0,1);
if ($modulepart == 'fckeditor') $modulepart='medias'; // For backward compatibility
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
// For some module part, dir may be privates
if (in_array($modulepart,array('facture_paiement','unpaid')))
if (in_array($modulepart, array('facture_paiement','unpaid')))
{
if (! $user->rights->societe->client->voir || $socid) $original_file='private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user
}
/*
* Action
*/
@@ -99,6 +102,33 @@ if (preg_match('/\.(html|htm)$/i',$original_file)) $attachment = false;
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment",'alpha')?true:false;
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
// If we have a hash public (hashp), we guess the original_file.
if (! empty($hashp))
{
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$result = $ecmfile->fetch(0, '', '', '', $hashp);
if ($result > 0)
{
$tmp = explode('/', $ecmfile->filepath, 2); // $ecmfile->filepatch is relative to document directory
$moduleparttocheck = $tmp[0];
if ($moduleparttocheck == $modulepart)
{
$original_file = (($tmp[1]?$tmp[1].'/':'').$ecmfile->filename); // this is relative to module dir
//var_dump($original_file); exit;
}
else
{
accessforbidden('Bad link. File owns to another module part.',0,0,1);
}
}
else
{
accessforbidden('Bad link. File was not found or sharing attribute removed recently.',0,0,1);
}
}
// Security: Delete string ../ into $original_file
$original_file = str_replace("../","/", $original_file);

View File

@@ -46,7 +46,9 @@ class EcmFiles //extends CommonObject
/**
*/
public $label;
public $ref; // hash of file path
public $label; // hash of file content (md5_file(dol_osencode($destfull))
public $share; // hash for file sharing. empty by default
public $entity;
public $filename;
public $filepath;
@@ -94,10 +96,15 @@ class EcmFiles //extends CommonObject
$error = 0;
// Clean parameters
if (isset($this->ref)) {
$this->ref = trim($this->ref);
}
if (isset($this->label)) {
$this->label = trim($this->label);
}
if (isset($this->share)) {
$this->share = trim($this->share);
}
if (isset($this->entity)) {
$this->entity = trim($this->entity);
}
@@ -136,6 +143,10 @@ class EcmFiles //extends CommonObject
}
if (empty($this->date_c)) $this->date_c = dol_now();
// If ref not defined
if (empty($ref)) $ref = dol_hash($this->filepath.'/'.$this->filename, 3);
$maxposition=0;
if (empty($this->position)) // Get max used
{
@@ -157,7 +168,9 @@ class EcmFiles //extends CommonObject
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
$sql.= 'ref,';
$sql.= 'label,';
$sql.= 'share,';
$sql.= 'entity,';
$sql.= 'filename,';
$sql.= 'filepath,';
@@ -174,7 +187,9 @@ class EcmFiles //extends CommonObject
$sql.= 'fk_user_m,';
$sql.= 'acl';
$sql .= ') VALUES (';
$sql .= " '".$ref."', ";
$sql .= ' '.(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").',';
$sql .= ' '.(! isset($this->share)?'NULL':"'".$this->db->escape($this->share)."'").',';
$sql .= ' '.(! isset($this->entity)?$conf->entity:$this->entity).',';
$sql .= ' '.(! isset($this->filename)?'NULL':"'".$this->db->escape($this->filename)."'").',';
$sql .= ' '.(! isset($this->filepath)?'NULL':"'".$this->db->escape($this->filepath)."'").',';
@@ -232,11 +247,13 @@ class EcmFiles //extends CommonObject
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Not used yet. Will contains a hash id from filename+filepath
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
* @param string $hashforshare Hash of file sharing.
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = null, $relativepath = '')
public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='')
{
dol_syslog(__METHOD__, LOG_DEBUG);
@@ -244,6 +261,7 @@ class EcmFiles //extends CommonObject
$sql .= ' t.rowid,';
$sql .= " t.ref,";
$sql .= " t.label,";
$sql .= " t.share,";
$sql .= " t.entity,";
$sql .= " t.filename,";
$sql .= " t.filepath,";
@@ -268,11 +286,20 @@ class EcmFiles //extends CommonObject
if ($relativepath) {
$sql .= " AND t.filepath = '" . $this->db->escape(dirname($relativepath)) . "' AND t.filename = '".$this->db->escape(basename($relativepath))."'";
}
elseif (null !== $ref) {
elseif (! empty($ref)) {
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
}
elseif (! empty($hashoffile)) {
$sql .= " AND t.label = '".$this->db->escape($hashoffile)."'";
}
elseif (! empty($hashforshare)) {
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
} else {
$sql .= ' AND t.rowid = ' . $id;
}
// When we search on hash of content, we take the first one. Solve also hash conflict.
$this->db->plimit(1);
$this->db->order('t.rowid', 'ASC');
$resql = $this->db->query($sql);
if ($resql) {
@@ -283,6 +310,7 @@ class EcmFiles //extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->ref;
$this->label = $obj->label;
$this->share = $obj->share;
$this->entity = $obj->entity;
$this->filename = $obj->filename;
$this->filepath = $obj->filepath;
@@ -344,6 +372,7 @@ class EcmFiles //extends CommonObject
$sql = 'SELECT';
$sql .= ' t.rowid,';
$sql .= " t.label,";
$sql .= " t.share,";
$sql .= " t.entity,";
$sql .= " t.filename,";
$sql .= " t.filepath,";
@@ -393,8 +422,9 @@ class EcmFiles //extends CommonObject
$line = new EcmfilesLine();
$line->id = $obj->rowid;
$line->ref = $obj->ref;
$line->label = $obj->label;
$line->share = $obj->share;
$line->entity = $obj->entity;
$line->filename = $obj->filename;
$line->filepath = $obj->filepath;
@@ -438,9 +468,15 @@ class EcmFiles //extends CommonObject
// Clean parameters
if (isset($this->ref)) {
$this->ref = trim($this->ref);
}
if (isset($this->label)) {
$this->label = trim($this->label);
}
if (isset($this->share)) {
$this->share = trim($this->share);
}
if (isset($this->entity)) {
$this->entity = trim($this->entity);
}
@@ -484,7 +520,9 @@ class EcmFiles //extends CommonObject
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
$sql .= " ref = '".dol_hash($this->filepath.'/'.$this->filename, 3)."',";
$sql .= ' label = '.(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").',';
$sql .= ' share = '.(! empty($this->share)?"'".$this->db->escape($this->share)."'":"null").',';
$sql .= ' entity = '.(isset($this->entity)?$this->entity:$conf->entity).',';
$sql .= ' filename = '.(isset($this->filename)?"'".$this->db->escape($this->filename)."'":"null").',';
$sql .= ' filepath = '.(isset($this->filepath)?"'".$this->db->escape($this->filepath)."'":"null").',';

View File

@@ -19,12 +19,12 @@
* \file htdocs/ecm/docfile.php
* \ingroup ecm
* \brief Card of a file for ECM module
* \author Laurent Destailleur
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
@@ -39,6 +39,9 @@ $langs->load("bills");
$langs->load("contracts");
$langs->load("categories");
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
if (!$user->rights->ecm->setup) accessforbidden();
// Get parameters
@@ -61,8 +64,6 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$cancel=GETPOST('cancel','alpha');
$action=GETPOST('action','aZ09');
$section=GETPOST("section");
if (! $section)
{
@@ -87,29 +88,33 @@ if (! $result > 0)
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile;
$file = new stdClass();
$file->section_id=$ecmdir->id;
$file->label=$urlfile;
$relativetodocument = 'ecm/'.$relativepath; // $relativepath is relative to ECM dir, we need relative to document
$filepath=$relativepath.$file->label;
$filepathtodocument=$relativetodocument.$file->label;
// Try to load object from index
$object = new ECMFiles($db);
$result=$object->fetch(0, '', $filepathtodocument);
if (! ($result >= 0))
{
dol_print_error($db, $object->error, $object->errors);
exit;
}
/*
$ecmfile = new ECMFile($db);
if (! empty($_GET["fileid"]))
{
$result=$ecmfile->fetch($_GET["fileid"]);
if (! $result > 0)
{
dol_print_error($db,$ecmfile->error);
exit;
}
}
*/
* Actions
*/
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
if ($action == 'cancel')
if ($cancel)
{
$action ='';
if ($backtourl)
@@ -119,7 +124,7 @@ if ($action == 'cancel')
}
else
{
header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager&section='.$section);
header("Location: ".DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.$urlfile.'&section='.$section);
exit;
}
}
@@ -129,8 +134,9 @@ if ($action == 'update')
{
$error=0;
$oldlabel=GETPOST('urlfile');
$newlabel=GETPOST('label');
$oldlabel=GETPOST('urlfile', 'alpha');
$newlabel=GETPOST('label', 'alpha');
$shareenabled = GETPOST('shareenabled', 'alpha');
//$db->begin();
@@ -144,7 +150,7 @@ if ($action == 'update')
//print $oldfile.' - '.$newfile;
if ($newlabel != $oldlabel)
{
$result=dol_move($oldfile, $newfile);
$result=dol_move($oldfile, $newfile); // This include update of database
if (! $result)
{
$langs->load('errors');
@@ -153,44 +159,62 @@ if ($action == 'update')
}
}
// Now we update index of file
$db->begin();
if (! $error)
{
//$db->commit();
if (is_object($object))
{
if ($shareenabled)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$object->share = getRandomPassword(true);
}
else
{
$object->share = '';
}
$result = $object->update($user);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if (!$error)
{
$db->commit();
$urlfile=$newlabel;
}
else
{
//$db->rollback();
$db->rollback();
}
}
/*******************************************************************
* PAGE
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
llxHeader();
/*
* View
*/
$form=new Form($db);
$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile;
$file = new stdClass();
$file->section_id=$ecmdir->id;
$file->label=$urlfile;
llxHeader();
$head = ecm_file_prepare_head($file);
if ($_GET["action"] == 'edit')
if ($action == 'edit')
{
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="section" value="'.$section.'">';
print '<input type="hidden" name="urlfile" value="'.$urlfile.'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
@@ -221,11 +245,11 @@ while ($tmpecmdir && $result > 0)
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
print $s;
print ' -> ';
if (GETPOST('action','aZ09') == 'edit') print '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfile.'">';
if ($action == 'edit') print '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfile.'">';
else print $urlfile;
print '</td></tr>';
/*print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
if ($_GET["action"] == 'edit')
if ($action == 'edit')
{
print '<textarea class="flat" name="description" cols="80">';
print $ecmdir->description;
@@ -253,31 +277,89 @@ print dol_print_size($totalsize);
print '</td></tr>';
*/
print '<tr><td>'.$langs->trans("HashOfFileContent").'</td><td>';
$object = new EcmFiles($db);
//$filenametosearch=basename($filepath);
//$filedirtosearch=basedir($filepath);
$object->fetch(0, '', $filepathtodocument);
if (! empty($object->label))
{
print $object->label;
}
else
{
print img_warning().' '.$langs->trans("FileNotYetIndexedInDatabase");
}
print '</td></tr>';
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<tr><td>'.$langs->trans("DirectDownloadLink").'</td><td>';
print '<tr><td>'.$langs->trans("DirectDownloadInternalLink").'</td><td>';
$modulepart='ecm';
$forcedownload=1;
$rellink='/document.php?modulepart='.$modulepart;
if ($forcedownload) $rellink.='&attachment=1';
if (! empty($object->entity)) $rellink.='&entity='.$object->entity;
$filepath=$relativepath.$file->label;
$rellink.='&file='.urlencode($filepath);
$fulllink=$urlwithroot.$rellink;
print img_picto('','object_globe.png').' ';
print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
if ($action != 'edit') print '<input type="text" class="quatrevingtpercent" id="downloadinternallink" name="downloadinternellink" value="'.dol_escape_htmltag($fulllink).'">';
else print $fulllink;
if ($action != 'edit') print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
print '</td></tr>';
print '<tr><td>';
if ($action != 'edit') print $langs->trans("DirectDownloadLink");
else print $langs->trans("FileSharedViaALink");
print '</td><td>';
if (! empty($object->share))
{
if ($action != 'edit')
{
$modulepart='ecm';
$forcedownload=1;
$rellink='/document.php?modulepart='.$modulepart;
if ($forcedownload) $rellink.='&attachment=1';
if (! empty($object->entity)) $rellink.='&entity='.$object->entity;
//$rellink.='&file='.urlencode($filepath); // No need of name of file for public link, we will use the hash
$fulllink=$urlwithroot.$rellink;
//if (! empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path
//elseif (! empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content
if (! empty($object->share)) $fulllink.='&hashp='.$object->share; // Hash for public share
print img_picto('','object_globe.png').' ';
if ($action != 'edit') print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadexternallink" value="'.dol_escape_htmltag($fulllink).'">';
else print $fulllink;
if ($action != 'edit') print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
}
else
{
print '<input type="checkbox" name="shareenabled"'.($object->share?' checked="checked"':'').' /> ';
}
}
else
{
if ($action != 'edit')
{
print '<span class="opacitymedium">'.$langs->trans("FileNotShared").'</span>';
}
else
{
print '<input type="checkbox" name="shareenabled"'.($object->share?' checked="checked"':'').' /> ';
}
}
print '</td></tr>';
print '</table>';
print ajax_autoselect('downloadinternallink');
print ajax_autoselect('downloadlink');
dol_fiche_end();
if ($_GET["action"] == 'edit')
if ($action == 'edit')
{
print '<div class="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
@@ -290,13 +372,13 @@ if ($_GET["action"] == 'edit')
// Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_file')
if ($action == 'delete_file')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1);
}
if ($_GET["action"] != 'edit')
if ($action != 'edit')
{
// Actions buttons
print '<div class="tabsAction">';
@@ -305,7 +387,7 @@ if ($_GET["action"] != 'edit')
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=cancel&section='.$section.'&urlfile='.urlencode($urlfile).'&backtourl='.urlencode($backtourl).'">'.$langs->trans('Cancel').'</a>';
//print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=cancel&section='.$section.'&urlfile='.urlencode($urlfile).'&backtourl='.urlencode($backtourl).'">'.$langs->trans('Cancel').'</a>';
}
/*
if ($user->rights->ecm->setup)

View File

@@ -143,26 +143,24 @@ if ($action == 'confirm_deletefile')
{
if (GETPOST('confirm') == 'yes')
{
// GETPOST('urlfile','alpha') is full relative URL from ecm root dir. Contains path of all sections.
//var_dump(GETPOST('urlfile'));exit;
$langs->load("other");
if ($section)
{
$result=$ecmdir->fetch($section);
if (! ($result > 0))
{
dol_print_error($db,$ecmdir->error);
exit;
}
$relativepath=$ecmdir->getRelativePath();
}
else $relativepath='';
$upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:'');
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
$file = $upload_dir . "/" . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
//var_dump($file);exit;
$ret=dol_delete_file($file);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$result=$ecmdir->changeNbOfFiles('-');
$ret=dol_delete_file($file); // This include also the delete from file index in database.
if ($ret)
{
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile','alpha')), null, 'mesgs');
$result=$ecmdir->changeNbOfFiles('-');
}
else
{
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile','alpha')), null, 'errors');
}
clearstatcache();
}
@@ -375,7 +373,7 @@ else
print '</a>';
}
$url=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&amp;module='.$module:'').($section?'&amp;section='.$section:'')));
print '<a href="'.$url.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('Refresh')).'">';
print '<a href="'.$url.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">';
print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">';
print '</a>';

View File

@@ -215,20 +215,22 @@ class ExpenseReport extends CommonObject
$resql=$this->db->query($sql);
if (!$resql) $error++;
foreach ($this->lines as $i => $val)
{
$newndfline=new ExpenseReportLine($this->db);
$newndfline=$this->lines[$i];
$newndfline->fk_expensereport=$this->id;
if ($result >= 0)
{
$result=$newndfline->insert();
}
if ($result < 0)
{
$error++;
break;
}
if (is_array($this->lines) && count($this->lines)>0) {
foreach ($this->lines as $i => $val)
{
$newndfline=new ExpenseReportLine($this->db);
$newndfline=$this->lines[$i];
$newndfline->fk_expensereport=$this->id;
if ($result >= 0)
{
$result=$newndfline->insert();
}
if ($result < 0)
{
$error++;
break;
}
}
}
if (! $error)

View File

@@ -284,7 +284,7 @@ class Holiday extends CommonObject
* @param string $filter SQL Filter
* @return int -1 if KO, 1 if OK, 2 if no result
*/
function fetchByUser($user_id,$order='',$filter='')
function fetchByUser($user_id, $order='', $filter='')
{
global $langs, $conf;
@@ -692,13 +692,17 @@ class Holiday extends CommonObject
}
/**
* verifDateHolidayCP
* Check if a user is on holiday (partially or completely) into a period.
* This function can be used to avoid to have 2 leave requests on same period for example.
* Warning: It consumes a lot of memory because it load in ->holiday all holiday of a dedicated user at each call.
*
* @param int $fk_user Id user
* @param date $dateDebut Start date
* @param date $dateFin End date
* @param int $halfday Tag to define half day when holiday start and end
* @return boolean
* @param date $dateDebut Start date of period to check
* @param date $dateFin End date of period to check
* @param int $halfday Tag to define how start and end the period to check:
* 0:Full days, 2:Sart afternoon end monring, -1:Start afternoon, 1:End morning
* @return boolean False is on holiday at least partially into the period, True is never on holiday during chcked period.
* @see verifDateHolidayForTimestamp
*/
function verifDateHolidayCP($fk_user, $dateDebut, $dateFin, $halfday=0)
{
@@ -710,14 +714,103 @@ class Holiday extends CommonObject
if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
// TODO Also use halfday for the check
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
if ($halfday == 0)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == -1)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == 1)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == 2)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
else
{
dol_print_error('', 'Bad value of parameter halfday when calling function verifDateHolidayCP');
}
}
return true;
}
/**
* Check a user is not on holiday for a particular timestamp
*
* @param int $fk_user Id user
* @param timestamp $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00)
* @return array array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp.
* @see verifDateHolidayCP
*/
function verifDateHolidayForTimestamp($fk_user, $timestamp)
{
global $langs, $conf;
$isavailablemorning=true;
$isavailableafternoon=true;
$sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
$sql.= " WHERE cp.entity IN (".getEntity('holiday').")";
$sql.= " AND cp.fk_user = ".(int) $fk_user;
$sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'";
$resql = $this->db->query($sql);
if ($resql)
{
$num_rows = $this->db->num_rows($resql); // Note, we can have 2 records if on is morning and the other one is afternoon
if ($num_rows > 0)
{
$i=0;
while ($i < $num_rows)
{
$obj = $this->db->fetch_object($resql);
// Note: $obj->halday is 0:Full days, 2:Sart afternoon end morning, -1:Start afternoon, 1:End morning
$arrayofrecord[$obj->rowid]=array('date_start'=>$this->db->jdate($obj->date_start), 'date_end'=>$this->db->jdate($obj->date_end), 'halfday'=>$obj->halfday);
$i++;
}
// We found a record, user is on holiday by default, so is not available is true.
$isavailablemorning = true;
foreach($arrayofrecord as $record)
{
if ($timestamp == $record['date_start'] && $record['halfday'] == 2) continue;
if ($timestamp == $record['date_start'] && $record['halfday'] == -1) continue;
$isavailablemorning = false;
break;
}
$isavailableafternoon = true;
foreach($arrayofrecord as $record)
{
if ($timestamp == $record['date_end'] && $record['halfday'] == 2) continue;
if ($timestamp == $record['date_end'] && $record['halfday'] == 1) continue;
$isavailableafternoon = false;
break;
}
}
}
else dol_print_error($this->db);
return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon);
}

View File

@@ -24,7 +24,7 @@ class Segment implements IteratorAggregate, Countable
protected $images = array();
protected $odf;
protected $file;
/**
* Constructor
*
@@ -86,15 +86,15 @@ class Segment implements IteratorAggregate, Countable
*/
public function merge()
{
// To provide debug information on line number processed
// To provide debug information on line number processed
global $count;
if (empty($count)) $count=1;
else $count++;
if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps
$this->xml = $this->savxml;
$tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values
// Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
@@ -106,7 +106,7 @@ class Segment implements IteratorAggregate, Countable
$tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
}
}
// Conditionals substitution
// Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
foreach($tmpvars as $key => $value)
@@ -133,7 +133,7 @@ class Segment implements IteratorAggregate, Countable
$this->xml = preg_replace($reg, '', $this->xml);
}
}
$this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml);
if ($this->hasChildren()) {
foreach ($this->children as $child) {
@@ -143,7 +143,7 @@ class Segment implements IteratorAggregate, Countable
}
$reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm";
$this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed);
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
$this->xmlParsed = $this->macroReplace($this->xmlParsed);
$this->file->open($this->odf->getTmpfile());
foreach ($this->images as $imageKey => $imageValue) {
@@ -155,28 +155,38 @@ class Segment implements IteratorAggregate, Countable
}
}
$this->file->close();
return $this->xmlParsed;
}
/**
* Function to replace macros for invoice short and long month, invoice year
*
*
* Substitution occur when the invoice is generated, not considering the invoice date
* so do not (re)generate in a diferent date than the one that the invoice belongs to
* Perhaps it would be better to use the invoice issued date but I still do not know
* how to get it here
*
* Miguel Erill 09/04/2017
*
*
* @param string $value String to convert
*/
public function macroReplace($text)
{
global $langs;
$patterns=array( '__CURRENTDAY__','__CURRENTDAYTEXT__','__CURRENTMONTHSHORT__','__CURRENTMONTH__','__CURRENTYEAR__' );
$values=array( date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y') );
$hoy = dol_getdate(dol_now('tzuser'));
$dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']);
$nextMonth = $dateinonemontharray['month'];
$patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u',
'/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u',
'/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u',
'/__CURRENTYEAR__/u','/__NEXTYEAR__/u' );
$values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']),
$hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']),
$nextMonth, monthArray($langs)[$nextMonth],
$hoy['year'], $hoy['year']+1 );
$text=preg_replace($patterns, $values, $text);
@@ -203,7 +213,7 @@ class Segment implements IteratorAggregate, Countable
}
return $this;
}
/**
* Assign a template variable to replace
*

View File

@@ -510,6 +510,7 @@ ALTER TABLE llx_user_rights DROP FOREIGN KEY fk_user_rights_fk_user_user;
ALTER TABLE llx_user_rights DROP INDEX uk_user_rights;
ALTER TABLE llx_user_rights DROP INDEX fk_user;
ALTER TABLE llx_user_rights ADD UNIQUE INDEX uk_user_rights (entity, fk_user, fk_id);
DELETE FROM llx_user_rights WHERE fk_user NOT IN (select rowid from llx_user);
ALTER TABLE llx_user_rights ADD CONSTRAINT fk_user_rights_fk_user_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
ALTER TABLE llx_usergroup_rights ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;

View File

@@ -41,6 +41,11 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
-- For 7.0
ALTER TABLE llx_ecm_files MODIFY label varchar(128) NOT NULL;
ALTER TABLE llx_ecm_files ADD COLUMN share varchar(128) NULL after label;
ALTER TABLE llx_c_paiement ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_c_payment_term ADD COLUMN position integer NOT NULL DEFAULT 0;

View File

@@ -90,6 +90,7 @@ delete from llx_livraison where ref = '';
delete from llx_expeditiondet where fk_expedition in (select rowid from llx_expedition where ref = '');
delete from llx_expedition where ref = '';
delete from llx_holiday_logs where fk_user_update not IN (select rowid from llx_user);
delete from llx_user_rights where fk_user not IN (select rowid from llx_user);
update llx_deplacement set dated='2010-01-01' where dated < '2000-01-01';

View File

@@ -19,8 +19,9 @@
CREATE TABLE llx_ecm_files
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(128), -- Not used yet. Will contains a hash id from filename+filepath
label varchar(64) NOT NULL, -- label contains a md5
ref varchar(128), -- contains a hash id from filename+filepath
label varchar(128) NOT NULL, -- contains hash of file content
share varchar(128) NULL, -- contains a hash for file sharing
entity integer DEFAULT 1 NOT NULL, -- multi company id
filepath varchar(255) NOT NULL, -- relative to dolibarr document dir. Example module/def
filename varchar(255) NOT NULL, -- file name only without any directory

View File

@@ -211,7 +211,8 @@ if ($ok)
$extrafields=new ExtraFields($db);
$listofmodulesextra=array('societe'=>'societe','adherent'=>'adherent','product'=>'product',
'socpeople'=>'socpeople', 'commande'=>'commande', 'facture'=>'facture',
'commande_fournisseur'=>'commande_fournisseur', 'actioncomm'=>'actioncomm',
'supplier_proposal'=>'supplier_proposal', 'commande_fournisseur'=>'commande_fournisseur', 'facture_fourn'=>'facture_fourn',
'actioncomm'=>'actioncomm',
'adherent_type'=>'adherent_type','user'=>'user','projet'=>'projet', 'projet_task'=>'projet_task');
print '<tr><td colspan="2"><br>*** Check fields into extra table structure match table of definition. If not add column into table</td></tr>';
foreach($listofmodulesextra as $tablename => $elementtype)
@@ -303,6 +304,10 @@ if ($ok)
print "</td><td>&nbsp;</td></tr>\n";
}
else
{
dol_print_error($db);
}
}
}

View File

@@ -343,6 +343,7 @@ DateIsNotEnough=Date not reached yet
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date
WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date
ViewAvailableGlobalDiscounts=View available discounts
# PaymentConditions
Statut=Status
PaymentConditionShortRECEP=Due Upon Receipt

View File

@@ -41,4 +41,8 @@ ECMDirectoryForFiles=Relative directory for files
CannotRemoveDirectoryContainsFiles=Removed not possible because it contains some files
ECMFileManager=File manager
ECMSelectASection=Select a directory on left tree...
DirNotSynchronizedSyncFirst=This directory seems to be created or modified outside ECM module. You must click on "Refresh" button first to synchronize disk and database to get content of this directory.
DirNotSynchronizedSyncFirst=This directory seems to be created or modified outside ECM module. You must click on "Resync" button first to synchronize disk and database to get content of this directory.
ReSyncListOfDir=Resync list of directories
HashOfFileContent=Hash of file content
FileNotYetIndexedInDatabase=File not yet indexed into database (try to re-upload it)
FileSharedViaALink=File shared via a link

View File

@@ -200,7 +200,7 @@ ErrorObjectMustHaveStatusDraftToBeValidated=Object %s must have status 'Draft' t
ErrorObjectMustHaveLinesToBeValidated=Object %s must have lines to be validated.
ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action.
ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not
ErrorDiscountLargerThanRemainToPaySplitItBefore=The discount you try to apply is larger than remain to pay. Split the discount in 2 smaller discounts before.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@@ -792,7 +792,8 @@ GroupBy=Group by...
ViewFlatList=View flat list
RemoveString=Remove string '%s'
SomeTranslationAreUncomplete=Some languages may be partially translated or may contains errors. If you detect some, you can fix language files registering to <a href="https://transifex.com/projects/p/dolibarr/" target="_blank">https://transifex.com/projects/p/dolibarr/</a>.
DirectDownloadLink=Direct download link
DirectDownloadLink=Direct download link (public/external)
DirectDownloadInternalLink=Direct download link (need to be logged and need permissions)
Download=Download
ActualizeCurrency=Update currency rate
Fiscalyear=Fiscal year
@@ -809,6 +810,7 @@ ImportId=Import id
Websites=Web sites
Events=Events
EMailTemplates=Emails templates
FileNotShared=File not shared to exernal public
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@@ -195,4 +195,6 @@ InventoryFlushed=Inventory flushed
ExitEditMode=Exit edition
inventoryDeleteLine=Delete line
RegulateStock=Regulate Stock
ListInventory=List
ListInventory=List
StockSupportServices=Stock management support services
StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service"

View File

@@ -37,7 +37,7 @@ VirtualHostUrlNotDefined=URL of the virtual host served by external web server n
NoPageYet=No pages yet
SyntaxHelp=Help on specific syntax tips
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=reldir/filename.ext"&gt;</strong>.<br>for a file into documents/media (open access), syntax is:<br><strong>&lt;a href="/document.php?modulepart=medias&file=reldir/filename.ext"&gt;</strong>.<br><br>To include an image stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong>&lt;a href="/viewimage.php?modulepart=medias&amp;file=filename.ext"&gt;</strong>.
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=reldir/filename.ext"&gt;</strong>.<br>for a file into documents/media (open public access), syntax is:<br><strong>&lt;a href="/document.php?modulepart=medias[&hashp=publicsharekey if modulepart != medias]"&gt;</strong>.<br><br>To include an image stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong>&lt;a href="/viewimage.php?modulepart=medias&amp;file=filename.ext"&gt;</strong>.
ClonePage=Clone page/container
CloneSite=Clone site
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.

View File

@@ -12,7 +12,7 @@ WithdrawalsLines=Direct debit order lines
RequestStandingOrderToTreat=Request for direct debit payment order to process
RequestStandingOrderTreated=Request for direct debit payment order processed
NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines.
NbOfInvoiceToWithdraw=Nb. of invoice with direct debit order
NbOfInvoiceToWithdraw=Nb. of qualified invoice with waiting direct debit order
NbOfInvoiceToWithdrawWithInfo=Nb. of customer invoice with direct debit payment orders having defined bank account information
InvoiceWaitingWithdraw=Invoice waiting for direct debit
AmountToWithdraw=Amount to withdraw
@@ -72,7 +72,7 @@ IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
WithdrawalFile=Withdrawal file
SetToStatusSent=Set to status "File Sent"
ThisWillAlsoAddPaymentOnInvoice=This will also apply payments to invoices and will classify them as "Paid"
ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null
StatisticsByLineStatus=Statistics by status of lines
RUM=UMR
RUMLong=Unique Mandate Reference
@@ -94,6 +94,8 @@ SEPAFrstOrRecur=Type of payment
ModeRECUR=Reccurent payment
ModeFRST=One-off payment
PleaseCheckOne=Please check one only
DirectDebitOrderCreated=Direct debit order %s created
AmountRequested=Amount requested
### Notifications
InfoCreditSubject=Payment of direct debit payment order %s by the bank

View File

@@ -1322,10 +1322,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php'.($ext?'?'.$ext:'').'"></script>'."\n";
// Add datepicker default options
if (! defined('DISABLE_DATE_PICKER'))
/*if (! defined('DISABLE_DATE_PICKER'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n";
}
}*/
// JS forced by modules (relative url starting with /)
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))

View File

@@ -238,6 +238,21 @@ foreach ($search_array_options as $key => $val)
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
/* If a group by is required
$sql.= " GROUP BY "
foreach($object->fields as $key => $val)
{
$sql.='t.'.$key.', ';
}
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
*/
$sql.=$db->order($sortfield,$sortorder);
// Count total nb of records

View File

@@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014-2015 Philippe Grand <philippe.grand@atoo-net.com>
@@ -1171,7 +1171,7 @@ if ($action == 'edit_price' && $object->getRights()->creer)
}
print '</td>';
print '</tr>';
$parameters=array('colspan' => 2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -1493,10 +1493,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0);
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@@ -51,13 +51,13 @@ $hookmanager->initHooks(array (
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder)

View File

@@ -48,11 +48,13 @@ $hookmanager->initHooks(array ('productstatspropal'));
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) { $page = 0;}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder = "DESC";

View File

@@ -48,11 +48,13 @@ $hookmanager->initHooks(array ('productstatspropal'));
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) { $page = 0;}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder = "DESC";

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$langs->load('projects');
$langs->load('users');
@@ -84,7 +85,7 @@ if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
$usertoprocess=$user;
$search_usertoprocessid=$usertoprocess->id;
}
elseif (search_usertoprocessid > 0)
elseif ($search_usertoprocessid > 0)
{
$usertoprocess=new User($db);
$usertoprocess->fetch($search_usertoprocessid);
@@ -484,10 +485,17 @@ print "</tr>\n";
// By default, we can edit only tasks we are assigned to
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
// Get if user is available or not for each day
$holiday = new Holiday($db);
$isavailable=array();
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse); // $daytoparse is a date with hours = 0
$isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
if (count($tasksarray) > 0)
{
$j=0;
projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse);
projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse, $isavailable);
$colspan = 8;
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++;

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$langs->load('projects');
$langs->load('users');
@@ -97,7 +98,7 @@ if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
$usertoprocess=$user;
$search_usertoprocessid=$usertoprocess->id;
}
elseif (search_usertoprocessid > 0)
elseif ($search_usertoprocessid > 0)
{
$usertoprocess=new User($db);
$usertoprocess->fetch($search_usertoprocessid);
@@ -474,9 +475,25 @@ print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'</td>'
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
for($i=0;$i<7;$i++)
// Get if user is available or not for each day
$holiday = new Holiday($db);
$isavailable=array();
for ($i=0;$i<7;$i++)
{
print '<td width="6%" align="center" class="hide'.$i.'">'.dol_print_date($startday + ($i * 3600 * 24), '%a').'<br>'.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').'</td>';
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $i, 'd'); // $firstdaytoshow is a date with hours = 0
$dayinloop = dol_time_plus_duree($startday, $i, 'd');
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
//$tmparray = dol_getdate($dayinloop);
//$dayinloopwithouthours=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
//print dol_print_date($dayinloop, 'dayhour').' ';
//print dol_print_date($dayinloopwithouthours, 'dayhour').' ';
//print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'<br>';
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow);
$isavailable[$dayinloopfromfirstdaytoshow]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
print '<td width="6%" align="center" class="hide'.$i.'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
}
print '<td></td>';
print "</tr>\n";
@@ -491,7 +508,7 @@ if (count($tasksarray) > 0)
$j=0;
$level=0;
projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask);
projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable);
$colspan=7;
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++;

View File

@@ -528,7 +528,7 @@ if ($action == 'create' && $user->rights->projet->creer)
print '</td><td class="maxwidthonsmartphone">';
$filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
$text=$form->select_thirdparty_list(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
$text=$form->select_company(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
{
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
@@ -747,7 +747,7 @@ elseif ($object->id > 0)
print '</td><td>';
$filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), '', 0, 0, 'minwidth300');
$text=$form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
{
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");

View File

@@ -20,7 +20,7 @@
/**
* \file htdocs/projet/document.php
* \ingroup project
* \brief Page de gestion des documents attachees a un projet
* \brief Page to managed related documents linked to a project
*/
require '../main.inc.php';
@@ -106,11 +106,11 @@ if ($object->id > 0)
$totalsize+=$file['size'];
}
// Project card
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
// Title
$morehtmlref.=$object->title;
@@ -120,19 +120,19 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref.='</div>';
// Define a complementary filter for search of next/prev ref.
if (! $user->rights->projet->all->lire)
{
$objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
@@ -141,10 +141,10 @@ if ($object->id > 0)
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n";
print '</div>';
dol_fiche_end();
$modulepart = 'project';

View File

@@ -643,33 +643,6 @@ foreach ($listofreferent as $key => $value)
$total_ttc = -$total_ttc;
}
/*switch ($classname) {
case 'FactureFournisseur':
$newclassname = 'SupplierInvoice';
break;
case 'Facture':
$newclassname = 'Bill';
break;
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
case 'MouvementStock':
$newclassname = 'StockMovement';
break;
default:
$newclassname = $classname;
}*/
$var = ! $var;
print '<tr class="oddeven">';
// Module
print '<td align="left">'.$name.'</td>';
@@ -693,7 +666,6 @@ print '</tr>';
print "</table>";
print '<br><br>';
print '<br>';
@@ -771,7 +743,7 @@ foreach ($listofreferent as $key => $value)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
// Remove link
// Remove link column
print '<td style="width: 24px"></td>';
// Ref
print '<td'.(($tablename != 'actioncomm' && $tablename != 'projet_task') ? ' style="width: 200px"':'').'>'.$langs->trans("Ref").'</td>';
@@ -862,11 +834,15 @@ foreach ($listofreferent as $key => $value)
}
print '<tr class="oddeven">';
// Remove link
print '<td style="width: 24px">';
if ($tablename != 'projet_task' && $tablename != 'stock_mouvement')
{
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $projectid . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $element->id . '">' . img_picto($langs->trans('Unlink'), 'editdelete') . '</a>';
if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true
{
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $projectid . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $element->id . '">' . img_picto($langs->trans('Unlink'), 'editdelete') . '</a>';
}
}
print "</td>\n";

View File

@@ -397,7 +397,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="1">';
$thirdpartyofproject=$projectstatic->getListContactId('thirdparty');
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$projectstatic->societe->id;
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$projectstatic->socid;
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', $thirdpartyofproject, 0, '&withproject='.$withproject);
print '</td>';

View File

@@ -66,21 +66,22 @@ $suffix=GETPOST("suffix",'aZ09');
$amount=price2num(GETPOST("amount",'alpha'));
if (! GETPOST("currency",'alpha')) $currency=$conf->currency;
else $currency=GETPOST("currency",'alpha');
$source = GETPOST("source",'alpha');
$source = GETPOST("s",'alpha')?GETPOST("s",'alpha'):GETPOST("source",'alpha');
$download = GETPOST('d','int')?GETPOST('d','int'):GETPOST('download','int');
if (! $action)
{
if (! GETPOST("amount",'alpha') && ! GETPOST("source",'alpha'))
if (! GETPOST("amount",'alpha') && ! $source)
{
print $langs->trans('ErrorBadParameters')." - amount or source";
exit;
}
if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! GETPOST("source",'alpha'))
if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! $source)
{
print $langs->trans('ErrorBadParameters')." - tag or source";
exit;
}
if (GETPOST("source",'alpha') && ! GETPOST("ref",'alpha'))
if ($source && ! GETPOST("ref",'alpha'))
{
print $langs->trans('ErrorBadParameters')." - ref";
exit;
@@ -111,7 +112,6 @@ $urlok=$urlwithroot.'/public/payment/paymentok.php?';
$urlko=$urlwithroot.'/public/payment/paymentko.php?';
// Complete urls for post treatment
$SOURCE=GETPOST("source",'alpha');
$ref=$REF=GETPOST('ref','alpha');
$TAG=GETPOST("tag",'alpha');
$FULLTAG=GETPOST("fulltag",'alpha'); // fulltag is tag with more informations
@@ -123,10 +123,10 @@ if (! empty($suffix))
$urlok.='suffix='.urlencode($suffix).'&';
$urlko.='suffix='.urlencode($suffix).'&';
}
if (! empty($SOURCE))
if ($source)
{
$urlok.='source='.urlencode($SOURCE).'&';
$urlko.='source='.urlencode($SOURCE).'&';
$urlok.='s='.urlencode($source).'&';
$urlko.='s='.urlencode($source).'&';
}
if (! empty($REF))
{
@@ -150,8 +150,8 @@ if (! empty($SECUREKEY))
}
if (! empty($entity))
{
$urlok.='entity='.urlencode($entity).'&';
$urlko.='entity='.urlencode($entity).'&';
$urlok.='e='.urlencode($entity).'&';
$urlko.='e='.urlencode($entity).'&';
}
$urlok=preg_replace('/&$/','',$urlok); // Remove last &
$urlko=preg_replace('/&$/','',$urlko); // Remove last &
@@ -223,7 +223,7 @@ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE))
{
if ($SOURCE && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $SOURCE . $REF, 2); // Use the source in the hash to avoid duplicates if the references are identical
if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $source . $REF, 2); // Use the source in the hash to avoid duplicates if the references are identical
else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
}
else
@@ -335,18 +335,23 @@ if ($action == 'dopayment')
$origfulltag=GETPOST("fulltag",'alpha');
// Securekey into back url useless for back url and we need an url lower than 150.
$urlok = preg_replace('/securekey=[^&]+/', '', $urlok);
$urlko = preg_replace('/securekey=[^&]+/', '', $urlko);
$mesg='';
if (empty($PRICE) || ! is_numeric($PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount"));
elseif (empty($email)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
elseif (! isValidEMail($email)) $mesg=$langs->trans("ErrorBadEMail",$email);
elseif (! $origfulltag) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode"));
elseif (dol_strlen($urlok) > 150) $mesg='Error urlok too long '.$urlok;
elseif (dol_strlen($urlko) > 150) $mesg='Error urlko too long '.$urlko;
elseif (dol_strlen($urlok) > 150) $mesg='Error urlok too long '.$urlok.'( Paybox requires 150, found '.strlen($urlok).')';
elseif (dol_strlen($urlko) > 150) $mesg='Error urlko too long '.$urlko.'( Paybox requires 150, found '.strlen($urlok).')';
if (empty($mesg))
{
dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php';
print_paybox_redirect($PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG);
session_destroy();
@@ -499,10 +504,10 @@ $conf->dol_hide_leftmenu=1;
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody');
// Check link validity
if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', '')))
if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', '')))
{
$langs->load("errors");
dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $SOURCE, $ref));
dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref));
llxFooter();
$db->close();
exit;
@@ -528,7 +533,7 @@ print '<input type="hidden" name="action" value="dopayment">'."\n";
print '<input type="hidden" name="tag" value="'.GETPOST("tag",'alpha').'">'."\n";
print '<input type="hidden" name="suffix" value="'.GETPOST("suffix",'alpha').'">'."\n";
print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
print '<input type="hidden" name="entity" value="'.$entity.'" />';
print '<input type="hidden" name="e" value="'.$entity.'" />';
print "\n";
print '<!-- Form to send a payment -->'."\n";
print '<!-- creditor = '.$creditor.' -->'."\n";
@@ -602,7 +607,7 @@ print $text;
// Output payment summary form
print '<tr><td align="center">';
print '<table with="100%" id="tablepublicpayment">';
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
print '<tr><td align="left" colspan="2" class="opacitymedium">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
$found=false;
$error=0;
@@ -709,8 +714,8 @@ if ($source == 'order')
$text='<b>'.$langs->trans("PaymentOrderRef",$order->ref).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
print '</td><td class="CTableRow'.($var?'1':'2').'">'.$text;
print '<input type="hidden" name="source" value="'.GETPOST("source",'alpha').'">';
print '<input type="hidden" name="ref" value="'.$order->ref.'">';
print '<input type="hidden" name="s" value="'.dol_escape_htmltag($source).'">';
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($order->ref).'">';
print '</td></tr>'."\n";
// Amount
@@ -808,7 +813,7 @@ if ($source == 'invoice')
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '<input type="hidden" name="creditor" value="'.dol_escape_htmltag($creditor).'">';
print '</td></tr>'."\n";
// Debitor
@@ -821,8 +826,8 @@ if ($source == 'invoice')
$text='<b>'.$langs->trans("PaymentInvoiceRef",$invoice->ref).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
print '</td><td class="CTableRow'.($var?'1':'2').'">'.$text;
print '<input type="hidden" name="source" value="'.GETPOST("source",'alpha').'">';
print '<input type="hidden" name="ref" value="'.$invoice->ref.'">';
print '<input type="hidden" name="s" value="'.dol_escape_htmltag($source).'">';
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($invoice->ref).'">';
print '</td></tr>'."\n";
// Amount
@@ -846,13 +851,21 @@ if ($source == 'invoice')
print '</td></tr>'."\n";
// Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">';
print '<input type="hidden" name="fulltag" value="'.$fulltag.'">';
print '</td></tr>'."\n";
// Add download link
if ($download > 0)
{
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Document");
print '</td><td class="CTableRow'.($var?'1':'2').'">';
print $invoice->getDirectExternalLink(1);
print '</td></tr>'."\n";
}
// Shipping address
$shipToName=$invoice->thirdparty->name;
$shipToStreet=$invoice->thirdparty->address;
@@ -996,8 +1009,8 @@ if ($source == 'contractline')
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
print '</td><td class="CTableRow'.($var?'1':'2').'">'.$text;
print '<input type="hidden" name="source" value="'.GETPOST("source",'alpha').'">';
print '<input type="hidden" name="ref" value="'.$contractline->ref.'">';
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($contractline->ref).'">';
print '</td></tr>'."\n";
// Quantity
@@ -1138,8 +1151,8 @@ if ($source == 'membersubscription')
$text='<b>'.$langs->trans("PaymentSubscription").'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
print '</td><td class="CTableRow'.($var?'1':'2').'">'.$text;
print '<input type="hidden" name="source" value="'.GETPOST("source",'alpha').'">';
print '<input type="hidden" name="ref" value="'.$member->ref.'">';
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($member->ref).'">';
print '</td></tr>'."\n";
if ($member->last_subscription_date || $member->last_subscription_amount)
@@ -1264,7 +1277,7 @@ if ($action != 'dopayment')
if (! empty($conf->stripe->enabled))
{
// If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe
print '<br><input class="button buttonpayment buttonpayment'.(empty($conf->global->STRIPE_PICTO_FOR_PAYMENT)?'stripe':$conf->global->STRIPE_PICTO_FOR_PAYMENT).'" type="submit" name="dopayment__stripe" value="'.$langs->trans("StripeDoPayment").'">';
print '<br><input class="button buttonpayment buttonpayment'.(empty($conf->global->STRIPE_PICTO_FOR_PAYMENT)?'stripe':$conf->global->STRIPE_PICTO_FOR_PAYMENT).'" type="submit" name="dopayment_stripe" value="'.$langs->trans("StripeDoPayment").'">';
}
if (! empty($conf->paypal->enabled))
@@ -1357,12 +1370,12 @@ if (preg_match('/^dopayment/',$action))
print '<input type="hidden" name="dopayment_stripe" value="1">'."\n";
print '<input type="hidden" name="action" value="charge">'."\n";
print '<input type="hidden" name="tag" value="'.$TAG.'">'."\n";
print '<input type="hidden" name="source" value="'.$SOURCE.'">'."\n";
print '<input type="hidden" name="s" value="'.$source.'">'."\n";
print '<input type="hidden" name="ref" value="'.$REF.'">'."\n";
print '<input type="hidden" name="fulltag" value="'.$FULLTAG.'">'."\n";
print '<input type="hidden" name="suffix" value="'.$suffix.'">'."\n";
print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
print '<input type="hidden" name="entity" value="'.$entity.'" />';
print '<input type="hidden" name="e" value="'.$entity.'" />';
print '<input type="hidden" name="amount" value="'.$amount.'">'."\n";
print '<input type="hidden" name="currency" value="'.$currency.'">'."\n";

View File

@@ -31,7 +31,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
$entity=(! empty($_GET['e']) ? (int) $_GET['e'] : (! empty($_POST['e']) ? (int) $_POST['e'] : 1));
if (is_numeric($entity)) define("DOLENTITY", $entity);
require '../../main.inc.php';

View File

@@ -31,7 +31,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
$entity=(! empty($_GET['e']) ? (int) $_GET['e'] : (! empty($_POST['e']) ? (int) $_POST['e'] : 1));
if (is_numeric($entity)) define("DOLENTITY", $entity);
require '../../main.inc.php';
@@ -76,7 +76,7 @@ if (! empty($conf->paypal->enabled))
$FULLTAG=GETPOST('FULLTAG');
if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag');
$source=GETPOST('source');
$source=GETPOST('s','alpha')?GETPOST('s','alpha'):GETPOST('source','alpha');
$ref=GETPOST('ref');
$suffix=GETPOST("suffix",'aZ09');
@@ -145,7 +145,6 @@ $conf->dol_hide_leftmenu=1;
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody');
// Show message
print '<span id="dolpaymentspan"></span>'."\n";
print '<div id="dolpaymentdiv" align="center">'."\n";

View File

@@ -237,9 +237,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$sortorder = GETPOST("sortorder", 'alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -344,55 +344,53 @@ input.buttongen {
vertical-align: middle;
}
input.buttonpayment {
width: 300px;
min-width: 280px;
margin-bottom: 15px;
background-image: none;
line-height: 24px;
padding: 8px;
background: none;
border: 2px solid #666666;
}
input.buttonpaymentcb {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/credit_card.png',1) ?>);
background-size: 26px;
background-repeat: no-repeat;
background-position: 5px 5px;
background-position: 2px 11px;
}
input.buttonpaymentcheque {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/cheque.png',1) ?>);
background-repeat: no-repeat;
background-position: 8px 7px;
}
input.buttonpaymentcb {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/credit_card.png',1) ?>);
background-size: 24px;
background-repeat: no-repeat;
background-position: 5px 4px;
}
input.buttonpaymentcheque {
background-image: url(<?php echo dol_buildpath($path.'/paypal/img/object_paypal.png',1) ?>);
background-repeat: no-repeat;
background-position: 5px 4px;
background-position: 2px 8px;
}
input.buttonpaymentpaypal {
background-image: url(<?php echo dol_buildpath($path.'/paypal/img/object_paypal.png',1) ?>);
background-repeat: no-repeat;
background-position: 8px 7px;
background-position: 8px 11px;
}
input.buttonpaymentpaybox {
background-image: url(<?php echo dol_buildpath($path.'/paybox/img/object_paybox.png',1) ?>);
background-repeat: no-repeat;
background-position: 8px 7px;
background-position: 8px 11px;
}
input.buttonpaymentstripe {
background-image: url(<?php echo dol_buildpath($path.'/stripe/img/object_stripe.png',1) ?>);
background-repeat: no-repeat;
background-position: 8px 7px;
background-position: 8px 11px;
}
/* Used by timesheets */
span.timesheetalreadyrecorded input {
border: none;
border-bottom: solid 1px rgba(0,0,0,0.4);
margin-right: 1px !important;
}
td.onholidaymorning, td.onholidayafternoon {
background-color: #fdf6f2;
}
td.onholidayallday {
background-color: #f4eede;
}
select.flat, form.flat select {
font-weight: normal;
}
@@ -1086,7 +1084,7 @@ div.fiche {
<?php if (! empty($conf->dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
}
body.onlinepaymentbody div.fiche { /* For online payment page */
margin: 40px !important;
margin: 20px !important;
}
div.fiche>table:first-child {
margin-bottom: 15px !important;
@@ -3141,7 +3139,7 @@ div.titre {
/* text-shadow: 1px 1px 2px #FFFFFF; */
}
#dolpaymenttable { width: 600px; font-size: 13px; }
#dolpaymenttable { min-width: 310px; font-size: 16px; } /* Width must have min to make stripe input area visible */
#tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; }
#tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; }
#tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; }

View File

@@ -341,11 +341,13 @@ input.buttongen {
vertical-align: middle;
}
input.buttonpayment {
width: 300px;
min-width: 280px;
margin-bottom: 15px;
background-image: none;
line-height: 24px;
padding: 8px;
background: none;
border: 2px solid #666666;
}
input.buttonpaymentcb {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/credit_card.png',1) ?>);
@@ -384,11 +386,18 @@ input.buttonpaymentstripe {
background-repeat: no-repeat;
background-position: 8px 7px;
}
/* Used for timesheets */
span.timesheetalreadyrecorded input {
border: none;
border-bottom: solid 1px rgba(0,0,0,0.1);
margin-right: 1px !important;
}
td.onholidaymorning, td.onholidayafternoon {
background-color: #fdf6f2;
}
td.onholidayallday {
background-color: #f4eede;
}
select.flat, form.flat select {
font-weight: normal;
@@ -1111,6 +1120,9 @@ div.fiche {
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?>
margin-bottom: 15px;
}
body.onlinepaymentbody div.fiche { /* For online payment page */
margin: 20px !important;
}
div.fichecenter {
width: 100%;
clear: both; /* This is to have div fichecenter that are true rectangles */
@@ -3230,7 +3242,7 @@ div.titre {
<?php print (empty($conf->dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?>
}
#dolpaymenttable { width: 600px; font-size: 13px; }
#dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible */
#tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; }
#tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; }
#tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; }