mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2b6af8ddfb
|
|
@ -3047,6 +3047,7 @@ if ($action == 'create') {
|
|||
*/
|
||||
|
||||
if ($action != 'presend') {
|
||||
$numlines = count($object->lines);
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
$parameters = array();
|
||||
|
|
@ -3086,45 +3087,65 @@ if ($action == 'create') {
|
|||
}
|
||||
}
|
||||
|
||||
$arrayforbutaction = array();
|
||||
|
||||
// Create a sale order
|
||||
if (isModEnabled('order') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
$arrayforbutaction[] = array('lang' => 'orders', 'enabled' => (isModEnabled('order') && $object->statut == Propal::STATUS_SIGNED), 'perm' => $usercancreateorder, 'label' => 'AddOrder', 'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid));
|
||||
/*if (isModEnabled('order') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
if ($usercancreateorder) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Create a purchase order
|
||||
if (getDolGlobalString('WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL')) {
|
||||
if ($object->statut == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
|
||||
$arrayforbutaction[] = array('lang' => 'orders', 'enabled' => ($object->statut == Propal::STATUS_SIGNED && isModEnabled("supplier_order")), 'perm' => $usercancreatepurchaseorder, 'label' => 'AddPurchaseOrder', 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid));
|
||||
/*if ($object->statut == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
|
||||
if ($usercancreatepurchaseorder) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// Create an intervention
|
||||
if (isModEnabled("service") && isModEnabled('intervention') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
$arrayforbutaction[] = array('lang' => 'interventions', 'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->statut == Propal::STATUS_SIGNED), 'perm' => $usercancreateintervention, 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid));
|
||||
/*if (isModEnabled("service") && isModEnabled('intervention') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
if ($usercancreateintervention) {
|
||||
$langs->load("interventions");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Create contract
|
||||
if (isModEnabled('contract') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
$arrayforbutaction[] = array('lang' => 'contracts', 'enabled' => (isModEnabled('contract') && $object->statut == Propal::STATUS_SIGNED), 'perm' => $usercancreatecontract, 'label' => 'AddContract', 'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid));
|
||||
/*if (isModEnabled('contract') && $object->statut == Propal::STATUS_SIGNED) {
|
||||
$langs->load("contracts");
|
||||
|
||||
if ($usercancreatecontract) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Create an invoice and classify billed
|
||||
if ($object->statut == Propal::STATUS_SIGNED && !getDolGlobalString('PROPOSAL_ARE_NOT_BILLABLE')) {
|
||||
if (isModEnabled('invoice') && $usercancreateinvoice) {
|
||||
$arrayforbutaction[] = array('lang' => 'invoice', 'enabled' => isModEnabled('invoice'), 'perm' => $usercancreateinvoice, 'label' => 'CreateBill', 'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid));
|
||||
/*if (isModEnabled('invoice') && $usercancreateinvoice) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
$actionButtonsParameters = [
|
||||
"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
|
||||
"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
|
||||
];
|
||||
|
||||
if ($numlines > 0) {
|
||||
print dolGetButtonAction('', $langs->trans("Create"), 'default', $arrayforbutaction, $object->id, 1, $actionButtonsParameters);
|
||||
} else {
|
||||
print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans("Create"), 'default', $arrayforbutaction, $object->id, 0, $actionButtonsParameters);
|
||||
}
|
||||
|
||||
if ($object->statut == Propal::STATUS_SIGNED && !getDolGlobalString('PROPOSAL_ARE_NOT_BILLABLE')) {
|
||||
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
||||
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
|
||||
if ($usercanclose) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -180,7 +181,7 @@ class modWebsite extends DolibarrModules
|
|||
if (is_dir($src)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
dol_mkdir($dest);
|
||||
$result = dolCopyDir($src, $dest, 0, 0);
|
||||
$result = dolCopyDir($src, $dest, '0', 0);
|
||||
if ($result < 0) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorFailToCopyDir', $src, $dest);
|
||||
|
|
|
|||
|
|
@ -60,16 +60,10 @@ class FichinterRec extends Fichinter
|
|||
*/
|
||||
public $picto = 'intervention';
|
||||
|
||||
|
||||
/**
|
||||
* @var string title
|
||||
*/
|
||||
public $title;
|
||||
public $number;
|
||||
public $date;
|
||||
public $amount;
|
||||
public $tva;
|
||||
public $total;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
|
|
@ -81,6 +75,9 @@ class FichinterRec extends Fichinter
|
|||
*/
|
||||
public $frequency;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $id_origin;
|
||||
|
||||
/**
|
||||
|
|
@ -93,7 +90,14 @@ class FichinterRec extends Fichinter
|
|||
*/
|
||||
public $propalid;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_last_gen;
|
||||
|
||||
/**
|
||||
* @var datetime|string
|
||||
*/
|
||||
public $date_when;
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +111,7 @@ class FichinterRec extends Fichinter
|
|||
public $nb_gen_max;
|
||||
|
||||
/**
|
||||
* int rank
|
||||
* @var int rank
|
||||
*/
|
||||
public $rang;
|
||||
|
||||
|
|
@ -116,6 +120,9 @@ class FichinterRec extends Fichinter
|
|||
*/
|
||||
public $special_code;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $usenewprice = 0;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -472,7 +473,7 @@ if (!$error && $db->connected && $action == "set") { // Test on permission not r
|
|||
// Copy directory medias
|
||||
$srcroot = $main_dir.'/install/medias';
|
||||
$destroot = $main_data_dir.'/medias';
|
||||
dolCopyDir($srcroot, $destroot, 0, 0);
|
||||
dolCopyDir($srcroot, $destroot, '0', 0);
|
||||
|
||||
if ($error) {
|
||||
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists", $main_data_dir);
|
||||
|
|
|
|||
|
|
@ -646,7 +646,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
|||
// Copy directory medias
|
||||
$srcroot = DOL_DOCUMENT_ROOT.'/install/medias';
|
||||
$destroot = DOL_DATA_ROOT.'/medias';
|
||||
dolCopyDir($srcroot, $destroot, 0, 0);
|
||||
dolCopyDir($srcroot, $destroot, '0', 0);
|
||||
|
||||
|
||||
// Actions for all versions (no database change but delete some files and directories)
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ if ($dirins && $action == 'initmodule' && $modulename && $user->hasRight("module
|
|||
'mymodule' => strtolower($modulename),
|
||||
'MyModule' => $modulename
|
||||
);
|
||||
$result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayreplacement);
|
||||
$result = dolCopyDir($srcdir, $destdir, '0', 0, $arrayreplacement);
|
||||
//dol_mkdir($destfile);
|
||||
if ($result <= 0) {
|
||||
if ($result < 0) {
|
||||
|
|
@ -980,7 +980,7 @@ if ($dirins && $action == 'addlanguage' && !empty($module) && $user->hasRight("m
|
|||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template/langs/en_US';
|
||||
$arrayofreplacement = array('mymodule' => $modulelowercase);
|
||||
}
|
||||
$result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayofreplacement);
|
||||
$result = dolCopyDir($srcdir, $destdir, '0', 0, $arrayofreplacement);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language")), null, 'errors');
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ class UserGroup extends CommonObject
|
|||
*/
|
||||
public function getrights($moduletag = '')
|
||||
{
|
||||
$this->loadRights($moduletag);
|
||||
return $this->loadRights($moduletag);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ class Website extends CommonObject
|
|||
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/containers';
|
||||
|
||||
dol_syslog("Copy pages from ".$srcdir." into ".$destdir);
|
||||
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array('old', 'back'), 1);
|
||||
dolCopyDir($srcdir, $destdir, '0', 1, $arrayreplacementinfilename, 2, array('old', 'back'), 1);
|
||||
|
||||
// Copy file README.md and LICENSE from directory containers into directory root
|
||||
if (dol_is_file($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md')) {
|
||||
|
|
@ -1038,14 +1038,14 @@ class Website extends CommonObject
|
|||
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey';
|
||||
|
||||
dol_syslog("Copy content from ".$srcdir." into ".$destdir);
|
||||
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
|
||||
dolCopyDir($srcdir, $destdir, '0', 1, $arrayreplacementinfilename);
|
||||
|
||||
// Copy files into medias/js
|
||||
$srcdir = DOL_DATA_ROOT.'/medias/js/'.$website->ref;
|
||||
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/js/websitekey';
|
||||
|
||||
dol_syslog("Copy content from ".$srcdir." into ".$destdir);
|
||||
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
|
||||
dolCopyDir($srcdir, $destdir, '0', 1, $arrayreplacementinfilename);
|
||||
|
||||
// Make some replacement into some files
|
||||
$cssindestdir = $conf->website->dir_temp.'/'.$website->ref.'/containers/styles.css.php';
|
||||
|
|
@ -1264,7 +1264,7 @@ class Website extends CommonObject
|
|||
|
||||
|
||||
// Copy containers directory
|
||||
dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/containers', $conf->website->dir_output.'/'.$object->ref, 0, 1); // Overwrite if exists
|
||||
dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/containers', $conf->website->dir_output.'/'.$object->ref, '0', 1); // Overwrite if exists
|
||||
|
||||
// Make replacement into css and htmlheader file
|
||||
$cssindestdir = $conf->website->dir_output.'/'.$object->ref.'/styles.css.php';
|
||||
|
|
@ -1283,7 +1283,7 @@ class Website extends CommonObject
|
|||
|
||||
// Copy dir medias/image/websitekey
|
||||
if (dol_is_dir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey')) {
|
||||
$result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, 0, 1);
|
||||
$result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, '0', 1);
|
||||
if ($result < 0) {
|
||||
$this->error = 'Failed to copy files into '.$conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref.'.';
|
||||
dol_syslog($this->error, LOG_WARNING);
|
||||
|
|
@ -1294,7 +1294,7 @@ class Website extends CommonObject
|
|||
|
||||
// Copy dir medias/js/websitekey
|
||||
if (dol_is_dir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey')) {
|
||||
$result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1);
|
||||
$result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, '0', 1);
|
||||
if ($result < 0) {
|
||||
$this->error = 'Failed to copy files into '.$conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref.'.';
|
||||
dol_syslog($this->error, LOG_WARNING);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ parameters:
|
|||
- '#\(\) expects int, string#'
|
||||
- '#run_sql expects int, string#'
|
||||
- '#on array{url: mixed} in empty\(\) does not exist.#'
|
||||
- '#dolCopyDir expects string, int given#'
|
||||
- '#dol_copy expects string, int given#'
|
||||
- '#dol_getIdFromCode expects string, int given#'
|
||||
- '#dol_strlen expects string, int given#'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user