Fehler behebung Theme und Favoriten
This commit is contained in:
parent
4b39b5c58e
commit
658b2df045
16 changed files with 473 additions and 659 deletions
|
|
@ -122,8 +122,8 @@ if ($action == 'deactivate') {
|
||||||
$title = $langs->trans('AnlagenSystems');
|
$title = $langs->trans('AnlagenSystems');
|
||||||
|
|
||||||
// Include CSS and JS
|
// Include CSS and JS
|
||||||
$morejs = array('/kundenkarte/js/kundenkarte.js');
|
$morejs = array('/kundenkarte/js/kundenkarte.js?v=1769962608');
|
||||||
$morecss = array('/kundenkarte/css/kundenkarte.css');
|
$morecss = array('/kundenkarte/css/kundenkarte.css?v=1769962608');
|
||||||
|
|
||||||
llxHeader('', $title, '', '', 0, 0, $morejs, $morecss);
|
llxHeader('', $title, '', '', 0, 0, $morejs, $morecss);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,9 @@ if ($action == 'confirm_delete_field' && $confirm == 'yes') {
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
$action = 'edit';
|
// Redirect back to edit page to stay in the fields list
|
||||||
|
header('Location: '.$_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&system='.$systemFilter);
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'activate_field') {
|
if ($action == 'activate_field') {
|
||||||
|
|
@ -270,15 +272,15 @@ if ($action == 'deactivate_field') {
|
||||||
$title = $langs->trans('AnlagenTypes');
|
$title = $langs->trans('AnlagenTypes');
|
||||||
|
|
||||||
// Include CSS and JS
|
// Include CSS and JS
|
||||||
$morejs = array('/kundenkarte/js/kundenkarte.js');
|
$morejs = array('/kundenkarte/js/kundenkarte.js?v=1769962608');
|
||||||
$morecss = array('/kundenkarte/css/kundenkarte.css');
|
$morecss = array('/kundenkarte/css/kundenkarte.css?v=1769962608');
|
||||||
|
|
||||||
llxHeader('', $title, '', '', 0, 0, $morejs, $morecss);
|
llxHeader('', $title, '', '', 0, 0, $morejs, $morecss);
|
||||||
|
|
||||||
$head = kundenkarteAdminPrepareHead();
|
$head = kundenkarteAdminPrepareHead();
|
||||||
print dol_get_fiche_head($head, 'types', $langs->trans('ModuleKundenKarteName'), -1, 'fa-file');
|
print dol_get_fiche_head($head, 'types', $langs->trans('ModuleKundenKarteName'), -1, 'fa-file');
|
||||||
|
|
||||||
// Confirmation
|
// Confirmation for type deletion
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
print $form->formconfirm(
|
print $form->formconfirm(
|
||||||
$_SERVER['PHP_SELF'].'?typeid='.$typeId.'&system='.$systemFilter,
|
$_SERVER['PHP_SELF'].'?typeid='.$typeId.'&system='.$systemFilter,
|
||||||
|
|
@ -291,6 +293,20 @@ if ($action == 'delete') {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Confirmation for field deletion
|
||||||
|
if ($action == 'delete_field') {
|
||||||
|
print $form->formconfirm(
|
||||||
|
$_SERVER['PHP_SELF'].'?typeid='.$typeId.'&fieldid='.$fieldId.'&system='.$systemFilter,
|
||||||
|
$langs->trans('Delete'),
|
||||||
|
$langs->trans('ConfirmDeleteField'),
|
||||||
|
'confirm_delete_field',
|
||||||
|
'',
|
||||||
|
'yes',
|
||||||
|
1
|
||||||
|
);
|
||||||
|
$action = 'edit'; // Stay in edit mode to show the fields
|
||||||
|
}
|
||||||
|
|
||||||
// Add/Edit form
|
// Add/Edit form
|
||||||
if (in_array($action, array('create', 'edit'))) {
|
if (in_array($action, array('create', 'edit'))) {
|
||||||
if ($action == 'edit' && $typeId > 0) {
|
if ($action == 'edit' && $typeId > 0) {
|
||||||
|
|
@ -407,19 +423,6 @@ if (in_array($action, array('create', 'edit'))) {
|
||||||
if ($action == 'edit' && $typeId > 0) {
|
if ($action == 'edit' && $typeId > 0) {
|
||||||
$editFieldId = GETPOSTINT('editfield');
|
$editFieldId = GETPOSTINT('editfield');
|
||||||
|
|
||||||
// Confirmation for field deletion
|
|
||||||
if ($action == 'delete_field') {
|
|
||||||
print $form->formconfirm(
|
|
||||||
$_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&fieldid='.$fieldId.'&system='.$systemFilter,
|
|
||||||
$langs->trans('Delete'),
|
|
||||||
$langs->trans('ConfirmDeleteField'),
|
|
||||||
'confirm_delete_field',
|
|
||||||
'',
|
|
||||||
'yes',
|
|
||||||
1
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
print '<h3>'.$langs->trans('AnlagenTypeFields').'</h3>';
|
print '<h3>'.$langs->trans('AnlagenTypeFields').'</h3>';
|
||||||
|
|
||||||
|
|
@ -513,7 +516,7 @@ if (in_array($action, array('create', 'edit'))) {
|
||||||
print '<td class="center nowraponall">';
|
print '<td class="center nowraponall">';
|
||||||
print '<div style="display:inline-flex;gap:8px;">';
|
print '<div style="display:inline-flex;gap:8px;">';
|
||||||
print '<a class="button buttongen" style="width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;" href="'.$_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&editfield='.$field->rowid.'&system='.$systemFilter.'" title="'.$langs->trans('Edit').'"><i class="fas fa-pen"></i></a>';
|
print '<a class="button buttongen" style="width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;" href="'.$_SERVER['PHP_SELF'].'?action=edit&typeid='.$typeId.'&editfield='.$field->rowid.'&system='.$systemFilter.'" title="'.$langs->trans('Edit').'"><i class="fas fa-pen"></i></a>';
|
||||||
print '<a class="button buttongen" style="width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;background:#dc3545;border-color:#dc3545;color:#fff;" href="'.$_SERVER['PHP_SELF'].'?action=delete_field&typeid='.$typeId.'&fieldid='.$field->rowid.'&system='.$systemFilter.'" title="'.$langs->trans('Delete').'" onclick="return confirm(\''.$langs->trans('ConfirmDeleteField').'\');"><i class="fas fa-trash"></i></a>';
|
print '<a class="button buttongen" style="width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;background:#dc3545;border-color:#dc3545;color:#fff;" href="'.$_SERVER['PHP_SELF'].'?action=delete_field&typeid='.$typeId.'&fieldid='.$field->rowid.'&system='.$systemFilter.'&token='.newToken().'" title="'.$langs->trans('Delete').'"><i class="fas fa-trash"></i></a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
@ -524,14 +527,20 @@ if (in_array($action, array('create', 'edit'))) {
|
||||||
print '<tr class="oddeven"><td colspan="10" class="opacitymedium">'.$langs->trans('NoFieldsDefined').'</td></tr>';
|
print '<tr class="oddeven"><td colspan="10" class="opacitymedium">'.$langs->trans('NoFieldsDefined').'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new field row
|
print '</table>';
|
||||||
print '<tr class="oddeven liste_titre_add">';
|
|
||||||
|
// Add new field form - completely separate from table
|
||||||
|
print '<div class="margintoponlyshort">';
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add_field">';
|
print '<input type="hidden" name="action" value="add_field">';
|
||||||
print '<input type="hidden" name="typeid" value="'.$typeId.'">';
|
print '<input type="hidden" name="typeid" value="'.$typeId.'">';
|
||||||
print '<input type="hidden" name="system" value="'.$systemFilter.'">';
|
print '<input type="hidden" name="system" value="'.$systemFilter.'">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th colspan="10">'.$langs->trans('Add').' '.$langs->trans('Field').'</th>';
|
||||||
|
print '</tr>';
|
||||||
|
print '<tr class="oddeven">';
|
||||||
print '<td><input type="text" name="field_code" class="flat minwidth100" placeholder="CODE" required></td>';
|
print '<td><input type="text" name="field_code" class="flat minwidth100" placeholder="CODE" required></td>';
|
||||||
print '<td><input type="text" name="field_label" class="flat minwidth150" placeholder="'.$langs->trans('FieldLabel').'" required></td>';
|
print '<td><input type="text" name="field_label" class="flat minwidth150" placeholder="'.$langs->trans('FieldLabel').'" required></td>';
|
||||||
print '<td><select name="field_type" class="flat" required>';
|
print '<td><select name="field_type" class="flat" required>';
|
||||||
|
|
@ -547,11 +556,10 @@ if (in_array($action, array('create', 'edit'))) {
|
||||||
print '<td class="center"><input type="number" name="field_position" class="flat" style="width:50px;" value="0" min="0"></td>';
|
print '<td class="center"><input type="number" name="field_position" class="flat" style="width:50px;" value="0" min="0"></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td class="center"><button type="submit" class="button buttongen"><i class="fa fa-plus"></i> '.$langs->trans('Add').'</button></td>';
|
print '<td class="center"><button type="submit" class="button buttongen"><i class="fa fa-plus"></i> '.$langs->trans('Add').'</button></td>';
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
// Help box for field options
|
// Help box for field options
|
||||||
print '<div class="info" style="margin-top:15px;">';
|
print '<div class="info" style="margin-top:15px;">';
|
||||||
|
|
|
||||||
0
ajax/export_tree_pdf.php
Normal file → Executable file
0
ajax/export_tree_pdf.php
Normal file → Executable file
7
ajax/favorite_update.php
Normal file → Executable file
7
ajax/favorite_update.php
Normal file → Executable file
|
|
@ -41,18 +41,21 @@ if (!$user->hasRight('kundenkarte', 'write')) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
$id = GETPOSTINT('id');
|
$id = GETPOSTINT('id');
|
||||||
$qty = GETPOSTFLOAT('qty');
|
$qty = GETPOST('qty', 'alpha');
|
||||||
|
|
||||||
if ($id <= 0) {
|
if ($id <= 0) {
|
||||||
echo json_encode(array('error' => 'Invalid ID'));
|
echo json_encode(array('error' => 'Invalid ID'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($qty <= 0) {
|
// Simple check: just needs to be numeric
|
||||||
|
if (!is_numeric($qty)) {
|
||||||
echo json_encode(array('error' => 'Invalid quantity'));
|
echo json_encode(array('error' => 'Invalid quantity'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$qty = (float) $qty;
|
||||||
|
|
||||||
$favoriteProduct = new FavoriteProduct($db);
|
$favoriteProduct = new FavoriteProduct($db);
|
||||||
$result = $favoriteProduct->fetch($id);
|
$result = $favoriteProduct->fetch($id);
|
||||||
|
|
||||||
|
|
|
||||||
0
ajax/icon_upload.php
Normal file → Executable file
0
ajax/icon_upload.php
Normal file → Executable file
0
ajax/type_fields.php
Normal file → Executable file
0
ajax/type_fields.php
Normal file → Executable file
|
|
@ -76,7 +76,7 @@ class modKundenKarte extends DolibarrModules
|
||||||
$this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@kundenkarte'
|
$this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@kundenkarte'
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = '2.0';
|
$this->version = '2.5';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -381,9 +381,9 @@
|
||||||
for (var key in data.fields) {
|
for (var key in data.fields) {
|
||||||
if (data.fields.hasOwnProperty(key)) {
|
if (data.fields.hasOwnProperty(key)) {
|
||||||
var field = data.fields[key];
|
var field = data.fields[key];
|
||||||
// Handle header fields as section titles
|
// Handle header fields as section titles (must span both grid columns)
|
||||||
if (field.type === 'header') {
|
if (field.type === 'header') {
|
||||||
html += '<span class="kundenkarte-tooltip-field-header" style="display:block;width:100%;font-weight:bold;margin-top:8px;padding-top:8px;border-top:1px solid #ddd;">' + this.escapeHtml(field.label) + '</span>';
|
html += '<span class="kundenkarte-tooltip-field-header" style="grid-column:1/-1;display:block;width:100%;font-weight:bold;margin-top:8px;padding-top:8px;border-top:1px solid #ddd;">' + this.escapeHtml(field.label) + '</span>';
|
||||||
} else if (field.value) {
|
} else if (field.value) {
|
||||||
html += '<span class="kundenkarte-tooltip-field-label">' + this.escapeHtml(field.label) + ':</span>';
|
html += '<span class="kundenkarte-tooltip-field-label">' + this.escapeHtml(field.label) + ':</span>';
|
||||||
html += '<span class="kundenkarte-tooltip-field-value">' + this.escapeHtml(field.value) + '</span>';
|
html += '<span class="kundenkarte-tooltip-field-value">' + this.escapeHtml(field.value) + '</span>';
|
||||||
|
|
|
||||||
0
sql/llx_kundenkarte_anlage_contact.sql
Normal file → Executable file
0
sql/llx_kundenkarte_anlage_contact.sql
Normal file → Executable file
0
sql/llx_kundenkarte_favorite_products_contact.sql
Normal file → Executable file
0
sql/llx_kundenkarte_favorite_products_contact.sql
Normal file → Executable file
0
sql/llx_kundenkarte_societe_system_contact.sql
Normal file → Executable file
0
sql/llx_kundenkarte_societe_system_contact.sql
Normal file → Executable file
|
|
@ -286,8 +286,10 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontodelete)
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Use Dolibarr standard button classes
|
||||||
|
|
||||||
$title = $langs->trans('TechnicalInstallations').' - '.$object->name;
|
$title = $langs->trans('TechnicalInstallations').' - '.$object->name;
|
||||||
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js'), array('/kundenkarte/css/kundenkarte.css'));
|
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233'));
|
||||||
|
|
||||||
// Prepare tabs
|
// Prepare tabs
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|
@ -364,7 +366,7 @@ if ($permissiontoadd) {
|
||||||
// Get systems not yet enabled for this customer
|
// Get systems not yet enabled for this customer
|
||||||
$availableSystems = array_diff_key($allSystems, $customerSystems);
|
$availableSystems = array_diff_key($allSystems, $customerSystems);
|
||||||
if (!empty($availableSystems)) {
|
if (!empty($availableSystems)) {
|
||||||
print '<button type="button" class="button small" onclick="document.getElementById(\'add-system-form\').style.display=\'block\';" style="margin-left:auto;">';
|
print '<button type="button" class="button small" style="margin-left:auto;" onclick="document.getElementById(\'add-system-form\').style.display=\'block\';">';
|
||||||
print '<i class="fa fa-plus"></i> '.$langs->trans('AddSystem');
|
print '<i class="fa fa-plus"></i> '.$langs->trans('AddSystem');
|
||||||
print '</button>';
|
print '</button>';
|
||||||
}
|
}
|
||||||
|
|
@ -394,7 +396,7 @@ print '</div>'; // End kundenkarte-system-tabs-wrapper
|
||||||
|
|
||||||
// Add system form (hidden by default)
|
// Add system form (hidden by default)
|
||||||
if ($permissiontoadd && !empty($availableSystems)) {
|
if ($permissiontoadd && !empty($availableSystems)) {
|
||||||
print '<div id="add-system-form" class="kundenkarte-add-system-form" style="display:none;margin-bottom:15px;padding:10px;background:#f9f9f9;border-radius:6px;">';
|
print '<div id="add-system-form" class="kundenkarte-add-system-form" style="display:none;margin-bottom:15px;">';
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add_system">';
|
print '<input type="hidden" name="action" value="add_system">';
|
||||||
|
|
@ -406,7 +408,7 @@ if ($permissiontoadd && !empty($availableSystems)) {
|
||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print ' <button type="submit" class="button small">'.$langs->trans('Add').'</button>';
|
print ' <button type="submit" class="button small">'.$langs->trans('Add').'</button>';
|
||||||
print ' <button type="button" class="button small button-cancel" onclick="document.getElementById(\'add-system-form\').style.display=\'none\';">'.$langs->trans('Cancel').'</button>';
|
print ' <button type="button" class="button small" onclick="document.getElementById(\'add-system-form\').style.display=\'none\';">'.$langs->trans('Cancel').'</button>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
@ -618,7 +620,7 @@ if (empty($customerSystems)) {
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center" style="margin-top:20px;">';
|
print '<div class="center" style="margin-top:20px;">';
|
||||||
print '<button type="submit" class="button">'.$langs->trans('Save').'</button>';
|
print '<button type="submit" class="button button-save">'.$langs->trans('Save').'</button>';
|
||||||
print ' <a class="button button-cancel" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'">'.$langs->trans('Cancel').'</a>';
|
print ' <a class="button button-cancel" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'">'.$langs->trans('Cancel').'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
@ -631,7 +633,7 @@ if (empty($customerSystems)) {
|
||||||
// Tree view
|
// Tree view
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<div style="margin-bottom:15px;">';
|
print '<div style="margin-bottom:15px;">';
|
||||||
print '<a class="button" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'&action=create">';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'&action=create">';
|
||||||
print '<i class="fa fa-plus"></i> '.$langs->trans('AddElement');
|
print '<i class="fa fa-plus"></i> '.$langs->trans('AddElement');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
|
||||||
14
tabs/contact_anlagen.php
Normal file → Executable file
14
tabs/contact_anlagen.php
Normal file → Executable file
|
|
@ -297,8 +297,10 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontodelete)
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Use Dolibarr standard button classes
|
||||||
|
|
||||||
$title = $langs->trans('TechnicalInstallations').' - '.$object->getFullName($langs);
|
$title = $langs->trans('TechnicalInstallations').' - '.$object->getFullName($langs);
|
||||||
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js'), array('/kundenkarte/css/kundenkarte.css'));
|
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233'));
|
||||||
|
|
||||||
// Prepare tabs
|
// Prepare tabs
|
||||||
$head = contact_prepare_head($object);
|
$head = contact_prepare_head($object);
|
||||||
|
|
@ -375,7 +377,7 @@ if ($permissiontoadd) {
|
||||||
// Get systems not yet enabled for this contact
|
// Get systems not yet enabled for this contact
|
||||||
$availableSystems = array_diff_key($allSystems, $customerSystems);
|
$availableSystems = array_diff_key($allSystems, $customerSystems);
|
||||||
if (!empty($availableSystems)) {
|
if (!empty($availableSystems)) {
|
||||||
print '<button type="button" class="button small" onclick="document.getElementById(\'add-system-form\').style.display=\'block\';" style="margin-left:auto;">';
|
print '<button type="button" class="button small" style="margin-left:auto;" onclick="document.getElementById(\'add-system-form\').style.display=\'block\';">';
|
||||||
print '<i class="fa fa-plus"></i> '.$langs->trans('AddSystem');
|
print '<i class="fa fa-plus"></i> '.$langs->trans('AddSystem');
|
||||||
print '</button>';
|
print '</button>';
|
||||||
}
|
}
|
||||||
|
|
@ -405,7 +407,7 @@ print '</div>'; // End kundenkarte-system-tabs-wrapper
|
||||||
|
|
||||||
// Add system form (hidden by default)
|
// Add system form (hidden by default)
|
||||||
if ($permissiontoadd && !empty($availableSystems)) {
|
if ($permissiontoadd && !empty($availableSystems)) {
|
||||||
print '<div id="add-system-form" class="kundenkarte-add-system-form" style="display:none;margin-bottom:15px;padding:10px;background:#f9f9f9;border-radius:6px;">';
|
print '<div id="add-system-form" class="kundenkarte-add-system-form" style="display:none;margin-bottom:15px;">';
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add_system">';
|
print '<input type="hidden" name="action" value="add_system">';
|
||||||
|
|
@ -417,7 +419,7 @@ if ($permissiontoadd && !empty($availableSystems)) {
|
||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print ' <button type="submit" class="button small">'.$langs->trans('Add').'</button>';
|
print ' <button type="submit" class="button small">'.$langs->trans('Add').'</button>';
|
||||||
print ' <button type="button" class="button small button-cancel" onclick="document.getElementById(\'add-system-form\').style.display=\'none\';">'.$langs->trans('Cancel').'</button>';
|
print ' <button type="button" class="button small" onclick="document.getElementById(\'add-system-form\').style.display=\'none\';">'.$langs->trans('Cancel').'</button>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
@ -641,7 +643,7 @@ if (empty($customerSystems)) {
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center" style="margin-top:20px;">';
|
print '<div class="center" style="margin-top:20px;">';
|
||||||
print '<button type="submit" class="button">'.$langs->trans('Save').'</button>';
|
print '<button type="submit" class="button button-save">'.$langs->trans('Save').'</button>';
|
||||||
print ' <a class="button button-cancel" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'">'.$langs->trans('Cancel').'</a>';
|
print ' <a class="button button-cancel" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'">'.$langs->trans('Cancel').'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
@ -654,7 +656,7 @@ if (empty($customerSystems)) {
|
||||||
// Tree view
|
// Tree view
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<div style="margin-bottom:15px;">';
|
print '<div style="margin-bottom:15px;">';
|
||||||
print '<a class="button" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'&action=create">';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&system='.$systemId.'&action=create">';
|
||||||
print '<i class="fa fa-plus"></i> '.$langs->trans('AddElement');
|
print '<i class="fa fa-plus"></i> '.$langs->trans('AddElement');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
|
||||||
16
tabs/contact_favoriteproducts.php
Normal file → Executable file
16
tabs/contact_favoriteproducts.php
Normal file → Executable file
|
|
@ -100,11 +100,11 @@ if ($action == 'delete' && $permissiontodelete) {
|
||||||
|
|
||||||
if ($action == 'updateqty' && $permissiontoadd) {
|
if ($action == 'updateqty' && $permissiontoadd) {
|
||||||
$favid = GETPOSTINT('favid');
|
$favid = GETPOSTINT('favid');
|
||||||
$qty = GETPOSTFLOAT('qty');
|
$qty = GETPOST('qty', 'alpha');
|
||||||
|
|
||||||
if ($favid > 0 && $qty > 0) {
|
if ($favid > 0 && is_numeric($qty)) {
|
||||||
$favoriteProduct->fetch($favid);
|
$favoriteProduct->fetch($favid);
|
||||||
$favoriteProduct->qty = $qty;
|
$favoriteProduct->qty = (float) $qty;
|
||||||
$result = $favoriteProduct->update($user);
|
$result = $favoriteProduct->update($user);
|
||||||
}
|
}
|
||||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$id);
|
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$id);
|
||||||
|
|
@ -151,8 +151,10 @@ if ($action == 'confirm_generateorder' && $confirm == 'yes' && $permissiontoadd)
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Use Dolibarr standard button classes
|
||||||
|
|
||||||
$title = $langs->trans('FavoriteProducts').' - '.$object->getFullName($langs);
|
$title = $langs->trans('FavoriteProducts').' - '.$object->getFullName($langs);
|
||||||
llxHeader('', $title);
|
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233'));
|
||||||
|
|
||||||
// Fetch favorites for this contact
|
// Fetch favorites for this contact
|
||||||
$favorites = $favoriteProduct->fetchAllByContact($id);
|
$favorites = $favoriteProduct->fetchAllByContact($id);
|
||||||
|
|
@ -198,7 +200,7 @@ if ($permissiontoadd) {
|
||||||
|
|
||||||
print '<div style="display:flex;align-items:center;gap:10px;">';
|
print '<div style="display:flex;align-items:center;gap:10px;">';
|
||||||
print '<label for="qty">'.$langs->trans('Qty').':</label>';
|
print '<label for="qty">'.$langs->trans('Qty').':</label>';
|
||||||
print '<input type="number" name="qty" id="qty" value="1" min="0.01" step="1" class="flat" style="width:80px;">';
|
print '<input type="number" name="qty" id="qty" value="1" step="any" class="flat" style="width:80px;">';
|
||||||
print '<button type="submit" class="button">'.$langs->trans('Add').'</button>';
|
print '<button type="submit" class="button">'.$langs->trans('Add').'</button>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
@ -281,7 +283,7 @@ if (is_array($favorites) && count($favorites) > 0) {
|
||||||
print '<td class="center nowraponall">';
|
print '<td class="center nowraponall">';
|
||||||
print '<div style="display:inline-flex;align-items:stretch;gap:0;">';
|
print '<div style="display:inline-flex;align-items:stretch;gap:0;">';
|
||||||
print '<input type="text" name="quantities['.$fav->id.']" value="'.$qtyDisplay.'" class="flat kundenkarte-favorites-qty" style="width:60px;text-align:center;border-radius:4px 0 0 4px;border-right:none;" data-fav-id="'.$fav->id.'">';
|
print '<input type="text" name="quantities['.$fav->id.']" value="'.$qtyDisplay.'" class="flat kundenkarte-favorites-qty" style="width:60px;text-align:center;border-radius:4px 0 0 4px;border-right:none;" data-fav-id="'.$fav->id.'">';
|
||||||
print '<button type="button" class="button kundenkarte-qty-save" data-fav-id="'.$fav->id.'" title="'.$langs->trans('Save').'" style="border-radius:0 4px 4px 0;padding:0 8px;margin:0;"><i class="fa fa-save"></i></button>';
|
print '<button type="button" class="button small kundenkarte-qty-save" data-fav-id="'.$fav->id.'" title="'.$langs->trans('Save').'" style="border-radius:0 4px 4px 0;padding:0 8px;margin:0;"><i class="fa fa-save"></i></button>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|
@ -322,7 +324,7 @@ if (is_array($favorites) && count($favorites) > 0) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<button type="submit" class="button" id="btn-generate-order" data-text="'.$langs->trans('GenerateOrder').' (%d)" data-text-none="'.$langs->trans('GenerateOrder').'">';
|
print '<button type="submit" class="butAction" id="btn-generate-order" data-text="'.$langs->trans('GenerateOrder').' (%d)" data-text-none="'.$langs->trans('GenerateOrder').'">';
|
||||||
print $langs->trans('GenerateOrder');
|
print $langs->trans('GenerateOrder');
|
||||||
print '</button>';
|
print '</button>';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,11 @@ if ($action == 'delete' && $permissiontodelete) {
|
||||||
|
|
||||||
if ($action == 'updateqty' && $permissiontoadd) {
|
if ($action == 'updateqty' && $permissiontoadd) {
|
||||||
$favid = GETPOSTINT('favid');
|
$favid = GETPOSTINT('favid');
|
||||||
$qty = GETPOSTFLOAT('qty');
|
$qty = GETPOST('qty', 'alpha');
|
||||||
|
|
||||||
if ($favid > 0 && $qty > 0) {
|
if ($favid > 0 && is_numeric($qty)) {
|
||||||
$favoriteProduct->fetch($favid);
|
$favoriteProduct->fetch($favid);
|
||||||
$favoriteProduct->qty = $qty;
|
$favoriteProduct->qty = (float) $qty;
|
||||||
$result = $favoriteProduct->update($user);
|
$result = $favoriteProduct->update($user);
|
||||||
}
|
}
|
||||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$id);
|
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$id);
|
||||||
|
|
@ -150,8 +150,10 @@ if ($action == 'confirm_generateorder' && $confirm == 'yes' && $permissiontoadd)
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Use Dolibarr standard button classes
|
||||||
|
|
||||||
$title = $langs->trans('FavoriteProducts').' - '.$object->name;
|
$title = $langs->trans('FavoriteProducts').' - '.$object->name;
|
||||||
llxHeader('', $title);
|
llxHeader('', $title, '', '', 0, 0, array('/kundenkarte/js/kundenkarte.js?v=1769963241'), array('/kundenkarte/css/kundenkarte.css?v=1769964233'));
|
||||||
|
|
||||||
// Fetch favorites
|
// Fetch favorites
|
||||||
$favorites = $favoriteProduct->fetchAllBySociete($id);
|
$favorites = $favoriteProduct->fetchAllBySociete($id);
|
||||||
|
|
@ -197,7 +199,7 @@ if ($permissiontoadd) {
|
||||||
|
|
||||||
print '<div style="display:flex;align-items:center;gap:10px;">';
|
print '<div style="display:flex;align-items:center;gap:10px;">';
|
||||||
print '<label for="qty">'.$langs->trans('Qty').':</label>';
|
print '<label for="qty">'.$langs->trans('Qty').':</label>';
|
||||||
print '<input type="number" name="qty" id="qty" value="1" min="0.01" step="1" class="flat" style="width:80px;">';
|
print '<input type="number" name="qty" id="qty" value="1" step="any" class="flat" style="width:80px;">';
|
||||||
print '<button type="submit" class="button">'.$langs->trans('Add').'</button>';
|
print '<button type="submit" class="button">'.$langs->trans('Add').'</button>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
@ -281,7 +283,7 @@ if (is_array($favorites) && count($favorites) > 0) {
|
||||||
print '<td class="center nowraponall">';
|
print '<td class="center nowraponall">';
|
||||||
print '<div style="display:inline-flex;align-items:stretch;gap:0;">';
|
print '<div style="display:inline-flex;align-items:stretch;gap:0;">';
|
||||||
print '<input type="text" name="quantities['.$fav->id.']" value="'.$qtyDisplay.'" class="flat kundenkarte-favorites-qty" style="width:60px;text-align:center;border-radius:4px 0 0 4px;border-right:none;" data-fav-id="'.$fav->id.'">';
|
print '<input type="text" name="quantities['.$fav->id.']" value="'.$qtyDisplay.'" class="flat kundenkarte-favorites-qty" style="width:60px;text-align:center;border-radius:4px 0 0 4px;border-right:none;" data-fav-id="'.$fav->id.'">';
|
||||||
print '<button type="button" class="button kundenkarte-qty-save" data-fav-id="'.$fav->id.'" title="'.$langs->trans('Save').'" style="border-radius:0 4px 4px 0;padding:0 8px;margin:0;"><i class="fa fa-save"></i></button>';
|
print '<button type="button" class="button small kundenkarte-qty-save" data-fav-id="'.$fav->id.'" title="'.$langs->trans('Save').'" style="border-radius:0 4px 4px 0;padding:0 8px;margin:0;"><i class="fa fa-save"></i></button>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|
@ -322,7 +324,7 @@ if (is_array($favorites) && count($favorites) > 0) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<button type="submit" class="button" id="btn-generate-order" data-text="'.$langs->trans('GenerateOrder').' (%d)" data-text-none="'.$langs->trans('GenerateOrder').'">';
|
print '<button type="submit" class="butAction" id="btn-generate-order" data-text="'.$langs->trans('GenerateOrder').' (%d)" data-text-none="'.$langs->trans('GenerateOrder').'">';
|
||||||
print $langs->trans('GenerateOrder');
|
print $langs->trans('GenerateOrder');
|
||||||
print '</button>';
|
print '</button>';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue