Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
commit
94c48d3573
@ -165,6 +165,10 @@ if ($action == 'update') {
|
|||||||
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GETPOSTISSET('PDF_USE_A')) {
|
||||||
|
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||||
@ -534,6 +538,14 @@ if ($conf->use_javascript_ajax) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_A").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('PDF_USE_A');
|
||||||
|
} else {
|
||||||
|
print $form->selectyesno('PDF_USE_A', (empty($conf->global->PDF_USE_A) ? 0 : $conf->global->PDF_USE_A), 1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -2770,20 +2770,20 @@ class ContratLigne extends CommonObjectLine
|
|||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
|
||||||
if ($status == self::STATUS_INITIAL) {
|
if ($status == self::STATUS_INITIAL) {
|
||||||
$labelStatus = $langs->trans("ServiceStatusInitial");
|
$labelStatus = $langs->transnoentities("ServiceStatusInitial");
|
||||||
$labelStatusShort = $langs->trans("ServiceStatusInitial");
|
$labelStatusShort = $langs->transnoentities("ServiceStatusInitial");
|
||||||
} elseif ($status == self::STATUS_OPEN && $expired == -1) {
|
} elseif ($status == self::STATUS_OPEN && $expired == -1) {
|
||||||
$labelStatus = $langs->trans("ServiceStatusRunning");
|
$labelStatus = $langs->transnoentities("ServiceStatusRunning");
|
||||||
$labelStatusShort = $langs->trans("ServiceStatusRunning");
|
$labelStatusShort = $langs->transnoentities("ServiceStatusRunning");
|
||||||
} elseif ($status == self::STATUS_OPEN && $expired == 0) {
|
} elseif ($status == self::STATUS_OPEN && $expired == 0) {
|
||||||
$labelStatus = $langs->trans("ServiceStatusNotLate");
|
$labelStatus = $langs->transnoentities("ServiceStatusNotLate");
|
||||||
$labelStatusShort = $langs->trans("ServiceStatusNotLateShort");
|
$labelStatusShort = $langs->transnoentities("ServiceStatusNotLateShort");
|
||||||
} elseif ($status == self::STATUS_OPEN && $expired == 1) {
|
} elseif ($status == self::STATUS_OPEN && $expired == 1) {
|
||||||
$labelStatus = $langs->trans("ServiceStatusLate");
|
$labelStatus = $langs->transnoentities("ServiceStatusLate");
|
||||||
$labelStatusShort = $langs->trans("ServiceStatusLateShort");
|
$labelStatusShort = $langs->transnoentities("ServiceStatusLateShort");
|
||||||
} elseif ($status == self::STATUS_CLOSED) {
|
} elseif ($status == self::STATUS_CLOSED) {
|
||||||
$labelStatus = $langs->trans("ServiceStatusClosed");
|
$labelStatus = $langs->transnoentities("ServiceStatusClosed");
|
||||||
$labelStatusShort = $langs->trans("ServiceStatusClosed");
|
$labelStatusShort = $langs->transnoentities("ServiceStatusClosed");
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
|
|||||||
@ -9056,10 +9056,15 @@ abstract class CommonObject
|
|||||||
$className = str_replace('@', '', $deleteFromObject[0]);
|
$className = str_replace('@', '', $deleteFromObject[0]);
|
||||||
$filePath = $deleteFromObject[1];
|
$filePath = $deleteFromObject[1];
|
||||||
$columnName = $deleteFromObject[2];
|
$columnName = $deleteFromObject[2];
|
||||||
|
$TMoreSQL = array();
|
||||||
|
$more_sql = $deleteFromObject[3];
|
||||||
|
if (!empty($more_sql)) {
|
||||||
|
$TMoreSQL['customsql'] = $more_sql;
|
||||||
|
}
|
||||||
if (dol_include_once($filePath)) {
|
if (dol_include_once($filePath)) {
|
||||||
$childObject = new $className($this->db);
|
$childObject = new $className($this->db);
|
||||||
if (method_exists($childObject, 'deleteByParentField')) {
|
if (method_exists($childObject, 'deleteByParentField')) {
|
||||||
$result = $childObject->deleteByParentField($this->id, $columnName);
|
$result = $childObject->deleteByParentField($this->id, $columnName, $TMoreSQL);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = $childObject->error;
|
$this->errors[] = $childObject->error;
|
||||||
@ -9141,10 +9146,12 @@ abstract class CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $parentId Parent Id
|
* @param int $parentId Parent Id
|
||||||
* @param string $parentField Name of Foreign key parent column
|
* @param string $parentField Name of Foreign key parent column
|
||||||
|
* @param array $filter an array filter
|
||||||
|
* @param string $filtermode AND or OR
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function deleteByParentField($parentId = 0, $parentField = '')
|
public function deleteByParentField($parentId = 0, $parentField = '', $filter = array(), $filtermode = "AND")
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@ -9157,6 +9164,23 @@ abstract class CommonObject
|
|||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql .= " WHERE ".$parentField." = ".(int) $parentId;
|
$sql .= " WHERE ".$parentField." = ".(int) $parentId;
|
||||||
|
|
||||||
|
// Manage filters
|
||||||
|
$sqlwhere = array();
|
||||||
|
if (count($filter) > 0) {
|
||||||
|
foreach ($filter as $key => $value) {
|
||||||
|
if ($key == 'customsql') {
|
||||||
|
$sqlwhere[] = $value;
|
||||||
|
} elseif (strpos($value, '%') === false) {
|
||||||
|
$sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")";
|
||||||
|
} else {
|
||||||
|
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count($sqlwhere) > 0) {
|
||||||
|
$sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")";
|
||||||
|
}
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$this->errors[] = $this->db->lasterror();
|
$this->errors[] = $this->db->lasterror();
|
||||||
|
|||||||
@ -518,8 +518,12 @@ function getNumberInvoicesPieChart($mode)
|
|||||||
$dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
|
$dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
foreach ($dataseries[0] as $key=>$value) {
|
if (!empty($dataseries[0])) {
|
||||||
$total += $value;
|
foreach ($dataseries[0] as $key => $value) {
|
||||||
|
if (is_numeric($value)) {
|
||||||
|
$total += $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$legend = array(
|
$legend = array(
|
||||||
$langs->trans('InvoiceLate30Days'),
|
$langs->trans('InvoiceLate30Days'),
|
||||||
|
|||||||
@ -154,7 +154,7 @@ class Job extends CommonObject
|
|||||||
// * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
// * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||||
// * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
// * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||||
// */
|
// */
|
||||||
// protected $childtablesoncascade = array('hrm_jobdet');
|
protected $childtablesoncascade = array("@SkillRank:hrm/class/skillrank.class.php:fk_object:objecttype='job'");
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * @var JobLine[] Array of subtable lines
|
// * @var JobLine[] Array of subtable lines
|
||||||
|
|||||||
@ -2194,3 +2194,4 @@ LanguageAndPresentation=Language and presentation
|
|||||||
SkinAndColors=Skin and colors
|
SkinAndColors=Skin and colors
|
||||||
IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax
|
IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax
|
||||||
IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax
|
IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax
|
||||||
|
PDF_USE_1A=Generate PDF with PDF/A-1b format
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user