Merge branch '14.0' into 14p42
This commit is contained in:
commit
a107c81bf1
@ -614,7 +614,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
||||||
|
|||||||
@ -235,10 +235,18 @@ if ($action != 'export_csv') {
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$button = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
$button .= '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||||
|
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
|
|||||||
@ -763,12 +763,19 @@ if (count($filter)) {
|
|||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Button re-export
|
// Button re-export
|
||||||
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||||
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
||||||
} else {
|
} else {
|
||||||
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
|
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
|
||||||
}
|
}
|
||||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
||||||
|
|
||||||
|
|||||||
@ -474,8 +474,15 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||||
|
|||||||
@ -474,8 +474,15 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||||
|
|||||||
@ -2319,7 +2319,7 @@ class Adherent extends CommonObject
|
|||||||
$labelStatus = $langs->trans("MemberStatusDraft");
|
$labelStatus = $langs->trans("MemberStatusDraft");
|
||||||
$labelStatusShort = $langs->trans("MemberStatusDraftShort");
|
$labelStatusShort = $langs->trans("MemberStatusDraftShort");
|
||||||
} elseif ($status >= self::STATUS_VALIDATED) {
|
} elseif ($status >= self::STATUS_VALIDATED) {
|
||||||
if ($need_subscription == 0) {
|
if ($need_subscription === 0) {
|
||||||
$statusType = 'status4';
|
$statusType = 'status4';
|
||||||
$labelStatus = $langs->trans("MemberStatusNoSubscription");
|
$labelStatus = $langs->trans("MemberStatusNoSubscription");
|
||||||
$labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort");
|
$labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort");
|
||||||
|
|||||||
@ -382,14 +382,18 @@ class Members extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$member->delete($member->id, DolibarrApiAccess::$user)) {
|
|
||||||
throw new RestException(401, 'error when deleting member');
|
$res = $member->delete($member->id, DolibarrApiAccess::$user);
|
||||||
|
if ($res < 0) {
|
||||||
|
throw new RestException(500, "Can't delete, error occurs");
|
||||||
|
} elseif ($res == 0) {
|
||||||
|
throw new RestException(409, "Can't delete, that product is probably used");
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'message' => 'member deleted'
|
'message' => 'Member deleted'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -228,14 +228,17 @@ class MembersTypes extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$membertype->delete()) {
|
$res = $membertype->delete();
|
||||||
throw new RestException(401, 'error when deleting member type');
|
if ($res < 0) {
|
||||||
|
throw new RestException(500, "Can't delete, error occurs");
|
||||||
|
} elseif ($res == 0) {
|
||||||
|
throw new RestException(409, "Can't delete, that product is probably used");
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'message' => 'member type deleted'
|
'message' => 'Member type deleted'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,14 +214,17 @@ class Subscriptions extends DolibarrApi
|
|||||||
throw new RestException(404, 'Subscription not found');
|
throw new RestException(404, 'Subscription not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$subscription->delete(DolibarrApiAccess::$user)) {
|
$res = $subscription->delete(DolibarrApiAccess::$user);
|
||||||
throw new RestException(401, 'error when deleting subscription');
|
if ($res < 0) {
|
||||||
|
throw new RestException(500, "Can't delete, error occurs");
|
||||||
|
} elseif ($res == 0) {
|
||||||
|
throw new RestException(409, "Can't delete, that product is probably used");
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'message' => 'subscription deleted'
|
'message' => 'Subscription deleted'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -462,6 +462,9 @@ class Documents extends DolibarrApi
|
|||||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$objectType = $modulepart;
|
||||||
|
if (! empty($object->id) && ! empty($object->table_element)) $objectType = $object->table_element;
|
||||||
|
|
||||||
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||||
if (empty($filearray)) {
|
if (empty($filearray)) {
|
||||||
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
|
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
|
||||||
@ -469,11 +472,14 @@ class Documents extends DolibarrApi
|
|||||||
if (($object->id) > 0 && !empty($modulepart)) {
|
if (($object->id) > 0 && !empty($modulepart)) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
|
||||||
$ecmfile = new EcmFiles($this->db);
|
$ecmfile = new EcmFiles($this->db);
|
||||||
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
|
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $objectType, 't.src_object_id' => $object->id));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
|
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
|
||||||
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
|
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
|
||||||
$filearray['ecmfiles_infos'] = $ecmfile->lines;
|
$count = count($filearray);
|
||||||
|
for ($i = 0 ; $i < $count ; $i++) {
|
||||||
|
if ($filearray[$i]['name'] == $ecmfile->lines[$i]->filename) $filearray[$i] = array_merge($filearray[$i], (array) $ecmfile->lines[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$attrname = GETPOST('attrname', 'alpha');
|
$attrname = GETPOST('attrname', 'alpha');
|
||||||
$elementtype = 'don'; //Must be the $table_element of the class that manage extrafield
|
$elementtype = 'asset'; //Must be the $table_element of the class that manage extrafield
|
||||||
|
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -508,9 +508,10 @@ if (empty($reshook)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$mesgs[] = $object->error;
|
$mesgs[] = $object->error;
|
||||||
|
$mesgs = array_merge($mesgs, $object->errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages(null, $mesgs, 'errors');
|
setEventMessages('', $mesgs, 'errors');
|
||||||
$action = "create";
|
$action = "create";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,9 +596,10 @@ if (empty($reshook)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$mesgs[] = $object->error;
|
$mesgs[] = $object->error;
|
||||||
|
$mesgs = array_merge($mesgs, $object->errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages($mesg, $mesgs, 'errors');
|
setEventMessages('', $mesgs, 'errors');
|
||||||
$action = "edit";
|
$action = "edit";
|
||||||
} else {
|
} else {
|
||||||
$action = "edit";
|
$action = "edit";
|
||||||
|
|||||||
@ -1635,13 +1635,13 @@ if ($action == 'create') {
|
|||||||
// Terms of payment
|
// Terms of payment
|
||||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||||
print img_picto('', 'paiment');
|
print img_picto('', 'paiment');
|
||||||
$form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1);
|
$form->select_conditions_paiements(((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') > 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Mode of payment
|
// Mode of payment
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||||
print img_picto('', 'bank').' ';
|
print img_picto('', 'bank').' ';
|
||||||
$form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
|
$form->select_types_paiements(((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') > 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
|
|||||||
@ -386,6 +386,9 @@ if ($resql) {
|
|||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
print '<input type="hidden" name="limit" value="'.$limit.'"/>';
|
print '<input type="hidden" name="limit" value="'.$limit.'"/>';
|
||||||
}
|
}
|
||||||
|
if ($type != '') {
|
||||||
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
}
|
||||||
|
|
||||||
$title = $langs->trans("InvoiceWaitingWithdraw");
|
$title = $langs->trans("InvoiceWaitingWithdraw");
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
|
|||||||
@ -191,6 +191,9 @@ if ($result) {
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
if ($type != '') {
|
||||||
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
}
|
||||||
|
|
||||||
$title = $langs->trans("WithdrawalsLines");
|
$title = $langs->trans("WithdrawalsLines");
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
|
|||||||
@ -158,7 +158,9 @@ if ($result) {
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
if ($type != '') {
|
||||||
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
}
|
||||||
$titlekey = "WithdrawalsReceipts";
|
$titlekey = "WithdrawalsReceipts";
|
||||||
$title = $langs->trans("WithdrawalsReceipts");
|
$title = $langs->trans("WithdrawalsReceipts");
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
|
|||||||
@ -152,7 +152,7 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto
|
|||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
|
||||||
$sql .= ' WHERE a.code <> "AC_OTH_AUTO"';
|
$sql .= ' WHERE a.code <> "AC_OTH_AUTO"';
|
||||||
$sql .= ' AND (';
|
$sql .= ' AND (';
|
||||||
$sql .= " (ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity;
|
$sql .= " ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity;
|
||||||
$sql .= ' )';
|
$sql .= ' )';
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
|
$sql .= ' JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
|
||||||
|
|||||||
@ -2072,7 +2072,7 @@ abstract class CommonObject
|
|||||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
} else {
|
} else {
|
||||||
$sql .= " AND ug.fk_user = te.rowid";
|
$sql .= " AND ug.fk_user = te.rowid";
|
||||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
@ -2142,7 +2142,7 @@ abstract class CommonObject
|
|||||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
} else {
|
} else {
|
||||||
$sql .= " AND ug.fk_user = te.rowid";
|
$sql .= " AND ug.fk_user = te.rowid";
|
||||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
|
|||||||
@ -1182,7 +1182,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "ALTER TABLE ".$table;
|
$sql = "ALTER TABLE ".$table;
|
||||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||||
if (in_array($field_desc['type'], array('double', 'tinyint', 'int', 'varchar')) && $field_desc['value']) {
|
if (in_array($field_desc['type'], array('double', 'varchar')) && $field_desc['value']) {
|
||||||
$sql .= "(".$field_desc['value'].")";
|
$sql .= "(".$field_desc['value'].")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6996,7 +6996,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
|
$substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
|
||||||
$substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null);
|
$substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null);
|
||||||
$substitutionarray['__NOTE_PRIVATE__'] = (isset($object->note_private) ? $object->note_private : null);
|
$substitutionarray['__NOTE_PRIVATE__'] = (isset($object->note_private) ? $object->note_private : null);
|
||||||
|
if ($object->element == "shipping") {
|
||||||
|
$substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_delivery) ? dol_print_date($object->date_delivery, 'day', 0, $outputlangs) : '');
|
||||||
|
} else {
|
||||||
$substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
|
$substitutionarray['__DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
|
||||||
|
}
|
||||||
$substitutionarray['__DATE_DELIVERY_DAY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%d") : '');
|
$substitutionarray['__DATE_DELIVERY_DAY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%d") : '');
|
||||||
$substitutionarray['__DATE_DELIVERY_DAY_TEXT__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%A") : '');
|
$substitutionarray['__DATE_DELIVERY_DAY_TEXT__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%A") : '');
|
||||||
$substitutionarray['__DATE_DELIVERY_MON__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%m") : '');
|
$substitutionarray['__DATE_DELIVERY_MON__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%m") : '');
|
||||||
@ -8133,7 +8137,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We block using of php exec or php file functions
|
// We block using of php exec or php file functions
|
||||||
$forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI(");
|
$forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI(", "base64_decode(");
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask("));
|
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask("));
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('function(', '$$', 'call_user_func('));
|
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('function(', '$$', 'call_user_func('));
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
||||||
|
|||||||
@ -1215,7 +1215,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
|||||||
} elseif ($yearlen == 2) {
|
} elseif ($yearlen == 2) {
|
||||||
$yearcomp = sprintf("%02d", date("y", $date) + $yearoffset);
|
$yearcomp = sprintf("%02d", date("y", $date) + $yearoffset);
|
||||||
} elseif ($yearlen == 1) {
|
} elseif ($yearlen == 1) {
|
||||||
$yearcomp = substr(date("y", $date), 2, 1) + $yearoffset;
|
$yearcomp = substr(date('y', $date), 1, 1) + $yearoffset;
|
||||||
}
|
}
|
||||||
if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
|
if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
|
||||||
if ($yearlen == 4) {
|
if ($yearlen == 4) {
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
||||||
*/
|
|
||||||
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
|
|
||||||
ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,9999);
|
|
||||||
else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
|
|
||||||
[d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).submit();return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
|
|
||||||
c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m=
|
|
||||||
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);
|
|
||||||
@ -220,9 +220,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
|||||||
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
} else {
|
} else {
|
||||||
if ($newuser->error == 'ErrorLoginAlreadyExists') {
|
if ($result == -6) { //login or email already exists
|
||||||
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
||||||
print '<br><div class="warning">'.$langs->trans("AdminLoginAlreadyExists", $login)."</div><br>";
|
print '<br><div class="warning">'.$newuser->error."</div><br>";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
} else {
|
} else {
|
||||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
||||||
@ -357,7 +357,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
|||||||
// Create lock file
|
// Create lock file
|
||||||
|
|
||||||
// If first install
|
// If first install
|
||||||
if ($action == "set" && $success) {
|
if ($action == "set") {
|
||||||
|
if ($success) {
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
|
||||||
// Install is finished
|
// Install is finished
|
||||||
print $langs->trans("SystemIsInstalled")."<br>";
|
print $langs->trans("SystemIsInstalled")."<br>";
|
||||||
@ -400,6 +401,7 @@ if ($action == "set" && $success) {
|
|||||||
print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
|
print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
|
||||||
print '</a></div>';
|
print '</a></div>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} elseif (empty($action) || preg_match('/upgrade/i', $action)) {
|
} elseif (empty($action) || preg_match('/upgrade/i', $action)) {
|
||||||
// If upgrade
|
// If upgrade
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
|
||||||
@ -443,7 +445,7 @@ if ($action == "set" && $success) {
|
|||||||
$morehtml .= '</a></div>';
|
$morehtml .= '</a></div>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error('', 'step5.php: unknown choice of action');
|
dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear cache files
|
// Clear cache files
|
||||||
|
|||||||
@ -435,7 +435,19 @@ class Products extends DolibarrApi
|
|||||||
global $user;
|
global $user;
|
||||||
$user = DolibarrApiAccess::$user;
|
$user = DolibarrApiAccess::$user;
|
||||||
|
|
||||||
return $this->product->delete(DolibarrApiAccess::$user);
|
$res = $this->product->delete(DolibarrApiAccess::$user);
|
||||||
|
if ($res < 0) {
|
||||||
|
throw new RestException(500, "Can't delete, error occurs");
|
||||||
|
} elseif ($res == 0) {
|
||||||
|
throw new RestException(409, "Can't delete, that product is probably used");
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'success' => array(
|
||||||
|
'code' => 200,
|
||||||
|
'message' => 'Object deleted'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -141,7 +141,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
|||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('entrepot').')';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('stock').')';
|
||||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,26 +132,18 @@ if ($result < 0) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$qualifiedjobs = array();
|
|
||||||
foreach ($object->lines as $val) {
|
|
||||||
if (!verifCond($val->test)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$qualifiedjobs[] = $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Duplicate code. This sequence of code must be shared with code into cron_run_jobs.php script.
|
// TODO Duplicate code. This sequence of code must be shared with code into cron_run_jobs.php script.
|
||||||
|
|
||||||
// current date
|
// current date
|
||||||
$nbofjobs = count($qualifiedjobs);
|
$nbofjobs = count($object->lines);
|
||||||
$nbofjobslaunchedok = 0;
|
$nbofjobslaunchedok = 0;
|
||||||
$nbofjobslaunchedko = 0;
|
$nbofjobslaunchedko = 0;
|
||||||
|
|
||||||
if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
if (is_array($object->lines) && (count($object->lines) > 0)) {
|
||||||
$savconf = dol_clone($conf);
|
$savconf = dol_clone($conf);
|
||||||
|
|
||||||
// Loop over job
|
// Loop over job
|
||||||
foreach ($qualifiedjobs as $line) {
|
foreach ($object->lines as $line) {
|
||||||
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
|
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
|
||||||
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
|
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
|
||||||
|
|
||||||
@ -181,6 +173,10 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!verifCond($line->test)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
|
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
|
||||||
if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) {
|
if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) {
|
||||||
echo " - qualified";
|
echo " - qualified";
|
||||||
|
|||||||
@ -287,6 +287,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
$result = $adh->create($user);
|
$result = $adh->create($user);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
@ -460,6 +461,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$errmsg .= join('<br>', $adh->errors);
|
$errmsg .= join('<br>', $adh->errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|||||||
@ -525,7 +525,20 @@ class Thirdparties extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
$this->company->oldcopy = clone $this->company;
|
$this->company->oldcopy = clone $this->company;
|
||||||
return $this->company->delete($id);
|
|
||||||
|
$res = $this->company->delete($id);
|
||||||
|
if ($res < 0) {
|
||||||
|
throw new RestException(500, "Can't delete, error occurs");
|
||||||
|
} elseif ($res == 0) {
|
||||||
|
throw new RestException(409, "Can't delete, that product is probably used");
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'success' => array(
|
||||||
|
'code' => 200,
|
||||||
|
'message' => 'Object deleted'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1141,7 +1154,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getCompanyBankAccount($id)
|
public function getCompanyBankAccount($id)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->facture->lire) {
|
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
|
|||||||
@ -216,8 +216,7 @@ class CompanyBankAccount extends Account
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib";
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$sql .= " WHERE rowid = ".((int) $id);
|
$sql .= " WHERE rowid = ".((int) $id);
|
||||||
}
|
} elseif ($socid > 0) {
|
||||||
if ($socid) {
|
|
||||||
$sql .= " WHERE fk_soc = ".((int) $socid);
|
$sql .= " WHERE fk_soc = ".((int) $socid);
|
||||||
if ($default > -1) {
|
if ($default > -1) {
|
||||||
$sql .= " AND default_rib = ".((int) $default);
|
$sql .= " AND default_rib = ".((int) $default);
|
||||||
|
|||||||
@ -3035,7 +3035,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
$sql .= " ".price2num($this->localtax2_tx).",";
|
$sql .= " ".price2num($this->localtax2_tx).",";
|
||||||
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
||||||
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
||||||
$sql .= " ".(!empty($this->subprice) ?price2num($this->subprice) : "null").",";
|
$sql .= " ".(!empty($this->subprice) ?price2num($this->subprice) : 0).",";
|
||||||
$sql .= " ".price2num($this->remise_percent).",";
|
$sql .= " ".price2num($this->remise_percent).",";
|
||||||
$sql .= " ".(isset($this->info_bits) ? "'".$this->db->escape($this->info_bits)."'" : "null").",";
|
$sql .= " ".(isset($this->info_bits) ? "'".$this->db->escape($this->info_bits)."'" : "null").",";
|
||||||
$sql .= " ".price2num($this->total_ht).",";
|
$sql .= " ".price2num($this->total_ht).",";
|
||||||
|
|||||||
@ -628,7 +628,17 @@ class Users extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
$this->useraccount->oldcopy = clone $this->useraccount;
|
$this->useraccount->oldcopy = clone $this->useraccount;
|
||||||
return $this->useraccount->delete(DolibarrApiAccess::$user);
|
|
||||||
|
if (!$this->useraccount->delete(DolibarrApiAccess::$user)) {
|
||||||
|
throw new RestException(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'success' => array(
|
||||||
|
'code' => 200,
|
||||||
|
'message' => 'Ticket deleted'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
|
|||||||
@ -3490,7 +3490,7 @@ class User extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
$sql .= " WHERE ((ug.fk_user = t.rowid";
|
$sql .= " WHERE ((ug.fk_user = t.rowid";
|
||||||
$sql .= " AND ug.entity IN (".getEntity('user')."))";
|
$sql .= " AND ug.entity IN (".getEntity('usergroup')."))";
|
||||||
$sql .= " OR t.entity = 0)"; // Show always superadmin
|
$sql .= " OR t.entity = 0)"; // Show always superadmin
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -173,25 +173,17 @@ if ($result < 0) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$qualifiedjobs = array();
|
|
||||||
foreach ($object->lines as $val) {
|
|
||||||
if (!verifCond($val->test)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$qualifiedjobs[] = $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Duplicate code. This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page.
|
// TODO Duplicate code. This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page.
|
||||||
|
|
||||||
$nbofjobs = count($qualifiedjobs);
|
$nbofjobs = count($object->lines);
|
||||||
$nbofjobslaunchedok = 0;
|
$nbofjobslaunchedok = 0;
|
||||||
$nbofjobslaunchedko = 0;
|
$nbofjobslaunchedko = 0;
|
||||||
|
|
||||||
if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
if (is_array($object->lines) && (count($object->lines) > 0)) {
|
||||||
$savconf = dol_clone($conf);
|
$savconf = dol_clone($conf);
|
||||||
|
|
||||||
// Loop over job
|
// Loop over job
|
||||||
foreach ($qualifiedjobs as $line) {
|
foreach ($object->lines as $line) {
|
||||||
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
|
dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG);
|
||||||
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
|
echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label;
|
||||||
|
|
||||||
@ -233,6 +225,10 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!verifCond($line->test)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
|
//If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database
|
||||||
if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) {
|
if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) {
|
||||||
echo " - qualified";
|
echo " - qualified";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user