private function init(&$TParam)
 {
     if (!isset($TParam['hide'])) {
         $TParam['hide'] = array();
     }
     if (!isset($TParam['link'])) {
         $TParam['link'] = array();
     }
     if (!isset($TParam['subQuery'])) {
         $TParam['subQuery'] = array();
     }
     if (!isset($TParam['type'])) {
         $TParam['type'] = array();
     }
     if (!isset($TParam['orderby']['noOrder'])) {
         $TParam['orderby']['noOrder'] = array();
     }
     if (!isset($TParam['node'])) {
         $TParam['node'] = array('main' => 'data', 'object' => 'dataline');
     }
     if (!isset($TParam['liste'])) {
         $TParam['liste'] = array();
     }
     $TParam['liste'] = array_merge(array('messageNothing' => "Il n'y a aucun élément à afficher.", 'picto_precedent' => '<', 'picto_suivant' => '>', 'order_down' => img_down(), 'order_up' => img_up(), 'noheader' => 0, 'image' => '', 'titre' => 'Liste', 'orderDown' => '', 'orderUp' => '', 'id' => $this->id, 'picto_search' => img_picto('Search', 'search.png'), 'head_search' => '', 'export' => array()), $TParam['liste']);
     if (!isset($TParam['limit'])) {
         $TParam['limit'] = array();
     }
     if (!empty($_REQUEST['TListTBS'][$this->id]['page'])) {
         $TParam['limit']['page'] = $_REQUEST['TListTBS'][$this->id]['page'];
     }
     $TParam['limit'] = array_merge(array('page' => 1, 'nbLine' => 30), $TParam['limit']);
     if (!empty($_REQUEST['TListTBS'][$this->id]['orderBy'])) {
         /*
         	$TParam['orderBy'] = array();	
         				foreach($_REQUEST['TListTBS'][$this->id]['orderBy'] as $asc=>$field) {
         					$TParam['orderBy'][$field]=$asc;
         				}
         */
         $TParam['orderBy'] = $_REQUEST['TListTBS'][$this->id]['orderBy'];
     }
     //	print_r($TParam);
 }
示例#2
0
     print '<td>';
     $text = $langs->trans($objexport->array_export_fields[0][$code]);
     $tablename = getablenamefromfield($code, $sqlmaxforexport);
     $htmltext = '<b>' . $langs->trans("Name") . ":</b> " . $text . '<br>';
     $htmltext .= '<b>' . $langs->trans("Table") . " -> " . $langs->trans("Field") . ":</b> " . $tablename . " -> " . preg_replace('/^.*\\./', '', $code) . "<br>";
     if (!empty($objexport->array_export_examplevalues[0][$code])) {
         $htmltext .= $langs->trans("SourceExample") . ': <b>' . $objexport->array_export_examplevalues[0][$code] . '</b><br>';
     }
     print $form->textwithpicto($text, $htmltext);
     //print ' ('.$code.')';
     print '</td>';
     print '<td align="right" width="100">';
     print $value . ' ';
     print '</td><td align="center" width="20">';
     if ($value < count($array_selected)) {
         print '<a href="' . $_SERVER["PHP_SELF"] . '?step=' . $step . '&datatoexport=' . $datatoexport . '&action=downfield&field=' . $code . '">' . img_down() . '</a>';
     }
     if ($value > 1) {
         print '<a href="' . $_SERVER["PHP_SELF"] . '?step=' . $step . '&datatoexport=' . $datatoexport . '&action=upfield&field=' . $code . '">' . img_up() . '</a>';
     }
     print '</td>';
     //print '<td>&nbsp;</td>';
     //print '<td>'.$langs->trans($objexport->array_export_fields[0][$code]).'</td>';
     print '</tr>';
 }
 print '</table>';
 print '</div>';
 /*
  * Barre d'action
  *
  */
示例#3
0
         print '</a>';
         print '</td>';
         print '<td align="center">';
         print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=ask_deleteline&amp;line_id=' . $objp->rowid . '">';
         print img_delete();
         print '</a></td>';
         if ($num > 1) {
             print '<td align="center">';
             if ($i > 0) {
                 print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=up&amp;line_id=' . $objp->rowid . '">';
                 print img_up();
                 print '</a>';
             }
             if ($i < $num - 1) {
                 print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=down&amp;line_id=' . $objp->rowid . '">';
                 print img_down();
                 print '</a>';
             }
             print '</td>';
         }
     } else {
         print '<td colspan="3">&nbsp;</td>';
     }
     print '</tr>';
     $line = new FichinterLigne($db);
     $line->fetch($objp->rowid);
     $extrafieldsline = new ExtraFields($db);
     $extralabelslines = $extrafieldsline->fetch_name_optionals_label($line->table_element);
     $line->fetch_optionals($line->rowid, $extralabelslines);
     print $line->showOptionals($extrafieldsline, 'view', array('style' => $bc[$var], 'colspan' => 5));
 }
示例#4
0
		<?php 
            echo img_up('default', 0, 'imgupforline');
            ?>
		</a>
		<?php 
        }
        ?>
		<?php 
        if ($i < $num - 1) {
            ?>
		<a class="lineupdown" href="<?php 
            echo $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=down&amp;rowid=' . $line->id;
            ?>
">
		<?php 
            echo img_down('default', 0, 'imgdownforline');
            ?>
		</a>
		<?php 
        }
        ?>
	</td>
    <?php 
    } else {
        ?>
    <td align="center"<?php 
        echo empty($conf->browser->phone) ? ' class="linecolmove tdlineupdown"' : ' class="linecolmove"';
        ?>
><?php 
        $coldisplay++;
        ?>
		<?php 
            echo img_up();
            ?>
		</a>
		<?php 
        }
        ?>
		<?php 
        if ($i < $num - 1) {
            ?>
		<a class="lineupdown" href="<?php 
            echo $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=down&amp;rowid=' . $line->id;
            ?>
">
		<?php 
            echo img_down();
            ?>
		</a>
		<?php 
        }
        ?>
	</td>
    <?php 
    } else {
        ?>
    <td align="center"<?php 
        echo empty($conf->browser->phone) ? ' class="tdlineupdown"' : '';
        ?>
><?php 
        $coldisplay++;
        ?>
示例#6
0
function form_constantes($tableau)
{
    global $db, $bc, $langs, $conf, $_Avery_Labels;
    $form = new Form($db);
    print '<table class="noborder" width="100%">';
    print '<tr class="liste_titre">';
    print '<td>' . $langs->trans("Description") . '</td>';
    print '<td>' . $langs->trans("Value") . '*</td>';
    print '<td>&nbsp;</td>';
    print '<td align="center" width="80">' . $langs->trans("Action") . '</td>';
    print "</tr>\n";
    $var = true;
    $listofparam = array();
    foreach ($tableau as $const) {
        $sql = "SELECT ";
        $sql .= "rowid";
        $sql .= ", " . $db->decrypt('name') . " as name";
        $sql .= ", " . $db->decrypt('value') . " as value";
        $sql .= ", type";
        $sql .= ", note";
        $sql .= " FROM " . MAIN_DB_PREFIX . "const";
        $sql .= " WHERE " . $db->decrypt('name') . " = '" . $const . "'";
        $sql .= " AND entity in (0, " . $conf->entity . ")";
        $sql .= " ORDER BY name ASC, entity DESC";
        $result = $db->query($sql);
        dol_syslog("List params sql=" . $sql);
        if ($result) {
            $obj = $db->fetch_object($result);
            // Take first result of select
            $var = !$var;
            print "\n" . '<form action="adherent.php" method="POST">';
            print "<tr " . $bc[$var] . ">";
            // Affiche nom constante
            print '<td>';
            print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
            print '<input type="hidden" name="action" value="update">';
            print '<input type="hidden" name="rowid" value="' . $rowid . '">';
            print '<input type="hidden" name="constname" value="' . $const . '">';
            print '<input type="hidden" name="constnote" value="' . nl2br($obj->note) . '">';
            print $langs->trans("Desc" . $const) != "Desc" . $const ? $langs->trans("Desc" . $const) : ($obj->note ? $obj->note : $const);
            if ($const == 'ADHERENT_MAILMAN_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick1">' . img_down() . '</a><br>';
                //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1';
                print '<div id="example1" class="hidden">';
                print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&adminpw=%MAILMAN_ADMINPW%&subscribe_or_invite=0&send_welcome_msg_to_this_batch=0&notification_to_list_owner=0';
                print '</div>';
            }
            if ($const == 'ADHERENT_MAILMAN_UNSUB_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick2">' . img_down() . '</a><br>';
                print '<div id="example2" class="hidden">';
                print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?unsubscribees_upload=%EMAIL%&adminpw=%MAILMAN_ADMINPW%&send_unsub_ack_to_this_batch=0&send_unsub_notifications_to_list_owner=0';
                print '</div>';
                //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            print "</td>\n";
            if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') {
                print '<td>';
                // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
                require_once DOL_DOCUMENT_ROOT . '/lib/format_cards.lib.php';
                $arrayoflabels = array();
                foreach (array_keys($_Avery_Labels) as $codecards) {
                    $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
                }
                print $form->selectarray('constvalue', $arrayoflabels, $obj->value ? $obj->value : 'CARD', 1, 0, 0);
                print '</td><td>';
                print '<input type="hidden" name="consttype" value="yesno">';
                print '</td>';
            } else {
                print '<td>';
                //print 'aa'.$const;
                if (in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT'))) {
                    print '<textarea class="flat" name="constvalue" cols="35" rows="5" wrap="soft">' . "\n";
                    print $obj->value;
                    print "</textarea>\n";
                    print '</td><td>';
                    print '<input type="hidden" name="consttype" value="texte">';
                } else {
                    if (in_array($const, array('ADHERENT_AUTOREGISTER_MAIL', 'ADHERENT_MAIL_VALID', 'ADHERENT_MAIL_COTIS', 'ADHERENT_MAIL_RESIL'))) {
                        require_once DOL_DOCUMENT_ROOT . "/lib/doleditor.class.php";
                        $doleditor = new DolEditor('constvalue_' . $const, $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, 5, 60);
                        $doleditor->Create();
                        print '</td><td>';
                        print '<input type="hidden" name="consttype" value="texte">';
                    } else {
                        if ($obj->type == 'yesno') {
                            print $form->selectyesno('constvalue', $obj->value, 1);
                            print '</td><td>';
                            print '<input type="hidden" name="consttype" value="yesno">';
                        } else {
                            print '<input type="text" class="flat" size="48" name="constvalue" value="' . $obj->value . '">';
                            print '</td><td>';
                            print '<input type="hidden" name="consttype" value="chaine">';
                        }
                    }
                }
                print '</td>';
            }
            print '<td align="center">';
            print '<input type="submit" class="button" value="' . $langs->trans("Update") . '" name="Button"> &nbsp;';
            // print '<a href="adherent.php?name='.$const.'&action=unset">'.img_delete().'</a>';
            print "</td>";
            print "</tr>\n";
            print "</form>\n";
            $i++;
        }
    }
    print '</table>';
}
示例#7
0
/**
 *	Show title line of an array
 *	@param	    name        Label of field
 *	@param	    file        Url used when we click on sort picto
 *	@param	    field       Field to use for new sorting
 *	@param	    begin       ("" by defaut)
 *	@param	    moreparam   Add more parameters on sort url links ("" by default)
 *	@param      td          Options of attribute td ("" by defaut)
 *	@param      sortfield   Current field used to sort
 *	@param      sortorder   Current sort order
 */
function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $moreparam = "", $td = "", $sortfield = "", $sortorder = "")
{
    global $conf;
    //print "$name, $file, $field, $begin, $options, $td, $sortfield, $sortorder<br>\n";
    // Le champ de tri est mis en evidence.
    // Exemple si (sortfield,field)=("nom","xxx.nom") ou (sortfield,field)=("nom","nom")
    if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\\.]+\\./", "", $field))) {
        print '<td class="liste_titre_sel" ' . $td . '>';
    } else {
        print '<td class="liste_titre" ' . $td . '>';
    }
    print $name;
    // If this is a sort field
    if ($field) {
        $options = preg_replace('/sortfield=([a-zA-Z0-9,\\s\\.]+)/i', '', $moreparam);
        $options = preg_replace('/sortorder=([a-zA-Z0-9,\\s\\.]+)/i', '', $options);
        $options = preg_replace('/&+/i', '&', $options);
        if (!preg_match('/^&/', $options)) {
            $options = '&' . $options;
        }
        //print "&nbsp;";
        print '<img width="2" src="' . DOL_URL_ROOT . '/theme/common/transparent.png" alt="">';
        if (!$sortorder) {
            print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 0) . '</a>';
            print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 0) . '</a>';
        } else {
            if ($field != $sortfield) {
                print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 0) . '</a>';
                print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 0) . '</a>';
            } else {
                $sortorder = strtoupper($sortorder);
                if ($sortorder == 'DESC') {
                    print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 0) . '</a>';
                    print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 1) . '</a>';
                }
                if ($sortorder == 'ASC') {
                    print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 1) . '</a>';
                    print '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 0) . '</a>';
                }
            }
        }
    }
    print "</td>";
}
示例#8
0
/**
 *	Show array with constants to edit
 *
 *	@param	array	$tableau		Array of constants
 *	@param	int		$strictw3c		0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all
 *	@return	void
 */
function form_constantes($tableau, $strictw3c = 0)
{
    global $db, $bc, $langs, $conf, $_Avery_Labels;
    $form = new Form($db);
    if (!empty($strictw3c) && $strictw3c == 1) {
        print "\n" . '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
    }
    print '<table class="noborder" width="100%">';
    print '<tr class="liste_titre">';
    print '<td>' . $langs->trans("Description") . '</td>';
    print '<td>' . $langs->trans("Value") . '*</td>';
    if (empty($strictw3c)) {
        print '<td align="center" width="80">' . $langs->trans("Action") . '</td>';
    }
    print "</tr>\n";
    $var = true;
    $listofparam = array();
    foreach ($tableau as $const) {
        $sql = "SELECT ";
        $sql .= "rowid";
        $sql .= ", " . $db->decrypt('name') . " as name";
        $sql .= ", " . $db->decrypt('value') . " as value";
        $sql .= ", type";
        $sql .= ", note";
        $sql .= " FROM " . MAIN_DB_PREFIX . "const";
        $sql .= " WHERE " . $db->decrypt('name') . " = '" . $const . "'";
        $sql .= " AND entity IN (0, " . $conf->entity . ")";
        $sql .= " ORDER BY name ASC, entity DESC";
        $result = $db->query($sql);
        dol_syslog("List params", LOG_DEBUG);
        if ($result) {
            $obj = $db->fetch_object($result);
            // Take first result of select
            $var = !$var;
            // For avoid warning in strict mode
            if (empty($obj)) {
                $obj = (object) array('rowid' => '', 'name' => '', 'value' => '', 'type' => '', 'note' => '');
            }
            if (empty($strictw3c)) {
                print "\n" . '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
            }
            print "<tr " . $bc[$var] . ">";
            // Show constant
            print '<td>';
            print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
            print '<input type="hidden" name="action" value="update">';
            print '<input type="hidden" name="rowid' . (empty($strictw3c) ? '' : '[]') . '" value="' . $obj->rowid . '">';
            print '<input type="hidden" name="constname' . (empty($strictw3c) ? '' : '[]') . '" value="' . $const . '">';
            print '<input type="hidden" name="constnote' . (empty($strictw3c) ? '' : '[]') . '" value="' . nl2br(dol_escape_htmltag($obj->note)) . '">';
            print $langs->trans('Desc' . $const);
            if ($const == 'ADHERENT_MAILMAN_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick1">' . img_down() . '</a><br>';
                //print 'http://lists.exampe.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1';
                print '<div id="example1" class="hidden">';
                print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;subscribe_or_invite=0&amp;send_welcome_msg_to_this_batch=0&amp;notification_to_list_owner=0';
                print '</div>';
            }
            if ($const == 'ADHERENT_MAILMAN_UNSUB_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick2">' . img_down() . '</a><br>';
                print '<div id="example2" class="hidden">';
                print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?unsubscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;send_unsub_ack_to_this_batch=0&amp;send_unsub_notifications_to_list_owner=0';
                print '</div>';
                //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            if ($const == 'ADHERENT_MAILMAN_LISTS') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick3">' . img_down() . '</a><br>';
                print '<div id="example3" class="hidden">';
                print 'mymailmanlist<br>';
                print 'mymailmanlist1,mymailmanlist2<br>';
                print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2<br>';
                if ($conf->categorie->enabled) {
                    print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2<br>';
                }
                print '</div>';
                //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            print "</td>\n";
            // Value
            if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') {
                print '<td>';
                // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
                require_once DOL_DOCUMENT_ROOT . '/core/lib/format_cards.lib.php';
                $arrayoflabels = array();
                foreach (array_keys($_Avery_Labels) as $codecards) {
                    $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
                }
                print $form->selectarray('constvalue' . (empty($strictw3c) ? '' : '[]'), $arrayoflabels, $obj->value ? $obj->value : 'CARD', 1, 0, 0);
                print '<input type="hidden" name="consttype" value="yesno">';
                print '</td>';
            } else {
                print '<td>';
                if (in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_ETIQUETTE_TEXT'))) {
                    print '<textarea class="flat" name="constvalue' . (empty($strictw3c) ? '' : '[]') . '" cols="50" rows="5" wrap="soft">' . "\n";
                    print $obj->value;
                    print "</textarea>\n";
                    print '<input type="hidden" name="consttype" value="texte">';
                } else {
                    if (in_array($const, array('ADHERENT_AUTOREGISTER_NOTIF_MAIL', 'ADHERENT_AUTOREGISTER_MAIL', 'ADHERENT_MAIL_VALID', 'ADHERENT_MAIL_COTIS', 'ADHERENT_MAIL_RESIL'))) {
                        require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                        $doleditor = new DolEditor('constvalue_' . $const . (empty($strictw3c) ? '' : '[]'), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, 5, 60);
                        $doleditor->Create();
                        print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="texte">';
                    } else {
                        if ($obj->type == 'yesno') {
                            print $form->selectyesno('constvalue' . (empty($strictw3c) ? '' : '[]'), $obj->value, 1);
                            print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="yesno">';
                        } else {
                            print '<input type="text" class="flat" size="48" name="constvalue' . (empty($strictw3c) ? '' : '[]') . '" value="' . dol_escape_htmltag($obj->value) . '">';
                            print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="chaine">';
                        }
                    }
                }
                print '</td>';
            }
            // Submit
            if (empty($strictw3c)) {
                print '<td align="center">';
                print '<input type="submit" class="button" value="' . $langs->trans("Update") . '" name="Button">';
                print "</td>";
            }
            print "</tr>\n";
            if (empty($strictw3c)) {
                print "</form>\n";
            }
        }
    }
    print '</table>';
    if (!empty($strictw3c) && $strictw3c == 1) {
        print '<div align="center"><input type="submit" class="button" value="' . $langs->trans("Update") . '" name="update"></div>';
        print "</form>\n";
    }
}
示例#9
0
    }
    print '</td>';
    print '<td>';
    if ($box->note == '(WarningUsingThisBoxSlowDown)') {
        $langs->load("errors");
        print img_warning('', 0) . ' ' . $langs->trans("WarningUsingThisBoxSlowDown");
    } else {
        print $box->note ? $box->note : '&nbsp;';
    }
    print '</td>';
    print '<td align="center">' . (empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])) . '</td>';
    $hasnext = $key < count($boxactivated) - 1;
    $hasprevious = $key != 0;
    print '<td align="center">' . ($key + 1) . '</td>';
    print '<td align="center">';
    print $hasnext ? '<a href="boxes.php?action=switch&amp;switchfrom=' . $box->rowid . '&amp;switchto=' . $boxactivated[$key + 1]->rowid . '">' . img_down() . '</a>&nbsp;' : '';
    print $hasprevious ? '<a href="boxes.php?action=switch&amp;switchfrom=' . $box->rowid . '&amp;switchto=' . $boxactivated[$key - 1]->rowid . '">' . img_up() . '</a>' : '';
    print '</td>';
    print '<td align="center">';
    print '<a href="boxes.php?rowid=' . $box->rowid . '&amp;action=delete">' . img_delete() . '</a>';
    print '</td>';
    print '</tr>' . "\n";
}
print '</table><br>';
// Other parameters
print "\n\n" . '<!-- Other Const -->' . "\n";
print_titre($langs->trans("Other"));
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="addconst">';
print '<table class="noborder" width="100%">';
示例#10
0
文件: boxes.php 项目: netors/dolibarr
     print '<td>' . img_object("", $logo) . ' ' . $box->boxlabel . '</td>';
     print '<td>' . ($obj->note ? $obj->note : '&nbsp;') . '</td>';
     print '<td align="center">' . $pos_name[$obj->position] . '</td>';
     $hasnext = true;
     $hasprevious = true;
     if ($foundrupture) {
         $hasprevious = false;
         $foundrupture = 0;
     }
     if (!$objnext || $obj->position != $objnext->position) {
         $hasnext = false;
         $foundrupture = 1;
     }
     print '<td align="center">' . $box_order . '</td>';
     print '<td align="center">';
     print $hasnext ? '<a href="boxes.php?action=switch&switchfrom=' . $obj->rowid . '&switchto=' . $objnext->rowid . '">' . img_down() . '</a>&nbsp;' : '';
     print $hasprevious ? '<a href="boxes.php?action=switch&switchfrom=' . $obj->rowid . '&switchto=' . $objprevious->rowid . '">' . img_up() . '</a>' : '';
     print '</td>';
     print '<td align="center">';
     print '<a href="boxes.php?rowid=' . $obj->rowid . '&amp;action=delete">' . img_delete() . '</a>';
     print '</td>';
     print '</tr>' . "\n";
     $i++;
     $box_order++;
     if (!$foundrupture) {
         $objprevious = $obj;
     } else {
         $box_order = 1;
     }
     $obj = $objnext;
 }
	</td>

	<td align="center">
		<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id; ?>">
		<?php echo img_delete(); ?>
		</a>
	</td>

	<?php if ($num > 1) { ?>
	<td align="center" class="tdlineupdown">
		<?php if ($i > 0) { ?>
		<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
		<?php echo img_up(); ?>
		</a>
		<?php } ?>
		<?php if ($i < $num-1) { ?>
		<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
		<?php echo img_down(); ?>
		</a>
		<?php } ?>
	</td>
	<?php } else { ?>
	<td align="center" class="tdlineupdown">&nbsp;</td>
	<?php } ?>
<?php } else { ?>
	<td colspan="3">&nbsp;</td>
<?php } ?>

</tr>
<!-- END PHP TEMPLATE predefinedproductline_view.tpl.php -->
示例#12
0
/**
 *	Get title line of an array
 *
 *	@param	string	$name        Label of field
 *	@param	int		$thead		 0=To use with standard table forat, 1=To use inside <thead><tr>, 2=To use with <div>
 *	@param	string	$file        Url used when we click on sort picto
 *	@param	string	$field       Field to use for new sorting. Empty if this field is not sortable.
 *	@param	string	$begin       ("" by defaut)
 *	@param	string	$moreparam   Add more parameters on sort url links ("" by default)
 *	@param  string	$moreattrib  Add more attributes on th ("" by defaut)
 *	@param  string	$sortfield   Current field used to sort
 *	@param  string	$sortorder   Current sort order
 *	@return	string
 */
function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "")
{
    global $conf;
    //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder<br>\n";
    $sortorder = strtoupper($sortorder);
    $out = '';
    $tag = 'th';
    if ($thead == 2) {
        $tag = 'div';
    }
    // If field is used as sort criteria we use a specific class
    // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
    if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\\.]+\\./", "", $field))) {
        $out .= '<' . $tag . ' class="liste_titre_sel" ' . $moreattrib . '>';
    } else {
        $out .= '<' . $tag . ' class="liste_titre" ' . $moreattrib . '>';
    }
    if (!empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) {
        $options = preg_replace('/sortfield=([a-zA-Z0-9,\\s\\.]+)/i', '', $moreparam);
        $options = preg_replace('/sortorder=([a-zA-Z0-9,\\s\\.]+)/i', '', $options);
        $options = preg_replace('/&+/i', '&', $options);
        if (!preg_match('/^&/', $options)) {
            $options = '&' . $options;
        }
        if ($sortorder == 'DESC') {
            $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">';
        }
        if ($sortorder == 'ASC') {
            $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">';
        }
    }
    $out .= $name;
    if (!empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) {
        $out .= '</a>';
    }
    if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) {
        $options = preg_replace('/sortfield=([a-zA-Z0-9,\\s\\.]+)/i', '', $moreparam);
        $options = preg_replace('/sortorder=([a-zA-Z0-9,\\s\\.]+)/i', '', $options);
        $options = preg_replace('/&+/i', '&', $options);
        if (!preg_match('/^&/', $options)) {
            $options = '&' . $options;
        }
        //print "&nbsp;";
        $out .= '<img width="2" src="' . DOL_URL_ROOT . '/theme/common/transparent.png" alt=""><span class="nowrap">';
        if (!$sortorder || $field != $sortfield) {
            $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 0) . '</a>';
            $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 0) . '</a>';
        } else {
            if ($sortorder == 'DESC') {
                $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 0) . '</a>';
                $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 1) . '</a>';
            }
            if ($sortorder == 'ASC') {
                $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=asc&begin=' . $begin . $options . '">' . img_down("A-Z", 1) . '</a>';
                $out .= '<a href="' . $file . '?sortfield=' . $field . '&sortorder=desc&begin=' . $begin . $options . '">' . img_up("Z-A", 0) . '</a>';
            }
        }
        $out .= '</span>';
    }
    $out .= '</' . $tag . '>';
    return $out;
}
示例#13
0
    $var = !$var;
    if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
        $logo = $box->boximg;
    } else {
        $logo = preg_replace("/^object_/i", "", $box->boximg);
    }
    print "\n" . '<!-- Box ' . $box->boxcode . ' -->' . "\n";
    print '<tr ' . $bc[$var] . '>';
    print '<td>' . img_object("", $logo) . ' ' . $box->boxlabel . '</td>';
    print '<td>' . ($box->note ? $box->note : '&nbsp;') . '</td>';
    print '<td align="center">' . (isset($pos_name[$box->position]) ? $pos_name[$box->position] : '') . '</td>';
    $hasnext = $key < count($boxactivated) - 1;
    $hasprevious = $key != 0;
    print '<td align="center">' . ($key + 1) . '</td>';
    print '<td align="center">';
    print $hasnext ? '<a href="' . $_SERVER['PHP_SELF'] . '?action=switch&switchfrom=' . $box->rowid . '&switchto=' . $boxactivated[$key + 1]->rowid . '">' . img_down() . '</a>&nbsp;' : '';
    print $hasprevious ? '<a href="' . $_SERVER['PHP_SELF'] . '?action=switch&switchfrom=' . $box->rowid . '&switchto=' . $boxactivated[$key - 1]->rowid . '">' . img_up() . '</a>' : '';
    print '</td>';
    print '<td align="center">';
    print '<a href="' . $_SERVER['PHP_SELF'] . '?rowid=' . $box->rowid . '&amp;action=delete">' . img_delete() . '</a>';
    print '</td>';
    print '</tr>' . "\n";
}
print '</table><br>';
// Other parameters
print_titre($langs->trans("Other"));
print '<table class="noborder" width="100%">';
$var = false;
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="addconst">';
示例#14
0
        print img_object('',$entityicon).' '.$langs->trans($entitylang);
        print '</td>';

        print '<td>';
        $text=$langs->trans($objexport->array_export_fields[0][$code]);
        $tablename=getablenamefromfield($code,$sqlmaxforexport);
        $htmltext ='<b>'.$langs->trans("Name").":</b> ".$text.'<br>';
        $htmltext.='<b>'.$langs->trans("Table")." -> ".$langs->trans("Field").":</b> ".$tablename." -> ".preg_replace('/^.*\./','',$code)."<br>";
        print $html->textwithpicto($text,$htmltext);
		//print ' ('.$code.')';
        print '</td>';

        print '<td align="right" width="100">';
        print $value.' ';
        print '</td><td align="center" width="20">';
        if ($value < sizeof($array_selected)) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=downfield&field='.$code.'">'.img_down().'</a>';
        if ($value > 1) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=upfield&field='.$code.'">'.img_up().'</a>';
        print '</td>';

        //print '<td>&nbsp;</td>';
        //print '<td>'.$langs->trans($objexport->array_export_fields[0][$code]).'</td>';

        print '</tr>';
    }

    print '</table>';


    print '</div>';

    if ($mesg) print $mesg;