default to create on card.php if $action is empty

This commit is contained in:
Christian Foellmann 2022-07-07 16:24:59 +02:00 committed by Laurent Destailleur
parent 6386432263
commit e0b664066b
59 changed files with 60 additions and 60 deletions

View File

@ -220,7 +220,7 @@ llxheader('', $title, $help_url);
// Create mode
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans('NewAccountingAccount'));
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";

View File

@ -154,7 +154,7 @@ $help_url = "EN:Module_Double_Entry_Accounting";
llxHeader('', $title, $help_url);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewFiscalYear"));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -340,7 +340,7 @@ if ($action == 'delete') {
print $formconfirm;
}
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("CreateMvts"));
$object = new BookKeeping($db);

View File

@ -920,7 +920,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// -----------------------------------------
// Create mode
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$object->canvas = $canvas;
$object->state_id = GETPOST('state_id', 'int');

View File

@ -253,7 +253,7 @@ $help_url = "EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électro
llxHeader('', 'EmailCollector', $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector")));
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -166,7 +166,7 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Asset")), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -138,7 +138,7 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_' . $object->picto);
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';

View File

@ -268,7 +268,7 @@ $help_url ='EN:Module_BOM';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -144,7 +144,7 @@ $h++;
$hselected = 'card';
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
/*
* Fact bookmark creation mode
*/

View File

@ -923,7 +923,7 @@ $arrayrecurrulefreq = array(
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('', $langs->trans("Agenda"), $help_url);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$contact = new Contact($db);
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');

View File

@ -704,7 +704,7 @@ llxHeader(
array()
);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
// EMailing in creation mode
print '<form name="new_mailing" action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -1533,7 +1533,7 @@ llxHeader('', $title, $help_url);
$now = dol_now();
// Add new proposal
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$currency_code = $conf->currency;
print load_fiche_titre($langs->trans("NewProp"), '', 'propal');

View File

@ -341,7 +341,7 @@ llxHeader("", $title, $help_url);
// Creation
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$object = new Account($db);
print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'bank_account');

View File

@ -335,7 +335,7 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
}
// Create mode
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
// Update fields properties in realtime
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript">';

View File

@ -194,7 +194,7 @@ $form = new Form($db);
/*
* Action create
*/
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@ -2888,7 +2888,7 @@ llxHeader('', $title, $help_url);
// Mode creation
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$facturestatic = new Facture($db);
$extrafields->fetch_name_optionals_label($facturestatic->table_element);

View File

@ -145,7 +145,7 @@ $title = $langs->trans("LT".$object->ltt)." - ".$langs->trans("Card");
$help_url = '';
llxHeader('', $title, $helpurl);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code));
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formlocaltax" method="post">'."\n";

View File

@ -343,7 +343,7 @@ llxHeader("", $title, $help_url);
// Form to create a social contribution
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewSocialContribution"));
print '<form name="charge" method="post" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -398,7 +398,7 @@ if ($id) {
}
// Form to enter VAT
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
if (!empty($conf->use_javascript_ajax)) {

View File

@ -627,7 +627,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if ($user->rights->societe->contact->creer) {
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
/*
* Fiche en mode creation
*/

View File

@ -1017,7 +1017,7 @@ if ($result > 0) {
}
// Create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans('AddContract'), '', 'contract');
$soc = new Societe($db);

View File

@ -258,7 +258,7 @@ llxHeader('', $langs->trans("CronTask"));
$head = cron_prepare_head($object);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("CronTask"), '', 'title_setup');
}

View File

@ -259,7 +259,7 @@ llxHeader('', $title, 'Livraison');
$form = new Form($db);
$formfile = new FormFile($db);
if ($action == 'create') { // Create. Seems to no be used
if ($action == 'create' || (empty($action) && empty($id))) { // Create. Seems to no be used
} else // View
{
if ($object->id > 0) {

View File

@ -386,7 +386,7 @@ if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("AddDonation"), '', 'object_donation');
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -206,7 +206,7 @@ llxHeader('', $langs->trans("ECMNewSection"));
$form = new Form($db);
$formecm = new FormEcm($db);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
//***********************
// Create
//***********************

View File

@ -166,7 +166,7 @@ $title = $langs->trans("ConferenceOrBooth");
$help_url = '';
llxHeader('', $title, $help_url);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$result = $projectstatic->fetch(GETPOST('fk_project'));
} else {
$result = $projectstatic->fetch($object->fk_project);
@ -392,7 +392,7 @@ if (!empty($withproject)) {
}
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBooth")), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -420,7 +420,7 @@ if (!empty($withproject)) {
}
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);

View File

@ -831,7 +831,7 @@ if ($action == 'create2') {
}
// Mode creation.
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$expe = new Expedition($db);
print load_fiche_titre($langs->trans("CreateShipment"), '', 'dolly');

View File

@ -1389,7 +1389,7 @@ $ecmfilesstatic = new EcmFiles($db);
$formexpensereport = new FormExpenseReport($db);
// Create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewTrip"), '', 'trip');
print '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="create">';

View File

@ -796,7 +796,7 @@ $help_url = 'EN:Module_Interventions';
llxHeader('', $langs->trans("Intervention"), $help_url);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
// Create new intervention
$soc = new Societe($db);

View File

@ -1544,7 +1544,7 @@ llxHeader('', $title, $help_url);
$now = dol_now();
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans('NewOrderSupplier'), '', 'supplier_order');
dol_htmloutput_events();

View File

@ -1899,7 +1899,7 @@ $help_url = 'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Mó
llxHeader('', $title, $help_url);
// Mode creation
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$facturestatic = new FactureFournisseur($db);
print load_fiche_titre($langs->trans('NewBill'), '', 'supplier_invoice');

View File

@ -159,7 +159,7 @@ $formcompany = new FormCompany($db);
/*
* Action create
*/
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewEstablishment"));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -255,7 +255,7 @@ print '<script type="text/javascript" language="javascript">
</script>';
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewEval"), '', 'object_' . $object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -180,7 +180,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';

View File

@ -187,7 +187,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto);
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';

View File

@ -156,7 +156,7 @@ if ($action == 'add' && $permissiontoadd) {
*/
// Creation mode
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$title = $langs->trans("IntracommReportTitle");
llxHeader("", $title);
print load_fiche_titre($langs->trans("IntracommReportTitle"));

View File

@ -169,7 +169,7 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewKnowledgeRecord"), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -254,7 +254,7 @@ llxHeader("", $title, $help_url);
// Create mode
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@ -242,7 +242,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
if (empty($permissiontoadd)) {
accessforbidden($langs->trans('NotEnoughPermissions'), 0, 1);
exit;

View File

@ -241,7 +241,7 @@ llxHeader('', $title, '');
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
if (GETPOST('fk_bom', 'int') > 0) {
$titlelist = $langs->trans("ToConsume");
if ($objectbom->bomtype == 1) {

View File

@ -259,7 +259,7 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewPartnership"), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -181,7 +181,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewInventory"), '', 'product');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -285,7 +285,7 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("", $langs->trans("WarehouseCard"), $help_url);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewWarehouse"), '', 'stock');
dol_set_focus('input[name="libelle"]');

View File

@ -378,7 +378,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("Batch"), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -413,7 +413,7 @@ print '});
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("StockTransfer")), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -728,7 +728,7 @@ if ($action == 'create2') {
}
// Mode creation.
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$recept = new Reception($db);
print load_fiche_titre($langs->trans("CreateReception"));

View File

@ -283,7 +283,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("RecruitmentCandidature")), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -202,7 +202,7 @@ $help_url = '';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewPositionToBeFilled"), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -197,7 +197,7 @@ $form = new Form($db);
$formresource = new FormResource($db);
if ($action == 'create' || $object->fetch($id, $ref) > 0) {
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($title, '', 'object_resource');
print dol_get_fiche_head('');
} else {

View File

@ -457,7 +457,7 @@ if ($id > 0) {
}
// Create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;

View File

@ -979,7 +979,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// -----------------------------------------
// When used in standard mode
// -----------------------------------------
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
/*
* Creation
*/

View File

@ -1138,7 +1138,7 @@ if (!empty($conf->project->enabled)) {
$now = dol_now();
// Add new askprice
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
$currency_code = $conf->currency;
print load_fiche_titre($langs->trans("NewAskPrice"), '', 'supplier_proposal');

View File

@ -254,7 +254,7 @@ $fuserstatic = new User($db);
$form = new Form($db);
$formfile = new FormFile($db);
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group');
dol_set_focus('#nom');

View File

@ -272,7 +272,7 @@ if ($result > 0) {
print '</tr>';
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
// $listofemails=$object->thirdparty_and_contact_email_array();
if ($object->email) {
$actions = array();

View File

@ -158,7 +158,7 @@ $help_url = 'EN:Module_Products#Variants';
llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ProductAttribute")), '', 'object_' . $object->picto);
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';

View File

@ -240,7 +240,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
if (empty($permissiontoadd)) {
accessforbidden($langs->trans('NotEnoughPermissions'), 0, 1);
exit;

View File

@ -118,7 +118,7 @@ $formfile = new FormFile($db);
llxHeader('', 'WebsiteAccount', '');
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("WebsiteAccount")));
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -186,7 +186,7 @@ llxHeader('', $title, $help_url);
<?php
// Part to create
if ($action == 'create') {
if ($action == 'create' || (empty($action) && empty($id))) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation")), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';