Example #1
0
 // Statut
 print '<tr><td>' . $langs->trans("Status") . '</td>';
 print '<td>';
 print $object->getLibStatut(4);
 print '</td></tr>';
 // Categories
 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
     print '<tr><td>' . fieldLabel('Categories', 'contcats') . '</td>';
     print '<td colspan="3">';
     $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1);
     $c = new Categorie($db);
     $cats = $c->containing($object->id, Categorie::TYPE_CONTACT);
     foreach ($cats as $cat) {
         $arrayselected[] = $cat->id;
     }
     print $form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
     print "</td></tr>";
 }
 // Other attributes
 $parameters = array('colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     print $object->showOptionals($extrafields, 'edit');
 }
 $object->load_ref_elements();
 if (!empty($conf->commande->enabled)) {
     print '<tr><td>' . $langs->trans("ContactForOrders") . '</td><td colspan="3">';
     print $object->ref_commande ? $object->ref_commande : $langs->trans("NoContactForAnyOrder");
     print '</td></tr>';
 }
Example #2
0
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     print $object->showOptionals($extrafields, 'edit', $parameters);
 }
 // Note (private, no output on invoices, propales...)
 print '<tr><td class="tdtop">' . $langs->trans("NoteNotVisibleOnBill") . '</td><td colspan="3">';
 // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
 $doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, '80%');
 $doleditor->Create();
 print "</td></tr>";
 if ($conf->categorie->enabled) {
     // Categories
     print '<tr><td>' . $langs->trans("Categories") . '</td><td colspan="3">';
     $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
     print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
     print "</td></tr>";
 }
 print '</table>';
 print '<br>';
 if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
     // We do no show price array on create when multiprices enabled.
     // We must set them on prices tab.
 } else {
     print '<table class="border" width="100%">';
     // Price
     print '<tr><td>' . $langs->trans("SellingPrice") . '</td>';
     print '<td><input name="price" size="10" value="' . $object->price . '">';
     print $form->selectPriceBaseType($object->price_base_type, "price_base_type");
     print '</td></tr>';
     // Min price
 /**
  *  Output html select list of type of event
  *
  *  @param	string		$selected       Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
  *  @param  string		$htmlname       Nom champ formulaire
  *  @param	string		$excludetype	A type to exclude ('systemauto', 'system', '')
  *  @param	string		$onlyautoornot	1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
  *  @param	int		    $hideinfohelp	1=Do not show info help
  *  @param  int		    $multiselect    1=Allow multiselect of action type
  * 	@return	void
  */
 function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0)
 {
     global $langs, $user, $form, $conf;
     if (!is_object($form)) {
         $form = new Form($db);
     }
     require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
     require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
     $caction = new CActionComm($this->db);
     // Suggest a list with manual events or all auto events
     $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
     array_unshift($arraylist, '&nbsp;');
     // Add empty line at start
     //asort($arraylist);
     if ($selected == 'manual') {
         $selected = 'AC_OTH';
     }
     if ($selected == 'auto') {
         $selected = 'AC_OTH_AUTO';
     }
     if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) {
         unset($arraylist['AC_OTH_AUTO']);
     }
     if (!empty($multiselect)) {
         if (!is_array($selected) && !empty($selected)) {
             $selected = explode(',', $selected);
         }
         print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
     } else {
         print $form->selectarray($htmlname, $arraylist, $selected);
     }
     if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) {
         print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
     }
 }
}
print '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="right" width="300">';
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_SHIPPABLEORDER_SPECIFIC_WAREHOUSE">';
dol_include_once('/product/class/html.formproduct.class.php');
$formDoli = new Form($db);
$formprod = new FormProduct($db);
$formprod->loadWarehouses();
$TWareHouse = array();
foreach ($formprod->cache_warehouses as $id => $ent) {
    $TWareHouse[$id] = $ent['label'];
}
echo $formDoli->multiselectarray('SHIPPABLEORDER_SPECIFIC_WAREHOUSE', $TWareHouse, explode(',', $conf->global->SHIPPABLEORDER_SPECIFIC_WAREHOUSE));
print '<input type="submit" ' . ($ent_by_user_activated ? 'disabled="disabled"' : '') . ' class="button" value="' . $langs->trans("Modify") . '">';
print '</form>';
print '</td></tr>';
// Entrepot par utilisateur
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("EntrepotByUser") . '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="right" width="300">';
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_SHIPPABLEORDER_ENTREPOT_BY_USER">';
print $formdoli->selectyesno("SHIPPABLEORDER_ENTREPOT_BY_USER", $conf->global->SHIPPABLEORDER_ENTREPOT_BY_USER, 1);
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
print '</form>';
Example #5
0
$selected = 3;
print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1);
print '<br><br>';
print "Test 4b: a select<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
$selected = 3;
print $form->selectarray('testselectb', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1);
print '<br><br>' . "\n";
print "Test 4c: Select array with no js forced<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
print $form->selectarray('selectarray', $array);
print '<br><br>' . "\n";
print "Test 4d: a select with ajax refresh and with onchange call of url<br>\n";
$selected = -1;
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT . '/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1);
print '<br><br>' . "\n";
// Test5a: form->select_thirdparty
print "Test 5a: Select thirdparty<br>\n";
print $form->select_company(0, 'thirdpartytest');
print '<br><br>' . "\n";
// Test5b: form->select_product
print "Test 5b: Select product (using ajax)<br>\n";
$form->select_produits(0, 'producttest');
print '<br><br>' . "\n";
// Test5c: a multiselect
print "Test 5c: a multiselect<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
$arrayselected = array(1, 3);
print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250);
llxFooter();
$db->close();
Example #6
0
 // Incoterms
 if (!empty($conf->incoterm->enabled)) {
     print '<tr>';
     print '<td>' . fieldLabel('IncotermLabel', 'incoterm_id') . '</td>';
     print '<td colspan="3" class="maxwidthonsmartphone">';
     print $form->select_incoterms(!empty($object->fk_incoterms) ? $object->fk_incoterms : '', !empty($object->location_incoterms) ? $object->location_incoterms : '');
     print '</td></tr>';
 }
 // Categories
 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
     $langs->load('categories');
     // Customer
     if ($object->prospect || $object->client) {
         print '<tr><td class="toptd">' . fieldLabel('CustomersCategoriesShort', 'custcats') . '</td><td colspan="3">';
         $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
         print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
         print "</td></tr>";
     }
     // Supplier
     if ($object->fournisseur) {
         print '<tr><td class="toptd">' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '</td><td colspan="3">';
         $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1);
         print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%");
         print "</td></tr>";
     }
 }
 // Other attributes
 $parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
Example #7
0
 if (!empty($conf->skype->enabled)) {
     print '<tr><td>' . $langs->trans("Skype") . '</td><td><input type="text" name="member_skype" size="40" value="' . (GETPOST('member_skype', 'alpha') ? GETPOST('member_skype', 'alpha') : $object->skype) . '"></td></tr>';
 }
 // Birthday
 print "<tr><td>" . $langs->trans("Birthday") . "</td><td>\n";
 $form->select_date($object->birth ? $object->birth : -1, 'birth', '', '', 1, 'formsoc');
 print "</td></tr>\n";
 // Public profil
 print "<tr><td>" . $langs->trans("Public") . "</td><td>\n";
 print $form->selectyesno("public", $object->public, 1);
 print "</td></tr>\n";
 // Categories
 if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
     print '<tr><td>' . fieldLabel('Categories', 'memcars') . '</td><td>';
     $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
     print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
     print "</td></tr>";
 }
 // Other attributes
 $parameters = array();
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     print $object->showOptionals($extrafields, 'edit');
 }
 /*
  // Third party Dolibarr
 if (! empty($conf->societe->enabled))
 {
 print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">';
 print $form->select_company($object->fk_soc,'socid','',1);